Jump to content

Bank Transfer instructions in PDF invoice


com2

Recommended Posts

How do you conditionally include the Bank Transfer Instructions in the PDF invoice (only when banktransfer is the chosen payment method for the invoice)? I could do an if and compare the text of payment method and include the text in the template. But when the text of the payment method is changed (it's not fixed) then the if fails. Also that text should already be there somewhere in the database. How to get it?

Link to comment
Share on other sites

This is what I did until I somebody gives me a better way of doing this. Insert it before the notes section of the code:

 

$pdf->Cell(0,0,"Pago por: ".$paymentmethod,0,1,'L','1'); //Pay by:

if ($paymentmethod=="Transferencia Bancaria o al contado") { // The "visible name" of the payment method

 

$pdf->Cell(0,0,"XXXXXXXX",0,1,'L','1'); //The bank details

$pdf->Cell(0,0,"CCC: XXXXXXXX",0,1,'L','1');

$pdf->Cell(0,0,"IBAN: XXXXXXXX",0,1,'L','1');

$pdf->Cell(0,0,"BIC: XXXXXXXX",0,1,'L','1');

 

}

if ($notes) {

$pdf->SetFont('helvetica','',10);

$pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes");

}

Edited by WHMCS ChrisD
Removed PII per posters request
Link to comment
Share on other sites

  • 2 weeks later...

Not exactly what you asked for, but maybe also an idea:

 

My customers can choose anytime how they pay.

I display the bank info on the PDF, but only if the invoice is unpaid,

because then the customer needs to know the info.

 

before payment:

For example, he has the invoice on his table, but doesnt want to use paypal today.

Or you could offer this way a discount if bank payment is choosen, give him a part

of your saved gateway cost back.

 

after (full) payment

If he downloads the final invoice (i split proforma- and final invoices),

which then has status paid , the bank account info will not be on the PDF

(as I see no reason to display it to his tax authorities on the final archived

paper version for years to come)

 

vim templates/portal/invoicepdf.tpl

...
$pdf->Cell(140,6,$_LANG["invoicestotal"],1,0,'R','1');
$pdf->Cell(40,6,$total,1,0,'C','1');
$pdf->Ln();
$pdf->Ln();

///////////////////////////////////////////////////
// show bank info only if unpaid
if ($status=="Unpaid") {
$bankinfo = 'Bankname sort code 00000 account 00000000000';
$pdf->SetFont('helvetica','',;
$pdf->Cell(170,5,$bankinfo,0,0,'L','0');
}
//////////

if ($notes) {
...

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