1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Show zero rate taxes on PDF

This commit is contained in:
Hillel Coren 2017-10-18 12:20:22 +03:00
parent 165b7a2b52
commit 293e07fc4e
4 changed files with 11 additions and 11 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

@ -678,11 +678,11 @@ NINJA.subtotals = function(invoice, hideBalance)
} }
} }
if (parseFloat(invoice.tax_rate1 || 0) != 0) { if (parseFloat(invoice.tax_rate1 || 0) != 0 || invoice.tax_name1) {
var taxStr = invoice.tax_name1 + ' ' + (invoice.tax_rate1*1).toString() + '%'; var taxStr = invoice.tax_name1 + ' ' + (invoice.tax_rate1*1).toString() + '%';
data.push([{text: taxStr, style: ['subtotalsLabel', 'tax1Label']}, {text: formatMoneyInvoice(invoice.tax_amount1, invoice), style: ['subtotals', 'tax1']}]); data.push([{text: taxStr, style: ['subtotalsLabel', 'tax1Label']}, {text: formatMoneyInvoice(invoice.tax_amount1, invoice), style: ['subtotals', 'tax1']}]);
} }
if (parseFloat(invoice.tax_rate2 || 0) != 0) { if (parseFloat(invoice.tax_rate2 || 0) != 0 || invoice.tax_name2) {
var taxStr = invoice.tax_name2 + ' ' + (invoice.tax_rate2*1).toString() + '%'; var taxStr = invoice.tax_name2 + ' ' + (invoice.tax_rate2*1).toString() + '%';
data.push([{text: taxStr, style: ['subtotalsLabel', 'tax2Label']}, {text: formatMoneyInvoice(invoice.tax_amount2, invoice), style: ['subtotals', 'tax2']}]); data.push([{text: taxStr, style: ['subtotalsLabel', 'tax2Label']}, {text: formatMoneyInvoice(invoice.tax_amount2, invoice), style: ['subtotals', 'tax2']}]);
} }

View File

@ -729,12 +729,12 @@ function calculateAmounts(invoice) {
} }
} }
if (parseFloat(item.tax_rate1) != 0) { if (parseFloat(item.tax_rate1) != 0 || item.tax_name1) {
taxRate1 = parseFloat(item.tax_rate1); taxRate1 = parseFloat(item.tax_rate1);
taxName1 = item.tax_name1; taxName1 = item.tax_name1;
} }
if (parseFloat(item.tax_rate2) != 0) { if (parseFloat(item.tax_rate2) != 0 || item.tax_name2) {
taxRate2 = parseFloat(item.tax_rate2); taxRate2 = parseFloat(item.tax_rate2);
taxName2 = item.tax_name2; taxName2 = item.tax_name2;
} }
@ -750,7 +750,7 @@ function calculateAmounts(invoice) {
} }
var taxAmount1 = roundToTwo(lineTotal * taxRate1 / 100); var taxAmount1 = roundToTwo(lineTotal * taxRate1 / 100);
if (taxAmount1 != 0) { if (taxAmount1 != 0 || taxName1) {
var key = taxName1 + taxRate1; var key = taxName1 + taxRate1;
if (taxes.hasOwnProperty(key)) { if (taxes.hasOwnProperty(key)) {
taxes[key].amount += taxAmount1; taxes[key].amount += taxAmount1;
@ -760,7 +760,7 @@ function calculateAmounts(invoice) {
} }
var taxAmount2 = roundToTwo(lineTotal * taxRate2 / 100); var taxAmount2 = roundToTwo(lineTotal * taxRate2 / 100);
if (taxAmount2 != 0) { if (taxAmount2 != 0 || taxName2) {
var key = taxName2 + taxRate2; var key = taxName2 + taxRate2;
if (taxes.hasOwnProperty(key)) { if (taxes.hasOwnProperty(key)) {
taxes[key].amount += taxAmount2; taxes[key].amount += taxAmount2;