diff --git a/source/components/ResultView/selectors.js b/source/components/ResultView/selectors.js index 0139d51dd..1d2f48794 100644 --- a/source/components/ResultView/selectors.js +++ b/source/components/ResultView/selectors.js @@ -286,15 +286,18 @@ const répartition = (ficheDePaie: FicheDePaie): Répartition => { ficheDePaie.cotisations ) const { salaireNet, salaireChargé, réductionsDeCotisations } = ficheDePaie + let CSG; + if (cotisations.autres) { + CSG = cotisations.autres.find(({ nom }) => nom === 'CSG') + if (!CSG) + throw new Error('[répartition selector]: expect CSG not to be null') + cotisations.autres = without([CSG], cotisations.autres) + } const rawRépartition: { [Branche]: MontantPartagé } = map( totalCotisations, cotisations ) - if (cotisations.autres) { - const CSG = cotisations.autres.find(({ nom }) => nom === 'CSG') - if (!CSG) - throw new Error('[répartition selector]: expect CSG not to be null') - cotisations.autres = without([CSG], cotisations.autres) + if (CSG) { dispatchCSGInPlace(CSG, rawRépartition) } diff --git a/source/locales/en.yaml b/source/locales/en.yaml index 6a6bbe7ee..46d949f98 100644 --- a/source/locales/en.yaml +++ b/source/locales/en.yaml @@ -122,3 +122,4 @@ payslip: heures: 'Number of hours worked: ' disclaimer: It takes into account national law but not union negotiated rules. Lots of aids for your enterprise exist, explore them on <1>aides-entreprises.fr (french). Effacer: Erase +Continuer: Continue