Jump to content

PDF Quote Format


Antikaaa

Recommended Posts

Hello,

 

I'm having trouble using the WHMCS PDF Quote, as well as the PDF Invoice. The issue  have is that my TAX ID field needs to be showing on the PDF Quote under my business name and address but it does not.

Another issue I have is that if I head to Setup > General Settings and add the Tax ID inside the Pay To Text field, the Invoice PDF will then have two Tax ID's because the Invoice by default has the Tax ID field inserted in the pdf while the quote does not. Can anyone assist me in giving me the code to add to the quotepdf.tpl to make the default Quote Form to contain my Tax ID field please. 

 

Thank you in advance

Link to comment
Share on other sites

On 07/08/2020 at 16:11, Corporate Hi-Tech said:

Can anyone assist me in giving me the code to add to the quotepdf.tpl to make the default Quote Form to contain my Tax ID field please. 

in quotepdf.tpl, you could change...

for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
    $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R');
}

to...

use WHMCS\Config\Setting;
$taxCode = Setting::getValue('TaxCode');
if ($taxCode) {
	$companyaddress[] = $taxCode;
}
for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
    $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R');
}

and that should pull the Tax ID value from the database, and if it exists, add it to the end of the companyaddress array before it is outputted.

the other way would be to keep the TAX ID value included in the Pay To Text field, but then remove the if($taxCode) block of code from invoicepdf.tpl - but it's swings and roundabouts as to which way to go, so just choose whichever option is the simpler for your situation.

Link to comment
Share on other sites

15 hours ago, brian! said:

in quotepdf.tpl, you could change...


for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
    $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R');
}

to...


use WHMCS\Config\Setting;
$taxCode = Setting::getValue('TaxCode');
if ($taxCode) {
	$companyaddress[] = $taxCode;
}
for ( $i = 1; $i <= ((count($companyaddress)>6) ? count($companyaddress) : 6); $i += 1) {
    $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R');
}

and that should pull the Tax ID value from the database, and if it exists, add it to the end of the companyaddress array before it is outputted.

the other way would be to keep the TAX ID value included in the Pay To Text field, but then remove the if($taxCode) block of code from invoicepdf.tpl - but it's swings and roundabouts as to which way to go, so just choose whichever option is the simpler for your situation.

Dear Brian,

 

I appreciate your efforts. I was successful in following the first step you shared. The only thing is, is it possible to make it say "ABN:" prior to the tax code? 

 

Thank you so very much!

Link to comment
Share on other sites

3 hours ago, Corporate Hi-Tech said:

I appreciate your efforts. I was successful in following the first step you shared. The only thing is, is it possible to make it say "ABN:" prior to the tax code? 

sure - just change...

$companyaddress[] = $taxCode;

to...

$companyaddress[] = "ABN:".$taxCode;
Link to comment
Share on other sites

14 hours ago, brian! said:

sure - just change...


$companyaddress[] = $taxCode;

to...


$companyaddress[] = "ABN:".$taxCode;

Thanks again sooo much Brian.

 

In terms of the footer of the quote form, is it possible to have my bank details pre-set in the quote by default? Usually set at the bottom of the table such as: 

 

BANK DETAILS 

Account Name:

Account Number

BSB: 

 

At all possible?

Link to comment
Share on other sites

7 hours ago, Corporate Hi-Tech said:

In terms of the footer of the quote form, is it possible to have my bank details pre-set in the quote by default?

below the existing quote table, then absolutely - you would just need to decide a) the layout of how these details are displayed and b) whether these bank details already exist in the WHMCS database somewhere, e.g if you were using the banktransfer gateway, they could be stored in there... I don't think the quotePDF has a footer/header in the same way that the invoicePDF does - but adding these details isn't difficult.

actually, b) isn't essential as you could hardocde the bank details in the template if you wanted to - I assume you're not going to be changing your bank account weekly... 🙂

the only reason I mentioned b) was in case these details already exist within WHMCS and if so, they can be pulled from the database and included in the output - then, should a change of bank details become necessary, you would only have to edit them in one place rather than two.

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.

×
×
  • 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