Closed soullivaneuh closed 8 years ago
@Soullivaneuh yes they are European, however they differ from country to country. There's a base format like a max lengths and accepted characters but the number itself can be different in each country.
For example, Portuguese and Spanish VAT numbers have different lengths.
@TCB13 Sorry not an expert about this.
To be sure: VAT = NIF? On all country?
So actually, this NIF validator works only for spanish VAT/NIF isn't it?
Could be awesome to manager another country like you did for zipcodes.
@Soullivaneuh Yes VAT = NIF. NIF it's kinda of a translation for VAT in Spanish and Portuguese... I guess the person who implemented the code didn't notice there was a VAT file already...
The file Vat.php
has validation rules for multiple countries. Including Spain. I'm not sure if the implementation is correct because I'm not into the Spanish tax code.
Indeed! Didn't notice the Vat.php
file.
So I think Nif.php
should be removed, isn't it?
My proposition:
Nif
test suites with Vat
test suites to check if all is good.Maybe this need a new major version.
Are you agree with this?
Could make a PR of that if you want.
cc @ronanguilloux
I think it needs further analysis from someone Spanish.
They are the only one who can determine if the Nif.php
should be removed and if there's any need to update the implementation on Vat.php
.
I can try to review the two files and look for differences by I'm not sure If I'm the right person.
@TCB13 Nif already have unit test: https://github.com/ronanguilloux/IsoCodes/blob/master/tests/IsoCodes/Tests/NifTest.php
This is not enough?
According to Wikipedia:
Spain | Número de Identificación Fiscal (for freelancers) or Código de Identificación Fiscal (for companies) | NIF / CIF | ES | 'ES'+9 digits, the first or the last value can also be a character – e.g. ESX9999999X |
---|
So Spain Nif and Cif seems to be the same. So Nif
and Cif
classes should be removed.
Btw, Spain VAT is already managed here: https://github.com/ronanguilloux/IsoCodes/blob/master/src/IsoCodes/Vat.php#L34-L35
AFAIK, NIF are not VAT:
"¿Es lo mismo NIF que NIF-IVA? No. El NIF lo necesitan las personas físicas o jurídicas para cualquier relación de naturaleza o con trascendencia tributaria, mientras que el NIF-IVA es necesario para realizar determinadas operaciones intracomunitarias." (source)
In fact, NIF unit tests would probably not match the VAT algorithm.
What is NIF-IVA
?
Can we have an English source please?
So is NIF only for Spain?
NIF unit tests would probably not match the VAT algorithm.
I'm curious. Have you check it?
What is NIF-IVA? Can we have an English source please?
So is NIF only for Spain?
I suppose, as it stands for Número de Identificación Fiscal
. Please, make your own researches if you want to know more.
I'm curious. Have you check it?
Yes.
I suppose, as it stands for Número de Identificación Fiscal. Please, make your own researches if you want to know more.
I made it and this is why I'm confused.
NIF could also be Numéros d'identification fiscale
in France and is use in all European coutries. See FR reference: http://ec.europa.eu/taxation_customs/taxation/tax_cooperation/mutual_assistance/tin/index_fr.htm
So, NIF is used by all European countries and some of them named it VAT.
So I really don't understand why NIF for Spain should be different from another countries.
Maybe a name mistake/confusion?
@ronanguilloux is there any chance you'll be implementing the Portuguese NIF at any point?
Hi @happyDemon,
Short answer: Portuguese NIF validation rule = Portuguese VAT rule, so you may simply use the exising VAT validator for Portugal. Check UE VAT/NIF rules specs links below.
Long answer & consequences:
AFAIK,
So I re-open this issue:
@ronanguilloux you said it all.
Don't rename NIF to TIN because nobody will know what that actually means. At least on the Portuguese case you easy drop the NIF validator because it does match the VAT one completely. Same rules, same number.
I see on your README file that your NIF validator if for Spain codes (Número de Identificación Fiscal) but, stop me if I'm wrong, NIF codes are Europeans.
See here: http://ec.europa.eu/taxation_customs/taxation/tax_cooperation/mutual_assistance/tin/index_fr.htm
Are we speaking about the same NIF?
Is your NIF validator compliant with EU conventions?
Regards