Open Tetragramat opened 4 years ago
@Tetragramat oh thank you for this valuable feedback. I see that it is indeed more complicated than expected for the specifications I've read.
do you mind if I take some inspiration for your validator in order to fix the one provided here?
i've already did some adjustements to avoid false negative. it's great to see that you implemented modulus check in your implementation :)
I think you misunderstood. Even if you copy my two validators you'll NOT have correct implementation of Czech TIN validator. Sure it will work for Natural person like me and sometimes for Legal person when they have TIN same as IČO, but it will fail for everything else.
Now I'm quite confused. Official document from European Commision says that Czech TIN is actually Czech national identification number. I thought that TIN (tax identification number) is Czech DIČ (taxpayer identification number).
https://ec.europa.eu/taxation_customs/tin/ Says:
Please note that the Tax Identification Number Validation Module can validate only Tax Identification Numbers referred to a natural persons. Member States may use other formats as Tax Identification Numbers for legal entities, which cannot be validated by TIN on Europa.
Which means they just ignored TIN for legal entities. So I think I was correct that TIN = Czech DIČ.
yes I think you are right this is a bit of a misnomer. My goal is to validate individuals, not legal entities so probably i need to update the readme to reflect that. as long as it works for the example you linked from the european commision, i'm happy :-)
Hi @Tetragramat,
In collaboration with @lekoala , we started a new project here: https://github.com/loophp/tin
This project includes the algorithm you made in your package. I didn't used the PHP dependency system because I don't want this package to depends of any other for obvious security reasons.
I took care to give you the prop for code in the class documentation header: https://github.com/loophp/tin/blob/master/src/CountryHandler/CzeckRepublic.php
Let us know if it's ok and if we can close this issue now.
Take care guys!
I'm ok with that. My project is MIT licensed so I suppose if I did not misunderstood you don't have to ask me.
Whyle copying you made few mistakes: You have wrong class name. It should be CzechRepublic or Czechia not CzeckRepublic. Also you have wrong COUNTRYCODE constant which should be CZ not CY which is Cyprus.
Thanks!
Are you willing to submit the PR yourself or I can do it tonight ?
You can do it. I don't have much free time. Sorry for year late response.
There is very high chance of false negatives from validator. Czech TIN is DIČ and it is not date but sometimes made from date.
I know how to validate czech national identification number and company registration number, but I have no knowledge of VČP and another edge cases of DIČ/TIN