unrealindeed Posted February 28, 2022 Share Posted February 28, 2022 Hi All, I'm hoping someone can help me with VAT number display options. Our company has 2 VAT numbers, one for Ireland (our base country and default VAT number) and one for UK. Is it possible to add both VAT numbers to WHMCS and have the system display the UK VAT number on invoices (and pdf invoices) ONLY if the client's country is set to UK? I cannot see anything in docs that suggests this is possible, it may involve adding some sort of hook, would anyone know how to implement such a feature? I don't want to have to hardcode a UK VAT number into all invoices when it will only be relevant to UK address based customers. Thank you :) 0 Quote Link to comment Share on other sites More sharing options...
unrealindeed Posted March 7, 2022 Author Share Posted March 7, 2022 Solution: In templates/$template/invoicepdf.tpl Replace: if ($taxCode) { $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R'); } with: if ($taxCode) { if ($clientsdetails["countrycode"] == "GB") { $taxIdLabel = 'UK VAT Number'; $taxCode = 'GBXXXXXXXXX'; } $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R'); } In In templates/$template/viewinvoice.tpl Replace: {$payto} {if $taxCode}<br />{$taxIdLabel}: {$taxCode}{/if} with: {$payto} {if $taxCode}<br /> {if $clientsdetails.countrycode eq "GB"} {assign var="taxIdLabel" value="UK VAT Number"} {assign var="taxCode" value="GBXXXXXXXX"} {/if} {$taxIdLabel}: {$taxCode} {/if} 1 Quote Link to comment Share on other sites More sharing options...
Dknowledge Posted May 13, 2022 Share Posted May 13, 2022 your solution is only displaying for one VAT number for UK only. what if you want to add for other countries. 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.