Closed AndrzejSzczepanik closed 2 years ago
Hi @AndrzejSzczepanik
You are describing an older version of this module. At that point it indeed assigned a user to a non-VAT group based on the VAT ID. However, this does not work for multiple addresses.
The new version of the module does vat validation based on the address, not the user. So an address is either VAT validated or not. If it is then VAT is disabled, otherwise it is enabled. Group assignment (and groups in general) is something different entirely and it's (and should be) unrelated to VAT calculation.
OK, that's how I understood the intentions in the current version, but the tests show that if the user has VIES and the address is exported, he does not count and invoice net anyway, until I manually changes the group to VIES, then the net is invoiced, it would follow that I don't know about something else. Could you explain at what point in time this verification takes place, does it have any reflection in the customer's databases, etc., thank you beautifully
The validation occurs when an Address is validated and then the result is stored in a database table. Each time the Tax calculator class gets requested this module hooks into that calculator and checks if the address is VAT validated or not. If it is then it returns 0 for tax.
TaxCalculator: https://github.com/NKoonen/vatchecker/blob/master/override/classes/tax/TaxRulesTaxManager.php Validation hook: https://github.com/NKoonen/vatchecker/blob/master/vatchecker.php#L126 Validation method: https://github.com/NKoonen/vatchecker/blob/master/vatchecker.php#L424
The validation isn't visible in the default customer tables. It's stored in this plugin's table: https://github.com/NKoonen/vatchecker/blob/037aa84064131cd33ffb3a4c62669cf33bd65896/vatchecker.php#L540-L543
Thank you for your clarification, so I see that VAT checking is performed on demand, and it does not depends on customer group at all. Sounds nice, but please pay atention to this atached screens - it should't calucate a tax but it does calculate TAX. The same situation with the same user, when the user is assigned to VIES group (what only lists product prices in net value) TAX is not included. What the explanation coud be? Prestshop 1.7.8.5 Vat checker today yesterdea reinstaled current version from this Giithub
the last screen is situation when user does not belong to VIES group
Supporting information - the store is multi languges and multi currencies
And I can see that ps_vatchecker table is not present in my database schemat
Hi @AndrzejSzczepanik Are you sure you are running the latest version? This plugin doesn't even check or validate a customer group so that is fully unrelated to any issue. The mentioned group setting to show prices excluding taxes is also unrelated as this is only changing display, not the actual pricing.
Please make sure you re-install correctly.
You make me start thinking. I did uninstall, and install again, then I have checked in vatchecker table was created, because I see that it shoud be created when vatchecker is installed, so I get succes - table was created, and all start working exactly as it is discrbed ! Perfect module - sutis exactly the need. Thanky very mutch for puting some light how it works.
And this approach to the VAT issue ensures showing correct prices and bill calculation as well based on address and VAT id of delivery address - really perfect !!! you are clever guy!!
Good to hear you've solved the issue, enjoy the module!
I have been using the module for 2 years, there was a description somewhere before, I remember that the description explained that the VIES group should be created for which prices are displayed net - this setting is in the group configuration. The module probably assigned to this group based on the VAT ID and delivery address. Now I can see that it does not automatically assign to any group and will charge the customer in gross price and so he will sell / issue a prestashop invoice if I have not added the customer to the VIES group manually. Can someone explain exactly how this is supposed to work. Thank you in advance