{"action":"created","issue":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/267","repository_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/267/comments","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/267/events","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/issues/267","id":145981533,"number":267,"title":"(Design) Budgets","user":{"login":"sfount","id":2844572,"avatar_url":"https://avatars.githubusercontent.com/u/2844572?v=3","gravatar_id":"","url":"https://api.github.com/users/sfount","html_url":"https://github.com/sfount","followers_url":"https://api.github.com/users/sfount/followers","following_url":"https://api.github.com/users/sfount/following{/other_user}","gists_url":"https://api.github.com/users/sfount/gists{/gist_id}","starred_url":"https://api.github.com/users/sfount/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfount/subscriptions","organizations_url":"https://api.github.com/users/sfount/orgs","repos_url":"https://api.github.com/users/sfount/repos","events_url":"https://api.github.com/users/sfount/events{/privacy}","received_events_url":"https://api.github.com/users/sfount/received_events","type":"User","site_admin":false},"labels":[{"id":317367720,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels/design","name":"design","color":"f7c6c7","default":false},{"id":318486197,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels/needs%20discussion","name":"needs discussion","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-04-05T13:01:52Z","updated_at":"2017-02-09T10:32:55Z","closed_at":null,"body":"This issue describes a design for the budgeting utility. \n`Finance / Budget`\n\nThe design focuses on creating reliable well tested tools that can be applied to many different situations and are not tied to one operation (creating an explosion of modules as we have seen before). \n\n![Budget module](http://i.imgur.com/OCSKKh4.jpg)\n\n**Key points**\n- Module consists of one large UI-Grid that shows all accounts in a tree structure \n- By the time the module has loaded the fiscal year that the user is budgeting for has already been selected (in this case Fiscal Year 2016) - this is demonstrated with a label as shown described here https://github.com/IMA-WorldHealth/bhima-2.X/issues/263\n- The first two columns, `account` and `Annual Total` are pinned to the left, the other columns can overflow-x : auto;\n- `split` allows the accountant to enter a value into the total and have that split (shared) amongst each of the periods, this should come with a warning if any of the periods have non-zero values\n- Total row along the bottom shows this years entire budget\n- Cells can be edited in each of the period columns automatically updated the annual amount for that line (and subsequently the total for the year)\n\n![Budget export CSV](http://i.imgur.com/v8Kstdc.jpg)\n\n**Export to CSV**\nA major benefit of the structure proposed in https://github.com/IMA-WorldHealth/bhima-2.X/issues/257 is the ability to request the same data with multiple different 'renderers'. In this case the `json` renderer would be used to initially populate the UI grid. Selecting `export` -> `csv` would request **exactly the same data, from the same route** but passed through a `csv` renderer. \n\n![Budget export PDF](http://i.imgur.com/hPva10m.jpg)\n\n**Export to PDF**\nPDF budget report would be in lined just like receipts. This would allow it to be previewed, downloaded and printed. \n\nAny discussions relevant to the Budget module can be added to this thread! Once we have reviewed this process it can be assigned and a module proposal issue can be created to track progress. [(2.x development process)](https://docs.google.com/document/d/1Opak2BgrhXte0DzbKPmziY-aL7jIBj4PCnYhALmiy4w/pub)\n"},"comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments/278604649","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/issues/267#issuecomment-278604649","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/267","id":278604649,"user":{"login":"jniles","id":896472,"avatar_url":"https://avatars.githubusercontent.com/u/896472?v=3","gravatar_id":"","url":"https://api.github.com/users/jniles","html_url":"https://github.com/jniles","followers_url":"https://api.github.com/users/jniles/followers","following_url":"https://api.github.com/users/jniles/following{/other_user}","gists_url":"https://api.github.com/users/jniles/gists{/gist_id}","starred_url":"https://api.github.com/users/jniles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jniles/subscriptions","organizations_url":"https://api.github.com/users/jniles/orgs","repos_url":"https://api.github.com/users/jniles/repos","events_url":"https://api.github.com/users/jniles/events{/privacy}","received_events_url":"https://api.github.com/users/jniles/received_events","type":"User","site_admin":false},"created_at":"2017-02-09T10:32:55Z","updated_at":"2017-02-09T10:32:55Z","body":"Further notes on here:\r\n 1. The order and selection of account should be determined by using the `account_type` table.  These are broken down by `title`, `income`, `expense`, and `balance`.\r\n 2. The columns of this budget table are drawn from the `period` table.\r\n 3. Each line in this table will appear in a `budget` table.  [It is already defined in the schema](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/server/models/schema.sql#L76) but may need to be updated.\r\n 4. The export to Excel functionality can use our [csv renderer](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/server/lib/renderers/csv.js) on the server.  Similarly, the export to PDF can use the [PDF renderer](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/server/lib/renderers/pdf.js).\r\n 5. An issue about parsing CSV/Excel should be made before it is actually implemented.\r\n\r\nFor the implementer of this proposal, the [Accounts Module](https://github.com/IMA-WorldHealth/bhima-2.X/blob/master/client/src/partials/accounts/accounts.js) is a really nicely implemented `ui-grid` that could be used for inspiration."}}
{"actor":{"display_login":"jniles"}}