{"action":"created","comment":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/66406444","id":66406444,"diff_hunk":"@@ -0,0 +1,70 @@\n+angular.module('bhima.controllers')\n+.controller('FiscalCreateController', FiscalCreateController);\n+FiscalCreateController.$inject = [\n+    '$state', 'ScrollService', 'FiscalService', 'NotifyService', 'util'\n+];\n+\n+/**\n+ * This controller is responsible for creating a debtor group. It provides\n+ * utility functions for submission and error handling.\n+ *\n+ * @todo refactor code to remove redundant features introduced previously\n+ *\n+ * @module fiscal/new\n+ */\n+function FiscalCreateController($state, ScrollTo, fiscalService, Notify, util) {\n+  var vm = this;\n+  // expose state for optional view elements\n+  vm.state   = $state;\n+  vm.fiscal  = {};\n+  vm.endDate = endDate;\n+\n+  vm.maxLength = util.maxTextLength; \n+\n+  function endDate(){\n+    var start_date = new Date(vm.fiscal.start_date);\n+    var previousDay;\n+    vm.end_date = start_date.setMonth(start_date.getMonth() + vm.fiscal.number_of_months);\n+  }\n+\n+  function handleException(error) {\n+    // expose error to view\n+    vm.exception = error;\n+  }\n+\n+  settupDefaults();\n+\n+  function settupDefaults() {\n+    vm.submit = submit;\n+  }\n+\n+  function submit(fiscal) {    \n+    var submitFiscal;\n+    fiscal.$setSubmitted();\n+\n+    // ensure all Angular form validation checks have passed\n+    if (fiscal.$invalid || !vm.fiscal.start_date) {","path":"client/src/partials/fiscal/fiscal.new.js","position":46,"original_position":46,"commit_id":"fd5e02638c424ca1205a35ca667ac4688291b97b","original_commit_id":"fd5e02638c424ca1205a35ca667ac4688291b97b","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},"body":"Do you need to check `!vm.fiscal.start_date`?  It should be automatically required, and set the form to $invalid if it is not defined.","created_at":"2016-06-09T09:11:14Z","updated_at":"2016-06-09T09:11:14Z","html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474#discussion_r66406444","pull_request_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474","_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments/66406444"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474#discussion_r66406444"},"pull_request":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474"}}},"pull_request":{"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474","id":73041765,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474","diff_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474.diff","patch_url":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474.patch","issue_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/474","number":474,"state":"open","locked":false,"title":"Fiscal year designed","user":{"login":"lomamech","id":8035588,"avatar_url":"https://avatars.githubusercontent.com/u/8035588?v=3","gravatar_id":"","url":"https://api.github.com/users/lomamech","html_url":"https://github.com/lomamech","followers_url":"https://api.github.com/users/lomamech/followers","following_url":"https://api.github.com/users/lomamech/following{/other_user}","gists_url":"https://api.github.com/users/lomamech/gists{/gist_id}","starred_url":"https://api.github.com/users/lomamech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lomamech/subscriptions","organizations_url":"https://api.github.com/users/lomamech/orgs","repos_url":"https://api.github.com/users/lomamech/repos","events_url":"https://api.github.com/users/lomamech/events{/privacy}","received_events_url":"https://api.github.com/users/lomamech/received_events","type":"User","site_admin":false},"body":"Design for Fiscal Year \r\n- Update the fiscal year API and adding the integration test\r\n- Creating the interface for client side Updating of file app js and using state for each operation \r\n- Adding the test end to end for the fiscal year client side\r\n\r\n\r\n@jniles ","created_at":"2016-06-08T13:00:48Z","updated_at":"2016-06-09T09:11:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37f5a988c93f72ab3a237ee1c0916d6489530df8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474/commits","review_comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474/comments","review_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/474/comments","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/fd5e02638c424ca1205a35ca667ac4688291b97b","head":{"label":"lomamech:fiscalYearDesigned","ref":"fiscalYearDesigned","sha":"fd5e02638c424ca1205a35ca667ac4688291b97b","user":{"login":"lomamech","id":8035588,"avatar_url":"https://avatars.githubusercontent.com/u/8035588?v=3","gravatar_id":"","url":"https://api.github.com/users/lomamech","html_url":"https://github.com/lomamech","followers_url":"https://api.github.com/users/lomamech/followers","following_url":"https://api.github.com/users/lomamech/following{/other_user}","gists_url":"https://api.github.com/users/lomamech/gists{/gist_id}","starred_url":"https://api.github.com/users/lomamech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lomamech/subscriptions","organizations_url":"https://api.github.com/users/lomamech/orgs","repos_url":"https://api.github.com/users/lomamech/repos","events_url":"https://api.github.com/users/lomamech/events{/privacy}","received_events_url":"https://api.github.com/users/lomamech/received_events","type":"User","site_admin":false},"repo":{"id":49122796,"name":"bhima-2.X","full_name":"lomamech/bhima-2.X","owner":{"login":"lomamech","id":8035588,"avatar_url":"https://avatars.githubusercontent.com/u/8035588?v=3","gravatar_id":"","url":"https://api.github.com/users/lomamech","html_url":"https://github.com/lomamech","followers_url":"https://api.github.com/users/lomamech/followers","following_url":"https://api.github.com/users/lomamech/following{/other_user}","gists_url":"https://api.github.com/users/lomamech/gists{/gist_id}","starred_url":"https://api.github.com/users/lomamech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lomamech/subscriptions","organizations_url":"https://api.github.com/users/lomamech/orgs","repos_url":"https://api.github.com/users/lomamech/repos","events_url":"https://api.github.com/users/lomamech/events{/privacy}","received_events_url":"https://api.github.com/users/lomamech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lomamech/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":true,"url":"https://api.github.com/repos/lomamech/bhima-2.X","forks_url":"https://api.github.com/repos/lomamech/bhima-2.X/forks","keys_url":"https://api.github.com/repos/lomamech/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lomamech/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lomamech/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/lomamech/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/lomamech/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/lomamech/bhima-2.X/events","assignees_url":"https://api.github.com/repos/lomamech/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/lomamech/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/lomamech/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/lomamech/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lomamech/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lomamech/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/lomamech/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lomamech/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/lomamech/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/lomamech/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/lomamech/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/lomamech/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/lomamech/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/lomamech/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/lomamech/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/lomamech/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/lomamech/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/lomamech/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/lomamech/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lomamech/bhima-2.X/merges","archive_url":"https://api.github.com/repos/lomamech/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lomamech/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/lomamech/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/lomamech/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/lomamech/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/lomamech/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lomamech/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/lomamech/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/lomamech/bhima-2.X/deployments","created_at":"2016-01-06T08:25:17Z","updated_at":"2016-01-06T08:25:20Z","pushed_at":"2016-06-08T12:51:52Z","git_url":"git://github.com/lomamech/bhima-2.X.git","ssh_url":"git@github.com:lomamech/bhima-2.X.git","clone_url":"https://github.com/lomamech/bhima-2.X.git","svn_url":"https://github.com/lomamech/bhima-2.X","homepage":null,"size":4385,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IMA-WorldHealth:master","ref":"master","sha":"3b9831bfa905d5073869a1b6abc9729380ae3d03","user":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"repo":{"id":49052669,"name":"bhima-2.X","full_name":"IMA-WorldHealth/bhima-2.X","owner":{"login":"IMA-WorldHealth","id":5330583,"avatar_url":"https://avatars.githubusercontent.com/u/5330583?v=3","gravatar_id":"","url":"https://api.github.com/users/IMA-WorldHealth","html_url":"https://github.com/IMA-WorldHealth","followers_url":"https://api.github.com/users/IMA-WorldHealth/followers","following_url":"https://api.github.com/users/IMA-WorldHealth/following{/other_user}","gists_url":"https://api.github.com/users/IMA-WorldHealth/gists{/gist_id}","starred_url":"https://api.github.com/users/IMA-WorldHealth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMA-WorldHealth/subscriptions","organizations_url":"https://api.github.com/users/IMA-WorldHealth/orgs","repos_url":"https://api.github.com/users/IMA-WorldHealth/repos","events_url":"https://api.github.com/users/IMA-WorldHealth/events{/privacy}","received_events_url":"https://api.github.com/users/IMA-WorldHealth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IMA-WorldHealth/bhima-2.X","description":"A fresh start for bhima to remove large commits","fork":false,"url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X","forks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/forks","keys_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/teams","hooks_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/hooks","issue_events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/events{/number}","events_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/events","assignees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/assignees{/user}","branches_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/branches{/branch}","tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/tags","blobs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/refs{/sha}","trees_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/{sha}","languages_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/languages","stargazers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/stargazers","contributors_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contributors","subscribers_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscribers","subscription_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/subscription","commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/commits{/sha}","git_commits_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/git/commits{/sha}","comments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/comments{/number}","issue_comment_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/comments{/number}","contents_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/contents/{+path}","compare_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/merges","archive_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/downloads","issues_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues{/number}","pulls_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls{/number}","milestones_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/milestones{/number}","notifications_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/labels{/name}","releases_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/releases{/id}","deployments_url":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/deployments","created_at":"2016-01-05T08:30:30Z","updated_at":"2016-05-25T12:28:41Z","pushed_at":"2016-06-09T08:40:57Z","git_url":"git://github.com/IMA-WorldHealth/bhima-2.X.git","ssh_url":"git@github.com:IMA-WorldHealth/bhima-2.X.git","clone_url":"https://github.com/IMA-WorldHealth/bhima-2.X.git","svn_url":"https://github.com/IMA-WorldHealth/bhima-2.X","homepage":null,"size":4646,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":96,"forks":6,"open_issues":96,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474"},"html":{"href":"https://github.com/IMA-WorldHealth/bhima-2.X/pull/474"},"issue":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/474"},"comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/issues/474/comments"},"review_comments":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474/comments"},"review_comment":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/pulls/474/commits"},"statuses":{"href":"https://api.github.com/repos/IMA-WorldHealth/bhima-2.X/statuses/fd5e02638c424ca1205a35ca667ac4688291b97b"}}}}
{"actor":{"display_login":"jniles"}}