footer added

This commit is contained in:
sigitas 2015-04-14 00:39:08 +03:00
parent 3d96f51790
commit 8921eb0e9b
2 changed files with 4 additions and 70 deletions

View File

@ -23,16 +23,12 @@ function notesAndTerms(invoice)
function invoiceLines(invoice) {
var grid =
[[{text: invoiceLabels.item, style: 'tableHeader'},
[[{text: invoiceLabels.item, style: 'tableHeader'},
{text: invoiceLabels.description, style: 'tableHeader'},
{text: invoiceLabels.unit_cost, style: 'tableHeader'},
{text: invoiceLabels.quantity, style: 'tableHeader'},
{text: invoice.has_taxes?invoiceLabels.tax:'', style: 'tableHeader'},
{text: invoiceLabels.line_total, style: 'tableHeader'}]];
//grid.push(['Sample value 1', 'Sample value 2', 'Sample value 3', 'Sample value 2', invoice.has_taxes?'Sample value 2':'','Sample value 3']);
//grid.push(['Sample value 1', 'Sample value 2', 'Sample value 3', 'Sample value 2', invoice.has_taxes?'Sample value 2':'','Sample value 3']);
var line = 1;
var total = 0;
var shownItem = false;
var currencyId = invoice && invoice.client ? invoice.client.currency_id : 1;
@ -84,71 +80,6 @@ function invoiceLines(invoice) {
grid.push(row);
}
/*
y = tableTop + (line * layout.tableRowHeight) + (3 * layout.tablePadding);
if (invoice.invoice_design_id == 8) {
doc.setDrawColor(30, 30, 30);
doc.setLineWidth(0.5);
var topX = tableTop - 14;
doc.line(layout.marginLeft - 10, topX, layout.marginLeft - 10, y);
doc.line(layout.descriptionLeft - 8, topX, layout.descriptionLeft - 8, y);
doc.line(layout.unitCostRight - 55, topX, layout.unitCostRight - 55, y);
doc.line(layout.qtyRight - 50, topX, layout.qtyRight - 50, y);
if (invoice.has_taxes) {
doc.line(layout.taxRight - 28, topX, layout.taxRight - 28, y);
}
doc.line(totalX - 25, topX, totalX - 25, y + 90);
doc.line(totalX + 45, topX, totalX + 45, y + 90);
}
var cutoff = 700;
if (invoice.terms) {
cutoff -= 50;
}
if (invoice.public_notes) {
cutoff -= 50;
}
if (y > cutoff) {
doc.addPage();
return layout.marginLeft;
}
*/
return grid;
}
/*
var doc = new jsPDF('portrait', 'pt', 'a4');
//doc.getStringUnitWidth = function(param) { console.log('getStringUnitWidth: %s', param); return 0};
//Set PDF properities
doc.setProperties({
title: 'Invoice ' + invoice.invoice_number,
subject: '',
author: 'InvoiceNinja.com',
keywords: 'pdf, invoice',
creator: 'InvoiceNinja.com'
});
//set default style for report
doc.setFont('Helvetica','');
eval(javascript);
// add footer
if (invoice.invoice_footer) {
doc.setFontType('normal');
doc.setFontSize('8');
SetPdfColor(invoice.invoice_design_id == 2 || invoice.invoice_design_id == 3 ? 'White' : 'Black',doc);
var top = doc.internal.pageSize.height - layout.marginLeft;
var numLines = invoice.invoice_footer.split("\n").length - 1;
doc.text(layout.marginLeft, top - (numLines * 8), invoice.invoice_footer);
}
return doc;
}
*/

View File

@ -99,6 +99,9 @@ var dd = {
]
},
],
footer:function(){
return invoice.invoice_footer?invoice.invoice_footer:"";
},
defaultStyle: {
font: 'sans'
},