Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MOSS-registered non-EU companies to be used as requester #82

Closed
wants to merge 1 commit into from

Conversation

Seldaek
Copy link
Contributor

@Seldaek Seldaek commented Nov 5, 2019

Kinda amazed this hasn't come up yet, I guess the compliance levels aren't as high as they should be :D

Anyway, non EU companies registering for MOSS get a EUxxxxx VAT number, so we need to be able to put that in the requester VAT ID. For reference, http://ec.europa.eu/taxation_customs/vies/ allows you to input "EU-MOSS Number" in the requester member state.

@DragonBe
Copy link
Owner

DragonBe commented Nov 5, 2019

To be honest, I didn't look into this as "EU" prefix was not mentioned in the list for validating VAT ID's on de EC website (see http://ec.europa.eu/taxation_customs/vies/faqvies.do#item_11).

I did a quick search online to figure out the "format" for such a MOSS VAT ID, but it seems to be just the prefix "EU" and then the number format for the country where it was registered (this is just an assumption as I can't find a document describing the correct format yet).

I haven't seen any use cases where this MOSS was used, do you have some examples @Seldaek?

Copy link
Owner

@DragonBe DragonBe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add EU to VIES_EU_COUNTRY_LIST we are not increasing complexity in the code and require no additional testing for this complexity.

As I cannot find the "format" description for EU MOSS VAT ID's I would like to know what validation rules we need to apply here.

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 5, 2019

@DragonBe it's only allowed in the requester field and it seems VIES is validating the number in some way, but I was unable to find any information how it's validated and is there any algorithm to validate it.

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 5, 2019

Found this document: https://ec.europa.eu/taxation_customs/sites/taxation/files/resources/documents/taxation/vat/how_vat_works/telecom/one-stop-shop-guidelines_en.pdf

To follow format: EUxxxyyyyyz where: xxx is the 3 digit ISO numeric of the Member State of
identification; yyyyy is the 5 digit number assigned by Member State of identification; and z is a
check digit.

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 5, 2019

This seems to be the ISO numeric codes: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 5, 2019

Valid EU-MOSS EU528003555

@Seldaek
Copy link
Contributor Author

Seldaek commented Nov 6, 2019

@krzaczek that format info seems to be correct with what we got, we registered for MOSS in Ireland (as a Swiss company we have no EU VAT number) - we have EU372 (ireland) then six digits. I don't know if it brings so much to validate this in the library though as the requester VAT is a hardcoded value you set for your company it's very unlikely to be wrong or if it is the API call will fail quickly..

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 6, 2019

@DragonBe we could add EU to VIES_EU_COUNTRY_LIST but we should also create a validator for it that should fail always .. so that passing EU vat to Vies ::validateVat would not error on validateVatSum line $className = self::VIES_EU_COUNTRY_LIST[$countryCode]['validator'];

We need to create a dummy validator that always returns false for EUxxxyyyyyz

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 6, 2019

I found the check digit algorithm. It's a simple weightSum with [8, 7, 6, 5, 4, 3, 2, 1] multipliers. I was able to validate 4 EU numbers found through the internet

EU372009975
EU826409867
EU528003555

We actually don't need it :) but was not able to let it go :) heheheh

@Seldaek
Copy link
Contributor Author

Seldaek commented Nov 6, 2019

@krzaczek if you wanna take over the PR be my guest :)

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 6, 2019

@Seldaek sure .. i'll try to send changes today - but in the evening :)

@krzaczek
Copy link
Collaborator

krzaczek commented Nov 6, 2019

closing -> new MR #85

@krzaczek krzaczek closed this Nov 6, 2019
DragonBe added a commit that referenced this pull request Nov 11, 2019
@DragonBe DragonBe mentioned this pull request Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants