mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Fix for partial invoice label on PDF
This commit is contained in:
parent
ad68d64dca
commit
07f50d188f
@ -31601,25 +31601,18 @@ NINJA.invoiceDetails = function(invoice) {
|
||||
])
|
||||
}
|
||||
|
||||
var isPartial = NINJA.parseFloat(invoice.partial);
|
||||
|
||||
if (NINJA.parseFloat(invoice.balance) < NINJA.parseFloat(invoice.amount)) {
|
||||
data.push([
|
||||
{text: invoiceLabels.balance_due},
|
||||
{text: formatMoneyInvoice(invoice.amount, invoice)}
|
||||
]);
|
||||
} else if (isPartial) {
|
||||
data.push([
|
||||
{text: invoiceLabels.balance_due},
|
||||
{text: formatMoneyInvoice(invoice.total_amount, invoice)}
|
||||
]);
|
||||
}
|
||||
|
||||
data.push([
|
||||
{text: isPartial ? invoiceLabels.partial_due : invoiceLabels.balance_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
{text: invoiceLabels.balance_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.total_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
])
|
||||
|
||||
if (NINJA.parseFloat(invoice.partial)) {
|
||||
data.push([
|
||||
{text: invoiceLabels.partial_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
])
|
||||
}
|
||||
|
||||
return NINJA.prepareDataPairs(data, 'invoiceDetails');
|
||||
}
|
||||
|
||||
|
@ -597,25 +597,18 @@ NINJA.invoiceDetails = function(invoice) {
|
||||
])
|
||||
}
|
||||
|
||||
var isPartial = NINJA.parseFloat(invoice.partial);
|
||||
|
||||
if (NINJA.parseFloat(invoice.balance) < NINJA.parseFloat(invoice.amount)) {
|
||||
data.push([
|
||||
{text: invoiceLabels.balance_due},
|
||||
{text: formatMoneyInvoice(invoice.amount, invoice)}
|
||||
]);
|
||||
} else if (isPartial) {
|
||||
data.push([
|
||||
{text: invoiceLabels.balance_due},
|
||||
{text: formatMoneyInvoice(invoice.total_amount, invoice)}
|
||||
]);
|
||||
}
|
||||
|
||||
data.push([
|
||||
{text: isPartial ? invoiceLabels.partial_due : invoiceLabels.balance_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
{text: invoiceLabels.balance_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.total_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
])
|
||||
|
||||
if (NINJA.parseFloat(invoice.partial)) {
|
||||
data.push([
|
||||
{text: invoiceLabels.partial_due, style: ['invoiceDetailBalanceDueLabel']},
|
||||
{text: formatMoneyInvoice(invoice.balance_amount, invoice), style: ['invoiceDetailBalanceDue']}
|
||||
])
|
||||
}
|
||||
|
||||
return NINJA.prepareDataPairs(data, 'invoiceDetails');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user