diff --git a/public/js/script.js b/public/js/script.js index 5569b2923c87..53090ec2e170 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1215,11 +1215,8 @@ y2=GlobalY; Msg='Balance Due'; var TmpMsgX = MsgRightAlign-(doc.getStringUnitWidth(Msg) * doc.internal.getFontSize()); - - doc.text(TmpMsgX, x, Msg); - SetPdfColor('LightBlue',doc); AmountText = formatMoney(balance , currencyId); headerLeft=headerRight+400; @@ -1227,7 +1224,38 @@ y2=GlobalY; doc.text(AmountX, x, AmountText); + GlobalY=GlobalY+100; + length=doc.splitTextToSize( terms, 200).length; + FontSize=10; + var h=length*FontSize; + + //check do we need to go to next page + MinHeight=700; + + if (GlobalY+h > MinHeight) { + GlobalY=Report1AddNewPage(invoice,account,doc); + } + + SetPdfColor('Black',doc); + doc.text(40, GlobalY, terms); + GlobalY=GlobalY+h; + + + //GlobalY=GlobalY+100; + length=doc.splitTextToSize( public_notes, 200).length; + FontSize=10; + var h=length*FontSize; + + //check do we need to go to next page + MinHeight=700; + if (GlobalY+h > MinHeight) { + GlobalY=Report1AddNewPage(invoice,account,doc); + } + + SetPdfColor('Black',doc); + doc.text(40, GlobalY, public_notes); + GlobalY=GlobalY+h;