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

Fix(rgcp/lodeom) : correction des erreurs de calcul avec régularisation annuelle #3325

Merged
merged 7 commits into from
Jan 22, 2025
3 changes: 3 additions & 0 deletions modele-social/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Journal des modifications

## next
### Nouveautés
- Ajout du calcul Lodeom pour toutes les zones et tous les barèmes
- Ajout du calcul du SMIC équivalent pour un mois incomplet

## 4.1.0
### Nouveautés
Expand Down
1 change: 1 addition & 0 deletions modele-social/règles/salarié/contrat.publicodes
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ salarié . contrat . salaire brut:
SMIC: temps de travail . SMIC
inversion numérique:
- coût total employeur
# - rémunération . brut
- rémunération . net . à payer avant impôt
- rémunération . net . payé après impôt
- équivalent temps plein
Expand Down
99 changes: 99 additions & 0 deletions modele-social/règles/salarié/mois-incomplet.publicodes
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
salarié . mois incomplet:
experimental: oui
description: |
Gestion des mois incomplets (absence, embauche, départ, etc), notamment pour le
calcul de la réduction générale des cotisations ou de l’exonération Lodeom.
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-d-determination-de-la-valeur-du-4-determination-de-la-valeur-du

salarié . mois incomplet . rémunération non impactée par l'absence:
somme:
- rémunération . primes
- rémunération . indemnités CDD
unité: €/mois

salarié . mois incomplet . rémunération de base mois incomplet:
# TODO: décommenter la formule lorsque "rémunération . brut" n'incluera plus
# les frais professionnels.
# Décommenter aussi la ligne "rémunération . brut" dans "salarié . contrat . salaire brut"

# valeur: rémunération . brut
# abattement:
# somme:
# - rémunération . heures supplémentaires
# - rémunération . heures complémentaires
# - rémunération non impactée par l'absence
unité: €/mois
description: |
Exclure de cette rémunération :
- le paiement des heures supplémentaires et complémentaires,
- les primes, indemnités de CDD et autres éléments de rémunération non impactés par l'absence.

salarié . mois incomplet . rémunération équivalente mois complet:
# par défaut: contrat . salaire brut
unité: €/mois
question: Quelle rémunération brute aurait été versée pour un mois complet ?
note: |
Exclure de cette rémunération :
- le paiement des heures supplémentaires et complémentaires,
- les primes, indemnités de CDD et autres éléments de rémunération non impactés par l'absence.

salarié . mois incomplet . prorata:
produit:
- rémunération de base mois incomplet
- 1 / rémunération équivalente mois complet
Comment on lines +42 to +44
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On peut écrire :

salarié . mois incomplet . prorata:
  valeur: rémunération de base mois incomplet / rémunération équivalente mois complet

unité: '%'
description: |
Le prorata correspond au rapport entre la rémunération du mois incomplet et
la rémunération qui aurait été versée pour un mois complet.

Plus précisément, ce prorata est le rapport entre :
- la rémunération brute versée pour le mois incomplet, sans les primes (et
autres éléments non impactés par l’absence) ni le paiements des heures
supplémentaires
- et la rémunération équivalente "mois complet" sans les primes et autres
éléments non impactés par l’absence.
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-d-determination-de-la-valeur-du-4-determination-de-la-valeur-du

salarié . mois incomplet . SMIC équivalent:
somme:
- SMIC mensuel proratisé
- SMIC heures supplémentaires
- SMIC heures complémentaires
unité: €/mois
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-d-determination-de-la-valeur-du

avec:
SMIC mensuel proratisé:
produit:
- SMIC
- prorata
unité: €/mois
description: |
Ce montant correspond au SMIC équivalent au mois incomplet, c’est-à-dire en
tenant compte du prorata du temps de travail et les heures supplémentaires et
complémentaires.

Ce prorata du temps de travail est en réalité calculé comme un prorata des
rémunérations, entre celle du mois incomplet et celle qui aurait été versée
pour un mois complet.
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-d-determination-de-la-valeur-du-4-determination-de-la-valeur-du

SMIC heures supplémentaires:
produit:
- temps de travail . heures supplémentaires
- SMIC . horaire
unité: €/mois
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-e-prise-en-compte-des-heures-com-1-heures-supplementaires

