Jump to content

Only show Credit in PDF if there is actually credit


MonkeyMagic

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 5 months later...

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

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated