-
-
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
Add Syntax Check to Slovakia #45
Conversation
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Do you have documentation for this?
src/CountryHandler/Slovakia.php
Outdated
if (strlen($tin) === 10 | ||
&& (int) $tin % 11 === 0) { | ||
return true; | ||
} | ||
if (strlen($tin) === 10) { | ||
return ((int) substr($tin, 0, 9) % 11) % 10 === (int) substr($tin, 9, 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (strlen($tin) === 10 | |
&& (int) $tin % 11 === 0) { | |
return true; | |
} | |
if (strlen($tin) === 10) { | |
return ((int) substr($tin, 0, 9) % 11) % 10 === (int) substr($tin, 9, 1); | |
} | |
if (strlen($tin) === 10) { | |
if ( (int) $tin % 11 === 0) { | |
return true; | |
} | |
return ((int) substr($tin, 0, 9) % 11) % 10 === (int) substr($tin, 9, 1); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the EU checker page (https://ec.europa.eu/taxation_customs/tin/#/check-tin) you can try e.g. 2822030541
This TIN is valid, even if it has 10 digits and starts with < 54.
We decompiled the Java lib you can find here:
https://taxation-customs.ec.europa.eu/document/download/07664928-b4f3-47a5-81f7-438767dc01cb_en?v=1721203258495
The modulo 11 check has those 2 modes in the decompiled lib.
b2fd537
to
861c59a
Compare
Thank you! |
@drupol Can we do a new release for this? :) |
Yes that's the plan. I have a few quirks to fix before, I will try to take care of this after my day, in the evening. |
Now Slovakia has proper check thanks to #45
Add Slovakia TIN Check Digit