Jump to content

adding text to PDF Invoices


easyhosting

Recommended Posts

Hi

 

I have some clients who are paying via bank transfer and apart from when they make the official order they are not given my bank details per invoice.

 

How can I add my bank details to the bottom of the PDF invoice just after the table.

 

i have tried by all that happens is the PDF invoices stop working or opening.

Link to comment
Share on other sites

We use the following code:

 

if ($status=="Unpaid") {

$pdf->SetFont($pdfFont,'B',10);
$pdf->Cell(0,4,"Payment Method: ".$paymentmethod,0,1);

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



if ($paymentmethod=="Direct Deposit") { // The "visible name" of the payment method
	$pdf->Ln();
	$pdf->Cell(0,0,"Bank: Bank Name",0,1,'L','0');
	$pdf->Cell(0,0,"Payee Name: Payee Name",0,1,'L','0');
	$pdf->Cell(0,0,"BSB: BSB Number",0,1,'L','0');
	$pdf->Cell(0,0,"Account Number: Account Number",0,1,'L','0');
	$pdf->Ln();
	$pdf->Cell(0,0,"Please use the invoice number as a payment reference. No other remittance advice is required.",0,1,'L','0');
}

}

Link to comment
Share on other sites

if it were me, i'd just add it using html - fpdf is fine and will work, but for most users, they'll probably find html easier to understand and modify...

 

http://forum.whmcs.com/showthread.php?89574-How-to-Add-Payment-Details-to-your-WHMCS-PDF-Invoices&p=393683#post393683

 

that html one does not work i just set a server error notice when opening a PDF invoice

Link to comment
Share on other sites

that html one does not work i just set a server error notice when opening a PDF invoice

really?

 

I just pasted it into our v6.2.2 dev after the transactions table and it works fine... I suppose technically the old references to 'Helvetica' should be changed to $pdfFont for v6, but other than that...

 

the point being that invoicepdf.tpl already uses multiple html tables to display the description, prices, transactions etc - so adding another one shouldn't cause a server issue.

Link to comment
Share on other sites

really?

 

I just pasted it into our v6.2.2 dev after the transactions table and it works fine... I suppose technically the old references to 'Helvetica' should be changed to $pdfFont for v6, but other than that...

 

the point being that invoicepdf.tpl already uses multiple html tables to display the description, prices, transactions etc - so adding another one shouldn't cause a server issue.

Hi

 

old references to 'Helvetica' must have been the cause as i changed it too $pdfFont and it works

 

Link to comment
Share on other sites

really?

 

I just pasted it into our v6.2.2 dev after the transactions table and it works fine... I suppose technically the old references to 'Helvetica' should be changed to $pdfFont for v6, but other than that...

 

the point being that invoicepdf.tpl already uses multiple html tables to display the description, prices, transactions etc - so adding another one shouldn't cause a server issue.

 

Now it seems to move over to 2 pages

 

pdf.jpg

Link to comment
Share on other sites

Now it seems to move over to 2 pages

that's the nature of the beast of adding more information to the invoice - especially if it contains an order for multiple different products which will take up more space on the page.

 

what I would suggest is that you use some IF statements to only show particular sections depending on the invoice status ($status).

 

for example, if an invoice is unpaid, there is no point in showing the transactions table because it will be blank - so for unpaid invoices, it makes more sense to show the payment methods... and oppositely, for invoices that have been paid, there's no point including the payment information - but more useful to show the transactions table.

 

that will allow you to utilise the page space more effectively.

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