report fixes

update
This commit is contained in:
alltheworld 2014-03-05 11:41:06 +02:00
parent 15d6eece81
commit 2a42f44acb

View File

@ -552,19 +552,12 @@ function GetReportTemplate1 (invoice,checkMath)
{ {
var doc=false; var doc=false;
// var MaxWidth=550;
// var MaxHeight=800;
// return generatePdf2(invoice,checkMath);
var GlobalY=0;//Y position of line at current page var GlobalY=0;//Y position of line at current page
var client = invoice.client; var client = invoice.client;
var account = invoice.account; var account = invoice.account;
var currencyId = client.currency_id; var currencyId = client.currency_id;
var invoiceNumber = invoice.invoice_number; var invoiceNumber = invoice.invoice_number;
var invoiceDate = invoice.invoice_date ? invoice.invoice_date : ''; var invoiceDate = invoice.invoice_date ? invoice.invoice_date : '';
@ -572,11 +565,6 @@ function GetReportTemplate1 (invoice,checkMath)
var paid_to_date = invoice.amount - invoice.balance; var paid_to_date = invoice.amount - invoice.balance;
//var work_email = account.work_email ? account.work_email : '';
//var work_phone =account.work_phone ? account.work_phone : '';
var headerRight = 150; var headerRight = 150;
var accountTop = 30; var accountTop = 30;
var marginLeft = 180; var marginLeft = 180;
@ -591,10 +579,6 @@ function GetReportTemplate1 (invoice,checkMath)
var lineTotalRight = 550; var lineTotalRight = 550;
var tableLeft = 50; var tableLeft = 50;
//var tableTop = 240+100;
//var tableRowHeight = 18;
var tablePadding = 14; var tablePadding = 14;
@ -722,14 +706,12 @@ function GetReportTemplate1 (invoice,checkMath)
doc.setFontSize(7); doc.setFontSize(7);
//account.email='email N/A';
if (account.work_email) { if (account.work_email) {
y += rowHeight; y += rowHeight;
doc.text(left, y, account.work_email); doc.text(left, y, account.work_email);
} }
//account.phone='phone N/A';
if (account.work_phone) { if (account.work_phone) {
y += rowHeight; y += rowHeight;
doc.text(left, y, account.work_phone); doc.text(left, y, account.work_phone);
@ -770,7 +752,7 @@ function GetReportTemplate1 (invoice,checkMath)
SetPdfColor('LightBlue',doc); SetPdfColor('LightBlue',doc);
doc.setFontSize('11'); doc.setFontSize('11');
doc.text(50, headerTop, 'Invoice'); doc.text(50, headerTop, 'INVOICE');
SetPdfColor('GrayLogo',doc); //set black color SetPdfColor('GrayLogo',doc); //set black color
y=130; y=130;
@ -808,7 +790,7 @@ function GetReportTemplate1 (invoice,checkMath)
doc.text(marginLeft2, line3, balance); doc.text(marginLeft2, line3, balance);
ClientCompanyName=client.name; ClientCompanyName=client.name;
ClientCompanyEmail='';//client.email;//'22222222'; ClientCompanyEmail='';
ClientCompanyPhone=client.work_phone; ClientCompanyPhone=client.work_phone;
ClientCompanyAddress1=client.address1; ClientCompanyAddress1=client.address1;
@ -956,31 +938,10 @@ function GetReportTemplate1 (invoice,checkMath)
if (h+GlobalY > MaxGlobalY) { if (h+GlobalY > MaxGlobalY) {
//tableTop = 40;
//GlobalY=tableTop;
//var MaxLinesPerPage=70;
GlobalY=Report1AddNewPage(invoice,account,doc); GlobalY=Report1AddNewPage(invoice,account,doc);
/*
doc.addPage();
if (invoice.imageLogo1)
{
pageHeight=820;
var left = headerRight ;
y=pageHeight-invoice.imageLogoHeight1;
var left = headerRight - invoice.imageLogoWidth1;
doc.addImage(invoice.imageLogo1, 'JPEG', left, y, invoice.imageLogoWidth1, invoice.imageLogoHeight1);
}*/
} }
if ((i%2)===0){ if ((i%2)===0){