1
0
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:
Hillel Coren 2016-04-24 00:08:16 +03:00
parent ad68d64dca
commit 07f50d188f
2 changed files with 18 additions and 32 deletions

View File

@ -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');
}

View File

@ -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');
}