Jump to content

Bank Transfer Instructions On Invoice


Recommended Posts

Currently I only accept payments via Bank Transfer; yet the information I've populated WHMCS with (bank account number, sort code) do not get shown on the invoice, so customers have to ask me for this.

Having looked at https://docs.whmcs.com/Bank_Transfer it seems that should be able to add this information to the banktransfer.php file for this to show. Yet the text already in that file isn't showing already, so why when I edit it will it suddenly appear on invoices?

What am I missing here?

Link to comment
Share on other sites

3 hours ago, thisismatt said:

What am I missing here?

if it's the HTML invoice, you shouldn't need to edit the .php file to show any text on the invoice - it should be there already if you added it to your payment gateway settings...

http://help.whmcs.com/m/payments/l/680987-changing-payment-instructions-on-invoices

if you wanted to add the bank details to an email template, e.g Invoice Created, then you could add the following code to the template and adjust the bank details to suit your own needs.

{if $invoice_payment_method eq "Bank Transfer"}
Please send your BACS payment using the following details
Sort Code: 12-34-56
Account No: 012345678{/if}

for the PDF invoice template, you could either hardocde the text into the template, or query the database to get the information from the bank transfer settings... either way is fairly simple to do..

if you're using a recent version of WHMCS, you'd need to tweak that code and change how SetFont is used...

#Payment Method

$pdf->SetFont($pdfFont,'B',12);
$pdf->Cell(0,4,"HOW TO PAY",0,1);

$pdf->Ln(5);

$pdf->SetFont($pdfFont,'',; 

$paymethhtml = '<table width="100%" cellspacing="1" cellpadding="2" border="0">
   <tr height="30">
       <td width="33%" style="text-align:center;"><strong>Cheque</strong><br><br>Please send cheque payable to<br>Thisismatt<br>To:<br><br></td>
   <td width="34%" style="text-align:center;"><strong>BACS</strong><br><br>Account Name: XXXX<br>Sort Code: XXXX<br>Account No: XXXX<br>Ref: #'.$invoicenum.'</td>
   <td width="33%" style="text-align:center;"><strong>Online</strong><br><br>Please visit https://XXXX.XXXX.it to pay online with most credit or debit cards.</td>
       </tr></table>';

$pdf->writeHTML($paymethhtml, true, false, false, false, '');

as you currently only have one payment method, you could remove two of those table cells and change/remove the width of the existing one, but i've left the above code in in case you need to add more payment methods later..

I know I quickly did the query method for someone in a PM but I can't currently find the thread (or the code)... but if you really need it, i'll dig deeper and post here if required.

Link to comment
Share on other sites

Hi Brian, thanks for the reply. Not sure I fully follow (sorry - it's being a newbie, not your explanation) though sorry.

When you say HTML invoice, is that effectively the email sent to the client? In that (the email) and the PDF attached to it, no bank details are displayed, yet they are shown in WHMCS (I input them).

I perhaps assumed that if Bank Transfer method is chosen, it would populate in the PDF sent.
 

I'll have a fuller look at your helpful response later tonight and see what I can fathom out!

M

Link to comment
Share on other sites

Hi Matt,

19 minutes ago, thisismatt said:

Hi Brian, thanks for the reply. Not sure I fully follow (sorry - it's being a newbie, not your explanation) though sorry.

I did get interrupted replying to other threads, so the reply might not have been as coherent as usual.:)

19 minutes ago, thisismatt said:

When you say HTML invoice, is that effectively the email sent to the client?

when I say the HTML invoice, i'm referring to the invoice the client would see when they log into the client area to view an invoice... e.g., if they click the button highlighted below...

BBTl7Mi.png

on the resulting invoice, your bank transfer details should be shown to the client...

btw - in the admin area invoices page, you can view either the HTML or PDF versions...

kZfDpgr.png

19 minutes ago, thisismatt said:

In that (the email) and the PDF attached to it, no bank details are displayed, yet they are shown in WHMCS (I input them).

payment method instructions aren't shown by default in the WHMCS invoice PDF files - they can be added, but in order to do so, you would need to edit the invoicepdf.tpl template in your active WHMCS template folder (probably "Six" or a custom) and add the code I posted above.

it's literally copy&paste and then edit to suit your needs.... we use a similar block on our invoices, though for us the payment method instructions are only shown on unpaid invoices... that way, after they've paid and they receive the Payment Confirmation email and invoice, they don't need to see how to pay because they have already paid!

I can tell you how to do that (it's just an if statement), but let's just get you displaying the payment method instructions first, and then we can tinker it later. :idea:

Link to comment
Share on other sites

3 minutes ago, thisismatt said:

OK, so neither the HTML or PDF invoice show the bank details.

Best/most logical place to start in getting this changed is....?!

i'm surprised an unpaid HTML invoice, set to use BT, doesn't show it... it should do so automatically when the BT gateway option is selected.

did you undo your changes to banktransfer.php if you made any?

Link to comment
Share on other sites

this is weird... works fine for me locally... so out of curiosity, I tried this on the Softaculous WHMCS Demo as it's a virtually clean default installation.

however, it's not showing any bank information on the invoice either... and then the solution occurred to me. :631_bulb:

I assume that in the Bank Transfer settings you just added your bank details to the text already there.... what you should do is to delete the entire textbox and enter the details again from scratch and save... that should ensure the details are added to the database.

wqLgBYh.png

mbHdv12.png

ignore that this example is using Mail In Payment rather than Bank Transfer, but the principle is the same for both.

hopefully when you enter the details again and save, those details will start appearing on the invoices. _vti_cnf_fingers%20crossed.gif

Link to comment
Share on other sites

Are you losing the will yet?!

So, I deleted all of the text and saved - confirmation that this was done. Refreshed the invoice and the payment method dropdown was blank. Great!

I then re-added my text and refreshed the invoice - only 'Bank Transfer' appeared on the HTML invoice once again, nothing beneath/above/anywhere to show the actual bank details.

I changed 'Bank Transfer' to be 'Mail in Payment', refreshed the HTML invoice - the text had changed; but again no actual instructions visible.

 

Where exactly do I find the 'despair' emoji?!

Link to comment
Share on other sites

22 hours ago, thisismatt said:

Are you losing the will yet?!

yes. :P

22 hours ago, thisismatt said:

So, I deleted all of the text and saved - confirmation that this was done. Refreshed the invoice and the payment method dropdown was blank. Great!

I then re-added my text and refreshed the invoice - only 'Bank Transfer' appeared on the HTML invoice once again, nothing beneath/above/anywhere to show the actual bank details.

I changed 'Bank Transfer' to be 'Mail in Payment', refreshed the HTML invoice - the text had changed; but again no actual instructions visible.

can you PM me the text you're adding to either of these boxes....

which version of WHMCS are you using?

22 hours ago, thisismatt said:

Where exactly do I find the 'despair' emoji?!

the standard one for any WHMCS user is :wall1: - but be aware that it's a strong wall that we've all been banging our heads against for years. :smile2:

Link to comment
Share on other sites

So, we have some movement here. I've got another invoice created and that *does* show the information. Curious.

Just putting this out there...if an original invoice is created (and shows the bank details), is then marked as paid, then marked as unpaid (and a few combinations of this) does the information get displayed again?

Invoice 39 does show it - and has never been 'fiddled' with post-generation
Invoice 37 doesn't show it - and has had its status changed.


Thoughts?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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