From c5f340b7b3fcd164411e206cd976db9813b3b1bf Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 17 Oct 2017 11:09:22 +0300 Subject: [PATCH] Remove balance check --- resources/views/invoices/edit.blade.php | 27 ++++++------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 05c05e1dfe..f96c1bf932 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1149,7 +1149,6 @@ } var origInvoiceNumber = false; - var checkedInvoiceBalances = false; function getPDFString(cb, force) { @if (! $invoice->id && $account->credit_number_counter > 0) var total = model.invoice().totals.rawTotal(); @@ -1163,30 +1162,16 @@ } @endif - var invoice = createInvoiceModel(); - - @if ($invoice->exists) - if (! checkedInvoiceBalances) { - // check amounts are correct - checkedInvoiceBalances = true; - var phpBalance = roundSignificant(invoice.balance); - var koBalance = roundSignificant(model.invoice().totals.rawTotal()); - var jsBalance = roundSignificant(calculateAmounts(invoice).total_amount); - if (phpBalance == koBalance && koBalance == jsBalance) { - // do nothing - } else { - var invitationKey = invoice.invitations[0].invitation_key; - window.onerror(invitationKey + ': Balances do not match | PHP: ' + phpBalance + ', JS: ' + jsBalance + ', KO: ' + koBalance); - } - } - @endif - @if ( ! $account->live_preview) return; @endif - var design = getDesignJavascript(); - if (!design) return; + var invoice = createInvoiceModel(); + var design = getDesignJavascript(); + + if (! design) { + return; + } generatePDF(invoice, design, force, cb); }