Remove exonération-covid
parent
8e3faa616d
commit
53b28a1858
|
@ -1,179 +0,0 @@
|
|||
import { DottedName as ExoCovidDottedNames } from 'exoneration-covid'
|
||||
import { PublicodesExpression } from 'publicodes'
|
||||
import { useCallback, useEffect } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import {
|
||||
createSearchParams,
|
||||
useLocation,
|
||||
useSearchParams,
|
||||
} from 'react-router-dom'
|
||||
|
||||
import { TrackPage } from '@/components/ATInternetTracking'
|
||||
import { ExplicableRule } from '@/components/conversation/Explicable'
|
||||
import RuleInput from '@/components/conversation/RuleInput'
|
||||
import {
|
||||
SituationStateProvider,
|
||||
useSynchronizedSituationState,
|
||||
} from '@/components/utils/SituationContext'
|
||||
import { Button } from '@/design-system/buttons'
|
||||
import { Grid, Spacing } from '@/design-system/layout'
|
||||
import { H3 } from '@/design-system/typography/heading'
|
||||
|
||||
import { useExoCovidEngine } from '.'
|
||||
import { FormulaireS1S1Bis } from './FormulaireS1S1Bis'
|
||||
import { FormulaireS2 } from './FormulaireS2'
|
||||
|
||||
const rootDottedNames = [
|
||||
'secteur',
|
||||
"début d'activité",
|
||||
"lieu d'exercice",
|
||||
] as const
|
||||
|
||||
export const ExonérationCovid = () => {
|
||||
const location = useLocation()
|
||||
const [searchParams] = useSearchParams()
|
||||
const params = Object.fromEntries(searchParams.entries()) as {
|
||||
[key in (typeof rootDottedNames)[number]]?: string
|
||||
}
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0)
|
||||
}, [location])
|
||||
|
||||
const engine = useExoCovidEngine()
|
||||
const situationState = useSynchronizedSituationState(engine, params)
|
||||
const { situation, setSituation } = situationState
|
||||
|
||||
const updateSituation = useCallback(
|
||||
(name: ExoCovidDottedNames, value: PublicodesExpression | undefined) => {
|
||||
setSituation({ ...situation, [name]: value })
|
||||
},
|
||||
[setSituation, situation]
|
||||
)
|
||||
|
||||
const setStep1Situation = useCallback(() => {
|
||||
const step1Situation = Object.fromEntries(
|
||||
Object.entries(situation).filter(([dotName]) =>
|
||||
(rootDottedNames as readonly string[]).includes(dotName)
|
||||
)
|
||||
)
|
||||
setSituation(step1Situation)
|
||||
}, [setSituation, situation])
|
||||
|
||||
const step2 = rootDottedNames.every((names) => params[names])
|
||||
|
||||
return (
|
||||
<SituationStateProvider value={situationState}>
|
||||
{step2 ? (
|
||||
engine.evaluate('secteur').nodeValue !== 'S2' ? (
|
||||
<>
|
||||
<TrackPage name="S1_S1bis" />
|
||||
<FormulaireS1S1Bis onChange={updateSituation} />
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<TrackPage name="S2" />
|
||||
|
||||
<FormulaireS2 onChange={updateSituation} />
|
||||
</>
|
||||
)
|
||||
) : (
|
||||
<>
|
||||
<TrackPage name="accueil" />
|
||||
<Grid item xs={12}>
|
||||
<H3 as="h2">
|
||||
{engine.getRule('secteur').rawNode.question}
|
||||
<ExplicableRule
|
||||
dottedName="secteur"
|
||||
aria-label={t('En savoir plus')}
|
||||
light
|
||||
/>
|
||||
</H3>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} sm={8}>
|
||||
<RuleInput
|
||||
dottedName={'secteur'}
|
||||
onChange={(value) => updateSituation('secteur', value)}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<H3 as="h2">
|
||||
{engine.getRule("début d'activité").rawNode.question}
|
||||
</H3>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12} sm={6}>
|
||||
<RuleInput
|
||||
dottedName="début d'activité"
|
||||
onChange={(value) => updateSituation("début d'activité", value)}
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<H3 as="h2">
|
||||
{engine.getRule("lieu d'exercice").rawNode.question}
|
||||
</H3>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<RuleInput
|
||||
dottedName="lieu d'exercice"
|
||||
onChange={(value) => updateSituation("lieu d'exercice", value)}
|
||||
/>
|
||||
</Grid>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Spacing lg />
|
||||
|
||||
<Grid container css={step2 ? '' : `justify-content: end`}>
|
||||
<Grid item xs={6} sm="auto">
|
||||
{step2 ? (
|
||||
<Button
|
||||
size="MD"
|
||||
to={{
|
||||
pathname: location.pathname,
|
||||
search: '',
|
||||
}}
|
||||
onClick={setStep1Situation}
|
||||
aria-label={t("Précédent, revenir à l'étape précédente")}
|
||||
>
|
||||
<span aria-hidden>←</span> <Trans>Précédent</Trans>
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
size="MD"
|
||||
isDisabled={!rootDottedNames.every((names) => situation[names])}
|
||||
{...(rootDottedNames.every((names) => situation[names])
|
||||
? {
|
||||
to: {
|
||||
pathname: location.pathname,
|
||||
search: createSearchParams(
|
||||
Object.fromEntries(
|
||||
rootDottedNames
|
||||
.filter((key) => situation[key])
|
||||
.map((key) => [
|
||||
key,
|
||||
situation[key]?.toString() ?? '',
|
||||
])
|
||||
)
|
||||
).toString(),
|
||||
},
|
||||
}
|
||||
: null)}
|
||||
aria-label={t("Suivant, passer à l'étape suivante")}
|
||||
>
|
||||
<Trans>Suivant</Trans> <span aria-hidden>→</span>
|
||||
</Button>
|
||||
)}
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Spacing lg />
|
||||
</SituationStateProvider>
|
||||
)
|
||||
}
|
|
@ -1,496 +0,0 @@
|
|||
import { DottedName as ExoCovidDottedNames } from 'exoneration-covid'
|
||||
import Engine, { EvaluatedNode, PublicodesExpression } from 'publicodes'
|
||||
import { Key, useRef } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
||||
import Value from '@/components/EngineValue'
|
||||
import { ExplicableRule } from '@/components/conversation/Explicable'
|
||||
import { Situation } from '@/components/utils/SituationContext'
|
||||
import { Grid, Spacing } from '@/design-system/layout'
|
||||
import { H3 } from '@/design-system/typography/heading'
|
||||
import { Li, Ul } from '@/design-system/typography/list'
|
||||
import { Body } from '@/design-system/typography/paragraphs'
|
||||
|
||||
import { useExoCovidEngine, useExoCovidSituationState } from '.'
|
||||
import { Bold, GridTotal, Italic, Recap, RecapExpert, Total } from './Recap'
|
||||
import { Row, Table, Tbody, Th, Thead, Tr } from './Table'
|
||||
|
||||
const getTotalByMonth = (
|
||||
engine: Engine<ExoCovidDottedNames>,
|
||||
situation: Situation<ExoCovidDottedNames>
|
||||
) => {
|
||||
const ret = Object.fromEntries(
|
||||
Object.entries(situation)
|
||||
.filter(([monthDottedName]) => monthDottedName.startsWith('mois . '))
|
||||
.map(([monthDottedName]) => {
|
||||
const parsedRules = engine.getParsedRules()
|
||||
|
||||
const exoSelected = (
|
||||
engine.evaluate(monthDottedName) as EvaluatedNode<string>
|
||||
).nodeValue
|
||||
|
||||
const exoApplicable =
|
||||
typeof exoSelected === 'string' &&
|
||||
monthDottedName + ' . ' + exoSelected in parsedRules &&
|
||||
engine.evaluate(monthDottedName + ' . ' + exoSelected).nodeValue
|
||||
|
||||
if (
|
||||
!exoApplicable ||
|
||||
!(exoSelected + ' . montant mensuel' in parsedRules)
|
||||
) {
|
||||
return [monthDottedName, undefined]
|
||||
}
|
||||
|
||||
const value = engine.evaluate(
|
||||
exoSelected + ' . montant mensuel'
|
||||
) as EvaluatedNode<number>
|
||||
|
||||
return [monthDottedName, value]
|
||||
})
|
||||
)
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
interface Props {
|
||||
onChange?: (
|
||||
dottedName: ExoCovidDottedNames,
|
||||
value: PublicodesExpression
|
||||
) => void
|
||||
}
|
||||
|
||||
export const FormulaireS1S1Bis = ({ onChange }: Props) => {
|
||||
const engine = useExoCovidEngine()
|
||||
const { t } = useTranslation()
|
||||
const { situation = {} } = useExoCovidSituationState()
|
||||
|
||||
const selectedKey = useRef<{ [key: string]: Key | undefined }>({})
|
||||
|
||||
const totalByMonth = getTotalByMonth(engine, situation) ?? {}
|
||||
|
||||
if (!engine.evaluate('mois').nodeValue) {
|
||||
return null
|
||||
}
|
||||
|
||||
const months = Object.entries(engine.getParsedRules()).filter(([name]) =>
|
||||
name.match(/^mois \. [^.]*$/)
|
||||
)
|
||||
|
||||
const formatZeroToEmpty = (str?: string) =>
|
||||
typeof str === 'undefined' || str === '0' ? t('vide') : str
|
||||
|
||||
const formatYesNo = (str?: string | null) =>
|
||||
str?.startsWith('O') ? t('oui') : t('non')
|
||||
|
||||
let isAnyRowShowed = false
|
||||
|
||||
return (
|
||||
<>
|
||||
<H3 as="h2">
|
||||
{engine.getRule('secteur . S1 ou S1bis').rawNode.question}
|
||||
<ExplicableRule
|
||||
aria-label={t('En savoir plus')}
|
||||
dottedName="secteur . S1 ou S1bis"
|
||||
light
|
||||
bigPopover
|
||||
/>
|
||||
</H3>
|
||||
<Table>
|
||||
<caption className="sr-only">
|
||||
<Trans>
|
||||
Tableau affichant pour chaque mois de la période précédemment
|
||||
sélectionnée le montant de réductions pour la situation
|
||||
sélectionnée.
|
||||
</Trans>
|
||||
</caption>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Trans>
|
||||
<Th>Mois</Th>
|
||||
<Th>Situation liée à la crise sanitaire</Th>
|
||||
<Th>Montant de la réduction</Th>
|
||||
</Trans>
|
||||
</Tr>
|
||||
</Thead>
|
||||
|
||||
<Tbody>
|
||||
{months.map(([dotName, node], i) => {
|
||||
const showRow = engine.evaluate(dotName).nodeValue !== null
|
||||
|
||||
if (!showRow) {
|
||||
if (isAnyRowShowed) {
|
||||
return (
|
||||
<Row
|
||||
{...months[i][1]}
|
||||
actualMonth={dotName}
|
||||
dottedNames={[]}
|
||||
key={months[i][0]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
isAnyRowShowed = true
|
||||
|
||||
return (
|
||||
<Row
|
||||
actualMonth={dotName}
|
||||
dottedNames={['LFSS 600', 'LFSS 300', 'LFR1']}
|
||||
title={node.title}
|
||||
total={totalByMonth[dotName]}
|
||||
defaultSelectedKey={selectedKey.current[dotName]}
|
||||
onSelectionChange={(key) => {
|
||||
selectedKey.current[dotName] = key
|
||||
const val = (key as string).replace(/\.\d+$/, '')
|
||||
onChange?.(dotName as ExoCovidDottedNames, `'${val}'`)
|
||||
}}
|
||||
key={dotName}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
</Tbody>
|
||||
</Table>
|
||||
|
||||
<Spacing lg />
|
||||
|
||||
<Recap>
|
||||
<Grid container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Bold>
|
||||
Dispositif loi de financement de la sécurité sociale (LFSS) pour
|
||||
2021
|
||||
</Bold>
|
||||
|
||||
<Italic>
|
||||
Mesure d’interdiction d’accueil du public ou baisse d’au moins
|
||||
50% (ou 65% à compter de décembre 2021) du chiffre d’affaires
|
||||
</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFSS 600"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Italic>Baisse entre 30% et 64% du chiffre d'affaires</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFSS 300"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<hr />
|
||||
|
||||
<Grid container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Bold>
|
||||
Dispositif loi de finances rectificative (LFR1) pour 2021
|
||||
</Bold>
|
||||
|
||||
<Italic>Éligibilité aux mois de mars, avril ou mai 2021</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFR1"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<hr />
|
||||
|
||||
<GridTotal container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Bold>
|
||||
Montant total de l'exonération Covid applicable aux cotisations
|
||||
2021
|
||||
</Bold>
|
||||
|
||||
<Italic>
|
||||
L'exonération correspondante s'impute sur les cotisations et
|
||||
contributions sociale définitives 2021, hors CFP (contribution à
|
||||
la formation professionnelle) et CURPS (contribution aux unions
|
||||
régionales des professionnels de santé), dans la limite des
|
||||
cotisations restant dues à l'Urssaf.
|
||||
</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="montant total"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</GridTotal>
|
||||
</Recap>
|
||||
|
||||
<Grid container>
|
||||
<Grid item md={6}>
|
||||
<Trans>
|
||||
<H3 as="h2">Résumé</H3>
|
||||
</Trans>
|
||||
|
||||
<RecapExpert>
|
||||
<Li>
|
||||
<Trans>
|
||||
Secteur d'activité dont relève l'activité principale :{' '}
|
||||
</Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate('secteur').nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>Activité exercée en </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("lieu d'exercice").nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>Début d'activité : </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("début d'activité").nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>
|
||||
Nombres de mois pour lesquels vous remplissez les conditions
|
||||
d'éligibilité
|
||||
</Trans>
|
||||
<Ul>
|
||||
<Li>
|
||||
LFSS :{' '}
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFSS . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
LFR1 :{' '}
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFR1 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>
|
||||
</Li>
|
||||
</Ul>
|
||||
</Li>
|
||||
</RecapExpert>
|
||||
</Grid>
|
||||
|
||||
<Grid item md={6}>
|
||||
<Trans>
|
||||
<H3>Résumé pour les tiers-déclarants</H3>
|
||||
<Body>
|
||||
Reportez les éléments entre parenthèses dans la déclaration EDI de
|
||||
votre client
|
||||
</Body>
|
||||
</Trans>
|
||||
|
||||
<RecapExpert>
|
||||
<Li>
|
||||
<Trans>
|
||||
Secteur d'activité dont relève l'activité principale :{' '}
|
||||
</Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate('secteur').nodeValue as string}
|
||||
</Bold>
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate('code . secteur').nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Activité exercée en </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("lieu d'exercice").nodeValue as string}
|
||||
</Bold>
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate("code . lieu d'exercice").nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Début d'activité : </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("début d'activité").nodeValue as string}
|
||||
</Bold>
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate("code . début d'activité").nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Eligibilité LFSS : </Trans>
|
||||
<Bold as="span">
|
||||
{formatYesNo(
|
||||
engine.evaluate('code . LFSS').nodeValue as string
|
||||
)}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{
|
||||
engine
|
||||
.evaluate('code . LFSS')
|
||||
.nodeValue?.toString()
|
||||
.split(';')[0]
|
||||
}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Eligibilité LFR : </Trans>
|
||||
<Bold as="span">
|
||||
{formatYesNo(
|
||||
engine.evaluate('code . LFR1').nodeValue as string
|
||||
)}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{
|
||||
(engine.evaluate('code . LFR1').nodeValue as string)?.split(
|
||||
';'
|
||||
)[0]
|
||||
}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFSS 600 : </Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFSS 600 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{formatZeroToEmpty(
|
||||
engine
|
||||
.evaluate('LFSS 600 . mois éligibles')
|
||||
.nodeValue?.toString()
|
||||
)}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFSS 300 : </Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFSS 300 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{formatZeroToEmpty(
|
||||
engine
|
||||
.evaluate('LFSS 300 . mois éligibles')
|
||||
.nodeValue?.toString()
|
||||
)}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFR : </Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFR1 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{formatZeroToEmpty(
|
||||
engine.evaluate('LFR1 . mois éligibles').nodeValue?.toString()
|
||||
)}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
</RecapExpert>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -1,369 +0,0 @@
|
|||
import { DottedName as ExoCovidDottedNames } from 'exoneration-covid'
|
||||
import { Evaluation, PublicodesExpression } from 'publicodes'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import styled from 'styled-components'
|
||||
|
||||
import Value from '@/components/EngineValue'
|
||||
import { Radio, ToggleGroup } from '@/design-system/field'
|
||||
import { Grid, Spacing } from '@/design-system/layout'
|
||||
import { H3 } from '@/design-system/typography/heading'
|
||||
import { Li } from '@/design-system/typography/list'
|
||||
import { Body } from '@/design-system/typography/paragraphs'
|
||||
|
||||
import { useExoCovidEngine } from '.'
|
||||
import { Bold, GridTotal, Italic, Recap, RecapExpert, Total } from './Recap'
|
||||
|
||||
const Info = styled(Body)`
|
||||
background-color: ${({ theme }) => theme.colors.extended.info['100']};
|
||||
padding: 1rem;
|
||||
border: 2px solid ${({ theme }) => theme.colors.extended.info['300']};
|
||||
border-radius: 0.35rem;
|
||||
color: ${({ theme }) => theme.colors.bases.tertiary[700]};
|
||||
`
|
||||
|
||||
export const FormulaireS2 = ({
|
||||
onChange,
|
||||
}: {
|
||||
onChange?: (
|
||||
dottedName: ExoCovidDottedNames,
|
||||
value: PublicodesExpression
|
||||
) => void
|
||||
}) => {
|
||||
const engine = useExoCovidEngine()
|
||||
const { t } = useTranslation()
|
||||
|
||||
const monthNames = [
|
||||
t('janvier'),
|
||||
t('février'),
|
||||
t('mars'),
|
||||
t('avril'),
|
||||
t('mai'),
|
||||
t('juin'),
|
||||
t('juillet'),
|
||||
t('août'),
|
||||
t('septembre'),
|
||||
t('octobre'),
|
||||
t('novembre'),
|
||||
t('décembre'),
|
||||
]
|
||||
|
||||
const exoS2Applicable = engine.evaluate('exonération S2').nodeValue !== null
|
||||
|
||||
const [firstMonth, firstYear] = (
|
||||
(engine.evaluate('exonération S2 . mois éligibles . premier mois')
|
||||
.nodeValue as Evaluation<string>) || ''
|
||||
)
|
||||
.slice(3)
|
||||
.split('/')
|
||||
.map((x) => parseInt(x))
|
||||
|
||||
const [lastMonth, lastYear] = (
|
||||
(engine.evaluate('exonération S2 . mois éligibles . dernier mois')
|
||||
.nodeValue as Evaluation<string>) || ''
|
||||
)
|
||||
.slice(3)
|
||||
.split('/')
|
||||
.map((x) => parseInt(x))
|
||||
|
||||
const monthCount =
|
||||
(engine.evaluate('exonération S2 . mois éligibles . plafond')
|
||||
.nodeValue as Evaluation<number>) ?? 0
|
||||
|
||||
const formatZeroToEmpty = (str?: string) =>
|
||||
typeof str === 'undefined' || str === '0' ? t('vide') : str
|
||||
|
||||
const formatYesNo = (str?: string | null) =>
|
||||
str?.startsWith('O') ? t('oui') : t('non')
|
||||
|
||||
return (
|
||||
<>
|
||||
{exoS2Applicable ? (
|
||||
<>
|
||||
<Trans>
|
||||
{/* @ts-ignore ignore ReactI18NextChildren error */}
|
||||
<H3 as="h2">
|
||||
Entre début {{ firstMonth: monthNames[firstMonth - 1] }}{' '}
|
||||
{{ firstYear: firstYear.toString() }} et fin{' '}
|
||||
{{ lastMonth: monthNames[lastMonth - 1] }}{' '}
|
||||
{{ lastYear: lastYear.toString() }}, combien de mois avez-vous été
|
||||
impacté par la crise sanitaire ?
|
||||
</H3>
|
||||
<Body>
|
||||
Précisez le nombre de mois durant lesquels vous avez fait l’objet
|
||||
d’une mesure d’interdiction affectant de manière prépondérante la
|
||||
poursuite de votre activité.
|
||||
</Body>
|
||||
</Trans>
|
||||
|
||||
<ToggleGroup
|
||||
onChange={(valeur) => {
|
||||
onChange?.('exonération S2 . mois éligibles', {
|
||||
valeur,
|
||||
unité: 'mois',
|
||||
})
|
||||
}}
|
||||
>
|
||||
{new Array(monthCount + 1).fill(null).map((_, i) => (
|
||||
<Radio hideRadio key={i} value={`${i}`}>
|
||||
{i}
|
||||
</Radio>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
|
||||
<Spacing xl />
|
||||
|
||||
<Recap>
|
||||
<Grid container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Bold>
|
||||
Dispositif loi de financement de la sécurité sociale (LFSS)
|
||||
pour 2021
|
||||
</Bold>
|
||||
|
||||
<Italic>
|
||||
Mesure d’interdiction affectant de manière prépondérante la
|
||||
poursuite de votre activité
|
||||
</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="exonération S2"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<hr />
|
||||
|
||||
<GridTotal container>
|
||||
<Grid item xs>
|
||||
<Trans>
|
||||
<Bold>
|
||||
Montant total de l'exonération Covid applicable aux
|
||||
cotisations 2021
|
||||
</Bold>
|
||||
|
||||
<Italic>
|
||||
L'exonération correspondante s'impute sur les cotisations et
|
||||
contributions sociale définitives 2021, hors CFP
|
||||
(contribution à la formation professionnelle) et CURPS
|
||||
(contribution aux unions régionales des professionnels de
|
||||
santé), dans la limite des cotisations restant dues à
|
||||
l'Urssaf.
|
||||
</Italic>
|
||||
</Trans>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
item
|
||||
xs="auto"
|
||||
css={`
|
||||
align-self: end;
|
||||
`}
|
||||
>
|
||||
<Total>
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="montant total"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Total>
|
||||
</Grid>
|
||||
</GridTotal>
|
||||
</Recap>
|
||||
</>
|
||||
) : (
|
||||
<Trans>
|
||||
<Info>
|
||||
Vous n'êtes pas concerné par l'exonération de cotisations Covid pour
|
||||
les indépendants.
|
||||
</Info>
|
||||
</Trans>
|
||||
)}
|
||||
|
||||
<Grid container>
|
||||
<Grid item md={6}>
|
||||
<Trans>
|
||||
<H3 as="h2">Résumé</H3>
|
||||
</Trans>
|
||||
|
||||
<RecapExpert>
|
||||
<Li>
|
||||
<Trans>
|
||||
Secteur d'activité dont relève l'activité principale :{' '}
|
||||
</Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate('secteur').nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>Activité exercée en </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("lieu d'exercice").nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>Début d'activité : </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("début d'activité").nodeValue as string}
|
||||
</Bold>
|
||||
</Li>
|
||||
<Li>
|
||||
<Trans>
|
||||
Nombres de mois pour lesquels vous remplissez les conditions
|
||||
d'éligibilité :{' '}
|
||||
</Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="exonération S2 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>
|
||||
</Li>
|
||||
</RecapExpert>
|
||||
</Grid>
|
||||
|
||||
<Grid item md={6}>
|
||||
<Trans>
|
||||
<H3 as="h2">Résumé pour les tiers-déclarants</H3>
|
||||
<Body>
|
||||
Reportez les éléments entre parenthèses dans la déclaration EDI de
|
||||
votre client
|
||||
</Body>
|
||||
</Trans>
|
||||
|
||||
{engine.evaluate('code . secteur').nodeValue as string}
|
||||
<RecapExpert>
|
||||
<Li>
|
||||
<Trans>
|
||||
Secteur d'activité dont relève l'activité principale :{' '}
|
||||
</Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate('secteur').nodeValue as string}
|
||||
</Bold>{' '}
|
||||
(<Bold as="span"></Bold>)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Activité exercée en </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("lieu d'exercice").nodeValue as string}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate("code . lieu d'exercice").nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Début d'activité : </Trans>
|
||||
<Bold as="span">
|
||||
{engine.evaluate("début d'activité").nodeValue as string}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate("code . début d'activité").nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Eligibilité LFSS : </Trans>
|
||||
<Bold as="span">
|
||||
{formatYesNo(
|
||||
engine.evaluate('code . LFSS').nodeValue as Evaluation<string>
|
||||
)}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{
|
||||
engine
|
||||
.evaluate('code . LFSS')
|
||||
.nodeValue?.toString()
|
||||
.split(';')[0]
|
||||
}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Eligibilité LFR : </Trans>
|
||||
<Bold as="span">
|
||||
{formatYesNo(
|
||||
engine.evaluate('code . LFR1').nodeValue?.toString()
|
||||
)}
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{engine.evaluate('code . LFR1').nodeValue as string}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFSS 600 : </Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="exonération S2 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{formatZeroToEmpty(
|
||||
engine
|
||||
.evaluate('exonération S2 . mois éligibles')
|
||||
.nodeValue?.toString()
|
||||
)}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFSS 300 : </Trans>
|
||||
<Bold as="span">0 mois ({t('vide')})</Bold>
|
||||
</Li>
|
||||
|
||||
<Li>
|
||||
<Trans>Nombre de mois LFR : </Trans>
|
||||
<Bold as="span">
|
||||
<Value
|
||||
engine={engine}
|
||||
expression="LFR1 . mois éligibles"
|
||||
linkToRule={false}
|
||||
precision={0}
|
||||
/>
|
||||
</Bold>{' '}
|
||||
(
|
||||
<Bold as="span">
|
||||
{formatZeroToEmpty(
|
||||
engine.evaluate('LFR1 . mois éligibles').nodeValue?.toString()
|
||||
)}
|
||||
</Bold>
|
||||
)
|
||||
</Li>
|
||||
</RecapExpert>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
import styled, { css } from 'styled-components'
|
||||
|
||||
import { Grid } from '@/design-system/layout'
|
||||
import { Ul } from '@/design-system/typography/list'
|
||||
import { baseParagraphStyle } from '@/design-system/typography/paragraphs'
|
||||
|
||||
export const Recap = styled.div`
|
||||
background: ${({ theme }) => {
|
||||
const colorPalette = theme.colors.bases.primary
|
||||
|
||||
return css`linear-gradient(60deg, ${colorPalette[800]} 0%, ${colorPalette[600]} 100%);`
|
||||
}};
|
||||
color: inherit;
|
||||
border-radius: 0.25rem;
|
||||
padding: 1.5rem;
|
||||
${baseParagraphStyle}
|
||||
line-height: 1.5rem;
|
||||
color: white;
|
||||
|
||||
hr {
|
||||
border-color: ${({ theme }) => theme.colors.bases.primary[500]};
|
||||
margin-bottom: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
`
|
||||
|
||||
export const Bold = styled.div`
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.5rem;
|
||||
`
|
||||
|
||||
export const Italic = styled.div`
|
||||
font-style: italic;
|
||||
margin-bottom: 0.5rem;
|
||||
`
|
||||
|
||||
export const GridTotal = styled(Grid)`
|
||||
${Bold} {
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
`
|
||||
|
||||
export const Total = styled.div`
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 0.5rem;
|
||||
padding-left: 1rem;
|
||||
`
|
||||
|
||||
export const RecapExpert = styled(Ul)`
|
||||
border-radius: 0.25rem;
|
||||
padding: 0 1.5rem;
|
||||
${baseParagraphStyle}
|
||||
line-height: 1.5rem;
|
||||
`
|
|
@ -1,233 +0,0 @@
|
|||
import { DottedName as ExoCovidDottedNames } from 'exoneration-covid'
|
||||
import { EvaluatedNode, formatValue } from 'publicodes'
|
||||
import { Key } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import styled, { css } from 'styled-components'
|
||||
|
||||
import { Item, Select } from '@/design-system/field/Select'
|
||||
import { baseParagraphStyle } from '@/design-system/typography/paragraphs'
|
||||
import { getMeta } from '@/utils'
|
||||
|
||||
import { useExoCovidEngine } from '.'
|
||||
|
||||
export const Th = styled.th<{ alignSelf?: string }>`
|
||||
flex: 2;
|
||||
word-break: break-word;
|
||||
${({ alignSelf }) =>
|
||||
alignSelf
|
||||
? css`
|
||||
align-self: ${alignSelf};
|
||||
`
|
||||
: ''}
|
||||
`
|
||||
|
||||
const Td = styled.td`
|
||||
flex: 2;
|
||||
word-break: break-word;
|
||||
margin: 0.5rem 0;
|
||||
`
|
||||
|
||||
const ThRow = styled.th`
|
||||
flex: 2;
|
||||
word-break: break-word;
|
||||
margin: 0.5rem 0;
|
||||
|
||||
&:first-child {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
`
|
||||
|
||||
export const Tr = styled.tr`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
flex: 1;
|
||||
word-break: break-word;
|
||||
padding: 1rem;
|
||||
|
||||
&:first-child {
|
||||
@media (max-width: ${({ theme }) => theme.breakpointsWidth.sm}) {
|
||||
border-radius: 0.35rem 0.35rem 0 0;
|
||||
}
|
||||
}
|
||||
&:last-child {
|
||||
border-radius: 0 0 0.35rem 0.35rem;
|
||||
}
|
||||
|
||||
${Td}:last-child {
|
||||
text-align: right;
|
||||
}
|
||||
${Td}:first-child, ${Td}:last-child, ${Th}:first-child, ${Th}:last-child {
|
||||
flex: 1;
|
||||
}
|
||||
@media (min-width: ${({ theme }) => theme.breakpointsWidth.sm}) {
|
||||
flex-direction: initial;
|
||||
align-items: center;
|
||||
}
|
||||
`
|
||||
|
||||
export const Thead = styled.thead`
|
||||
background: ${({ theme }) => theme.colors.bases.primary[200]};
|
||||
color: ${({ theme }) => theme.colors.bases.primary[700]};
|
||||
|
||||
&:first-child {
|
||||
border-radius: 0.35rem 0.35rem 0 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@media (max-width: ${({ theme }) => theme.breakpointsWidth.sm}) {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
|
||||
export const Tbody = styled.tbody`
|
||||
${Tr}:nth-child(odd) {
|
||||
background: ${({ theme }) =>
|
||||
theme.darkMode ? 'transparent' : theme.colors.extended.grey[200]};
|
||||
}
|
||||
`
|
||||
|
||||
export const Table = styled.table`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: left;
|
||||
border: 1px solid ${({ theme }) => theme.colors.extended.grey[400]};
|
||||
border-radius: 0.35rem;
|
||||
${baseParagraphStyle}
|
||||
font-weight: bold;
|
||||
`
|
||||
|
||||
const Empty = styled.div`
|
||||
display: inline-block;
|
||||
background: ${({ theme }) => theme.colors.extended.grey[300]};
|
||||
padding: 0.25rem 1rem;
|
||||
border-radius: 0.25rem;
|
||||
font-weight: 500;
|
||||
font-size: 0.9rem;
|
||||
`
|
||||
|
||||
type RowProps = {
|
||||
dottedNames: ExoCovidDottedNames[]
|
||||
actualMonth: string
|
||||
title?: string
|
||||
total?: EvaluatedNode<number>
|
||||
onSelectionChange?: (key: Key) => void
|
||||
defaultSelectedKey?: Key
|
||||
}
|
||||
|
||||
export const Row = ({
|
||||
title,
|
||||
total,
|
||||
dottedNames,
|
||||
actualMonth,
|
||||
defaultSelectedKey,
|
||||
onSelectionChange,
|
||||
}: RowProps) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const engine = useExoCovidEngine()
|
||||
|
||||
const choices = {
|
||||
non: [t('Aucun (0 €)')],
|
||||
'LFSS 600': [
|
||||
t("Interdiction d'accueil du public (600 €)"),
|
||||
t("Baisse d'au moins 50% du chiffre d'affaires mensuel (600 €)"),
|
||||
],
|
||||
'LFSS 600 65%': [
|
||||
t("Interdiction d'accueil du public (600 €)"),
|
||||
t("Baisse d'au moins 65% du chiffre d'affaires mensuel (600 €)"),
|
||||
],
|
||||
'LFSS 300': [
|
||||
t("Baisse entre 30% et 64% du chiffre d'affaires mensuel (300 €)"),
|
||||
],
|
||||
LFR1: [t('Eligibilité aux mois de mars, avril ou mai 2021 (250 €)')],
|
||||
}
|
||||
|
||||
const items = dottedNames
|
||||
.map((rule) => engine.getRule(rule))
|
||||
.filter(
|
||||
(node) =>
|
||||
node.dottedName &&
|
||||
actualMonth + ' . ' + node.dottedName in engine.getParsedRules() &&
|
||||
engine.evaluate(actualMonth + ' . ' + node.dottedName).nodeValue !==
|
||||
null &&
|
||||
(node.dottedName + ' applicable' in engine.getParsedRules()
|
||||
? engine.evaluate(node.dottedName + ' applicable').nodeValue
|
||||
: true)
|
||||
)
|
||||
.flatMap((node) => {
|
||||
const name = (actualMonth +
|
||||
' . ' +
|
||||
node.dottedName) as ExoCovidDottedNames
|
||||
const rawNode = engine.getRule(name).rawNode
|
||||
|
||||
type Meta = { "baisse d'au moins"?: string }
|
||||
const percent = getMeta<Meta>(rawNode, {})?.["baisse d'au moins"]
|
||||
|
||||
const choice = (node.dottedName +
|
||||
(percent ? ' ' + percent : '')) as keyof typeof choices
|
||||
|
||||
const lieu = engine.evaluate("lieu d'exercice").nodeValue
|
||||
|
||||
return choices[choice]
|
||||
.filter((_, i) => {
|
||||
const hideChoice1 = !(
|
||||
i === 1 &&
|
||||
choice.startsWith('LFSS 600') &&
|
||||
((lieu === 'métropole' &&
|
||||
['mois . juin 2021', 'mois . juillet 2021'].includes(
|
||||
actualMonth
|
||||
)) ||
|
||||
(lieu === 'outre-mer' &&
|
||||
[
|
||||
'mois . juin 2021',
|
||||
'mois . juillet 2021',
|
||||
'mois . octobre 2021',
|
||||
'mois . novembre 2021',
|
||||
].includes(actualMonth)))
|
||||
)
|
||||
|
||||
return hideChoice1
|
||||
})
|
||||
.map((text, i) => ({
|
||||
key: node.dottedName + `.${i}`,
|
||||
text,
|
||||
}))
|
||||
})
|
||||
.filter(<T,>(x: T | null): x is T => Boolean(x))
|
||||
|
||||
if (items.length > 0) {
|
||||
items.unshift({ key: 'non', text: choices.non[0] })
|
||||
}
|
||||
|
||||
return (
|
||||
<Tr>
|
||||
<ThRow>{title}</ThRow>
|
||||
<Td>
|
||||
{items.length > 0 ? (
|
||||
<Select
|
||||
onSelectionChange={onSelectionChange}
|
||||
defaultSelectedKey={defaultSelectedKey}
|
||||
label={t('Situation liée à la crise sanitaire')}
|
||||
>
|
||||
{items.map(({ key, text }) => (
|
||||
<Item key={key} textValue={text}>
|
||||
{text}
|
||||
</Item>
|
||||
))}
|
||||
</Select>
|
||||
) : (
|
||||
<Empty>
|
||||
<Trans>Mois non concerné</Trans>
|
||||
</Empty>
|
||||
)}
|
||||
</Td>
|
||||
<Td>
|
||||
{(items.length > 0 &&
|
||||
typeof total?.nodeValue === 'number' &&
|
||||
(formatValue(total) as string)) ||
|
||||
'-'}
|
||||
</Td>
|
||||
</Tr>
|
||||
)
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
import ExonérationCovid from '.'
|
||||
import { config } from '../configs/config'
|
||||
import { SimulatorsDataParams } from '../configs/types'
|
||||
|
||||
export function exonérationCovidConfig({ t, sitePaths }: SimulatorsDataParams) {
|
||||
return config({
|
||||
id: 'exonération-covid',
|
||||
icône: '😷',
|
||||
tracking: 'exoneration_covid',
|
||||
iframePath: 'exoneration-covid',
|
||||
pathId: 'simulateurs.exonération-covid',
|
||||
meta: {
|
||||
title: t(
|
||||
'pages.simulateurs.exonération-covid.meta.title',
|
||||
'Exonération de cotisations covid'
|
||||
),
|
||||
description: t(
|
||||
'pages.simulateurs.exonération-covid.meta.description',
|
||||
'Déterminez les éléments à déclarer pour bénéficier de l’exonération Covid et obtenir les codes « norme EDI »'
|
||||
),
|
||||
},
|
||||
shortName: t(
|
||||
'pages.simulateurs.exonération-covid.shortName',
|
||||
'Simulateur d’exonération COVID'
|
||||
),
|
||||
title: t(
|
||||
'pages.simulateurs.exonération-covid.title',
|
||||
'Simulateur d’exonération de cotisations Covid pour indépendant'
|
||||
),
|
||||
nextSteps: ['déclaration-charges-sociales-indépendant'],
|
||||
path: sitePaths.simulateurs['exonération-covid'],
|
||||
component: ExonérationCovid,
|
||||
} as const)
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
import exonerationCovid, {
|
||||
DottedName as ExoCovidDottedNames,
|
||||
} from 'exoneration-covid'
|
||||
import Engine from 'publicodes'
|
||||
import { useContext, useRef } from 'react'
|
||||
|
||||
import { EngineContext, EngineProvider } from '@/components/utils/EngineContext'
|
||||
import { useSituationState } from '@/components/utils/SituationContext'
|
||||
|
||||
import { ExonérationCovid } from './ExonérationCovid'
|
||||
|
||||
const exoCovidEngine = new Engine(exonerationCovid)
|
||||
|
||||
export const useExoCovidEngine = () =>
|
||||
useContext(EngineContext) as Engine<ExoCovidDottedNames>
|
||||
|
||||
export const useExoCovidSituationState = () =>
|
||||
useSituationState<ExoCovidDottedNames>()
|
||||
|
||||
/**
|
||||
* Use this hooks to keep state of engine with the react fast refresh
|
||||
* @param originalEngine
|
||||
* @returns engine
|
||||
*/
|
||||
export const useEngineKeepState = <Names extends string>(
|
||||
originalEngine: Engine<Names>
|
||||
) => {
|
||||
const { current: engine } = useRef(originalEngine)
|
||||
|
||||
return engine
|
||||
}
|
||||
|
||||
const ExonérationCovidProvider = () => {
|
||||
const engine = useEngineKeepState(exoCovidEngine)
|
||||
|
||||
return (
|
||||
<EngineProvider value={engine}>
|
||||
<ExonérationCovid />
|
||||
</EngineProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default ExonérationCovidProvider
|
|
@ -22,7 +22,6 @@ import { dividendesConfig } from './dividendes/config'
|
|||
import { eirlConfig } from './eirl/config'
|
||||
import { entrepriseIndividuelleConfig } from './entreprise-individuelle/config'
|
||||
import { eurlConfig } from './eurl/config'
|
||||
import { exonérationCovidConfig } from './exonération-covid/config'
|
||||
import { expertComptableConfig } from './expert-comptable/config'
|
||||
import { impôtSociétéConfig } from './impot-societe/config'
|
||||
import { indépendantConfig } from './indépendant/config'
|
||||
|
@ -69,7 +68,6 @@ const getMetadataSrc = (params: SimulatorsDataParams) => {
|
|||
...professionLibéraleConfig(params),
|
||||
...pamcConfig(params),
|
||||
...dividendesConfig(params),
|
||||
...exonérationCovidConfig(params),
|
||||
...coûtCréationEntrepriseConfig(params),
|
||||
...impôtSociétéConfig(params),
|
||||
...cipavConfig(params),
|
||||
|
|
|
@ -34,7 +34,7 @@ export function déclarationChargesSocialesIndépendantConfig({
|
|||
'pages.gérer.declaration_charges_sociales_indépendant.title',
|
||||
'Assistant à la détermination des charges sociales déductibles'
|
||||
),
|
||||
nextSteps: ['exonération-covid', 'déclaration-revenu-indépendant-beta'],
|
||||
nextSteps: ['déclaration-revenu-indépendant-beta'],
|
||||
component: DéclarationChargeSocialeIndépendant,
|
||||
} as const)
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export function déclarationRevenuIndépendantConfig({
|
|||
'pages.gérer.declaration_charges_sociales_indépendant.title',
|
||||
'Assistant à la détermination des charges sociales déductibles'
|
||||
),
|
||||
nextSteps: ['exonération-covid', 'déclaration-revenu-indépendant-beta'],
|
||||
nextSteps: ['déclaration-revenu-indépendant-beta'],
|
||||
component: DéclarationChargeSocialeIndépendant,
|
||||
} as const)
|
||||
}
|
||||
|
|
|
@ -34,10 +34,7 @@ export function déclarationRevenuIndépendantBetaConfig({
|
|||
'pages.gérer.declaration_revenu_indépendant.title',
|
||||
'Assistant à la déclaration de revenu pour les indépendants'
|
||||
),
|
||||
nextSteps: [
|
||||
'exonération-covid',
|
||||
'déclaration-charges-sociales-indépendant',
|
||||
],
|
||||
nextSteps: ['déclaration-charges-sociales-indépendant'],
|
||||
path: sitePaths.gérer.déclarationIndépendant.beta.index,
|
||||
component: DéclarationRevenuIndépendant,
|
||||
} as const)
|
||||
|
|
|
@ -89,7 +89,6 @@ const rawSitePathsFr = {
|
|||
},
|
||||
is: 'impot-societe',
|
||||
dividendes: 'dividendes',
|
||||
'exonération-covid': 'exonération-covid',
|
||||
},
|
||||
nouveautés: 'nouveautés',
|
||||
stats: 'statistiques',
|
||||
|
@ -178,7 +177,6 @@ const rawSitePathsEn = {
|
|||
},
|
||||
is: 'corporate-tax',
|
||||
dividendes: 'dividends',
|
||||
'exonération-covid': 'exoneration-covid',
|
||||
},
|
||||
nouveautés: 'news',
|
||||
stats: 'statistics',
|
||||
|
|
Loading…
Reference in New Issue