Closed ghost closed 4 years ago
Hi Nicholas,
Thanks for pointing this out. Does the individual number also have a distinctive name that can be used to reference it? If so it may be a good idea to add a separate module for that and have codicefiscale just reference the two modules, otherwise I'll add checking for the VAT to the codicefiscale module.
@arthurdejong
Hi Arthur, the the individual number is called "Codice Fiscale", while the non-individual number is the "Partita IVA" (VAT). So, basically:
There are not other names (to my knowledge). I hope I have clarified it (I know, little messy).
So, yes, if you have a Codice Fiscale of 11 characters, it should not be refused and it should be validated against the partitaiva (vat) module instead. In fact in my original post I missed to provide some expected behaviour for codicefiscale module:
validate('RCCMNL83S18D969H')
accepted as it is a valid individual Codice Fiscalevalidate('RCCMNL83S18D969')
not accepted (wrong length)validate('00743110158')
accepted as it is a Codice Fiscale for non-individual (using partitaiva validation)validate('00743110158')
not accepted as it is not a valid Partita IVA, so it cannot be a Codice Fiscale for non-individuals.validate('IT00743110158')
? I expect to be valid because I'm writing the "Partita IVA" in the VATIN format (EU), with the country code. I think this is up to the implementation to accept or refuse this case, as the law says nothing to my knowledge.Thanks for the clarification. I've fixed it in 9605dbe.
For now I've not allowed the IT prefix in the Codice Fiscale until it becomes common within Italy to use the prefix in the Codice Fiscale.
The current validation of an Italian fiscal code ("codice fiscale", https://github.com/arthurdejong/python-stdnum/blob/master/stdnum/it/codicefiscale.py) is incomplete, since by definition an Italian fiscal code could be:
Reference: https://it.wikipedia.org/wiki/Codice_fiscale (italian). I'm unable to find a proper english translation. Event the english Wikipedia seems incomplete.
Notice: the opposite is not true. An Italian VAT cannot be 16 characters long.