{"action":"created","comment":{"url":"https://api.github.com/repos/dodoas/lodo/pulls/comments/60196832","id":60196832,"diff_hunk":"@@ -124,4 +113,29 @@ elseif($_lib['input']->getProperty('action_save_internal')) {\n     header ($header);\n }\n \n+$ready_to_send_to_fb = false;\n+$error_messages = array();\n+if($_lib['input']->getProperty('InvoiceID')) {\n+  $invoice->init(array());\n+  list($ready_to_send_to_fb, $error_messages) = $invoice->fakturabank_send_precheck();\n+}\n+\n+if($_lib['input']->getProperty('action_invoice_fakturabanksend') || $_lib['input']->getProperty('action_invoice_lock')) {\n+  foreach($error_messages as $error_message) $_lib['message']->add(array('message' => $error_message));\n+}\n+\n+if($_lib['input']->getProperty('action_invoice_lock')) {\n+    $invoice->init(array());\n+    if ($ready_to_send_to_fb) {\n+      $invoice->lock();\n+    }\n+}\n+elseif($_lib['input']->getProperty('action_invoice_fakturabanksend')) {\n+    $invoice->init(array());","path":"modules/invoice/view/record.inc","position":43,"original_position":43,"commit_id":"2f20e1b88dc7115e6d9b621eb5aa48f7ba6e5859","original_commit_id":"2f20e1b88dc7115e6d9b621eb5aa48f7ba6e5859","user":{"login":"stoivo","id":3492040,"avatar_url":"https://avatars.githubusercontent.com/u/3492040?v=3","gravatar_id":"","url":"https://api.github.com/users/stoivo","html_url":"https://github.com/stoivo","followers_url":"https://api.github.com/users/stoivo/followers","following_url":"https://api.github.com/users/stoivo/following{/other_user}","gists_url":"https://api.github.com/users/stoivo/gists{/gist_id}","starred_url":"https://api.github.com/users/stoivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoivo/subscriptions","organizations_url":"https://api.github.com/users/stoivo/orgs","repos_url":"https://api.github.com/users/stoivo/repos","events_url":"https://api.github.com/users/stoivo/events{/privacy}","received_events_url":"https://api.github.com/users/stoivo/received_events","type":"User","site_admin":false},"body":"I don't think we need this since we call init on line 119.","created_at":"2016-04-19T09:12:44Z","updated_at":"2016-04-19T09:12:44Z","html_url":"https://github.com/dodoas/lodo/pull/115#discussion_r60196832","pull_request_url":"https://api.github.com/repos/dodoas/lodo/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/comments/60196832"},"html":{"href":"https://github.com/dodoas/lodo/pull/115#discussion_r60196832"},"pull_request":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/dodoas/lodo/pulls/115","id":63245763,"html_url":"https://github.com/dodoas/lodo/pull/115","diff_url":"https://github.com/dodoas/lodo/pull/115.diff","patch_url":"https://github.com/dodoas/lodo/pull/115.patch","issue_url":"https://api.github.com/repos/dodoas/lodo/issues/115","number":115,"state":"open","locked":false,"title":"Validate invoice before locking it","user":{"login":"mladjo2505","id":3684429,"avatar_url":"https://avatars.githubusercontent.com/u/3684429?v=3","gravatar_id":"","url":"https://api.github.com/users/mladjo2505","html_url":"https://github.com/mladjo2505","followers_url":"https://api.github.com/users/mladjo2505/followers","following_url":"https://api.github.com/users/mladjo2505/following{/other_user}","gists_url":"https://api.github.com/users/mladjo2505/gists{/gist_id}","starred_url":"https://api.github.com/users/mladjo2505/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mladjo2505/subscriptions","organizations_url":"https://api.github.com/users/mladjo2505/orgs","repos_url":"https://api.github.com/users/mladjo2505/repos","events_url":"https://api.github.com/users/mladjo2505/events{/privacy}","received_events_url":"https://api.github.com/users/mladjo2505/received_events","type":"User","site_admin":false},"body":"Closes #111 ","created_at":"2016-03-17T15:53:10Z","updated_at":"2016-04-19T09:12:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c86f2606a4a743551619fc08d0193308e6f83340","assignee":{"login":"mladjo2505","id":3684429,"avatar_url":"https://avatars.githubusercontent.com/u/3684429?v=3","gravatar_id":"","url":"https://api.github.com/users/mladjo2505","html_url":"https://github.com/mladjo2505","followers_url":"https://api.github.com/users/mladjo2505/followers","following_url":"https://api.github.com/users/mladjo2505/following{/other_user}","gists_url":"https://api.github.com/users/mladjo2505/gists{/gist_id}","starred_url":"https://api.github.com/users/mladjo2505/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mladjo2505/subscriptions","organizations_url":"https://api.github.com/users/mladjo2505/orgs","repos_url":"https://api.github.com/users/mladjo2505/repos","events_url":"https://api.github.com/users/mladjo2505/events{/privacy}","received_events_url":"https://api.github.com/users/mladjo2505/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dodoas/lodo/pulls/115/commits","review_comments_url":"https://api.github.com/repos/dodoas/lodo/pulls/115/comments","review_comment_url":"https://api.github.com/repos/dodoas/lodo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dodoas/lodo/issues/115/comments","statuses_url":"https://api.github.com/repos/dodoas/lodo/statuses/2f20e1b88dc7115e6d9b621eb5aa48f7ba6e5859","head":{"label":"dodoas:md/validate_invoice_on_lock","ref":"md/validate_invoice_on_lock","sha":"2f20e1b88dc7115e6d9b621eb5aa48f7ba6e5859","user":{"login":"dodoas","id":2697200,"avatar_url":"https://avatars.githubusercontent.com/u/2697200?v=3","gravatar_id":"","url":"https://api.github.com/users/dodoas","html_url":"https://github.com/dodoas","followers_url":"https://api.github.com/users/dodoas/followers","following_url":"https://api.github.com/users/dodoas/following{/other_user}","gists_url":"https://api.github.com/users/dodoas/gists{/gist_id}","starred_url":"https://api.github.com/users/dodoas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodoas/subscriptions","organizations_url":"https://api.github.com/users/dodoas/orgs","repos_url":"https://api.github.com/users/dodoas/repos","events_url":"https://api.github.com/users/dodoas/events{/privacy}","received_events_url":"https://api.github.com/users/dodoas/received_events","type":"User","site_admin":false},"repo":{"id":7601637,"name":"lodo","full_name":"dodoas/lodo","owner":{"login":"dodoas","id":2697200,"avatar_url":"https://avatars.githubusercontent.com/u/2697200?v=3","gravatar_id":"","url":"https://api.github.com/users/dodoas","html_url":"https://github.com/dodoas","followers_url":"https://api.github.com/users/dodoas/followers","following_url":"https://api.github.com/users/dodoas/following{/other_user}","gists_url":"https://api.github.com/users/dodoas/gists{/gist_id}","starred_url":"https://api.github.com/users/dodoas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodoas/subscriptions","organizations_url":"https://api.github.com/users/dodoas/orgs","repos_url":"https://api.github.com/users/dodoas/repos","events_url":"https://api.github.com/users/dodoas/events{/privacy}","received_events_url":"https://api.github.com/users/dodoas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dodoas/lodo","description":"Lodo Regnskap","fork":false,"url":"https://api.github.com/repos/dodoas/lodo","forks_url":"https://api.github.com/repos/dodoas/lodo/forks","keys_url":"https://api.github.com/repos/dodoas/lodo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dodoas/lodo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dodoas/lodo/teams","hooks_url":"https://api.github.com/repos/dodoas/lodo/hooks","issue_events_url":"https://api.github.com/repos/dodoas/lodo/issues/events{/number}","events_url":"https://api.github.com/repos/dodoas/lodo/events","assignees_url":"https://api.github.com/repos/dodoas/lodo/assignees{/user}","branches_url":"https://api.github.com/repos/dodoas/lodo/branches{/branch}","tags_url":"https://api.github.com/repos/dodoas/lodo/tags","blobs_url":"https://api.github.com/repos/dodoas/lodo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dodoas/lodo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dodoas/lodo/git/refs{/sha}","trees_url":"https://api.github.com/repos/dodoas/lodo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dodoas/lodo/statuses/{sha}","languages_url":"https://api.github.com/repos/dodoas/lodo/languages","stargazers_url":"https://api.github.com/repos/dodoas/lodo/stargazers","contributors_url":"https://api.github.com/repos/dodoas/lodo/contributors","subscribers_url":"https://api.github.com/repos/dodoas/lodo/subscribers","subscription_url":"https://api.github.com/repos/dodoas/lodo/subscription","commits_url":"https://api.github.com/repos/dodoas/lodo/commits{/sha}","git_commits_url":"https://api.github.com/repos/dodoas/lodo/git/commits{/sha}","comments_url":"https://api.github.com/repos/dodoas/lodo/comments{/number}","issue_comment_url":"https://api.github.com/repos/dodoas/lodo/issues/comments{/number}","contents_url":"https://api.github.com/repos/dodoas/lodo/contents/{+path}","compare_url":"https://api.github.com/repos/dodoas/lodo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dodoas/lodo/merges","archive_url":"https://api.github.com/repos/dodoas/lodo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dodoas/lodo/downloads","issues_url":"https://api.github.com/repos/dodoas/lodo/issues{/number}","pulls_url":"https://api.github.com/repos/dodoas/lodo/pulls{/number}","milestones_url":"https://api.github.com/repos/dodoas/lodo/milestones{/number}","notifications_url":"https://api.github.com/repos/dodoas/lodo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dodoas/lodo/labels{/name}","releases_url":"https://api.github.com/repos/dodoas/lodo/releases{/id}","deployments_url":"https://api.github.com/repos/dodoas/lodo/deployments","created_at":"2013-01-14T09:31:19Z","updated_at":"2016-01-23T20:36:17Z","pushed_at":"2016-04-19T07:16:54Z","git_url":"git://github.com/dodoas/lodo.git","ssh_url":"git@github.com:dodoas/lodo.git","clone_url":"https://github.com/dodoas/lodo.git","svn_url":"https://github.com/dodoas/lodo","homepage":"","size":9502,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":3,"default_branch":"master"}},"base":{"label":"dodoas:master","ref":"master","sha":"0b29d187caf12ab1636e2661fb2df358e771ecf4","user":{"login":"dodoas","id":2697200,"avatar_url":"https://avatars.githubusercontent.com/u/2697200?v=3","gravatar_id":"","url":"https://api.github.com/users/dodoas","html_url":"https://github.com/dodoas","followers_url":"https://api.github.com/users/dodoas/followers","following_url":"https://api.github.com/users/dodoas/following{/other_user}","gists_url":"https://api.github.com/users/dodoas/gists{/gist_id}","starred_url":"https://api.github.com/users/dodoas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodoas/subscriptions","organizations_url":"https://api.github.com/users/dodoas/orgs","repos_url":"https://api.github.com/users/dodoas/repos","events_url":"https://api.github.com/users/dodoas/events{/privacy}","received_events_url":"https://api.github.com/users/dodoas/received_events","type":"User","site_admin":false},"repo":{"id":7601637,"name":"lodo","full_name":"dodoas/lodo","owner":{"login":"dodoas","id":2697200,"avatar_url":"https://avatars.githubusercontent.com/u/2697200?v=3","gravatar_id":"","url":"https://api.github.com/users/dodoas","html_url":"https://github.com/dodoas","followers_url":"https://api.github.com/users/dodoas/followers","following_url":"https://api.github.com/users/dodoas/following{/other_user}","gists_url":"https://api.github.com/users/dodoas/gists{/gist_id}","starred_url":"https://api.github.com/users/dodoas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dodoas/subscriptions","organizations_url":"https://api.github.com/users/dodoas/orgs","repos_url":"https://api.github.com/users/dodoas/repos","events_url":"https://api.github.com/users/dodoas/events{/privacy}","received_events_url":"https://api.github.com/users/dodoas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dodoas/lodo","description":"Lodo Regnskap","fork":false,"url":"https://api.github.com/repos/dodoas/lodo","forks_url":"https://api.github.com/repos/dodoas/lodo/forks","keys_url":"https://api.github.com/repos/dodoas/lodo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dodoas/lodo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dodoas/lodo/teams","hooks_url":"https://api.github.com/repos/dodoas/lodo/hooks","issue_events_url":"https://api.github.com/repos/dodoas/lodo/issues/events{/number}","events_url":"https://api.github.com/repos/dodoas/lodo/events","assignees_url":"https://api.github.com/repos/dodoas/lodo/assignees{/user}","branches_url":"https://api.github.com/repos/dodoas/lodo/branches{/branch}","tags_url":"https://api.github.com/repos/dodoas/lodo/tags","blobs_url":"https://api.github.com/repos/dodoas/lodo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dodoas/lodo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dodoas/lodo/git/refs{/sha}","trees_url":"https://api.github.com/repos/dodoas/lodo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dodoas/lodo/statuses/{sha}","languages_url":"https://api.github.com/repos/dodoas/lodo/languages","stargazers_url":"https://api.github.com/repos/dodoas/lodo/stargazers","contributors_url":"https://api.github.com/repos/dodoas/lodo/contributors","subscribers_url":"https://api.github.com/repos/dodoas/lodo/subscribers","subscription_url":"https://api.github.com/repos/dodoas/lodo/subscription","commits_url":"https://api.github.com/repos/dodoas/lodo/commits{/sha}","git_commits_url":"https://api.github.com/repos/dodoas/lodo/git/commits{/sha}","comments_url":"https://api.github.com/repos/dodoas/lodo/comments{/number}","issue_comment_url":"https://api.github.com/repos/dodoas/lodo/issues/comments{/number}","contents_url":"https://api.github.com/repos/dodoas/lodo/contents/{+path}","compare_url":"https://api.github.com/repos/dodoas/lodo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dodoas/lodo/merges","archive_url":"https://api.github.com/repos/dodoas/lodo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dodoas/lodo/downloads","issues_url":"https://api.github.com/repos/dodoas/lodo/issues{/number}","pulls_url":"https://api.github.com/repos/dodoas/lodo/pulls{/number}","milestones_url":"https://api.github.com/repos/dodoas/lodo/milestones{/number}","notifications_url":"https://api.github.com/repos/dodoas/lodo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dodoas/lodo/labels{/name}","releases_url":"https://api.github.com/repos/dodoas/lodo/releases{/id}","deployments_url":"https://api.github.com/repos/dodoas/lodo/deployments","created_at":"2013-01-14T09:31:19Z","updated_at":"2016-01-23T20:36:17Z","pushed_at":"2016-04-19T07:16:54Z","git_url":"git://github.com/dodoas/lodo.git","ssh_url":"git@github.com:dodoas/lodo.git","clone_url":"https://github.com/dodoas/lodo.git","svn_url":"https://github.com/dodoas/lodo","homepage":"","size":9502,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":16,"forks":1,"open_issues":16,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/115"},"html":{"href":"https://github.com/dodoas/lodo/pull/115"},"issue":{"href":"https://api.github.com/repos/dodoas/lodo/issues/115"},"comments":{"href":"https://api.github.com/repos/dodoas/lodo/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dodoas/lodo/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/dodoas/lodo/statuses/2f20e1b88dc7115e6d9b621eb5aa48f7ba6e5859"}}}}