Skip to content

Commit

Permalink
fix(indemnite-licenciement): correctifs de la cc 2614 (#5310)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr authored Aug 23, 2023
1 parent 282f944 commit 859ccb3
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ import {
describe("CC 2614", () => {
describe("Calcul de l'ancienneté", () => {
test.each`
absences | entryDate | exitDate | expectedAnciennete
${[]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ motif: { key: MotifKeys.maladieNonPro } }, { motif: { key: MotifKeys.accidentTrajet } }, { motif: { key: MotifKeys.congesSabbatique } }, { motif: { key: MotifKeys.congesCreationEntreprise } }, { motif: { key: MotifKeys.congesParentalEducation } }, { motif: { key: MotifKeys.congesSansSolde } }, { motif: { key: MotifKeys.greve } }, { motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
${[{ durationInMonth: 0.5, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0.75, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 2.5, motif: { key: MotifKeys.maladieNonPro } }]} | ${"01/01/2008"} | ${"01/01/2021"} | ${13}
${[{ durationInMonth: 20, motif: { key: MotifKeys.maladieNonPro } }]} | ${"01/01/2022"} | ${"01/02/2023"} | ${1.0833333333333333}
absences | entryDate | exitDate | expectedAnciennete
${[]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ motif: { key: MotifKeys.maladieNonPro } }, { motif: { key: MotifKeys.accidentTrajet } }, { motif: { key: MotifKeys.congesSabbatique } }, { motif: { key: MotifKeys.congesCreationEntreprise } }, { motif: { key: MotifKeys.congesParentalEducation } }, { motif: { key: MotifKeys.congesSansSolde } }, { motif: { key: MotifKeys.greve } }, { motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
${[{ durationInMonth: 0.5, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0.75, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 2.5, motif: { key: MotifKeys.maladieNonPro } }]} | ${"01/01/2008"} | ${"01/01/2021"} | ${13}
${[{ durationInMonth: 20, motif: { key: MotifKeys.maladieNonPro } }]} | ${"01/01/2022"} | ${"01/02/2023"} | ${1.0833333333333333}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 100, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 100, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
${[{ durationInMonth: 0.5, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0.75, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 2.5, motif: { key: MotifKeys.accidentTrajet } }]} | ${"01/01/2008"} | ${"01/01/2021"} | ${13}
${[{ durationInMonth: 20, motif: { key: MotifKeys.accidentTrajet } }]} | ${"01/01/2022"} | ${"01/02/2023"} | ${1.0833333333333333}
`(
"Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an",
({ absences, entryDate, exitDate, expectedAnciennete }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { IndemniteLicenciementPublicodes } from "../../../../../publicodes";

const engine = new IndemniteLicenciementPublicodes(
modelsIndemniteLicenciement,
"2614"
);

const notifications = [
{
description: `Si le salarié a perçu une prime de vacances ou une indemnité de congés payés au cours des 12 mois précédant la notification du licenciement, le montant de l’indemnité de licenciement pourrait être moins élevé. En effet, la convention collective prévoit que l’indemnité doit être calculée sur la base du salaire sans ces éléments de rémunération, alors que le simulateur les intègre.`,
},
];

describe("CC 2614", () => {
describe("Affichage des notifications de l'indemnité de licenciement", () => {
test.each`
seniorityRight | seniority | salaireRef | age | expectedNotification
${0} | ${0} | ${2624} | ${0} | ${notifications}
${1.5} | ${2} | ${2624} | ${54} | ${notifications}
${2} | ${15} | ${2624} | ${54} | ${notifications}
${2} | ${24} | ${2624} | ${54} | ${notifications}
${1.5} | ${2} | ${2624} | ${59} | ${notifications}
${2} | ${15} | ${2624} | ${59} | ${notifications}
${2} | ${24} | ${2624} | ${59} | ${notifications}
${2} | ${40} | ${2624} | ${59} | ${notifications}
${1.5} | ${2} | ${2624} | ${67} | ${notifications}
${2} | ${15} | ${2624} | ${67} | ${notifications}
${2} | ${24} | ${2624} | ${67} | ${notifications}
`(
"Avec une ancienneté $seniority ans, un salaire de référence $salaireRef €, age $age => on attend les notifications $expectedNotification",
({
salaireRef,
seniority,
seniorityRight,
age,
expectedNotification,
}) => {
engine.setSituation(
{
"contrat salarié . convention collective": "'IDCC2614'",
"contrat salarié . convention collective . travaux publics . age":
age,
"contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année":
seniority,
"contrat salarié . indemnité de licenciement . ancienneté conventionnelle requise en année":
seniorityRight,
"contrat salarié . indemnité de licenciement . salaire de référence conventionnel":
salaireRef,
},
"contrat salarié . indemnité de licenciement . résultat conventionnel"
);
const notifs = engine.getNotifications();
expect(notifs).toHaveLength(expectedNotification.length);
const notifsToCompare = notifs.map((notif) => {
return {
description: notif.description,
};
});
expect(notifsToCompare).toEqual(expectedNotification);
}
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,10 @@ contrat salarié . convention collective . travaux publics . résultat conventio
explanations:
- "Sref : Salaire de référence": contrat salarié . indemnité de licenciement . salaire de référence conventionnel
formula: 11 * Sref

contrat salarié . convention collective . travaux publics . notification:
type: notification
description: Si le salarié a perçu une prime de vacances ou une indemnité de congés payés au cours des 12 mois précédant la notification du licenciement, le montant de l’indemnité de licenciement pourrait être moins élevé. En effet, la convention collective prévoit que l’indemnité doit être calculée sur la base du salaire sans ces éléments de rémunération, alors que le simulateur les intègre.
valeur: oui
cdtn:
affichage: conventionnel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { MotifKeys } from "../../common/motif-keys";
import { SeniorityDefault } from "../../common/seniority";

const MOTIFS_2614: Motif[] = LEGAL_MOTIFS.map((item) => {
if (item.key === MotifKeys.maladieNonPro) {
if (
item.key === MotifKeys.maladieNonPro ||
item.key === MotifKeys.accidentTrajet
) {
return {
...item,
value: 0,
Expand Down

0 comments on commit 859ccb3

Please sign in to comment.