From cbe39f9aaf88d80a372b81dda09315bebe8b2b31 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 29 Jun 2016 22:59:54 +0300 Subject: [PATCH] Fix for elegant design --- public/built.js | 4 +++- public/js/pdf.pdfmake.js | 4 +++- storage/templates/elegant.js | 11 ++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/public/built.js b/public/built.js index 3f9e5c80f858..911b80879594 100644 --- a/public/built.js +++ b/public/built.js @@ -31096,7 +31096,9 @@ function GetPdfMake(invoice, javascript, callback) { if (!invoice.features.remove_created_by) { var footer = dd.footer(); if (footer) { - if (designId == NINJA.TEMPLATES.PLAYFUL) { + 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]}) diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 1203f283fd7c..7c5ef92b37cc 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -89,7 +89,9 @@ function GetPdfMake(invoice, javascript, callback) { if (!invoice.features.remove_created_by) { var footer = dd.footer(); if (footer) { - if (designId == NINJA.TEMPLATES.PLAYFUL) { + 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]}) diff --git a/storage/templates/elegant.js b/storage/templates/elegant.js index 050847ea8bb2..c26925594fc4 100755 --- a/storage/templates/elegant.js +++ b/storage/templates/elegant.js @@ -103,8 +103,13 @@ }], "footer": [ { - "text": "$invoiceFooter", - "margin": [40, -40, 40, 20] + "columns": [ + { + "text": "$invoiceFooter", + "alignment": "left" + } + ], + "margin": [40, -20, 40, 0] }, {"canvas": [{ "type": "line", "x1": 35, "y1": 5, "x2": 555, "y2": 5, "lineWidth": 2,"margin": [30,0,0,0]}]}, {"canvas": [{ "type": "line", "x1": 35, "y1": 3, "x2": 555, "y2": 3, "lineWidth": 1,"margin": [30,0,0,0]}]} @@ -203,4 +208,4 @@ } }, "pageMargins": [40, 40, 40, 40] -} \ No newline at end of file +}