NKoonen / vatchecker

[Prestashop]Checks if customer has a valid VAT number, and then puts the customer a specific group.
https://customs-documents.com
BSD 3-Clause "New" or "Revised" License
34 stars 14 forks source link

When the VAT number is valid the VAT rate should be 0% and not be disabled. #41

Closed Steven44223 closed 6 months ago

Steven44223 commented 8 months ago

When the VAT/TAX is set to disabled/false the invoice shows nothing in the VAT Rate. This should be set to 0%.

When set to 0% the invoice shows a VAT rate of 0% and the VAT Detail is shown with the text No VAT.

This makes it more clear that it is an european intra-Community transaction.

TaxRulesTaxManager.php:

- $tax_enabled = false;
+ $tax = new Tax();
+ $tax->rate = 0;
+ return new TaxCalculator([$tax]);

VAT/TAX DISABLED: VAT-DISABLED

VAT/TAX 0% VAT-0

NKoonen commented 8 months ago

This is actually generated by Prestashop. We currently don't make any edits in the invoice pdf. You could edit this translation "Frontoffice > your theme > Shop > pdf". Or you could edit/override the default template.

Steven44223 commented 8 months ago

Hi,

Yes I know, I didn't make any changes to the PDF's.

When you set the tax to 0 (TaxRulesTaxManager.php) PrestaShop adds a new entry in the ps_order_detail_tax table This will show the 0% VAT Rate and VAT Detail table in the pdf invoice.

If you disable tax (current code), PrestaShop does not add a new entry in the ps_order_detail_tax table and the VAT Rate will show as blank and the VAT Detail table in the invoice pdf does not show.

NKoonen commented 8 months ago

So instead of setting tax to 0% in the module, you'd like the module to create a 0% tax rule and use this for the orders. Makes sense! Might be a good update. (will make this when i have time)

Steven44223 commented 8 months ago

Yes, I think it's more clear for the customer. The changes to the code in my first post is working for me.