Closed Geolim4 closed 5 years ago
Hello, there is an issue.
The SIRET 35600000000048 is a valid SIRET number.
But 3+5+6+4+8 = 26 so array_sum(str_split($insee)) % 5 === 0
is false :s
I see everywhere that the %5 is the new algorithm for La Poste. I didn't find any explanation about this.
Simply because it is compliant with Luhn formula ;) Also this SIRET is the head direction of La Poste, which mean it's one of the first created SIRET that was not yet using of %5 modulo. The %5 modulo only apply for sub-siren from that SIRET that has been created after La Poste group became a Anonymous Company (SA).
Ok, so we must first check for the Luhn and then for La Poste Siret :) When do you think you can fix your PR ?
Guys, I prepared a fix for that remaining PR code review, taking into account the test case @PastisD raised: So @Geolim4 If you're too busy no worries, I'll commit mine by the end of the week. But if you still want to achieve this one within these next days, be my guest, I'll wait till next week-end
Side note about the 356 000 000
SIREN in the SIRET check:
You may find some La Poste local offices with a SIRET start with '356_000_XXX' where XXX
is not equal 000
. Now, all these Post offices are actually closed to date. Any other active office SIRET is now under the unique 356 000 000
SIREN, hence that SIREN is fine and sufficient to check.
See https://fr.wikipedia.org/wiki/Discussion:Formule_de_Luhn#Au_sujet_de_l'exception_des_SIRET_de_La_Poste,_et_du_SIRET_356_000_539_14285_pris_en_exemple,_probablement_%C3%A0_ignorer
and the mentioned SIRENE open data base URL+filters.
I'm about to add that fix in order to take into account the test case @PastisD raised - but as @Geolim4 did the biggest part of it, happy to merge this before.
Added support for French mail company "La Poste" to SIRE(T|N) validators