{"action":"created","comment":{"url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/comments/103193123","pull_request_review_id":23970894,"id":103193123,"diff_hunk":"@@ -59,86 +64,133 @@ export class DataForm {\n     //                 }\n     //             })\n     //     }\n-    // }\n-\n+    // } \n \n     async barcodeChoose(e) {\n-        debugger\n-        var itemData = e.srcElement.defaultValue;\n-        if (itemData != \"\") {\n+        var itemData = e.target.value;\n+        if (itemData && itemData.length >= 13) {\n             var fgTemp = await this.service.getByCode(itemData);\n-            var fg = fgTemp[0];\n-            if (Object.getOwnPropertyNames(fg).length > 0) {\n+            if (fgTemp != undefined) {\n+                if (Object.getOwnPropertyNames(fgTemp).length > 0) {\n+                    var fg = fgTemp[0];\n+                    if (fg != undefined && Object.getOwnPropertyNames(fg).length > 0) {\n+                        var newItem = {};\n+                        var _data = this.data.items.find((item) => item.code === fg.code);\n+                        if (!_data) {\n+                            this.qtyFg = 0;\n+                            this.price = 0;\n+                            newItem.itemId = fg._id;\n+                            newItem.availableQuantity = 0;\n+                            var result = await this.service.getDataInventory(this.data.source._id, newItem.itemId);\n+                            if (result != undefined) {\n+                                newItem.availableQuantity = result.quantity;\n+                            }\n+                            newItem.name = fg.name;\n+                            newItem.code = fg.code;\n+                            this.qtyFg = this.qtyFg + 1;\n+                            newItem.quantity = 1;\n+                            this.price = fg.domesticSale;\n+                            newItem.price = parseFloat(fg.domesticSale)\n+                            newItem.remark = \"\";\n+\n+                            this.data.items.push(newItem);\n+                        } else {\n+                            this.qtyFg = parseInt(_data.quantity) + 1;\n+                            this.price = this.qtyFg * this.price\n+                            _data.price = parseFloat(this.price)\n+                            _data.quantity = this.qtyFg;\n+                        }\n+                    }\n+                }\n+            }\n+            this.makeTotal(this.data.items);\n+            this.barcode = \"\";\n+        }\n+\n+    }\n+\n+\n+\n+    async nameChoose(e) {\n+        this.hasFocus = false;\n+        var itemData = e.detail;\n+        if (itemData != undefined) {\n+            if (Object.getOwnPropertyNames(itemData).length > 0) {\n                 var newItem = {};\n-                var _data = this.data.items.find((item) => item.code === fg.code);\n+                var _data = this.data.items.find((item) => item.code === itemData.code);\n                 if (!_data) {\n-                    newItem.itemId = fg._id;\n+                    this.qtyFg = 0;\n+                    this.price = 0;\n+                    newItem.itemId = itemData._id;\n                     newItem.availableQuantity = 0;\n-                    var result = await this.getQuantity(this.data.source._id, newItem.itemId);\n+                    var result = await this.service.getDataInventory(this.data.source._id, newItem.itemId);\n                     if (result != undefined) {\n-                        newItem.availableQuantity = result;\n+                        newItem.availableQuantity = result.quantity;\n                     }\n-                    newItem.name = fg.name;\n-                    newItem.code = fg.code;\n+                    newItem.name = itemData.name;\n+                    newItem.code = itemData.code;\n                     newItem.quantity = 1;\n+                    this.qtyFg = this.qtyFg + 1;\n+                    this.price = itemData.domesticSale;\n+                    newItem.price = parseFloat(itemData.domesticSale);\n                     newItem.remark = \"\";\n                     this.data.items.push(newItem);\n-                    this.barcode = \"\";\n                 }\n+                this.makeTotal(this.data.items);\n+                this.item = null;\n             }\n-\n         }\n \n     }\n \n-    getQuantity(source, itemId) {\n-        this.service.getDataInventory(source, itemId)\n-            .then(inventoryData => {\n-                if (inventoryData) {\n-                    return inventoryData.quantity;\n+    qtyChange(e) {\n+        var itemData = e.detail;\n+        if (itemData != undefined) {","path":"src/modules/efr-kb-rtp-cr/data-form.js","position":122,"original_position":122,"commit_id":"14c31d2d5b730b8becce0090ed44ad530494843a","original_commit_id":"14c31d2d5b730b8becce0090ed44ad530494843a","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use '!==' to compare with 'undefined'.","created_at":"2017-02-27T12:11:51Z","updated_at":"2017-02-27T12:11:52Z","html_url":"https://github.com/danliris/bateeq-ui/pull/98#discussion_r103193123","pull_request_url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/comments/103193123"},"html":{"href":"https://github.com/danliris/bateeq-ui/pull/98#discussion_r103193123"},"pull_request":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98","id":107818436,"html_url":"https://github.com/danliris/bateeq-ui/pull/98","diff_url":"https://github.com/danliris/bateeq-ui/pull/98.diff","patch_url":"https://github.com/danliris/bateeq-ui/pull/98.patch","issue_url":"https://api.github.com/repos/danliris/bateeq-ui/issues/98","number":98,"state":"open","locked":false,"title":"rechange value getQty in stock","user":{"login":"JanuitaM","id":19768390,"avatar_url":"https://avatars.githubusercontent.com/u/19768390?v=3","gravatar_id":"","url":"https://api.github.com/users/JanuitaM","html_url":"https://github.com/JanuitaM","followers_url":"https://api.github.com/users/JanuitaM/followers","following_url":"https://api.github.com/users/JanuitaM/following{/other_user}","gists_url":"https://api.github.com/users/JanuitaM/gists{/gist_id}","starred_url":"https://api.github.com/users/JanuitaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanuitaM/subscriptions","organizations_url":"https://api.github.com/users/JanuitaM/orgs","repos_url":"https://api.github.com/users/JanuitaM/repos","events_url":"https://api.github.com/users/JanuitaM/events{/privacy}","received_events_url":"https://api.github.com/users/JanuitaM/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-24T12:09:29Z","updated_at":"2017-02-27T12:11:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc43dcb1a729392634e8c49fbd64f7d5de2e6719","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98/commits","review_comments_url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98/comments","review_comment_url":"https://api.github.com/repos/danliris/bateeq-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danliris/bateeq-ui/issues/98/comments","statuses_url":"https://api.github.com/repos/danliris/bateeq-ui/statuses/14c31d2d5b730b8becce0090ed44ad530494843a","head":{"label":"JanuitaM:dev","ref":"dev","sha":"14c31d2d5b730b8becce0090ed44ad530494843a","user":{"login":"JanuitaM","id":19768390,"avatar_url":"https://avatars.githubusercontent.com/u/19768390?v=3","gravatar_id":"","url":"https://api.github.com/users/JanuitaM","html_url":"https://github.com/JanuitaM","followers_url":"https://api.github.com/users/JanuitaM/followers","following_url":"https://api.github.com/users/JanuitaM/following{/other_user}","gists_url":"https://api.github.com/users/JanuitaM/gists{/gist_id}","starred_url":"https://api.github.com/users/JanuitaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanuitaM/subscriptions","organizations_url":"https://api.github.com/users/JanuitaM/orgs","repos_url":"https://api.github.com/users/JanuitaM/repos","events_url":"https://api.github.com/users/JanuitaM/events{/privacy}","received_events_url":"https://api.github.com/users/JanuitaM/received_events","type":"User","site_admin":false},"repo":{"id":73666909,"name":"bateeq-ui","full_name":"JanuitaM/bateeq-ui","owner":{"login":"JanuitaM","id":19768390,"avatar_url":"https://avatars.githubusercontent.com/u/19768390?v=3","gravatar_id":"","url":"https://api.github.com/users/JanuitaM","html_url":"https://github.com/JanuitaM","followers_url":"https://api.github.com/users/JanuitaM/followers","following_url":"https://api.github.com/users/JanuitaM/following{/other_user}","gists_url":"https://api.github.com/users/JanuitaM/gists{/gist_id}","starred_url":"https://api.github.com/users/JanuitaM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanuitaM/subscriptions","organizations_url":"https://api.github.com/users/JanuitaM/orgs","repos_url":"https://api.github.com/users/JanuitaM/repos","events_url":"https://api.github.com/users/JanuitaM/events{/privacy}","received_events_url":"https://api.github.com/users/JanuitaM/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JanuitaM/bateeq-ui","description":null,"fork":true,"url":"https://api.github.com/repos/JanuitaM/bateeq-ui","forks_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/forks","keys_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/teams","hooks_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/hooks","issue_events_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/issues/events{/number}","events_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/events","assignees_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/assignees{/user}","branches_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/branches{/branch}","tags_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/tags","blobs_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/languages","stargazers_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/stargazers","contributors_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/contributors","subscribers_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/subscribers","subscription_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/subscription","commits_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/contents/{+path}","compare_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/merges","archive_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/downloads","issues_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/issues{/number}","pulls_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/labels{/name}","releases_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/releases{/id}","deployments_url":"https://api.github.com/repos/JanuitaM/bateeq-ui/deployments","created_at":"2016-11-14T04:28:35Z","updated_at":"2017-01-18T04:18:53Z","pushed_at":"2017-02-27T12:11:41Z","git_url":"git://github.com/JanuitaM/bateeq-ui.git","ssh_url":"git@github.com:JanuitaM/bateeq-ui.git","clone_url":"https://github.com/JanuitaM/bateeq-ui.git","svn_url":"https://github.com/JanuitaM/bateeq-ui","homepage":null,"size":522,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"danliris:dev","ref":"dev","sha":"c5ec86f6db5bad2a8c960fc5202d7a18f97b5658","user":{"login":"danliris","id":20855729,"avatar_url":"https://avatars.githubusercontent.com/u/20855729?v=3","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"repo":{"id":60683096,"name":"bateeq-ui","full_name":"danliris/bateeq-ui","owner":{"login":"danliris","id":20855729,"avatar_url":"https://avatars.githubusercontent.com/u/20855729?v=3","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danliris/bateeq-ui","description":null,"fork":false,"url":"https://api.github.com/repos/danliris/bateeq-ui","forks_url":"https://api.github.com/repos/danliris/bateeq-ui/forks","keys_url":"https://api.github.com/repos/danliris/bateeq-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danliris/bateeq-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danliris/bateeq-ui/teams","hooks_url":"https://api.github.com/repos/danliris/bateeq-ui/hooks","issue_events_url":"https://api.github.com/repos/danliris/bateeq-ui/issues/events{/number}","events_url":"https://api.github.com/repos/danliris/bateeq-ui/events","assignees_url":"https://api.github.com/repos/danliris/bateeq-ui/assignees{/user}","branches_url":"https://api.github.com/repos/danliris/bateeq-ui/branches{/branch}","tags_url":"https://api.github.com/repos/danliris/bateeq-ui/tags","blobs_url":"https://api.github.com/repos/danliris/bateeq-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danliris/bateeq-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danliris/bateeq-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/danliris/bateeq-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danliris/bateeq-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/danliris/bateeq-ui/languages","stargazers_url":"https://api.github.com/repos/danliris/bateeq-ui/stargazers","contributors_url":"https://api.github.com/repos/danliris/bateeq-ui/contributors","subscribers_url":"https://api.github.com/repos/danliris/bateeq-ui/subscribers","subscription_url":"https://api.github.com/repos/danliris/bateeq-ui/subscription","commits_url":"https://api.github.com/repos/danliris/bateeq-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/danliris/bateeq-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/danliris/bateeq-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/danliris/bateeq-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/danliris/bateeq-ui/contents/{+path}","compare_url":"https://api.github.com/repos/danliris/bateeq-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danliris/bateeq-ui/merges","archive_url":"https://api.github.com/repos/danliris/bateeq-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danliris/bateeq-ui/downloads","issues_url":"https://api.github.com/repos/danliris/bateeq-ui/issues{/number}","pulls_url":"https://api.github.com/repos/danliris/bateeq-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/danliris/bateeq-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/danliris/bateeq-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danliris/bateeq-ui/labels{/name}","releases_url":"https://api.github.com/repos/danliris/bateeq-ui/releases{/id}","deployments_url":"https://api.github.com/repos/danliris/bateeq-ui/deployments","created_at":"2016-06-08T08:48:48Z","updated_at":"2017-01-16T04:06:33Z","pushed_at":"2017-02-27T12:11:42Z","git_url":"git://github.com/danliris/bateeq-ui.git","ssh_url":"git@github.com:danliris/bateeq-ui.git","clone_url":"https://github.com/danliris/bateeq-ui.git","svn_url":"https://github.com/danliris/bateeq-ui","homepage":null,"size":526,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98"},"html":{"href":"https://github.com/danliris/bateeq-ui/pull/98"},"issue":{"href":"https://api.github.com/repos/danliris/bateeq-ui/issues/98"},"comments":{"href":"https://api.github.com/repos/danliris/bateeq-ui/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danliris/bateeq-ui/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/danliris/bateeq-ui/statuses/14c31d2d5b730b8becce0090ed44ad530494843a"}}}}
{"actor":{"display_login":"houndci-bot"}}