Jump to content

Place bank & cheque details at the end of invoice - Updated


webberoo

Recommended Posts

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

Link to comment
Share on other sites

  • 9 months later...

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.

Link to comment
Share on other sites

  • 2 months later...
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

Link to comment
Share on other sites

  • 6 months later...
THANK YOU for posting the answer Webberoo, works perfectly

Rob

 

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 ?

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