Jump to content

PDF Invoice Display Transaction Method


roop

Recommended Posts

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 + thanks

if ($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','',8);

$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

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