Jump to content

Paid seal in the PDF Invoice after payment


iPH - Sriram

Recommended Posts

Hi There,

 

I've been working around WHMCS 3.5.1 after it was integrated with CCAVENUE.

 

My query is when a Invoice is generated and paid by the user through say paypal or ccavenue, the PDF invoice remains the same and only a email notification goes out to the user saying that we have received the payment and the email serves as a official receipt.

 

Is there a way where we can have a paid seal on the invoice like in CE. That looks more professional as the invoice will more or less have all the details of the transaction and client can easily take a print of the pdf invoice.

And the PDF will even have out logo.

 

Regards,

Sriram

Link to comment
Share on other sites

  • WHMCS CEO
My query is when a Invoice is generated and paid by the user through say paypal or ccavenue, the PDF invoice remains the same and only a email notification goes out to the user saying that we have received the payment and the email serves as a official receipt.

Incorrect. The PDF changes to say PAID on it in grey text thus showing it has been paid and the user also receives the Invoice Payment Confirmation email with a copy of it attached. It did used to be a big bright image but that can't be translated so now it's text - if you want it to stand out more you just need to edit the template file.

 

Matt

Link to comment
Share on other sites

Hi Matt,

 

Thanks for your reply.. But is there any settings that i need to change. Coz thatz not happening. I'm not even getting the Grey Text. And btw what template do i need to edit so that i can put a seal of the attached image.

 

Any assistance wud be helpful

 

Regards,

Sriram

paid_stamp.jpg

Link to comment
Share on other sites

From memory, the grey text is there but doesn't display on some monitors -- I had to adjust contrast on my LCD monitor before I could see it!

 

Please forgive any evil PHP slackness in the following, but I made the following changes to display a Green "Paid" when it was paid (instead of grey), and to display "Now Due" (instead of "Unpaid"):

 

98a152,159
> $displaystatus = $status;
> if ($status == "Unpaid")
>     $displaystatus = "Now Due";
> $r = 245; $g = $b = 0;  // red
> if ($status == "Paid")
> {
>     $r = $b = 0; $g = 255; // green
> }
100,101c161,163
< $pdf->SetTextColor(245);
< $pdf->Write(5,strtoupper($status));
---
> $pdf->SetTextColor($r, $g, $b);
> // $pdf->SetTextColor(245, 0, 0); // this displayed grey
> $pdf->Write(5,strtoupper($displaystatus));

According to the doco for the FPDF library WHMCS uses, SetTextColor(245) should be the same as SetTextColor(245, 0, 0) but it's not - it results in a light, almost unreadable grey whereas it should result in a red. Matt has previously stated it should be a grey colour, which is what you get without customisation, but unless I've missed something(*) it's grey because of a bug in the FPDF library.

 

(*) completely possible ...

Link to comment
Share on other sites

From memory, the grey text is there but doesn't display on some monitors -- I had to adjust contrast on my LCD monitor before I could see it!

 

Please forgive any evil PHP slackness in the following, but I made the following changes to display a Green "Paid" when it was paid (instead of grey), and to display "Now Due" (instead of "Unpaid"):

 

98a152,159
> $displaystatus = $status;
> if ($status == "Unpaid")
>     $displaystatus = "Now Due";
> $r = 245; $g = $b = 0;  // red
> if ($status == "Paid")
> {
>     $r = $b = 0; $g = 255; // green
> }
100,101c161,163
< $pdf->SetTextColor(245);
< $pdf->Write(5,strtoupper($status));
---
> $pdf->SetTextColor($r, $g, $b);
> // $pdf->SetTextColor(245, 0, 0); // this displayed grey
> $pdf->Write(5,strtoupper($displaystatus));

According to the doco for the FPDF library WHMCS uses, SetTextColor(245) should be the same as SetTextColor(245, 0, 0) but it's not - it results in a light, almost unreadable grey whereas it should result in a red. Matt has previously stated it should be a grey colour, which is what you get without customisation, but unless I've missed something(*) it's grey because of a bug in the FPDF library.

 

(*) completely possible ...

 

Thanks mate,

 

But where shd i change the code in..? i mean which file..?

 

Actuallty i tried couple of times and even downloading the invoice again and again, but no luck. Can't see paid.

 

Regards,

Sriram.

Link to comment
Share on other sites

whmcs/includes/pdfconfig.php

 

The output above is from diff(1), so obviously has the old code followed by the new code in pairs separated by "---".

 

I'm quite certain the "Paid" is there - try adjusting the contrast on your monitor, and looking at it sideways. You can also sometimes see it on a printout.

 

(ps: small aside - please don't quote the whole of a long message when replying as it makes the thread a lot harder for people to read! :))

Link to comment
Share on other sites

Hi pal,

 

Thanks for that.. i just looked sideways and yes the PAID exists..

 

But you know if any person is looking for it, then he can find it.

 

Is there a way if i can add the below attached image when invoice is paid.

 

I know its a just a line of code, but i'm not so proficient in PHP.

 

That image really looks good on a receipt rather than just TEXT.

 

Regards,

Sriram

paid_stamp.jpg

Link to comment
Share on other sites

I kinda like the text solution, as it's more portable and easier to change. Having said that if you copy the code used to display the logo, and work out how to put "paid" in the right spot, you should be good. You could always refer back to earlier versions of pdfconfig.php to learn how to do that!

 

If you just want to change the color of the "Paid" from grey to green my code above already does that.

Link to comment
Share on other sites

if ($notes) {
$pdf->SetFont('Arial','',;
$pdf->MultiCell(188,5,$_LANG["invoicesnotes"].": $notes");
}

if ($status=="Cancelled") {
$pdf->SetXY(80,80);
$statustext = $_LANG["invoicescancelled"];
} elseif ($status=="Unpaid") {
$pdf->SetXY(120,80);
$statustext = $_LANG["invoicesunpaid"];
} elseif ($status=="Paid") {
$pdf->SetXY(120,80);
$statustext = $_LANG["invoicespaid"];
}
$pdf->SetFont('Arial','B',40);
$pdf->SetTextColor(245);
$pdf->Write(5,strtoupper($statustext));

 

This is the code now, what would we need to edit to make PAID green?

Link to comment
Share on other sites

 

Thanks Arhost.

 

Will try and let you know.

 

In the meantime, if i want to put a image (the one that i've attached in my previous post). How do i do it..?

 

Can you help me with the line of code that i have to put (if you can)

 

Thanks in advance

 

Regards,

Sriram

Link to comment
Share on other sites

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