Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Incorrect verification of the VAT number for a customer who does not have an EU VAT number #20

Open
m4dh opened this issue Nov 28, 2020 · 16 comments

Comments

@m4dh
Copy link

m4dh commented Nov 28, 2020

Describe the bug

After installing the European VAT number add-on, and enabling the automatic checking of registration in the VIES database, the module works correctly only for taxpayers registered in this database - i.e. deducts the tax due in the country of purchase from the total of purchases.
If you enter a VAT number that is not registered in the EU VIES VAT database - the system displays the error "VAT number not found".
This is a correct message only if we assume that the field in the form is used to enter the VAT number of registered taxpayers in the VIES database.
If the taxpayer has the correct number but is not registered in the VIES database, the module prevents him from processing the order.
The data form cannot contain two different fields for entering the VAT number (in a given country) and EU VAT - and this is the only solution at the moment (wrong in assumption).

Expected behavior

Enabling the module should for registered VAT VIES taxpayers for tax deduction upon purchase, for taxpayers not registered in the VIES database, the system should validate the EU VAT field in terms of entering the VAT number, and prevent the deduction of due tax, informing that the taxpayer is not entitled to a tax deduction.

Steps to Reproduce

Steps to reproduce the behavior:

Module version 2.1.0
configure the module like this:

Customers' country: eg. Poland
Enable checking of the VAT number with the web service: Enable

Go through the purchase process in the store
register customer (company) data
enter EU VAT eg. PL5862283151
Saving the form causes the error "VAT number not found"

Screenshots

If applicable, add screenshots or screen recordings to help explain your problem.

Additional information

  • PrestaShop version: 1.7.6.8
  • PHP version: 7.2
@m4dh
Copy link
Author

m4dh commented Nov 28, 2020

Uploading Zrzut ekranu 2020-11-29 o 00.02.15.png…

@Hlavtox
Copy link

Hlavtox commented Nov 29, 2020

@m4dh Important issue. I think he should not enter the VAT at all, if he is not a VAT payer.

That is a problem, because when you disable VIES check, all VAT numbers are taken as VAT payers and VAT is deducted. (VIES is not available from time to time and I had to disable it, because our customers could not make orders, when the module could not connect to VIES.)

I think what should be done is.

VIES check enabled

  • If he enters invalid (locally checked) VAT number, "VAT number invalid", VAT not deducted
  • If he enters VAT number and it's VIES validated, "VAT number is valid", VAT deducted
  • If he enters VAT number and it's not VIES validated, "Not a VAT payer", VAT not deducted
  • If he enters VAT number and VIES validation fails, display checkbox: "I am a VAT payer".

VIES check disabled

  • If he enters invalid (locally checked) VAT number, "VAT number invalid", VAT not deducted
  • If he enters (locally checked) valid VAT number, display checkbox below the field: "I am a VAT payer". Only then the VAT would be deducted.

@hibatallahAouadni
Copy link

hibatallahAouadni commented Nov 30, 2020

Hello @m4dh

I managed to reproduce your issue with PS1.7.6.9 and PS1.7.7.0-rc.1, I attached a screen reocrd below:

https://drive.google.com/file/d/1mbPZaDYY-l-SCPWIkn0aH3VEQqztpatn/view

But like @Hlavtox mentioned above, this issue need to be reviewed.
Ping @PrestaShop/product-team wdyt of @Hlavtox suggestion?

PS: My question for @PrestaShop/prestashop-core-developers is "is it normal to have HTTP ERROR 500 when the debug mode is enabled, while reproducing this issue?"

Thanks!

@m4dh
Copy link
Author

m4dh commented Nov 30, 2020 via email

@Hlavtox
Copy link

Hlavtox commented Nov 30, 2020

@m4dh VIES does not have any central database. It checks the VAT number agains databases of the member states.

@m4dh
Copy link
Author

m4dh commented Nov 30, 2020 via email

@Hlavtox
Copy link

Hlavtox commented Nov 30, 2020

@m4dh Of course, but I think we disagree on this - "but if I am a VAT payer and I am not registered in VIES, the system should allow me to enter a VAT number that is not registered in VIES" - Every VAT payer should be validated successfully by VIES.

And I don't know about laws in your country, but if a buyer is not a VAT payer, he should not enter the VAT to the order at all, because he is confusing the other side of the bussiness by this. Last week a woman from Slovakia made order on our store, entered VAT number, paid XX EUR less because Prestashop deducted the tax. Now we found out she is not a VAT payer and she does not want to pay the rest of it.

@m4dh
Copy link
Author

m4dh commented Nov 30, 2020 via email

@Hlavtox
Copy link

Hlavtox commented Nov 30, 2020

@m4dh So, you have a company, you have a VAT PL5862283151, you add 21% VAT to your products, but you are not VIES validated? Right?

@m4dh
Copy link
Author

m4dh commented Nov 30, 2020 via email

@Hlavtox
Copy link

Hlavtox commented Dec 1, 2020

@m4dh Hmmm, lack of knowledge on my side, sorry. If I'm not wrong, in Czech republic, all VAT payers are automatically registered to "EU VAT system".

BUT, I think it's not a problem. The module should do VIES-checking only when customer selects other country than your 'home' one.

@m4dh
Copy link
Author

m4dh commented Dec 1, 2020 via email

@Hlavtox
Copy link

Hlavtox commented Dec 3, 2020

@eternoendless Hi Pablo, if we put together a proper specs with @m4dh, would there be a time in PS dev team, to tweak this module a bit, so we have it working properly? It's quite important topic...

I reported some bugs here also - https://github.com/PrestaShop/PrestaShop/issues/19634

@HartLarsson
Copy link

HartLarsson commented Dec 4, 2020

is the same in Italy:

To be brief, if the seller is European and sells to a European customer, the VAT number of the customer must be registered with VIES only if the customer has a billing address outside the country of the Seller.
VIES VAT registration is needed only for import/export not for national selling.

I did a minor fast Fix to the mechanic here: #16
but i still working on a new version with more control over the VAT syntax.

My fix not resolve anyway the error 500 of the original module if debug is enabled.

@m4dh
Copy link
Author

m4dh commented Jan 22, 2021

Hi All ,
Any update in this issue - this is very important issue affecting lot of users of Prestashop.

Today i was trying to install that module from repository and i receive message that packet is not a valid zip module

" This file does not appear to be a valid zip module"

@hibatallahAouadni
Copy link

Hello @m4dh

As you can see this issue is already in our Bug Classification board to be studied 😉
So, please be patient with us 🙏

Thanks!

@PierreRambaud PierreRambaud transferred this issue from PrestaShop/PrestaShop Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants