From e03a185d39d8205211de7526909467e8eb5fdefe Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 14 Jul 2016 22:59:22 +0300 Subject: [PATCH] Fix for branding logo with custom designs --- public/built.js | 28 ++++++++++++++++++---------- public/js/pdf.pdfmake.js | 28 ++++++++++++++++++---------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/public/built.js b/public/built.js index f72e47d096..7e38c6b151 100644 --- a/public/built.js +++ b/public/built.js @@ -31118,23 +31118,31 @@ function GetPdfMake(invoice, javascript, callback) { return val; } - // Add ninja logo to the footer var dd = JSON.parse(javascript, jsonCallBack); var designId = invoice.invoice_design_id; if (!invoice.features.remove_created_by) { var footer = (typeof dd.footer === 'function') ? dd.footer() : dd.footer; if (footer) { - if (designId == NINJA.TEMPLATES.ELEGANT) { - footer[0].columns.push({image: logoImages.imageLogo1, alignment: 'right', width: 130, margin: [0, -20, 20, 0]}) - } else if (designId == NINJA.TEMPLATES.PLAYFUL) { - footer.push({image: logoImages.imageLogo1, alignment: 'right', width: 130, margin: [0, 0, 10, 10]}) - } else if (designId == NINJA.TEMPLATES.BOLD) { - footer[1].columns.push({image: logoImages.imageLogo2, alignment: 'right', width: 130, margin: [0, -20, 20, 0]}) - } else if (designId == NINJA.TEMPLATES.MODERN) { - footer[1].columns[0].stack.push({image: logoImages.imageLogo3, alignment: 'left', width: 130, margin: [40, 6, 0, 0]}); - } else { + if (footer.hasOwnProperty('columns')) { footer.columns.push({image: logoImages.imageLogo1, alignment: 'right', width: 130, margin: [0, 0, 0, 0]}) + } else { + var foundColumns; + for (var i=0; i