From a4135ec902b2646a36bcb21c08b05da7ea121688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Fri, 22 Nov 2019 17:34:38 +0300 Subject: [PATCH] Invoice and Bill get item dropdown style fixes.. --- resources/assets/js/views/expenses/bills.js | 7 ++++--- resources/assets/js/views/incomes/invoices.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/views/expenses/bills.js b/resources/assets/js/views/expenses/bills.js index 4020f71ef..e7130330f 100644 --- a/resources/assets/js/views/expenses/bills.js +++ b/resources/assets/js/views/expenses/bills.js @@ -53,11 +53,11 @@ const app = new Vue({ this.onAddItem(); } - if (typeof invoice_items !== 'undefined') { + if (typeof bill_items !== 'undefined' && bill_items) { let items = []; let currency_code = this.form.currency_code; - invoice_items.forEach(function(item) { + bill_items.forEach(function(item) { items.push({ show: false, currency: currency_code, @@ -148,11 +148,12 @@ const app = new Vue({ onGetItem(event, index) { let name = event.target.value; + this.form.items[index].show = false; axios.get(url + '/common/items/autocomplete', { params: { query: name, - type: 'invoice', + type: 'bill', currency_code: this.form.currency_code } }) diff --git a/resources/assets/js/views/incomes/invoices.js b/resources/assets/js/views/incomes/invoices.js index 2e6e8040d..962725657 100644 --- a/resources/assets/js/views/incomes/invoices.js +++ b/resources/assets/js/views/incomes/invoices.js @@ -53,7 +53,7 @@ const app = new Vue({ this.onAddItem(); } - if (typeof invoice_items !== 'undefined') { + if (typeof invoice_items !== 'undefined' && invoice_items) { let items = []; let currency_code = this.form.currency_code; @@ -148,6 +148,7 @@ const app = new Vue({ onGetItem(event, index) { let name = event.target.value; + this.form.items[index].show = false; axios.get(url + '/common/items/autocomplete', { params: {