SMIC heures complémentaires:
produit:
- temps de travail . heures complémentaires
- SMIC . horaire
unité: €/mois
références:
Bulletin Officiel de la Sécurité Sociale: https://boss.gouv.fr/portail/accueil/exonerations/allegements-generaux.html#titre-chapitre-1--la-reduction-general-section-2---determination-du-mon-ii-calcul-du-montant-de-la-reduc-e-prise-en-compte-des-heures-com-2-heures-complementaires
1 change: 0 additions & 1 deletion modele-social/règles/salarié/rémunération.publicodes
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ salarié . rémunération . indemnités CDD:
- primes . ancienneté
- primes . activité
- indemnités CDD . fin de contrat
références:

congés payés . Méthode du dixième:
produit:
Expand Down
4 changes: 2 additions & 2 deletions site/cypress/integration/mon-entreprise/lodeom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
})

it('should not crash', function () {
cy.contains('Rémunération brute')
cy.contains('Quelle est votre localisation ?')
})

it('should display a warning when no zone is selected', function () {
Expand Down Expand Up @@ -282,7 +282,6 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
})

it('should include a recap table', function () {
cy.contains('Régularisation progressive').click()
cy.get('div[id="simulator-legend"]').should(
'include.text',
'Récapitulatif trimestriel'
Expand Down Expand Up @@ -310,6 +309,7 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
})

it('should display code in recap table based on scale', function () {
cy.contains('Régularisation progressive').click()
cy.contains('Récapitulatif trimestriel').next().as('recapTable')

cy.get('@recapTable').should('include.text', 'code 462')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ describe(
})

it('should handle incomplete months', function () {
cy.contains('Régularisation progressive').click()
cy.get(inputSelector).first().type('{selectall}1500')
cy.get('input[id="option-heures-sup-janvier"]').type('{selectall}5')
cy.get('input[id="option-rémunération-etp-janvier"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default function RéductionBasique({
const currentUnit = useSelector(targetUnitSelector)
const { t } = useTranslation()

const répartition = getRépartitionBasique(dottedName, currentUnit, engine)
const répartition =
withRépartition && getRépartitionBasique(dottedName, currentUnit, engine)

return (
<>
Expand All @@ -65,7 +66,7 @@ export default function RéductionBasique({
round={false}
/>
<Spacing md />
{withRépartition && (
{répartition && (
<Répartition dottedName={dottedName} répartition={répartition} />
)}
</Condition>
Expand Down
109 changes: 109 additions & 0 deletions site/source/locales/rules-en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10984,6 +10984,115 @@ salarié . coût total employeur . aides . emploi franc . éligible:
question.fr: Cette embauche est-elle éligible à l'aide emploi-franc ?
titre.en: '[automatic] eligible'
titre.fr: éligible
salarié . mois incomplet:
description.en: >
[automatic] Management of incomplete months (absence, hiring, departure,
etc.), in particular for calculating

calculating the general reduction in contributions or the Lodeom exemption.
description.fr: >
Gestion des mois incomplets (absence, embauche, départ, etc), notamment pour
le

calcul de la réduction générale des cotisations ou de l’exonération Lodeom.
titre.en: '[automatic] incomplete month'
titre.fr: mois incomplet
salarié . mois incomplet . SMIC équivalent:
avec:
SMIC heures complémentaires:
titre.en: '[automatic] SMIC overtime'
titre.fr: SMIC heures complémentaires
SMIC heures supplémentaires:
titre.en: '[automatic] SMIC overtime'
titre.fr: SMIC heures supplémentaires
SMIC mensuel proratisé:
description.en: >
[automatic] This amount corresponds to the SMIC equivalent for an
incomplete month, i.e. taking

taking into account the pro rata of working time and overtime and

and overtime.


This prorata of working time is in fact calculated as a prorata of remuneration, between that of the incomplete month and that which would have been paid for the full month.

between the remuneration for the incomplete month and that which would have been paid for a full month.

for a full month.
description.fr: >
Ce montant correspond au SMIC équivalent au mois incomplet, c’est-à-dire
en

tenant compte du prorata du temps de travail et les heures supplémentaires et

complémentaires.


Ce prorata du temps de travail est en réalité calculé comme un prorata des

rémunérations, entre celle du mois incomplet et celle qui aurait été versée

pour un mois complet.
titre.en: '[automatic] Adjusted monthly minimum wage'
titre.fr: SMIC mensuel proratisé
titre.en: '[automatic] SMIC equivalent'
titre.fr: SMIC équivalent
salarié . mois incomplet . prorata:
description.en: >
[automatic] The prorata corresponds to the ratio between the remuneration
for the incomplete month and the remuneration that would have been paid for
a full month.

the remuneration that would have been paid for a full month.


More precisely, the prorata is the ratio between :
- the gross remuneration paid for the incomplete month, excluding bonuses (and other
other items not affected by the absence) and overtime payments.

overtime
- and the equivalent "full month" remuneration without bonuses and other
not affected by the absence.
description.fr: |
Le prorata correspond au rapport entre la rémunération du mois incomplet et
la rémunération qui aurait été versée pour un mois complet.

Plus précisément, ce prorata est le rapport entre :
- la rémunération brute versée pour le mois incomplet, sans les primes (et
autres éléments non impactés par l’absence) ni le paiements des heures
supplémentaires
- et la rémunération équivalente "mois complet" sans les primes et autres
éléments non impactés par l’absence.
titre.en: '[automatic] prorata'
titre.fr: prorata
salarié . mois incomplet . rémunération de base mois incomplet:
description.en: >
[automatic] Exclude from this remuneration :
- payment for overtime and complementary hours,
- bonuses, fixed-term contract allowances and other remuneration not affected by the absence.
description.fr: >
Exclure de cette rémunération :
- le paiement des heures supplémentaires et complémentaires,
- les primes, indemnités de CDD et autres éléments de rémunération non impactés par l'absence.
titre.en: '[automatic] basic remuneration incomplete month'
titre.fr: rémunération de base mois incomplet
salarié . mois incomplet . rémunération non impactée par l'absence:
titre.en: '[automatic] compensation not affected by absence'
titre.fr: rémunération non impactée par l'absence
salarié . mois incomplet . rémunération équivalente mois complet:
note.en: >
[automatic] Exclude from this remuneration :
- payment for overtime and complementary hours,
- bonuses, fixed-term contract allowances and other remuneration not affected by the absence.
note.fr: >
Exclure de cette rémunération :
- le paiement des heures supplémentaires et complémentaires,
- les primes, indemnités de CDD et autres éléments de rémunération non impactés par l'absence.
question.en: '[automatic] What gross salary would have been paid for a full month?'
question.fr: Quelle rémunération brute aurait été versée pour un mois complet ?
titre.en: '[automatic] equivalent remuneration for a full month'
titre.fr: rémunération équivalente mois complet
salarié . régimes spécifiques:
titre.en: '[automatic] specific regimes'
titre.fr: régimes spécifiques
Expand Down
26 changes: 18 additions & 8 deletions site/source/pages/simulateurs/lodeom/Goals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ export default function LodeomSimulationGoals({
'salarié . cotisations . exonérations . lodeom . code régularisation'
).nodeValue as string

const withRépartition = currentZone === 'zone un'

const initializeLodeomMoisParMoisData = useCallback(() => {
const data = getInitialRéductionMoisParMois(lodeomDottedName, year, engine)
const data = getInitialRéductionMoisParMois(
lodeomDottedName,
year,
engine,
withRépartition
)
setData(data)
}, [engine, year])
}, [engine, withRépartition, year])

useEffect(() => {
if (lodeomMoisParMoisData.length === 0) {
Expand All @@ -76,10 +83,11 @@ export default function LodeomSimulationGoals({
previousData,
year,
engine,
régularisationMethod
régularisationMethod,
withRépartition
)
})
}, [engine, situation, régularisationMethod, year])
}, [engine, situation, régularisationMethod, year, withRépartition])

const onRémunérationChange = (
monthIndex: number,
Expand All @@ -94,7 +102,8 @@ export default function LodeomSimulationGoals({
year,
engine,
dispatch,
régularisationMethod
régularisationMethod,
withRépartition
)
})
}
Expand All @@ -108,7 +117,8 @@ export default function LodeomSimulationGoals({
previousData,
year,
engine,
régularisationMethod
régularisationMethod,
withRépartition
)
})
}
Expand Down Expand Up @@ -153,15 +163,15 @@ export default function LodeomSimulationGoals({
code: codeRégularisation,
})
}
withRépartitionAndRégularisation={currentZone === 'zone un'}
withRépartitionAndRégularisation={withRépartition}
/>
) : (
<RéductionBasique
dottedName={lodeomDottedName}
onUpdate={initializeLodeomMoisParMoisData}
warningCondition={`${lodeomDottedName} = 0`}
warningMessage={<WarningSalaireTrans />}
withRépartition={currentZone === 'zone un'}
withRépartition={withRépartition}
/>
))}
</SimulationGoals>
Expand Down
Loading
Loading