1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Merge bug fixes

This commit is contained in:
Hillel Coren 2018-07-08 14:33:11 +03:00
parent 239f492311
commit ea2d58e30f
3 changed files with 13 additions and 8 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

@ -203,6 +203,9 @@ function GetPdfMake(invoice, javascript, callback) {
if (window.accountBackground) { if (window.accountBackground) {
var origBackground = dd.background; var origBackground = dd.background;
if (! origBackground) {
origBackground = [{"image": window.accountBackground, "alignment": "center"}];
}
dd.background = function(currentPage) { dd.background = function(currentPage) {
var allPages = origBackground.length && origBackground[0].pages == 'all'; var allPages = origBackground.length && origBackground[0].pages == 'all';
return currentPage == 1 || allPages ? origBackground : false; return currentPage == 1 || allPages ? origBackground : false;
@ -406,9 +409,11 @@ NINJA.decodeJavascript = function(invoice, javascript)
value = formatMoneyInvoice(value, invoice); value = formatMoneyInvoice(value, invoice);
} }
if (['$pageNumber', '$pageCount'].indexOf(match) == -1) {
javascript = javascript.replace(match, value); javascript = javascript.replace(match, value);
} }
} }
}
return javascript; return javascript;
} }