com2 Posted February 2, 2010 Share Posted February 2, 2010 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? 0 Quote Link to comment Share on other sites More sharing options...
vchosting Posted February 2, 2010 Share Posted February 2, 2010 I would like to do this also 0 Quote Link to comment Share on other sites More sharing options...
com2 Posted February 3, 2010 Author Share Posted February 3, 2010 (edited) 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 February 28, 2020 by WHMCS ChrisD Removed PII per posters request 0 Quote Link to comment Share on other sites More sharing options...
easytouch Posted February 16, 2010 Share Posted February 16, 2010 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) { ... 0 Quote Link to comment Share on other sites More sharing options...
com2 Posted February 16, 2010 Author Share Posted February 16, 2010 I also use split invoices and I will combine your idea with mine. Thanks for sharing! 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.