Opened 16 years ago
Closed 13 years ago
#10756 closed Bug (fixed)
Correct PLNIPField
Reported by: | remik | Owned by: | nobody |
---|---|---|---|
Component: | contrib.localflavor | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | michal.modzelewski@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Valid forms are: XXX-XXX-YY-YY or XXX-XX-YY-YYY.
Attachments (2)
Change History (8)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
by , 14 years ago
Attachment: | ticket10756.diff added |
---|
patch that changes the accepted formats, details in the comments
comment:4 by , 14 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
Has patch: | set |
Version: | 1.0 → SVN |
I've added a patch to fix this.
New accepted formats are XXX-XXX-XX-XX, XXX-XX-XX-XXX and XXXXXXXXXX based on http://pl.wikipedia.org/wiki/NIP, the historical wikipedia entry http://pl.wikipedia.org/w/index.php?title=NIP&oldid=18661745 and some Polish legal forums that discussed the matter of validation.
Some translations from the wikipedia article:
Prefiks - trzy pierwsze cyfry każdego NIP oznaczają kod urzędu skarbowego, który nadał dany numer.
Prefix - the first three digits in each NIP signify the tax office that assigned the number.
W przeszłości NIP zwyczajowo zapisywało się, oddzielając grupy cyfr łącznikiem. Obecnie nadawany jest bez znaków łącznika.
In the past a NIP was commonly writen with dashes separating the digit groups. Currently numbers are assigned without dashes.
Translated excerpt from the historical artical:
Zwyczajowo NIP zapisuje się, oddzielając grupy cyfr łącznikiem. Dla osób fizycznych numer dzielony jest na grupy 123-456-78-90, a dla osób prawnych, bądź ułomnych osób prawnych, na grupy 123-45-67-890.
Commonly a NIP is written with dashes separating the digits into groups. For individuals the number is split into groups 123-456-78-90, and for legal personalities and restricted legal personalities into groups 123-45-67-890.
From the note on prefixes we can see that the previous accepted format of XX-XX-XXX-XXX was incorrect so I have removed it.
Apropos the comment by zgoda, since the current accepted format is without dashes, we only need to accept the current format and the two historical formats posted in the bug report by remik, and in the historical wikipedia entry.
We don't need to support the previously accepted format for backwards compatibility since the fields clean method stripped the dashes.
comment:5 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
UI/UX: | unset |
Polish law does not specify any particular form of tax ID number, the only requirement is 10 digits. These formats are only enforced by paper forms and may vary. To be fair with current law, we should use a regex that allows any grouping (with no grouping as special case).