roop Posted November 7, 2008 Share Posted November 7, 2008 Hi, I've customised the PDF invoices slightly to add payment details to Paid invoices, but have noticed a problem with the output from the following code: # If Invoice Paid then display confirmation + thanksif ($status=="Paid") { $paymentDetails = "Payment Method: ".$paymentmethod."\n\n"; $paymentDetails .= "Payment Received: ".$datepaid."\n\n\n"; $paymentDetails .= "THANK YOU FOR YOUR PAYMENT\n"; $pdf->SetTextColor(0); $pdf->SetFont('Arial','',; $paymentinfo = explode("\n", $paymentDetails); $ordinate = 235; $abscissa = 20; $linebreaks = 3; for ( $i = 0; $i <= count($paymentinfo); $i += 1) { $pdf->SetXY($abscissa,$ordinate); $pdf->Write(5,trim($paymentinfo[$i])); $ordinate = $ordinate + $linebreaks; } } The problem is that the Payment Method displayed is the one originally assigned to the Invoice, which is not necessarily the method that the customer used to pay. For example, we send out most non-CC payment methods as BACS, however some people insist on paying by cheque. We then log in to WHMCS and go to the invoice | Add Payment | and set Gateway=Cheque + £123 received | Add Payment. The invoice is now paid, but the PDF generated still says "BACS Transfer" as the payment method, rather than the Payment Gateway and/or Transaction ID we entered. I'm not sure if this is a bug or just me calling the wrong variables, but I was unable to find the correct variables for the actual transaction rather than the payment method set against the invoice. Thanks for reading! Rupert 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.