From 31377eb2267fb8e7c1581a9cd7193592539139db Mon Sep 17 00:00:00 2001 From: alltheworld Date: Mon, 3 Mar 2014 17:49:10 +0200 Subject: [PATCH] report fixes --- public/js/script.js | 50 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index 7bca0f3125..f4485157b8 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -900,7 +900,7 @@ function GetReportTemplate1 (invoice,checkMath) var shownItem = false; - GlobalY=GlobalY+14; //padding from top + GlobalY=GlobalY+14+10; //padding from top var FontSize=7; doc.setFontSize(FontSize); @@ -1034,8 +1034,20 @@ function GetReportTemplate1 (invoice,checkMath) + + + //-------------------------------Publishing Document balance------------------------------------------ +//check do we need to go to next page + MinHeight=700; + + if (GlobalY > MinHeight) { + + + GlobalY=Report1AddNewPage(invoice,account,doc); + } + @@ -1047,19 +1059,22 @@ function GetReportTemplate1 (invoice,checkMath) - GlobalY=x; + // GlobalY=x; + + GlobalY=GlobalY+25; doc.setLineWidth(0.3); doc.setDrawColor(251,251,251); doc.setFillColor(251,251,251); var x1 = tableLeft-tablePadding*2+14 ; var y1 = GlobalY-FontSize-tablePadding; + var w2 = 510+tablePadding*2;//lineTotalRight-tablePadding*5; var h2 = doc.internal.getFontSize()*3+tablePadding*2; doc.rect(x1, y1, w2, h2, 'FD'); - + x=y1+FontSize+tablePadding; Msg='Subtotal'; @@ -1122,6 +1137,19 @@ function GetReportTemplate1 (invoice,checkMath) } + + + + + + + + + + + + + function GetReportTemplate2 (invoice,checkMath) { var doc=false; @@ -1794,7 +1822,6 @@ function SetPdfColor(color,doc) } - function Report2AddFooter (invoice,doc) { @@ -2659,4 +2686,19 @@ function Report3AddHeader (invoice,account,doc) } +} + + +function Report1AddNewPage(invoice,account,doc) +{ + //alert(1); + doc.addPage(); + + GlobalY = 40; + return GlobalY; +} + +function Report1AddFooter(invoice,account,doc) +{ + alert(2); } \ No newline at end of file