feat(lodeom): suppression de la régularisation pour la zone 2
parent
7294137b4a
commit
5793399ec5
|
@ -333,6 +333,10 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
|
|||
cy.get('@recapTable').should('include.text', 'code 688')
|
||||
})
|
||||
|
||||
it('should not include regularization for zone 2', function () {
|
||||
cy.contains('régularisation', { matchCase: false }).should('not.exist')
|
||||
})
|
||||
|
||||
it('should be RGAA compliant', function () {
|
||||
cy.contains('Exonération mensuelle').click()
|
||||
checkA11Y()
|
||||
|
|
|
@ -64,7 +64,7 @@ export default function Montant({
|
|||
</FlexDiv>
|
||||
</StyledTooltip>
|
||||
) : (
|
||||
<FlexDiv id={id} $alignment={alignment}>
|
||||
<FlexDiv id={id} $alignment="center">
|
||||
{formatValue(
|
||||
{
|
||||
nodeValue: réduction,
|
||||
|
|
|
@ -13,7 +13,7 @@ type Props = {
|
|||
data: MonthState[]
|
||||
codeRéduction?: string
|
||||
codeRégularisation?: string
|
||||
withRépartition?: boolean
|
||||
withRépartitionAndRégularisation?: boolean
|
||||
mobileVersion?: boolean
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ export default function RécapitulatifTrimestre({
|
|||
data,
|
||||
codeRéduction,
|
||||
codeRégularisation,
|
||||
withRépartition = true,
|
||||
withRépartitionAndRégularisation = true,
|
||||
mobileVersion = false,
|
||||
}: Props) {
|
||||
const { t, i18n } = useTranslation()
|
||||
|
@ -84,7 +84,7 @@ export default function RécapitulatifTrimestre({
|
|||
displayedUnit={displayedUnit}
|
||||
language={language}
|
||||
alignment="center"
|
||||
withRépartition={withRépartition}
|
||||
withRépartition={withRépartitionAndRégularisation}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export default function RécapitulatifTrimestre({
|
|||
displayedUnit={displayedUnit}
|
||||
language={language}
|
||||
alignment="center"
|
||||
withRépartition={withRépartition}
|
||||
withRépartition={withRépartitionAndRégularisation}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -130,27 +130,29 @@ export default function RécapitulatifTrimestre({
|
|||
</Grid>
|
||||
</GridContainer>
|
||||
|
||||
<GridContainer container spacing={2}>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
{t(
|
||||
'pages.simulateurs.réduction-générale.recap.header-régularisation',
|
||||
'Régularisation calculée'
|
||||
)}
|
||||
{codeRégularisation && (
|
||||
<>
|
||||
<br />
|
||||
{codeRégularisation}
|
||||
</>
|
||||
)}
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
<MontantRégularisation />
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
</GridContainer>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<GridContainer container spacing={2}>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
{t(
|
||||
'pages.simulateurs.réduction-générale.recap.header-régularisation',
|
||||
'Régularisation calculée'
|
||||
)}
|
||||
{codeRégularisation && (
|
||||
<>
|
||||
<br />
|
||||
{codeRégularisation}
|
||||
</>
|
||||
)}
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
<MontantRégularisation />
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
</GridContainer>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<tr>
|
||||
|
@ -158,9 +160,11 @@ export default function RécapitulatifTrimestre({
|
|||
<td>
|
||||
<MontantRéduction />
|
||||
</td>
|
||||
<td>
|
||||
<MontantRégularisation />
|
||||
</td>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<td>
|
||||
<MontantRégularisation />
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ type Props = {
|
|||
onOptionsChange: (monthIndex: number, options: Options) => void
|
||||
warningCondition: PublicodesExpression
|
||||
warningTooltip: ReactNode
|
||||
withRépartition?: boolean
|
||||
withRépartitionAndRégularisation?: boolean
|
||||
mobileVersion?: boolean
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ export default function RéductionMois({
|
|||
onOptionsChange,
|
||||
warningCondition,
|
||||
warningTooltip,
|
||||
withRépartition = true,
|
||||
withRépartitionAndRégularisation = true,
|
||||
mobileVersion = false,
|
||||
}: Props) {
|
||||
const { t, i18n } = useTranslation()
|
||||
|
@ -125,7 +125,7 @@ export default function RéductionMois({
|
|||
language={language}
|
||||
warningCondition={warningCondition}
|
||||
warningTooltip={warningTooltip}
|
||||
withRépartition={withRépartition}
|
||||
withRépartition={withRépartitionAndRégularisation}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ export default function RéductionMois({
|
|||
répartition={data.régularisation.répartition}
|
||||
displayedUnit={displayedUnit}
|
||||
language={language}
|
||||
withRépartition={withRépartition}
|
||||
withRépartition={withRépartitionAndRégularisation}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -184,18 +184,20 @@ export default function RéductionMois({
|
|||
</Grid>
|
||||
</GridContainer>
|
||||
|
||||
<GridContainer container spacing={2}>
|
||||
<Grid item>
|
||||
<RuleLink
|
||||
dottedName={`${réductionGénéraleDottedName} . régularisation`}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
<MontantRégularisation />
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
</GridContainer>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<GridContainer container spacing={2}>
|
||||
<Grid item>
|
||||
<RuleLink
|
||||
dottedName={`${réductionGénéraleDottedName} . régularisation`}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<StyledBody>
|
||||
<MontantRégularisation />
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
</GridContainer>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
|
@ -210,9 +212,11 @@ export default function RéductionMois({
|
|||
<td>
|
||||
<MontantRéduction />
|
||||
</td>
|
||||
<td>
|
||||
<MontantRégularisation />
|
||||
</td>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<td>
|
||||
<MontantRégularisation />
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
{isOptionVisible && (
|
||||
<StyledTableRow>
|
||||
|
|
|
@ -29,7 +29,7 @@ type Props = {
|
|||
warningTooltip: ReactNode
|
||||
codeRéduction?: string
|
||||
codeRégularisation?: string
|
||||
withRépartition?: boolean
|
||||
withRépartitionAndRégularisation?: boolean
|
||||
}
|
||||
|
||||
export default function RéductionMoisParMois({
|
||||
|
@ -43,7 +43,7 @@ export default function RéductionMoisParMois({
|
|||
warningTooltip,
|
||||
codeRéduction,
|
||||
codeRégularisation,
|
||||
withRépartition = true,
|
||||
withRépartitionAndRégularisation = true,
|
||||
}: Props) {
|
||||
const { t } = useTranslation()
|
||||
const isDesktop = useMediaQuery(
|
||||
|
@ -93,11 +93,13 @@ export default function RéductionMoisParMois({
|
|||
<th scope="col">
|
||||
<RuleLink dottedName={dottedName} />
|
||||
</th>
|
||||
<th scope="col">
|
||||
<RuleLink
|
||||
dottedName={`${réductionGénéraleDottedName} . régularisation`}
|
||||
/>
|
||||
</th>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<th scope="col">
|
||||
<RuleLink
|
||||
dottedName={`${réductionGénéraleDottedName} . régularisation`}
|
||||
/>
|
||||
</th>
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -120,7 +122,9 @@ export default function RéductionMoisParMois({
|
|||
}}
|
||||
warningCondition={warningCondition}
|
||||
warningTooltip={warningTooltip}
|
||||
withRépartition={withRépartition}
|
||||
withRépartitionAndRégularisation={
|
||||
withRépartitionAndRégularisation
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
|
@ -156,18 +160,20 @@ export default function RéductionMoisParMois({
|
|||
</>
|
||||
)}
|
||||
</th>
|
||||
<th scope="col">
|
||||
{t(
|
||||
'pages.simulateurs.réduction-générale.recap.header-régularisation',
|
||||
'Régularisation calculée'
|
||||
)}
|
||||
{codeRégularisation && (
|
||||
<>
|
||||
<br />
|
||||
{codeRégularisation}
|
||||
</>
|
||||
)}
|
||||
</th>
|
||||
{withRépartitionAndRégularisation && (
|
||||
<th scope="col">
|
||||
{t(
|
||||
'pages.simulateurs.réduction-générale.recap.header-régularisation',
|
||||
'Régularisation calculée'
|
||||
)}
|
||||
{codeRégularisation && (
|
||||
<>
|
||||
<br />
|
||||
{codeRégularisation}
|
||||
</>
|
||||
)}
|
||||
</th>
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -179,7 +185,9 @@ export default function RéductionMoisParMois({
|
|||
data={quarters[label]}
|
||||
codeRéduction={codeRéduction}
|
||||
codeRégularisation={codeRégularisation}
|
||||
withRépartition={withRépartition}
|
||||
withRépartitionAndRégularisation={
|
||||
withRépartitionAndRégularisation
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
|
@ -207,7 +215,9 @@ export default function RéductionMoisParMois({
|
|||
}}
|
||||
warningCondition={warningCondition}
|
||||
warningTooltip={warningTooltip}
|
||||
withRépartition={withRépartition}
|
||||
withRépartitionAndRégularisation={
|
||||
withRépartitionAndRégularisation
|
||||
}
|
||||
mobileVersion={true}
|
||||
/>
|
||||
))}
|
||||
|
@ -228,7 +238,9 @@ export default function RéductionMoisParMois({
|
|||
data={quarters[label]}
|
||||
codeRéduction={codeRéduction}
|
||||
codeRégularisation={codeRégularisation}
|
||||
withRépartition={withRépartition}
|
||||
withRépartitionAndRégularisation={
|
||||
withRépartitionAndRégularisation
|
||||
}
|
||||
mobileVersion={true}
|
||||
/>
|
||||
))}
|
||||
|
|
|
@ -33,7 +33,7 @@ export default function LodeomSimulationGoals({
|
|||
monthByMonth: boolean
|
||||
toggles?: React.ReactNode
|
||||
legend: string
|
||||
régularisationMethod: RégularisationMethod
|
||||
régularisationMethod?: RégularisationMethod
|
||||
}) {
|
||||
const engine = useEngine()
|
||||
const dispatch = useDispatch()
|
||||
|
@ -70,8 +70,8 @@ export default function LodeomSimulationGoals({
|
|||
previousSituation.current,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}, [engine, situation, régularisationMethod, year])
|
||||
|
@ -87,9 +87,9 @@ export default function LodeomSimulationGoals({
|
|||
rémunérationBrute,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine,
|
||||
dispatch
|
||||
dispatch,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -102,8 +102,8 @@ export default function LodeomSimulationGoals({
|
|||
options,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ export default function LodeomSimulationGoals({
|
|||
code: codeRégularisation,
|
||||
})
|
||||
}
|
||||
withRépartition={currentZone === 'zone un'}
|
||||
withRépartitionAndRégularisation={currentZone === 'zone un'}
|
||||
/>
|
||||
) : (
|
||||
<RéductionBasique
|
||||
|
|
|
@ -68,7 +68,9 @@ export default function LodeomSimulation() {
|
|||
<PeriodSwitch periods={periods} onSwitch={onPeriodSwitch} />
|
||||
</>
|
||||
}
|
||||
régularisationMethod={régularisationMethod}
|
||||
régularisationMethod={
|
||||
currentZone === 'zone un' ? régularisationMethod : undefined
|
||||
}
|
||||
/>
|
||||
</Simulation>
|
||||
</>
|
||||
|
|
|
@ -69,8 +69,8 @@ export default function RéductionGénéraleSimulationGoals({
|
|||
previousSituation.current,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}, [engine, situation, régularisationMethod, year])
|
||||
|
@ -86,9 +86,9 @@ export default function RéductionGénéraleSimulationGoals({
|
|||
rémunérationBrute,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine,
|
||||
dispatch
|
||||
dispatch,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ export default function RéductionGénéraleSimulationGoals({
|
|||
options,
|
||||
previousData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ export const getDataAfterSituationChange = (
|
|||
previousSituation: SituationType,
|
||||
previousData: MonthState[],
|
||||
year: number,
|
||||
régularisationMethod: RégularisationMethod,
|
||||
engine: Engine<DottedName>
|
||||
engine: Engine<DottedName>,
|
||||
régularisationMethod?: RégularisationMethod
|
||||
): MonthState[] => {
|
||||
if (!Object.keys(situation).length) {
|
||||
return getInitialRéductionMoisParMois(dottedName, year, engine)
|
||||
|
@ -103,8 +103,8 @@ export const getDataAfterSituationChange = (
|
|||
dottedName,
|
||||
updatedData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -114,9 +114,9 @@ export const getDataAfterRémunérationChange = (
|
|||
rémunérationBrute: number,
|
||||
previousData: MonthState[],
|
||||
year: number,
|
||||
régularisationMethod: RégularisationMethod,
|
||||
engine: Engine<DottedName>,
|
||||
dispatch: Dispatch<AnyAction>
|
||||
dispatch: Dispatch<AnyAction>,
|
||||
régularisationMethod?: RégularisationMethod
|
||||
): MonthState[] => {
|
||||
const updatedData = [...previousData]
|
||||
updatedData[monthIndex] = {
|
||||
|
@ -130,8 +130,8 @@ export const getDataAfterRémunérationChange = (
|
|||
dottedName,
|
||||
updatedData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -141,8 +141,8 @@ export const getDataAfterOptionsChange = (
|
|||
options: Options,
|
||||
previousData: MonthState[],
|
||||
year: number,
|
||||
régularisationMethod: RégularisationMethod,
|
||||
engine: Engine<DottedName>
|
||||
engine: Engine<DottedName>,
|
||||
régularisationMethod?: RégularisationMethod
|
||||
): MonthState[] => {
|
||||
const updatedData = [...previousData]
|
||||
updatedData[monthIndex] = {
|
||||
|
@ -154,8 +154,8 @@ export const getDataAfterOptionsChange = (
|
|||
dottedName,
|
||||
updatedData,
|
||||
year,
|
||||
régularisationMethod,
|
||||
engine
|
||||
engine,
|
||||
régularisationMethod
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -253,8 +253,8 @@ export const reevaluateRéductionMoisParMois = (
|
|||
dottedName: RéductionDottedName,
|
||||
data: MonthState[],
|
||||
year: number,
|
||||
régularisationMethod: RégularisationMethod,
|
||||
engine: Engine<DottedName>
|
||||
engine: Engine<DottedName>,
|
||||
régularisationMethod?: RégularisationMethod
|
||||
): MonthState[] => {
|
||||
const totalRémunérationBrute = sumAll(
|
||||
data.map((monthData) => monthData.rémunérationBrute)
|
||||
|
@ -345,7 +345,7 @@ export const reevaluateRéductionMoisParMois = (
|
|||
engine
|
||||
)
|
||||
}
|
||||
} else if (régularisationMethod === 'annuelle') {
|
||||
} else {
|
||||
const date = getDateForContexte(monthIndex, year)
|
||||
réduction.value = getMonthlyRéduction(
|
||||
dottedName,
|
||||
|
@ -355,7 +355,10 @@ export const reevaluateRéductionMoisParMois = (
|
|||
engine
|
||||
)
|
||||
|
||||
if (monthIndex === data.length - 1) {
|
||||
if (
|
||||
régularisationMethod === 'annuelle' &&
|
||||
monthIndex === data.length - 1
|
||||
) {
|
||||
// La régularisation annuelle est la différence entre la réduction calculée
|
||||
// pour la rémunération annuelle (comparée au SMIC annuel) et la somme des réductions
|
||||
// déjà accordées.
|
||||
|
|
Loading…
Reference in New Issue