From 841b0aea89f54c2c6f9ba1ac6c1a91357a4ac72b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 19 Feb 2018 16:31:33 +0200 Subject: [PATCH] Remove broken balance check --- resources/views/invoices/edit.blade.php | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index ce774404453b..0bec4e5cc7f1 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1204,7 +1204,6 @@ } var origInvoiceNumber = false; - var checkedInvoiceBalances = false; function getPDFString(cb, force) { @if (! $invoice->id && $account->credit_number_counter > 0) @@ -1219,28 +1218,13 @@ } @endif - var invoice = createInvoiceModel(); - var design = getDesignJavascript(); - - @if ($invoice->exists) - if (! checkedInvoiceBalances) { - 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 invoice = createInvoiceModel(); + var design = getDesignJavascript(); + if (! design) { return; }