Add back commented out balance check code
This commit is contained in:
parent
6ade9f5f1c
commit
490269ad63
1 changed files with 22 additions and 3 deletions
|
|
@ -1191,6 +1191,8 @@
|
|||
}
|
||||
|
||||
var origInvoiceNumber = false;
|
||||
var checkedInvoiceBalances = false;
|
||||
|
||||
function getPDFString(cb, force) {
|
||||
@if (! $invoice->id && $account->credit_number_counter > 0)
|
||||
var total = model.invoice().totals.rawTotal();
|
||||
|
|
@ -1204,13 +1206,30 @@
|
|||
}
|
||||
@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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue