betagouv / mon-entreprise

L'assistant officiel des entrepreneurs
https://mon-entreprise.urssaf.fr
MIT License
261 stars 75 forks source link

modele-social: Bug on Edge case for BIC & ACRE #3070

Closed jsmrcaga closed 1 month ago

jsmrcaga commented 2 months ago

Hi mon-entreprise team!

modele-social versions

Was working on

2.1.0

Stopped working on

2.3.0

Description of what went wrong

We are encountering an edge case on one of our unit tests where the ACRE rate is not taken into account.

This was working with version 2.1.0 of the modele-social package, but since the update to 2.3.0 it broke. Please note that we have many different scenarios tested, and this is the only one that broke.

These are the params used in the estimation ```js { date: '02/05/2024', "dirigeant . auto-entrepreneur . chiffre d'affaires": '100000 €/mois', 'dirigeant . auto-entrepreneur . impôt . versement libératoire': 'non', 'dirigeant . exonérations . ACRE': 'oui', 'entreprise . catégorie juridique': "'EI'", 'entreprise . catégorie juridique . EI . auto-entrepreneur': 'oui', 'entreprise . date de création': '02/05/2024', 'établissement . commune . code postal': `"'34000'"`, 'impôt . méthode de calcul': "'barème standard'", 'impôt . foyer fiscal . situation de famille': "'couple'", 'impôt . foyer fiscal . enfants à charge': '10 enfant', 'impôt . foyer fiscal . revenu imposable . autres revenus imposables': 60000, 'entreprise . activités . revenus mixtes': 'non', 'entreprise . activité . nature': "'commerciale'", 'entreprise . activités . service ou vente': "'service'" } ```

And this is the result on the mon-entreprise simulator.

In both cases the rate for Cotisations results in21.2%, but should be 10.6% (computing for May 2nd 2024).

Screenshot ![Screenshot 2024-08-09 at 08 52 02](https://github.com/user-attachments/assets/b124c070-f352-4350-9db4-83f01ce29d08)
Extra tests We've also tested this config with * Smaller revenues (3000 for income and 3000 for family income) * 0 family income * Less children (1 and 0) * Single people without children In all cases, the rate results in 21.2 instead of 10.6

I've also noticed that clicking on the Taux ACRE › Service BIC link on the web results in an error.

It might have something to do with this pull request, but I'm not sure. I could not find any other recent commit that could have influenced the result.

[!NOTE] This does not happen if the company has mixed revenues (BIC and BNC). In that case the rate adapts correctly

Please let me know if we can do anything to help investigate/solve the issue!

Thanks!

glopezrios commented 2 months ago

Hi José Maria,

Thank you very for your comment and sorry for my late reply.

You're right: there's a problem to solve! We noticed it 3 weeks ago, cf. #3054 We hope this will be fixed soon.

However, you should be aware that ACRE is not available above a certain level of sales. In your case, sales are €1,200,000, well above the €87,984 limit for ACRE if you're running a commercial service business. (I did the same mistake a few months ago :-) https://github.com/betagouv/mon-entreprise/issues/2931#issuecomment-2125077261 )

More information on https://bpifrance-creation.fr/encyclopedie/aides-a-creation-a-reprise-dentreprise/aides-sociales-financieres/acre-aide-aux

En cas de dépassement des seuils de chiffre d'affaires correspondant à un revenu forfaitaire de 43 992 €, l'assuré perd le bénéfice de l'Acre et des taux minorés le premier jour du mois ou du trimestre qui suit le dépassement. Les cotisations sont alors recalculées sur la base des taux habituels sur le chiffre d’affaires annuel.

Ces seuils sont déterminés après application de l’abattement prévu par l’article 50-0 du code général des impôts :

  • pour les activités libérales : 66 655 € de CA annuel (43 992 € X 100/66)
  • pour les activités de prestations de services commerciales et artisanales : 87 984 € de CA annuel (43 992 € x 100/50)
  • pour les activités commerciales : 151 697 € de CA annuel (43 992 € x 100/29)
glopezrios commented 2 months ago

@JalilArfaoui et @liliced Je vous laisse vérifier si l'issue #3054 couvre bien cette isssue.

jsmrcaga commented 2 months ago

Hi @glopezrios ! Thanks a lot for the answer. Let me know whenever this advances, we will update our version of modele-social or publicodes accordingly.

Also let me know if there's anything I can do to help. We have a nice array of tests, so I'll be able to report strange cases from time to time

liliced commented 1 month ago

Hello @jsmrcaga!

Thank you for the bug update. It has now been solved, it will be fixed in modele-social's next version.

Don't hesitate to report errors or suspect behaviors whenever you find them :)

jsmrcaga commented 1 month ago

Thanks a lot @liliced !

I've noticed there's no new version for modele-social yet. Do you know when it is planned for?

Thanks!

jsmrcaga commented 1 month ago

@liliced @glopezrios sorry to press, any news on the updated package on npm? Anything we can do to help?

liliced commented 1 month ago

Hi @jsmrcaga, Sorry for the wait, modele-social 2.4.0 version is now available!