{"action":"closed","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/292","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/292/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima/issues/292/events","html_url":"https://github.com/IMA-WorldHealth/bhima/issues/292","id":53841785,"number":292,"title":"Notes on implementing budget modules","user":{"login":"jmcameron","id":62145,"avatar_url":"https://avatars.githubusercontent.com/u/62145?v=3","gravatar_id":"","url":"https://api.github.com/users/jmcameron","html_url":"https://github.com/jmcameron","followers_url":"https://api.github.com/users/jmcameron/followers","following_url":"https://api.github.com/users/jmcameron/following{/other_user}","gists_url":"https://api.github.com/users/jmcameron/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcameron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcameron/subscriptions","organizations_url":"https://api.github.com/users/jmcameron/orgs","repos_url":"https://api.github.com/users/jmcameron/repos","events_url":"https://api.github.com/users/jmcameron/events{/privacy}","received_events_url":"https://api.github.com/users/jmcameron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima/labels/feature","name":"feature","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-09T07:41:02Z","updated_at":"2015-01-30T18:05:25Z","closed_at":"2015-01-30T18:05:25Z","body":"**[NOTE: The following material is the first cut.  To see an updated version with commentary, please see the Google Docs page:  https://docs.google.com/document/d/1excmr98BqT6Vt9MxMU8SqVNQTPIhIsNMSwuET7-OnRs/edit]**\r\n\r\nAfter talking with Larry, here is my understanding of how the budget process would work with bhima:\r\n\r\n1. Towards the end of the year, bhima will export an excel/csv file of the last years total yearly budget (this might include historical data for previous year's budgets to project trends).  \r\n\r\n2. The chief accountant will work the budget in Excel to project a best-guess budget for the coming year.\r\n\r\n3. The proposed budget will be reviewed/updated by the hospital administrator and eventually presented to the hospital board where it will again be adjusted and then finallly accepted.  The budget data at this point is for the whole year (no monthly granularity).\r\n\r\n4. The resulting offical budet data will be exported from Excel as a CSV file.\r\n\r\n5. BHIMA will read the CSV budget and create the budget items for the new year.  Normally the budget for each account will be divided evenly over the months of the year.  \r\n\r\nWARNING: Once these items are created, the yearly total for each budget item cannot be changed--although the scheduling of the budet over the periods of the year can be adjusted to reflect lump expenses, etc.\r\n\r\n**PAGES TO IMPLEMENT:**\r\n\r\n1. Budget Analysis Report (based on IMCK printout)\r\n\r\n   MENU:  Report/Buget Analysis\r\n\r\n   USE CASES: \r\n\r\n      * The financial/administrative user wants to see how the current\r\n        income/expense balance is lining up with the budget.  He\r\n        selects a period of coverage, level of detail, and gets the\r\n        report.  This might include more details as needed.  The user\r\n        may simply review the numbers on the screen or they may need a\r\n        printout or PDF file for review or record-keeping.\r\n\r\n      * The board requests a report on the budgetary analysis.  The\r\n        financial/administrative user generates the report of a low\r\n        level of detail to keep the report to user-friendly size.  The\r\n        result will be printed or saved to PDF for delivery to the\r\n        requestor. \r\n\r\n   NOTES:\r\n\r\n   * The Budget Analysis Report should support reports including\r\n       * the year up to a specific month or quarter\r\n       * a month/period\r\n       * a date range (probably cannot select start/end date with more resolution than a month)\r\n       * how many levels to display\r\n\r\n   * The report will include roll-ups of (title) accounts and all lower-level income/expense accounts.  \r\n\r\n   * The report should include columns\r\n       * Account number\r\n       * Account name/designation\r\n       * Budget\r\n       * Actuals (Realisation)\r\n       * % over budget\r\n       * Difference from budget\r\n       * (May also want comparison with same data for last year?)\r\n\r\n\r\n2. Budget Export\r\n\r\n   MENU: Finance/Export Budget Data\r\n\r\n   USE CASE:\r\n\r\n    * The fiscal year is drawing to a close and it is necessary to\r\n      generate a budget for the upcoming fiscal year.  Presumably this\r\n      would happen in the fall (but note that the spending/income for\r\n      the current year is not complete).  The financial officer\r\n      requests a CSV file with the current budgetary data so that it\r\n      can be imported into Excel for further analysis and creation of a\r\n      proposed budget for the coming fiscal year.  After selecting the\r\n      options and pressing a [Submit] button, the user will be prompted\r\n      where to save the resulting CSV file.\r\n\r\n   NOTES:\r\n\r\n    * Allows the user to specify what fiscal years to include \r\n      (besides the current one).\r\n    * All income, expense, and title accounts will be exported \r\n      (may need filtering to execlude title accounts with no\r\n      income/expense children accounts)\r\n    * Resulting output file will be ordered (logically) by account number\r\n\r\n   DATA TO BE EXPORTED:\r\n      * Account number\r\n      * Account name/designation\r\n      * Account type (title, income, expense) -- will not include balance accounts\r\n      * Budget total for each selected FY\r\n      * Actual total for each selected FY\r\n      * Account id (database primary key 'id' for double-checking later)\r\n\r\n3. Budget Import\r\n\r\n   MENU: Finance/Import New Budget Data\r\n\r\n   USE CASE:\r\n\r\n    * The board has approved a budget and the financial officer has\r\n      reworked the full spreadsheet of budget data to reflect the final\r\n      approved budget.  The budget for each account is updated\r\n      apropriately.  Then the financial officer exports a CSV file from\r\n      Excel that includes the necesary data (see below for details).\r\n      Then the financial officer uses the BHIMA system to import the\r\n      new budget data for the FY.\r\n\r\n   NOTES:\r\n\r\n    * The budgetary number for each account will be the year's total.\r\n      It is up to the bhima system and the financial operator to adjust\r\n      income/expense data within the periods of each account as needed.\r\n    * The user will select which fiscal year to import the data into\r\n    * The system will verify that no budget data exists for that fiscal\r\n      year (once approved budget data is entered into the system it\r\n      cannot be changed).\r\n    * Checks that will be performed on import\r\n        - Verify that account number, name, and id match the existing\r\n          account\r\n        - Totals under each title account match the actual totals of\r\n          children accounts\r\n    * Budget data from title accounts will not be saved since their totals should \r\n       result from roll-ups of children income or expense accounts.\r\n    * Each yearly total will be divided into 12 parts and budget table\r\n      entries will be created for each period for the fiscal year.  \r\n    * Budget records will only be created for income/expense accounts with\r\n      non-zero budget totals.\r\n    \r\n   DATA TO BE IMPORTED:\r\n      * Account number\r\n      * Account name/designation\r\n      * Account type (title, income, expense) -- will not include balance accounts\r\n      * Budget total for the fiscal year (for each account)\r\n      * Account id (database primary key 'id' for double-checking later)\r\n\r\n\r\n4. Budget Phasing Adjustment\r\n\r\n   MENU: Finance/Adjust Budget Phasing\r\n\r\n   USE CASE:\r\n\r\n    * The budget for the fiscal year has been approved and imported\r\n      into the BHIMA system and the total for each account has been\r\n      divided into 12 periods.  The financial officer knows that some\r\n      accounts have expenses/incomes that do not occur in such even\r\n      intervals.  He will invoke this page to redistribute the total\r\n      for each account as appropriate.  He cannot increase or decrease\r\n      the year's total for he account since the approved total budget\r\n      for the year cannot be changed once entered.  These adjustments\r\n      may occur later in the year as lump income/expense items come\r\n      up. \r\n\r\n   NOTES:\r\n\r\n    * The user will be able to select an account\r\n    * The user will be able to select the current fiscal year or the\r\n      next fiscal year (in case the budget was approved and imported\r\n      before the end of the preceeding fiscal year).\r\n    * Once the user clicks on [Submit] a budget worksheet (a table of\r\n      periods) will be shown with the total for the year (non-editable)\r\n      and the value of each period shown in an editable field.\r\n    * The [Submit] button will not be active if the totals of the\r\n      periods do not sum to the total for the account for the year.\r\n    * Each period will have \"Lock\" option (on the right) that will\r\n      allow the user to indicate that its value has been locked. The\r\n      rows for periods that are in the past will be locked by default.\r\n    * There will be a [Adjust] button that adjusts (evenly) all the\r\n      unlocked fields so that the total of the peroid values match the\r\n      yearly total. This is to simplify life for the user so that\r\n      manual calculations will not be necessary to get the totals to\r\n      work out correctly.\r\n    * Once the [Submit] button is pressed, the data for the periods\r\n      will be adjusted in the database.\r\n    "}}