webberoo Posted May 14, 2013 Share Posted May 14, 2013 Due to customer requests I recently placed my bank and cheque details on the invoice generated by WHMCS. I found a solution in the forums but it was very outdated. Here is the solution I came up with: File is found /pathtoinstall/templates/yourtemplate/invoicepdf.tpl Insert the following above #Notes # Offline payment methods $pdf->Ln(5); $pdf->SetFont('freesans','B',12); $pdf->Cell(0,4,"Payment Details",0,1); $pdf->Ln(5); $pdf->SetFont('freesans','',9); $tblhtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="50%">Payment by Cheque</td> <td width="50%">Payment by EFT</td> </tr> <tr bgcolor="#fff"> <td align="center">Made Payable to: [YourName] <br/>Send to: [YourPostalAddress]</td> <td align="center">[Your Account name]<br/>[bankAccountDetails]</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); # Notes if ($notes) { Don't forget to replace the stuff in brackets with your details. Hope this helps someone. Toby 0 Quote Link to comment Share on other sites More sharing options...
dclune Posted February 24, 2014 Share Posted February 24, 2014 You can also add the a variable to the start of the above code so it only shows on invoices where the payment method is set to manual or "Bank Transfer" # Offline payment methods if ($paymentmethod=="Bank Transfer") { $pdf->Ln(5); $pdf->SetFont('freesans','B',12); $pdf->Cell(0,4,"Payment Details",0,1); $pdf->Ln(5); $pdf->SetFont('freesans','',9); $tblhtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="50%">Payment by Cheque</td> <td width="50%">Payment by EFT</td> </tr> <tr bgcolor="#fff"> <td align="center">Made Payable to: [YourName] <br/>Send to: [YourPostalAddress]</td> <td align="center">[Your Account name]<br/>[bankAccountDetails]</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); } # Notes if ($notes) { Don't forget the extra } added before # Notes. The word "Bank Transfer" assumes you have labelled your WHMCS payment gateway this. If not, adjust accordingly. 0 Quote Link to comment Share on other sites More sharing options...
Stingraynut Posted May 4, 2014 Share Posted May 4, 2014 Due to customer requests I recently placed my bank and cheque details on the invoice generated by WHMCS. I found a solution in the forums but it was very outdated. Here is the solution I came up with: etc etc etc Hope this helps someone. Toby THANK YOU for posting the answer Webberoo, works perfectly Rob 0 Quote Link to comment Share on other sites More sharing options...
uriel Posted November 23, 2014 Share Posted November 23, 2014 THANK YOU for posting the answer Webberoo, works perfectlyRob I am using a Template from ThemesChamp and I tried the above code which didnt make any difference. Could you please tell me how to determine which invoicepdf.tpl I should be editing ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 23, 2014 Share Posted November 23, 2014 it should be the invoicepdf.tpl in your active template directory - so whichever template name is shown in the dropdown in... setup -> general settings -> general -> template 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.