Need text VAT shifted to <VAT-code> on invoice

  • Posts: 80
  • Thank you received: 8
6 years 1 month ago #299679

-- HikaShop version -- : 4.0
-- Joomla version -- : 3.8.13
-- PHP version -- : 7.1
-- Browser(s) name and version -- : Chrome (latest)
-- Error-message(debug-mod must be tuned on) -- : n/a

Because we are also selling goods to other companies we need to make some changes to our webshop.
Having the customer fill in the VAT code and checking the VAT code is no problem. Also preventing that VAT is calculated in this case can be accomplished.

However only when a valid VAT code is available we have to put a line of text on the invoice (at least on the pdf) stating that the tax (VAT) has been shifted to that VAT-code. In Dutch: 'BTW verlegd naar <BTW-nummer>'. How can i accomplish this?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
6 years 1 month ago #299681

Hi,

So do you use the PDF invoice plugin ( www.hikashop.com/marketplace/product/18-plugin-pdf.html ) ?
Do you allow your customers to see the invoice on the frontend ? Or do you only get the invoice from the backend ?
(different view files are involved based on your answer to these questions so the modifications will vary a bit)

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 8
6 years 1 month ago #299714

Hi Nicolas,

I use the pdf Hikashop pdf plugin. The customer receives the invoice with his e-mail and we print the pdf for our administration.

Because of dutch tax rules we need the text 'BTW verlegd naar <address_vat> on this pdf invoice..

I managed to get the address_vat in the Address field but for the tax we have to print the line BTW verlegd ... on the PDF invoice and only in the case where a address_vat has been filled in by the customer.

I think i have to edit the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php but i have no idea how to print the correct information here.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 8
6 years 1 month ago #299718

Hi Nicolas,

In another topic I found part of the solution and after some testing i used the following php code and put it at the bottom of the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php just before the </page> tag.

<?php if (!empty($order->billing_address->address_vat) && $order->billing_address->address_country !== 'Netherlands'){
	echo 'BTW verlegd naar: '.$order->billing_address->address_vat;
}
?>

At first I thought that I only had to check for address_vat but when a customer from the Netherlands is filling in this field then he also got that text line. So I had to do a double check see code above.

This works for me..

Have a nice weekend.

Last edit: 6 years 4 weeks ago by bp54.
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum