MonkeyMagic Posted June 7, 2009 Share Posted June 7, 2009 Hi everyone, In the PDF invoices that are sent to clients, there is always the Credit line with a $0.00 amount between the Sub Total and Total. What we want to do is completely remove that Credit line so long as there is no credit being applied. But if there IS credit, ONLY then it should show. So something like, if it doesn't = $0.00, then show ... otherwise hide it. I hope that makes sense. I have mucked around with it a bit but I can't get it to work. Anyone have any ideas of how to do this - I'd greatly appreciate it. Cheers 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted June 7, 2009 Share Posted June 7, 2009 find these lines $pdf->Cell(90,0,$_LANG["invoicescredit"],0,0,'R',0); $pdf->Cell(20,0,$credit,0,0,'R',0); $pdf->Ln();$pdf->Cell(2,0); and change it to this$xcredit=explode(' ',$credit);if ($xcredit[0] != "$0.00") { $pdf->Cell(90,0,$_LANG["invoicescredit"],0,0,'R',0); $pdf->Cell(20,0,$credit,0,0,'R',0); $pdf->Ln();$pdf->Cell(2,0); } Thats so long as you do use the $ symbol If not a little bit more code is needed 0 Quote Link to comment Share on other sites More sharing options...
MonkeyMagic Posted June 8, 2009 Author Share Posted June 8, 2009 Worked perfectly - thanks sparky 0 Quote Link to comment Share on other sites More sharing options...
ditto Posted November 9, 2009 Share Posted November 9, 2009 Thats so long as you do use the $ symbol If not a little bit more code is needed I am using WHMCS v. 4.1.2. In "Setup" - "Currencies" I have these values: Currency Code: NOK Prefix: Kr Suffix: NOK Format: 1234.56 My credit line on the PDF invoice looks like this: Kr 0.00 NOK I have this in my invoicepdf.tpl: $xcredit=explode(' ',$credit); if ($xcredit[0] != "$0.00") { $pdf->Cell(140,7,$_LANG["invoicescredit"],1,0,'R','1'); $pdf->Cell(40,7,$credit,1,0,'C','1'); $pdf->Ln(); } I have tried to change "$0.00" into "Kr0.00", but it did not work. I have also tried different variations ("Kr 0.00" or "Kr 0.00 NOK" etc). Can anybody help with this? I really need to remove the "Credit" line when the credit is 0.00 0 Quote Link to comment Share on other sites More sharing options...
dutchnet Posted March 21, 2011 Share Posted March 21, 2011 this works in 4.4.2 $xcredit=substr($credit,-5); if ($xcredit != "0.00 ") { $pdf->Cell(148,7,$_LANG["invoicescredit"].":",1,0,'R',1); $pdf->Cell(40,7,$currencysymbol." - ".$credit." ",1,0,'R',1); $pdf->Ln(); } 0 Quote Link to comment Share on other sites More sharing options...
TruConcept Posted March 21, 2011 Share Posted March 21, 2011 Helpful tip, thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.