-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor Spain country handler to support Natural Persons without DNI or NIE and Non-Natural Persons TIN formats #36
Conversation
Hello, Are these changes from somewhere? Can you please provide the documentation? In the TIN specifications hasn't been updated since 2019, do you have an updated specification? Thanks! |
I have refactored the code according to the validation that I created in 2015 and with which I have validated hundreds of TINs from public organizations in Spain. The code is based on the information collected in the Spanish Wikipedia: Right now I do not have official sources on the validation of Spanish TINs. If I find something I will share it here. |
The 'P2009300A' corresponds to the City Council of Mendaro (Gipuzkoa, Spain) and is one of the many CIFs that did not validate the current code: Estos son validadores online que validan correctamente los TIN con los que he tenido problemas: |
Let's be consistent here to make sure that the message you're trying to tell me is well understood. From what I understand:
Questions:
Thoughts: Regarding making changes, I wish I could have official sources to implement these changes, even though they seem totally correct. Do you know where we can find that documentation? |
The Código de Identificación Fiscal (CIF, tax identification code) was the name given to TINs in Spain from 1975 to 2008. For historical reasons, we commonly call the TIN of a company, organization or public entity as CIF. There are three algorithms:
From experience I know that my implementation is correct, I have been able to verify it with hundreds of TINs of different types of legal entities. I am looking for information on official sites such as pages of the Spanish Government or the BOE (where the laws are published). |
Thanks, I also wrote an email to DG Taxud for having more official informations too, I'll keep you posted. |
This document is interesting, it is on a Spanish Government website but it is prepared from information from a forum or similar: |
The only official references I have found about the TINs of legal entities are about the format, not about verification: |
I have found a public administration that describes the validation algorithm for TINs of legal entities. Unfortunately it does not provide information about the regulations where these algorithms are defined. However, we have a description of them from an institutional website. |
Please don't use |
Something went wrong while trying to rebase. |
This PR
Spanish Natural Persons without DNI or NIE and Non-Natural Persons TIN formats: