diff --git a/public/js/built.js b/public/js/built.js index 24a961f94fe3..b7608fd24faa 100644 --- a/public/js/built.js +++ b/public/js/built.js @@ -33351,12 +33351,12 @@ function notesAndTerms(invoice) { var text = []; if (invoice.public_notes) { - text.push(invoice.public_notes); + text.push({text:invoice.public_notes, style:'notes'}); } if (invoice.terms) { - text.push({text:invoiceLabels.terms, style:'bold'}); - text.push(invoice.terms); + text.push({text:invoiceLabels.terms, style:'termsLabel'}); + text.push({text:invoice.terms, style:'terms'}); } return text; @@ -33459,6 +33459,9 @@ function subtotals(invoice) if (invoice.account.hide_paid_to_date != '1' || paid) { data.push([invoiceLabels.paid_to_date, formatMoney(paid, invoice.client.currency_id)]); } + + data.push([{text:invoice.is_quote ? invoiceLabels.total : invoiceLabels.balance_due, style:'balanceDueLabel'}, + {text:formatMoney(invoice.balance_amount, invoice.client.currency_id), style:'balanceDueValue'}]); return data; } @@ -33484,4 +33487,8 @@ function accountAddress(account) { function primaryColor( defaultColor) { return NINJA.primaryColor?NINJA.primaryColor:defaultColor; +} + +function secondaryColor( defaultColor) { + return NINJA.primaryColor?NINJA.secondaryColor:defaultColor; } \ No newline at end of file diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 7bf8885b78f0..646edbf97ab5 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -10,12 +10,12 @@ function notesAndTerms(invoice) { var text = []; if (invoice.public_notes) { - text.push(invoice.public_notes); + text.push({text:invoice.public_notes, style:'notes'}); } if (invoice.terms) { - text.push({text:invoiceLabels.terms, style:'bold'}); - text.push(invoice.terms); + text.push({text:invoiceLabels.terms, style:'termsLabel'}); + text.push({text:invoice.terms, style:'terms'}); } return text; @@ -118,6 +118,9 @@ function subtotals(invoice) if (invoice.account.hide_paid_to_date != '1' || paid) { data.push([invoiceLabels.paid_to_date, formatMoney(paid, invoice.client.currency_id)]); } + + data.push([{text:invoice.is_quote ? invoiceLabels.total : invoiceLabels.balance_due, style:'balanceDueLabel'}, + {text:formatMoney(invoice.balance_amount, invoice.client.currency_id), style:'balanceDueValue'}]); return data; } diff --git a/public/js/templates/clean.js b/public/js/templates/clean.js index 3e2d5677ccc5..c0eec538cb8b 100644 --- a/public/js/templates/clean.js +++ b/public/js/templates/clean.js @@ -85,6 +85,7 @@ var dd = { paddingBottom: function(i, node) { return 8; } }, }, + '\n', { columns: [ notesAndTerms(invoice), @@ -167,6 +168,23 @@ var dd = { }, tableHeader: { bold: true + }, + balanceDueLabel: { + fontSize: 11 + }, + balanceDueValue: { + fontSize: 11, + color:primaryColor('#299CC2') + }, + notes: { + }, + terms: { + + }, + termsLabel: { + bold: true, + fontSize: 10, + margin: [0, 10, 0, 4] } }, pageMargins: [72, 40, 40, 80]