Skip to content
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

Fixed #134 #136

Merged
merged 3 commits into from
Sep 28, 2019
Merged

Conversation

Geolim4
Copy link
Contributor

@Geolim4 Geolim4 commented Apr 19, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #134

Added support for French mail company "La Poste" to SIRE(T|N) validators

@PastisD
Copy link

PastisD commented May 2, 2019

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.

@Geolim4
Copy link
Contributor Author

Geolim4 commented May 2, 2019

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).

@PastisD
Copy link

PastisD commented May 3, 2019

Ok, so we must first check for the Luhn and then for La Poste Siret :)
When do you think you can fix your PR ?

@ronanguilloux
Copy link
Owner

ronanguilloux commented Sep 22, 2019

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.

ronanguilloux added a commit that referenced this pull request Sep 22, 2019
@ronanguilloux ronanguilloux merged commit 88b3ce1 into ronanguilloux:master Sep 28, 2019
@ronanguilloux
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants