feat(lodeom): ajout de codes adaptés au barème
parent
41aadc327d
commit
061f0c4285
|
@ -301,6 +301,27 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
|
|||
)
|
||||
})
|
||||
|
||||
it('should display code in recap table based on scale', function () {
|
||||
cy.contains('Récapitulatif trimestriel').next().as('recapTable')
|
||||
|
||||
cy.get('@recapTable').should('include.text', 'code 462')
|
||||
cy.get('@recapTable').should('include.text', 'code 684')
|
||||
|
||||
cy.get('div[aria-label="Barème à appliquer"]')
|
||||
.contains('Barème de compétitivité renforcée')
|
||||
.click()
|
||||
|
||||
cy.get('@recapTable').should('include.text', 'code 463')
|
||||
cy.get('@recapTable').should('include.text', 'code 538')
|
||||
|
||||
cy.get('div[aria-label="Barème à appliquer"]')
|
||||
.contains("Barème d'innovation et croissance")
|
||||
.click()
|
||||
|
||||
cy.get('@recapTable').should('include.text', 'code 473')
|
||||
cy.get('@recapTable').should('include.text', 'code 685')
|
||||
})
|
||||
|
||||
it('should be RGAA compliant', function () {
|
||||
cy.contains('Exonération mensuelle').click()
|
||||
checkA11Y()
|
||||
|
|
|
@ -9,9 +9,16 @@ const barèmesPossibles = [
|
|||
'barème compétitivité renforcée',
|
||||
'barème innovation et croissance',
|
||||
]
|
||||
type Barème = (typeof barèmesPossibles)[number]
|
||||
|
||||
export const useBaremeLodeom = () => {
|
||||
export type Barème = (typeof barèmesPossibles)[number]
|
||||
|
||||
type ReturnType = {
|
||||
barèmesPossibles: Barème[]
|
||||
currentBarème?: Barème
|
||||
updateBarème: (barème: Barème) => void
|
||||
}
|
||||
|
||||
export const useBaremeLodeom = (): ReturnType => {
|
||||
const dottedName = 'salarié . cotisations . exonérations . lodeom . zone un'
|
||||
const engine = useEngine()
|
||||
const dispatch = useDispatch()
|
||||
|
|
|
@ -1457,8 +1457,12 @@ pages:
|
|||
caption: "Lodeom exemption month by month :"
|
||||
recap:
|
||||
code:
|
||||
"462": code 462(€)
|
||||
"684": code 684(€)
|
||||
"462": code 462
|
||||
"463": code 463
|
||||
"473": code 473
|
||||
"538": code 538
|
||||
"684": code 684
|
||||
"685": code 685
|
||||
shortname: Lodeom exemption
|
||||
tab:
|
||||
month: Monthly exemption
|
||||
|
|
|
@ -1550,8 +1550,12 @@ pages:
|
|||
caption: "Exonération Lodeom mois par mois :"
|
||||
recap:
|
||||
code:
|
||||
"462": code 462(€)
|
||||
"684": code 684(€)
|
||||
"462": code 462
|
||||
"463": code 463
|
||||
"473": code 473
|
||||
"538": code 538
|
||||
"684": code 684
|
||||
"685": code 685
|
||||
shortname: Éxonération Lodeom
|
||||
tab:
|
||||
month: Exonération mensuelle
|
||||
|
|
|
@ -7,6 +7,7 @@ import RéductionMoisParMois from '@/components/RéductionDeCotisations/Réducti
|
|||
import { SimulationGoals } from '@/components/Simulation'
|
||||
import { useEngine } from '@/components/utils/EngineContext'
|
||||
import useYear from '@/components/utils/useYear'
|
||||
import { Barème, useBaremeLodeom } from '@/hooks/useBaremeLodeom'
|
||||
import { situationSelector } from '@/store/selectors/simulationSelectors'
|
||||
import {
|
||||
getDataAfterOptionsChange,
|
||||
|
@ -40,6 +41,7 @@ export default function LodeomSimulationGoals({
|
|||
const year = useYear()
|
||||
const situation = useSelector(situationSelector) as SituationType
|
||||
const previousSituation = useRef(situation)
|
||||
const { currentBarème } = useBaremeLodeom()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const initializeLodeomMoisParMoisData = useCallback(() => {
|
||||
|
@ -99,6 +101,21 @@ export default function LodeomSimulationGoals({
|
|||
})
|
||||
}
|
||||
|
||||
const codesByBareme = {
|
||||
['barème compétitivité' as Barème]: {
|
||||
réduction: t('pages.simulateurs.lodeom.recap.code.462', 'code 462'),
|
||||
régularisation: t('pages.simulateurs.lodeom.recap.code.684', 'code 684'),
|
||||
},
|
||||
['barème compétitivité renforcée' as Barème]: {
|
||||
réduction: t('pages.simulateurs.lodeom.recap.code.463', 'code 463'),
|
||||
régularisation: t('pages.simulateurs.lodeom.recap.code.538', 'code 538'),
|
||||
},
|
||||
['barème innovation et croissance' as Barème]: {
|
||||
réduction: t('pages.simulateurs.lodeom.recap.code.473', 'code 473'),
|
||||
régularisation: t('pages.simulateurs.lodeom.recap.code.685', 'code 685'),
|
||||
},
|
||||
}
|
||||
|
||||
return (
|
||||
<SimulationGoals toggles={toggles} legend={legend}>
|
||||
{monthByMonth ? (
|
||||
|
@ -114,14 +131,12 @@ export default function LodeomSimulationGoals({
|
|||
warnings={<Warnings />}
|
||||
warningCondition={`${lodeomDottedName} = 0`}
|
||||
warningTooltip={<WarningSalaireTrans />}
|
||||
codeRéduction={t(
|
||||
'pages.simulateurs.lodeom.recap.code.462',
|
||||
'code 462(€)'
|
||||
)}
|
||||
codeRégularisation={t(
|
||||
'pages.simulateurs.lodeom.recap.code.684',
|
||||
'code 684(€)'
|
||||
)}
|
||||
codeRéduction={
|
||||
currentBarème && codesByBareme[currentBarème].réduction
|
||||
}
|
||||
codeRégularisation={
|
||||
currentBarème && codesByBareme[currentBarème].régularisation
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<RéductionBasique
|
||||
|
|
Loading…
Reference in New Issue