iPH - Sriram Posted January 20, 2008 Share Posted January 20, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
urevised Posted January 20, 2008 Share Posted January 20, 2008 Sounds like a great idea to me. 0 Quote Link to comment Share on other sites More sharing options...
iPH - Sriram Posted January 20, 2008 Author Share Posted January 20, 2008 And even the clients can save the PDF Receipt onto their systems. I guess i'll leave it Matt if he can put across if this feature can be added or not. Regards, Sriram 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 20, 2008 WHMCS CEO Share Posted January 20, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
iPH - Sriram Posted January 20, 2008 Author Share Posted January 20, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
brianoz Posted January 20, 2008 Share Posted January 20, 2008 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 ... 0 Quote Link to comment Share on other sites More sharing options...
iPH - Sriram Posted January 20, 2008 Author Share Posted January 20, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
brianoz Posted January 20, 2008 Share Posted January 20, 2008 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! ) 0 Quote Link to comment Share on other sites More sharing options...
iPH - Sriram Posted January 20, 2008 Author Share Posted January 20, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
urevised Posted January 20, 2008 Share Posted January 20, 2008 Yeah it is a little faint on my screen as well and i have a 19" DVI LCD/TFT. I think maybe it would be better in green so that it makes the user feel special that they have paid us 0 Quote Link to comment Share on other sites More sharing options...
brianoz Posted January 21, 2008 Share Posted January 21, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
jdk Posted January 21, 2008 Share Posted January 21, 2008 Maybe the green paid text mod can be incorporated into 3.6.0 0 Quote Link to comment Share on other sites More sharing options...
jdk Posted January 21, 2008 Share Posted January 21, 2008 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? 0 Quote Link to comment Share on other sites More sharing options...
arhost Posted January 21, 2008 Share Posted January 21, 2008 see: http://forum.whmcs.com/showpost.php?p=39749&postcount=10 Thanks, 0 Quote Link to comment Share on other sites More sharing options...
iPH - Sriram Posted January 21, 2008 Author Share Posted January 21, 2008 see: http://forum.whmcs.com/showpost.php?p=39749&postcount=10 Thanks, 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 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.