diff --git a/mon-entreprise/source/components/PaySlipSections.tsx b/mon-entreprise/source/components/PaySlipSections.tsx index 0b15baccd..7f5870db7 100644 --- a/mon-entreprise/source/components/PaySlipSections.tsx +++ b/mon-entreprise/source/components/PaySlipSections.tsx @@ -2,7 +2,7 @@ import Value, { Condition, ValueProps } from 'Components/EngineValue' import RuleLink from 'Components/RuleLink' import { DottedName } from 'modele-social' import { isNotApplicable, isNotYetDefined } from 'publicodes' -import { Trans } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' import { useEngine } from './utils/EngineContext' export const SalaireBrutSection = () => { @@ -28,6 +28,7 @@ export const SalaireBrutSection = () => { } export const SalaireNetSection = () => { + const { t } = useTranslation() return (

@@ -56,8 +57,13 @@ export const SalaireNetSection = () => { rule="contrat salarié . rémunération . net" className="payslip__total" /> - - + + { type LineProps = { rule: DottedName + title?: string negative?: boolean } & Omit, 'expression'> @@ -76,6 +83,7 @@ export function Line({ rule, displayedUnit = '€', negative = false, + title, className, ...props }: LineProps) { @@ -92,7 +100,9 @@ export function Line({ return ( 0`}> - + + {title} + >> = { function Distribution() { const targetUnit = useSelector(targetUnitSelector) const engine = useEngine() - const distribution = ( - Object.entries(CotisationsSection).map(([section, cotisations]) => [ - section, - cotisations - .map((c) => engine.evaluate({ valeur: c, unité: targetUnit })) - .reduce( - (acc, evaluation) => acc + ((evaluation?.nodeValue as number) || 0), - 0 - ), - ]) as Array<[DottedName, number]> - ) + const distribution = (Object.entries( + CotisationsSection + ).map(([section, cotisations]) => [ + section, + cotisations + .map((c) => engine.evaluate({ valeur: c, unité: targetUnit })) + .reduce( + (acc, evaluation) => acc + ((evaluation?.nodeValue as number) || 0), + 0 + ), + ]) as Array<[DottedName, number]>) .filter(([, value]) => value > 0) .sort(([, a], [, b]) => b - a) diff --git a/mon-entreprise/source/components/simulationExplanation/SalaryExplanation.tsx b/mon-entreprise/source/components/simulationExplanation/SalaryExplanation.tsx index 35e25399d..40c360bbf 100644 --- a/mon-entreprise/source/components/simulationExplanation/SalaryExplanation.tsx +++ b/mon-entreprise/source/components/simulationExplanation/SalaryExplanation.tsx @@ -96,7 +96,7 @@ function RevenueRepartitionSection(props: { onSeePayslip: () => void }) { color: palettes[0][0], }, { - dottedName: 'impôt', + dottedName: 'impôt . montant', title: t('impôt'), color: palettes[1][0], }, diff --git a/mon-entreprise/source/pages/Simulateurs/AutoEntrepreneur.tsx b/mon-entreprise/source/pages/Simulateurs/AutoEntrepreneur.tsx index 916969bf3..a9b810d76 100644 --- a/mon-entreprise/source/pages/Simulateurs/AutoEntrepreneur.tsx +++ b/mon-entreprise/source/pages/Simulateurs/AutoEntrepreneur.tsx @@ -52,7 +52,7 @@ function Explanation() { color: palettes[0][0], }, { - dottedName: 'impôt', + dottedName: 'impôt . montant', title: t('impôt'), color: palettes[1][0], },