1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Fix tax columns with inclusive taxes

This commit is contained in:
Hillel Coren 2018-01-02 12:13:22 +02:00
parent 8c8ebf75c6
commit 39640418b5
3 changed files with 30 additions and 26 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -666,7 +666,9 @@ function calculateAmounts(invoice) {
}
}
if (invoice.account.inclusive_taxes != '1') {
if (! taxRate1) {
var taxAmount1 = 0;
} else if (invoice.account.inclusive_taxes != '1') {
var taxAmount1 = roundToTwo(lineTotal * taxRate1 / 100);
} else {
var taxAmount1 = roundToTwo((lineTotal * 100) / (100 + (taxRate1 * 100)));
@ -681,7 +683,9 @@ function calculateAmounts(invoice) {
}
}
if (invoice.account.inclusive_taxes != '1') {
if (! taxRate2) {
var taxAmount2 = 0;
} else if (invoice.account.inclusive_taxes != '1') {
var taxAmount2 = roundToTwo(lineTotal * taxRate2 / 100);
} else {
var taxAmount2 = roundToTwo((lineTotal * 100) / (100 + (taxRate2 * 100)));