View Full Version : Bank Transfer instructions in PDF invoice
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?
vchosting
02-02-10, 09:26 PM
I would like to do this also
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,"Banco: CajAstur, Gijón",0,1,'L','1'); //The bank details
$pdf->Cell(0,0,"CCC: 2048 0167 19 3400002755",0,1,'L','1');
$pdf->Cell(0,0,"IBAN: ES2020480167193400002755",0,1,'L','1');
$pdf->Cell(0,0,"BIC: CECAESMM048",0,1,'L','1');
}
if ($notes) {
$pdf->SetFont('helvetica','',10);
$pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes");
}
easytouch
02-16-10, 01:46 PM
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','',8);
$pdf->Cell(170,5,$bankinfo,0,0,'L','0');
}
//////////
if ($notes) {
...
I also use split invoices and I will combine your idea with mine. Thanks for sharing!
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.