From 001208e3452bba5065e14f55bc7743977f12d8ee Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 19 Oct 2014 23:10:16 +0300 Subject: [PATCH] fix #174 - Tax rate error in live PDF --- public/built.js | 5 +++-- public/js/script.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/built.js b/public/built.js index 0218d67cdc81..0fc4aa3b17f9 100644 --- a/public/built.js +++ b/public/built.js @@ -46755,8 +46755,9 @@ function displayGrid(doc, invoice, data, x, y, layout, options) { if (key.substring(0, 6) === 'custom') { key = invoice.account[key]; - } else if (key === 'tax') { - key = invoiceLabels[key] + ' ' + invoice.tax_amount + '%'; + } else if (key === 'tax' && invoice.tax_rate) { + console.log(invoice); + key = invoiceLabels[key] + ' ' + (invoice.tax_rate*1).toString() + '%'; } else { key = invoiceLabels[key]; } diff --git a/public/js/script.js b/public/js/script.js index 32db83ad11b5..ce82108a6741 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -830,8 +830,8 @@ function displayGrid(doc, invoice, data, x, y, layout, options) { if (key.substring(0, 6) === 'custom') { key = invoice.account[key]; - } else if (key === 'tax') { - key = invoiceLabels[key] + ' ' + invoice.tax_amount + '%'; + } else if (key === 'tax' && invoice.tax_rate) { + key = invoiceLabels[key] + ' ' + (invoice.tax_rate*1).toString() + '%'; } else { key = invoiceLabels[key]; }