1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 00:53:10 +01:00

bug fixes

This commit is contained in:
Hillel Coren 2014-02-04 09:12:23 +02:00
parent 2d23bb1e3e
commit bc336d0701

View File

@ -225,7 +225,7 @@ function generatePDF(invoice, checkMath) {
for (var i=0; i<invoice.invoice_items.length; i++) { for (var i=0; i<invoice.invoice_items.length; i++) {
var item = invoice.invoice_items[i]; var item = invoice.invoice_items[i];
var cost = formatMoney(item.cost, currencyId, true); var cost = formatMoney(item.cost, currencyId, true);
var qty = parseFloat(item.qty) ? parseFloat(item.qty) + '' : ''; var qty = NINJA.parseFloat(item.qty) ? NINJA.parseFloat(item.qty) + '' : '';
var notes = item.notes; var notes = item.notes;
var productKey = item.product_key; var productKey = item.product_key;
var tax = 0; var tax = 0;
@ -245,7 +245,7 @@ function generatePDF(invoice, checkMath) {
notes = processVariables(notes); notes = processVariables(notes);
productKey = processVariables(productKey); productKey = processVariables(productKey);
var lineTotal = item.cost * item.qty; var lineTotal = NINJA.parseFloat(item.cost) * NINJA.parseFloat(item.qty);
if (tax) { if (tax) {
lineTotal += lineTotal * tax / 100; lineTotal += lineTotal * tax / 100;
} }
@ -346,7 +346,7 @@ function generatePDF(invoice, checkMath) {
x += 16; x += 16;
if (checkMath && parseFloat(total).toFixed(4) != parseFloat(invoice.amount).toFixed(4)) if (checkMath && NINJA.parseFloat(total).toFixed(4) != NINJA.parseFloat(invoice.amount).toFixed(4))
{ {
var doc = new jsPDF('p', 'pt'); var doc = new jsPDF('p', 'pt');
doc.setFont('Helvetica',''); doc.setFont('Helvetica','');