mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Fix: NaN% taxes on PDF
This commit is contained in:
parent
a6635c2ffb
commit
f7d0ef71ec
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -675,11 +675,11 @@ NINJA.subtotals = function(invoice, hideBalance)
|
||||
}
|
||||
}
|
||||
|
||||
if (parseFloat(invoice.tax_rate1) != 0) {
|
||||
if (parseFloat(invoice.tax_rate1 || 0) != 0) {
|
||||
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']}]);
|
||||
}
|
||||
if (parseFloat(invoice.tax_rate2) != 0) {
|
||||
if (parseFloat(invoice.tax_rate2 || 0) != 0) {
|
||||
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']}]);
|
||||
}
|
||||
|
@ -764,10 +764,10 @@ function calculateAmounts(invoice) {
|
||||
|
||||
taxRate1 = 0;
|
||||
taxRate2 = 0;
|
||||
if (parseFloat(invoice.tax_rate1) != 0) {
|
||||
if (parseFloat(invoice.tax_rate1 || 0) != 0) {
|
||||
taxRate1 = parseFloat(invoice.tax_rate1);
|
||||
}
|
||||
if (parseFloat(invoice.tax_rate2) != 0) {
|
||||
if (parseFloat(invoice.tax_rate2 || 0) != 0) {
|
||||
taxRate2 = parseFloat(invoice.tax_rate2);
|
||||
}
|
||||
taxAmount1 = roundToTwo(total * taxRate1 / 100);
|
||||
|
Loading…
Reference in New Issue
Block a user