From dd96ce4f21788c35ead977a36200e6925a7f5c91 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 27 Mar 2018 15:12:10 +0300 Subject: [PATCH] Optimize edit invoice page --- resources/views/invoices/knockout.blade.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/views/invoices/knockout.blade.php b/resources/views/invoices/knockout.blade.php index eae180dd3..9223ff291 100644 --- a/resources/views/invoices/knockout.blade.php +++ b/resources/views/invoices/knockout.blade.php @@ -374,8 +374,15 @@ function InvoiceModel(data) { } self.formatMoney = function(amount) { + /* var client = $.parseJSON(ko.toJSON(self.client())); return formatMoneyAccount(amount, self.account, client); + */ + + var currencyId = (self.client().currency_id() || account.currency_id) || {{ DEFAULT_CURRENCY }}; + var countryId = (self.client().country_id() || account.country_id) || {{ DEFAULT_COUNTRY }}; + var decorator = parseInt(account.show_currency_code) ? 'code' : 'symbol'; + return formatMoney(amount, currencyId, countryId, decorator); } self.totals = ko.observable();