{"action":"created","comment":{"url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/comments/186623612","pull_request_review_id":118235875,"id":186623612,"diff_hunk":"@@ -0,0 +1,86 @@\n+<?php\n+\n+namespace App\\Http\\Controllers\\Finance;\n+\n+use App\\Http\\Controllers\\Controller;\n+use App\\Models\\Finance\\Invoice;\n+use Carbon\\Carbon;\n+use Illuminate\\Http\\Request;\n+\n+class ReportsController extends Controller\n+{\n+    /**\n+     * Display the financial reports\n+     *\n+     * @return \\Illuminate\\View\\View\n+     */\n+    public function index()\n+    {\n+        $request = request();\n+        if ($request->get('start') && $request->get('end'))\n+        {\n+            $startDate = $request->get('start');\n+            $endDate = $request->get('end');\n+            $invoices = Invoice::filterByDates($startDate, $endDate);\n+            $attr = [\n+                'invoices' => $invoices,\n+                'report' => self::getReportDetails($invoices),\n+                'startDate' => $startDate,\n+                'endDate' => $endDate,\n+                'displayStartDate' => (new Carbon($startDate))->format('F d, Y'),\n+                'displayEndDate' => (new Carbon($endDate))->format('F d, Y'),\n+            ];\n+        } else {\n+            $invoices = Invoice::all();\n+            $attr = [\n+                'invoices' => $invoices,\n+                'report' => self::getReportDetails($invoices),\n+            ];\n+        }\n+\n+        return view('finance.reports.index')->with($attr);\n+    }\n+\n+    /**\n+     * Get an details of the report in the passed invoices to be printed\n+     *\n+     * @param  \\Illuminate\\Database\\Eloquent\\Collection $invoices\n+     * @return array\n+     */\n+    public static function getReportDetails($invoices)\n+    {\n+        $report = [];\n+        $report['tds'] = 0;\n+        $report['gst'] = 0;\n+        foreach (config('constants.currency') as $currency => $currencyMeta) {\n+            $report['sentAmount'][$currency] = 0;\n+            $report['paidAmount'][$currency] = 0;\n+            $report['transactionCharge'][$currency] = 0;\n+            $report['transactionTax'][$currency] = 0;\n+        }\n+        foreach ($invoices as $invoice) {\n+            $report['gst'] += $invoice->gst;","path":"app/Http/Controllers/Finance/ReportsController.php","position":62,"original_position":62,"commit_id":"db35bd352015438175e36272be18007bccf25f74","original_commit_id":"db35bd352015438175e36272be18007bccf25f74","user":{"login":"nishanth-kd","id":12891880,"avatar_url":"https://avatars1.githubusercontent.com/u/12891880?v=4","gravatar_id":"","url":"https://api.github.com/users/nishanth-kd","html_url":"https://github.com/nishanth-kd","followers_url":"https://api.github.com/users/nishanth-kd/followers","following_url":"https://api.github.com/users/nishanth-kd/following{/other_user}","gists_url":"https://api.github.com/users/nishanth-kd/gists{/gist_id}","starred_url":"https://api.github.com/users/nishanth-kd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nishanth-kd/subscriptions","organizations_url":"https://api.github.com/users/nishanth-kd/orgs","repos_url":"https://api.github.com/users/nishanth-kd/repos","events_url":"https://api.github.com/users/nishanth-kd/events{/privacy}","received_events_url":"https://api.github.com/users/nishanth-kd/received_events","type":"User","site_admin":false},"body":"It appears my previous comments haven't been address. Please don't assign for review in future unless previous feedbacks haven't been addressed. \r\n","created_at":"2018-05-08T05:59:08Z","updated_at":"2018-05-08T05:59:08Z","html_url":"https://github.com/ColoredCow/employee-portal/pull/178#discussion_r186623612","pull_request_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/comments/186623612"},"html":{"href":"https://github.com/ColoredCow/employee-portal/pull/178#discussion_r186623612"},"pull_request":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178"}},"in_reply_to_id":186623438},"pull_request":{"url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178","id":186320998,"html_url":"https://github.com/ColoredCow/employee-portal/pull/178","diff_url":"https://github.com/ColoredCow/employee-portal/pull/178.diff","patch_url":"https://github.com/ColoredCow/employee-portal/pull/178.patch","issue_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/178","number":178,"state":"open","locked":false,"title":"(#166) finance reports","user":{"login":"rathorevaibhav","id":12053186,"avatar_url":"https://avatars3.githubusercontent.com/u/12053186?v=4","gravatar_id":"","url":"https://api.github.com/users/rathorevaibhav","html_url":"https://github.com/rathorevaibhav","followers_url":"https://api.github.com/users/rathorevaibhav/followers","following_url":"https://api.github.com/users/rathorevaibhav/following{/other_user}","gists_url":"https://api.github.com/users/rathorevaibhav/gists{/gist_id}","starred_url":"https://api.github.com/users/rathorevaibhav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathorevaibhav/subscriptions","organizations_url":"https://api.github.com/users/rathorevaibhav/orgs","repos_url":"https://api.github.com/users/rathorevaibhav/repos","events_url":"https://api.github.com/users/rathorevaibhav/events{/privacy}","received_events_url":"https://api.github.com/users/rathorevaibhav/received_events","type":"User","site_admin":false},"body":"#166 \r\n\r\nNeeds to be reviewed and merged after #177 ","created_at":"2018-05-07T11:08:08Z","updated_at":"2018-05-08T05:59:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23088bd26198bc2c65e4de1aff566bcd1246d4d1","assignee":{"login":"rathorevaibhav","id":12053186,"avatar_url":"https://avatars3.githubusercontent.com/u/12053186?v=4","gravatar_id":"","url":"https://api.github.com/users/rathorevaibhav","html_url":"https://github.com/rathorevaibhav","followers_url":"https://api.github.com/users/rathorevaibhav/followers","following_url":"https://api.github.com/users/rathorevaibhav/following{/other_user}","gists_url":"https://api.github.com/users/rathorevaibhav/gists{/gist_id}","starred_url":"https://api.github.com/users/rathorevaibhav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathorevaibhav/subscriptions","organizations_url":"https://api.github.com/users/rathorevaibhav/orgs","repos_url":"https://api.github.com/users/rathorevaibhav/repos","events_url":"https://api.github.com/users/rathorevaibhav/events{/privacy}","received_events_url":"https://api.github.com/users/rathorevaibhav/received_events","type":"User","site_admin":false},"assignees":[{"login":"rathorevaibhav","id":12053186,"avatar_url":"https://avatars3.githubusercontent.com/u/12053186?v=4","gravatar_id":"","url":"https://api.github.com/users/rathorevaibhav","html_url":"https://github.com/rathorevaibhav","followers_url":"https://api.github.com/users/rathorevaibhav/followers","following_url":"https://api.github.com/users/rathorevaibhav/following{/other_user}","gists_url":"https://api.github.com/users/rathorevaibhav/gists{/gist_id}","starred_url":"https://api.github.com/users/rathorevaibhav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rathorevaibhav/subscriptions","organizations_url":"https://api.github.com/users/rathorevaibhav/orgs","repos_url":"https://api.github.com/users/rathorevaibhav/repos","events_url":"https://api.github.com/users/rathorevaibhav/events{/privacy}","received_events_url":"https://api.github.com/users/rathorevaibhav/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":866718225,"url":"https://api.github.com/repos/ColoredCow/employee-portal/labels/status%20:%20ready%20for%20review","name":"status : ready for review","color":"bfd4f2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178/commits","review_comments_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178/comments","review_comment_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/178/comments","statuses_url":"https://api.github.com/repos/ColoredCow/employee-portal/statuses/db35bd352015438175e36272be18007bccf25f74","head":{"label":"ColoredCow:166-finance-reports","ref":"166-finance-reports","sha":"db35bd352015438175e36272be18007bccf25f74","user":{"login":"ColoredCow","id":17040495,"avatar_url":"https://avatars3.githubusercontent.com/u/17040495?v=4","gravatar_id":"","url":"https://api.github.com/users/ColoredCow","html_url":"https://github.com/ColoredCow","followers_url":"https://api.github.com/users/ColoredCow/followers","following_url":"https://api.github.com/users/ColoredCow/following{/other_user}","gists_url":"https://api.github.com/users/ColoredCow/gists{/gist_id}","starred_url":"https://api.github.com/users/ColoredCow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColoredCow/subscriptions","organizations_url":"https://api.github.com/users/ColoredCow/orgs","repos_url":"https://api.github.com/users/ColoredCow/repos","events_url":"https://api.github.com/users/ColoredCow/events{/privacy}","received_events_url":"https://api.github.com/users/ColoredCow/received_events","type":"Organization","site_admin":false},"repo":{"id":125008594,"name":"employee-portal","full_name":"ColoredCow/employee-portal","owner":{"login":"ColoredCow","id":17040495,"avatar_url":"https://avatars3.githubusercontent.com/u/17040495?v=4","gravatar_id":"","url":"https://api.github.com/users/ColoredCow","html_url":"https://github.com/ColoredCow","followers_url":"https://api.github.com/users/ColoredCow/followers","following_url":"https://api.github.com/users/ColoredCow/following{/other_user}","gists_url":"https://api.github.com/users/ColoredCow/gists{/gist_id}","starred_url":"https://api.github.com/users/ColoredCow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColoredCow/subscriptions","organizations_url":"https://api.github.com/users/ColoredCow/orgs","repos_url":"https://api.github.com/users/ColoredCow/repos","events_url":"https://api.github.com/users/ColoredCow/events{/privacy}","received_events_url":"https://api.github.com/users/ColoredCow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ColoredCow/employee-portal","description":"Solution for organisations to manage all operations' data. Built over GSuite.","fork":false,"url":"https://api.github.com/repos/ColoredCow/employee-portal","forks_url":"https://api.github.com/repos/ColoredCow/employee-portal/forks","keys_url":"https://api.github.com/repos/ColoredCow/employee-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ColoredCow/employee-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ColoredCow/employee-portal/teams","hooks_url":"https://api.github.com/repos/ColoredCow/employee-portal/hooks","issue_events_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/events{/number}","events_url":"https://api.github.com/repos/ColoredCow/employee-portal/events","assignees_url":"https://api.github.com/repos/ColoredCow/employee-portal/assignees{/user}","branches_url":"https://api.github.com/repos/ColoredCow/employee-portal/branches{/branch}","tags_url":"https://api.github.com/repos/ColoredCow/employee-portal/tags","blobs_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ColoredCow/employee-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/ColoredCow/employee-portal/languages","stargazers_url":"https://api.github.com/repos/ColoredCow/employee-portal/stargazers","contributors_url":"https://api.github.com/repos/ColoredCow/employee-portal/contributors","subscribers_url":"https://api.github.com/repos/ColoredCow/employee-portal/subscribers","subscription_url":"https://api.github.com/repos/ColoredCow/employee-portal/subscription","commits_url":"https://api.github.com/repos/ColoredCow/employee-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/ColoredCow/employee-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/ColoredCow/employee-portal/contents/{+path}","compare_url":"https://api.github.com/repos/ColoredCow/employee-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ColoredCow/employee-portal/merges","archive_url":"https://api.github.com/repos/ColoredCow/employee-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ColoredCow/employee-portal/downloads","issues_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues{/number}","pulls_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/ColoredCow/employee-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/ColoredCow/employee-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ColoredCow/employee-portal/labels{/name}","releases_url":"https://api.github.com/repos/ColoredCow/employee-portal/releases{/id}","deployments_url":"https://api.github.com/repos/ColoredCow/employee-portal/deployments","created_at":"2018-03-13T07:16:20Z","updated_at":"2018-05-08T04:54:45Z","pushed_at":"2018-05-08T05:22:00Z","git_url":"git://github.com/ColoredCow/employee-portal.git","ssh_url":"git@github.com:ColoredCow/employee-portal.git","clone_url":"https://github.com/ColoredCow/employee-portal.git","svn_url":"https://github.com/ColoredCow/employee-portal","homepage":"","size":1141,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":45,"watchers":2,"default_branch":"master"}},"base":{"label":"ColoredCow:develop","ref":"develop","sha":"a944f8ec8aa658d6a6164b1f597ebf98c96cc2af","user":{"login":"ColoredCow","id":17040495,"avatar_url":"https://avatars3.githubusercontent.com/u/17040495?v=4","gravatar_id":"","url":"https://api.github.com/users/ColoredCow","html_url":"https://github.com/ColoredCow","followers_url":"https://api.github.com/users/ColoredCow/followers","following_url":"https://api.github.com/users/ColoredCow/following{/other_user}","gists_url":"https://api.github.com/users/ColoredCow/gists{/gist_id}","starred_url":"https://api.github.com/users/ColoredCow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColoredCow/subscriptions","organizations_url":"https://api.github.com/users/ColoredCow/orgs","repos_url":"https://api.github.com/users/ColoredCow/repos","events_url":"https://api.github.com/users/ColoredCow/events{/privacy}","received_events_url":"https://api.github.com/users/ColoredCow/received_events","type":"Organization","site_admin":false},"repo":{"id":125008594,"name":"employee-portal","full_name":"ColoredCow/employee-portal","owner":{"login":"ColoredCow","id":17040495,"avatar_url":"https://avatars3.githubusercontent.com/u/17040495?v=4","gravatar_id":"","url":"https://api.github.com/users/ColoredCow","html_url":"https://github.com/ColoredCow","followers_url":"https://api.github.com/users/ColoredCow/followers","following_url":"https://api.github.com/users/ColoredCow/following{/other_user}","gists_url":"https://api.github.com/users/ColoredCow/gists{/gist_id}","starred_url":"https://api.github.com/users/ColoredCow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColoredCow/subscriptions","organizations_url":"https://api.github.com/users/ColoredCow/orgs","repos_url":"https://api.github.com/users/ColoredCow/repos","events_url":"https://api.github.com/users/ColoredCow/events{/privacy}","received_events_url":"https://api.github.com/users/ColoredCow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ColoredCow/employee-portal","description":"Solution for organisations to manage all operations' data. Built over GSuite.","fork":false,"url":"https://api.github.com/repos/ColoredCow/employee-portal","forks_url":"https://api.github.com/repos/ColoredCow/employee-portal/forks","keys_url":"https://api.github.com/repos/ColoredCow/employee-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ColoredCow/employee-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ColoredCow/employee-portal/teams","hooks_url":"https://api.github.com/repos/ColoredCow/employee-portal/hooks","issue_events_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/events{/number}","events_url":"https://api.github.com/repos/ColoredCow/employee-portal/events","assignees_url":"https://api.github.com/repos/ColoredCow/employee-portal/assignees{/user}","branches_url":"https://api.github.com/repos/ColoredCow/employee-portal/branches{/branch}","tags_url":"https://api.github.com/repos/ColoredCow/employee-portal/tags","blobs_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ColoredCow/employee-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/ColoredCow/employee-portal/languages","stargazers_url":"https://api.github.com/repos/ColoredCow/employee-portal/stargazers","contributors_url":"https://api.github.com/repos/ColoredCow/employee-portal/contributors","subscribers_url":"https://api.github.com/repos/ColoredCow/employee-portal/subscribers","subscription_url":"https://api.github.com/repos/ColoredCow/employee-portal/subscription","commits_url":"https://api.github.com/repos/ColoredCow/employee-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/ColoredCow/employee-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/ColoredCow/employee-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/ColoredCow/employee-portal/contents/{+path}","compare_url":"https://api.github.com/repos/ColoredCow/employee-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ColoredCow/employee-portal/merges","archive_url":"https://api.github.com/repos/ColoredCow/employee-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ColoredCow/employee-portal/downloads","issues_url":"https://api.github.com/repos/ColoredCow/employee-portal/issues{/number}","pulls_url":"https://api.github.com/repos/ColoredCow/employee-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/ColoredCow/employee-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/ColoredCow/employee-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ColoredCow/employee-portal/labels{/name}","releases_url":"https://api.github.com/repos/ColoredCow/employee-portal/releases{/id}","deployments_url":"https://api.github.com/repos/ColoredCow/employee-portal/deployments","created_at":"2018-03-13T07:16:20Z","updated_at":"2018-05-08T04:54:45Z","pushed_at":"2018-05-08T05:22:00Z","git_url":"git://github.com/ColoredCow/employee-portal.git","ssh_url":"git@github.com:ColoredCow/employee-portal.git","clone_url":"https://github.com/ColoredCow/employee-portal.git","svn_url":"https://github.com/ColoredCow/employee-portal","homepage":"","size":1141,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":45,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178"},"html":{"href":"https://github.com/ColoredCow/employee-portal/pull/178"},"issue":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/issues/178"},"comments":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/ColoredCow/employee-portal/statuses/db35bd352015438175e36272be18007bccf25f74"}},"author_association":"OWNER"}}
{"actor":{"display_login":"nishanth-kd"}}