cakephp / localized

I18n and L10n related CakePHP code
Other
213 stars 179 forks source link

Polish 14-digit REGON #137

Closed mik-laj closed 6 years ago

mik-laj commented 8 years ago

Hello,

Currently, In a repo have a function regon, but this function only checks numbers that consist of 9 digits. In special cases, a government agency may assign 14 digit number. Example: 96998880588057

I think that should be a function that checks the second case.

More: http://www.krs-online.com.pl/sprawdzanie_regon.html https://pl.wikipedia.org/wiki/REGON I would like to emphatize sentence:

Ponieważ jeden ze współczynników wagowych wynosi zero to weryfikacja „długiego” REGON-u wymaga weryfikacji 9 cyfr z wagami jak dla 9-cyfrowego numeru, a następnie weryfikacji długiego REGON-u z innymi wagami.

because not every project checks this condition (ex. https://github.com/marioosh/common_numbers )

Thanks in advance.

mik-laj commented 8 years ago

Good code: https://github.com/pear/Validate_PL/blob/master/Validate/PL.php#L203-L228

dereuromark commented 8 years ago

Can you maybe provide a pull request with your suggested changes? Or a diff or code piece how it should look like?