mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve PHP/JS checks
This commit is contained in:
parent
18ce61c6ef
commit
b463ccf79a
@ -866,9 +866,13 @@
|
|||||||
|
|
||||||
// check amounts are correct
|
// check amounts are correct
|
||||||
var phpBalance = invoice.balance;
|
var phpBalance = invoice.balance;
|
||||||
var jsBalance = model.invoice().totals.rawTotal();
|
var koBalance = model.invoice().totals.rawTotal();
|
||||||
if (phpBalance != jsBalance) {
|
var jsBalance = calculateAmounts(createInvoiceModel()).total_amount;
|
||||||
window.onerror('Balances do not match | PHP: ' + phpBalance + ', JS: ' + jsBalance);
|
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);
|
||||||
}
|
}
|
||||||
@else
|
@else
|
||||||
// set the default account tax rate
|
// set the default account tax rate
|
||||||
|
@ -554,10 +554,7 @@ function InvoiceModel(data) {
|
|||||||
total = NINJA.parseFloat(total) + customValue2;
|
total = NINJA.parseFloat(total) + customValue2;
|
||||||
}
|
}
|
||||||
|
|
||||||
var paid = self.totals.rawPaidToDate();
|
total -= self.totals.rawPaidToDate();
|
||||||
if (paid > 0) {
|
|
||||||
total -= paid;
|
|
||||||
}
|
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user