From dae5dcc3efcded6b39b71daebae5f601579605cf Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 1 Feb 2018 09:14:46 +0200 Subject: [PATCH] Fix for qty when field is hidden --- resources/views/invoices/knockout.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/invoices/knockout.blade.php b/resources/views/invoices/knockout.blade.php index f4bc9b1a031b..ed650d09da09 100644 --- a/resources/views/invoices/knockout.blade.php +++ b/resources/views/invoices/knockout.blade.php @@ -820,7 +820,7 @@ function ItemModel(data) { self.product_key = ko.observable(''); self.notes = ko.observable(''); self.cost = ko.observable(0); - self.qty = ko.observable(0); + self.qty = ko.observable({{ $account->hasInvoiceField('product', 'product.quantity') ? 0 : 1 }}); self.discount = ko.observable(); self.custom_value1 = ko.observable(''); self.custom_value2 = ko.observable(''); @@ -922,7 +922,7 @@ function ItemModel(data) { } this.isEmpty = function() { - return !self.product_key() && !self.notes() && !self.cost() && !self.qty(); + return !self.product_key() && !self.notes() && !self.cost(); } this.onSelect = function() {}