mirror of
https://github.com/betagouv/mon-entreprise
synced 2025-02-10 13:55:03 +00:00
feat(pam): création de l'assistant à la déclaration version basique - régime micro-fiscal
This commit is contained in:
parent
85229bc9c9
commit
10403bf961
10 changed files with 443 additions and 0 deletions
118
site/source/components/Assistant/AssistantGoal.tsx
Normal file
118
site/source/components/Assistant/AssistantGoal.tsx
Normal file
|
@ -0,0 +1,118 @@
|
|||
import { DottedName } from 'modele-social'
|
||||
import { PublicodesExpression } from 'publicodes'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { styled } from 'styled-components'
|
||||
|
||||
import { ForceThemeProvider } from '@/components/utils/DarkModeContext'
|
||||
import { Grid } from '@/design-system/layout'
|
||||
import { Body } from '@/design-system/typography/paragraphs'
|
||||
import { SimpleRuleEvaluation } from '@/domaine/engine/SimpleRuleEvaluation'
|
||||
import { ajusteLaSituation } from '@/store/actions/actions'
|
||||
|
||||
import { ExplicableRule } from '../conversation/Explicable'
|
||||
import RuleInput from '../conversation/RuleInput'
|
||||
import LectureGuide from '../LectureGuide'
|
||||
import { Appear } from '../ui/animate'
|
||||
import AnimatedTargetValue from '../ui/AnimatedTargetValue'
|
||||
import { useEngine } from '../utils/EngineContext'
|
||||
import { useInitialRender } from '../utils/useInitialRender'
|
||||
|
||||
type SimulationGoalProps = {
|
||||
dottedName: DottedName
|
||||
originalUnit?: boolean
|
||||
}
|
||||
|
||||
export function AssistantGoal({
|
||||
dottedName,
|
||||
originalUnit = false,
|
||||
}: SimulationGoalProps) {
|
||||
const dispatch = useDispatch()
|
||||
const engine = useEngine()
|
||||
const evaluation = engine.evaluate({
|
||||
valeur: dottedName,
|
||||
})
|
||||
const rule = engine.getRule(dottedName)
|
||||
const initialRender = useInitialRender()
|
||||
const [isFocused, setFocused] = useState(false)
|
||||
const onChange = useCallback(
|
||||
(x?: PublicodesExpression) => {
|
||||
dispatch(
|
||||
ajusteLaSituation({ [dottedName]: x } as Record<
|
||||
DottedName,
|
||||
SimpleRuleEvaluation
|
||||
>)
|
||||
)
|
||||
},
|
||||
[dispatch, dottedName]
|
||||
)
|
||||
if (evaluation.nodeValue === null) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Appear unless={initialRender}>
|
||||
<StyledGoal>
|
||||
<Grid
|
||||
container
|
||||
style={{
|
||||
alignItems: 'baseline',
|
||||
justifyContent: 'space-between',
|
||||
}}
|
||||
spacing={2}
|
||||
>
|
||||
<Grid item md="auto" sm={8} xs={8}>
|
||||
<Grid
|
||||
container
|
||||
style={{
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Grid item>
|
||||
<StyledBody id={`${dottedName.replace(/\s|\./g, '_')}-title`}>
|
||||
{rule.title}
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<ForceThemeProvider forceTheme="default">
|
||||
<ExplicableRule dottedName={dottedName} light />
|
||||
</ForceThemeProvider>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<LectureGuide />
|
||||
<Grid item md={3} sm={4} xs={4}>
|
||||
{!isFocused && (
|
||||
<AnimatedTargetValue value={evaluation.nodeValue as number} />
|
||||
)}
|
||||
<RuleInput
|
||||
dottedName={dottedName}
|
||||
displayedUnit={originalUnit ? undefined : '€'}
|
||||
missing={dottedName in evaluation.missingVariables}
|
||||
onChange={onChange}
|
||||
onFocus={() => setFocused(true)}
|
||||
onBlur={() => setFocused(false)}
|
||||
showSuggestions={false}
|
||||
aria-labelledby={`${dottedName.replace(/\s|\./g, '_')}-title`}
|
||||
aria-describedby={`${dottedName.replace(
|
||||
/\s|\./g,
|
||||
'_'
|
||||
)}-description`}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</StyledGoal>
|
||||
</Appear>
|
||||
)
|
||||
}
|
||||
|
||||
const StyledGoal = styled.div`
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin: ${({ theme }) => theme.spacings.xxs} 0;
|
||||
`
|
||||
|
||||
const StyledBody = styled(Body)`
|
||||
margin: 0;
|
||||
font-size: 1.125rem;
|
||||
`
|
|
@ -931,6 +931,12 @@ pages:
|
|||
title: Determining deductible social security charges
|
||||
shortname: Determining deductible social security charges
|
||||
title: Assistance in determining deductible social charges
|
||||
declaration-revenus-pamc:
|
||||
meta:
|
||||
description: Calculate the amounts of your income to report on your tax return.
|
||||
title: PAMC tax return
|
||||
shortname: PAMC tax return assistant
|
||||
title: PAMC tax return assistant
|
||||
pour-mon-entreprise:
|
||||
avertissement-entreprise-non-traitée: <0>There is no income simulator for your
|
||||
type of business on this site yet.</0><1>If you would like us to develop
|
||||
|
|
|
@ -989,6 +989,13 @@ pages:
|
|||
title: Détermination des charges sociales déductibles
|
||||
shortname: Détermination des charges sociales déductibles
|
||||
title: Assistant à la détermination des charges sociales déductibles
|
||||
declaration-revenus-pamc:
|
||||
meta:
|
||||
description: Calculez les montants de vos revenus à reporter dans votre
|
||||
déclaration de revenus.
|
||||
title: Déclaration de revenus des PAMC
|
||||
shortname: Assistant à la déclaration de revenus des PAMC
|
||||
title: Assistant à la déclaration de revenus pour les PAMC
|
||||
pour-mon-entreprise:
|
||||
avertissement-entreprise-non-traitée: <0>Il n'existe pas encore de simulateur de
|
||||
revenu pour votre type d'entreprise sur ce site.</0><1>Si vous souhaitez
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
import { AssistantGoal } from '@/components/Assistant/AssistantGoal'
|
||||
import { WhenAlreadyDefined } from '@/components/EngineValue/WhenAlreadyDefined'
|
||||
import { WhenApplicable } from '@/components/EngineValue/WhenApplicable'
|
||||
import { H2 } from '@/design-system/typography/heading'
|
||||
|
||||
import { SimpleField } from '../../components/Fields'
|
||||
|
||||
export default function Formulaire() {
|
||||
return (
|
||||
<>
|
||||
<H2>Profession</H2>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . profession" />
|
||||
<SimpleField dottedName="déclaration revenus PAMC . statut" />
|
||||
|
||||
<WhenAlreadyDefined dottedName="déclaration revenus PAMC . profession">
|
||||
<H2>Recettes</H2>
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . recettes brutes totales" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . revenus imposables" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . cotisations sociales obligatoires" />
|
||||
|
||||
<H2>Données du relevé SNIR</H2>
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . SNIR . honoraires remboursables" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . SNIR . dépassements honoraires" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . SNIR . honoraires tarifs opposables" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . SNIR . honoraires hors forfaits" />
|
||||
<AssistantGoal
|
||||
dottedName="déclaration revenus PAMC . SNIR . taux urssaf"
|
||||
originalUnit
|
||||
/>
|
||||
|
||||
<WhenApplicable dottedName="déclaration revenus PAMC . activité en structures de soins">
|
||||
<H2>Structures de soins</H2>
|
||||
</WhenApplicable>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . activité en structures de soins" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . activité en structures de soins . recettes" />
|
||||
|
||||
<H2>Déductions et exonérations</H2>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . déductions et exonérations" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . déductions et exonérations . zone déficitaire en offre de soins" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . déductions et exonérations . revenus exonérés" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . déductions et exonérations . plus-values à court terme" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . déductions et exonérations . chèques vacances" />
|
||||
|
||||
<H2>Autres revenus non salariés</H2>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . autres revenus non salariés" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . autres revenus non salariés . plus-values nettes à court terme" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . autres revenus non salariés . vente de marchandises" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . autres revenus non salariés . prestation de service" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . autres revenus non salariés . agricole" />
|
||||
|
||||
<WhenApplicable dottedName="déclaration revenus PAMC . actes conventionnés uniquement">
|
||||
<H2>Actes conventionnés</H2>
|
||||
</WhenApplicable>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . actes conventionnés uniquement" />
|
||||
|
||||
<H2>Revenus de remplacement</H2>
|
||||
<SimpleField dottedName="déclaration revenus PAMC . revenus de remplacement" />
|
||||
<AssistantGoal dottedName="déclaration revenus PAMC . revenus de remplacement . AJPA" />
|
||||
</WhenAlreadyDefined>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
import { Condition } from '@/components/EngineValue/Condition'
|
||||
import { WhenAlreadyDefined } from '@/components/EngineValue/WhenAlreadyDefined'
|
||||
import { SimulationValue } from '@/components/Simulation/SimulationValue'
|
||||
import { Emoji } from '@/design-system/emoji'
|
||||
import { Container } from '@/design-system/layout'
|
||||
import { H2, H3 } from '@/design-system/typography/heading'
|
||||
|
||||
export default function Résultats() {
|
||||
return (
|
||||
<WhenAlreadyDefined dottedName="déclaration revenus PAMC . résultats">
|
||||
<Container
|
||||
forceTheme="dark"
|
||||
backgroundColor={(theme) => theme.colors.bases.primary[600]}
|
||||
>
|
||||
<H2>
|
||||
<Emoji emoji="📄" /> Montants à reporter dans votre déclaration de
|
||||
revenus
|
||||
</H2>
|
||||
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . statut"
|
||||
label="Situation au 1er janvier ou à la date du début d’activité"
|
||||
/>
|
||||
|
||||
<H3>Recettes brutes</H3>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . recettes brutes totales"
|
||||
label="Recettes brutes totales tirées des activités non salariées"
|
||||
/>
|
||||
|
||||
<Condition expression="déclaration revenus PAMC . revenus de remplacement . total">
|
||||
<H3>Montant des revenus de remplacement</H3>
|
||||
</Condition>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . revenus de remplacement . AJPA"
|
||||
label="Montant des allocations journalières du proche aidant (AJPA) versées par la CAF"
|
||||
/>
|
||||
|
||||
<Condition expression="déclaration revenus PAMC . déductions et exonérations . total déductible">
|
||||
<H3>Déductions et exonérations</H3>
|
||||
</Condition>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . déductions et exonérations . zone déficitaire en offre de soins"
|
||||
label="Exonération zone déficitaire en offre de soins"
|
||||
/>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . déductions et exonérations . chèques vacances"
|
||||
label="Chèques vacances déduits du revenu imposable"
|
||||
/>
|
||||
|
||||
<H3>Cotisations sociales obligatoires</H3>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . cotisations sociales obligatoires"
|
||||
label="Cotisations sociales obligatoires déduites du résultat imposable"
|
||||
/>
|
||||
|
||||
<H3>Répartition des revenus nets</H3>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . revenus nets . revenus conventionnés"
|
||||
label="Revenu net de l’activité conventionnée"
|
||||
/>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . revenus nets . revenus non conventionnés"
|
||||
label="Revenus nets tirés des autres activités non salariées"
|
||||
/>
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . revenus nets . revenus structures de soins"
|
||||
label="Dont revenus nets de l’activité réalisée dans des structures de soins"
|
||||
/>
|
||||
|
||||
<H3>Données transmises par l’Assurance Maladie</H3>
|
||||
<SimulationValue dottedName="déclaration revenus PAMC . SNIR . honoraires remboursables" />
|
||||
<SimulationValue dottedName="déclaration revenus PAMC . SNIR . dépassements honoraires" />
|
||||
<SimulationValue dottedName="déclaration revenus PAMC . SNIR . honoraires tarifs opposables" />
|
||||
<SimulationValue dottedName="déclaration revenus PAMC . SNIR . honoraires hors forfaits" />
|
||||
<SimulationValue
|
||||
dottedName="déclaration revenus PAMC . SNIR . taux urssaf"
|
||||
displayedUnit="%"
|
||||
/>
|
||||
</Container>
|
||||
</WhenAlreadyDefined>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
import DéclarationRevenusPAMC from '.'
|
||||
import { config } from '../../simulateurs/_configs/config'
|
||||
import { SimulatorsDataParams } from '../../simulateurs/_configs/types'
|
||||
|
||||
export function déclarationRevenusPAMCConfig({
|
||||
t,
|
||||
sitePaths,
|
||||
}: SimulatorsDataParams) {
|
||||
return config({
|
||||
id: 'déclaration-revenus-pamc',
|
||||
pathId: 'assistants.déclaration-revenus-pamc',
|
||||
path: sitePaths.assistants['déclaration-revenus-pamc'],
|
||||
iframePath: 'déclaration-revenus-pamc',
|
||||
icône: '📑',
|
||||
tracking: {
|
||||
chapter1: 'assistant',
|
||||
chapter2: 'declaration_revenus_pamc',
|
||||
},
|
||||
meta: {
|
||||
description: t(
|
||||
'pages.assistants.declaration-revenus-pamc.meta.description',
|
||||
'Calculez les montants de vos revenus à reporter dans votre déclaration de revenus.'
|
||||
),
|
||||
title: t(
|
||||
'pages.assistants.declaration-revenus-pamc.meta.title',
|
||||
'Déclaration de revenus des PAMC'
|
||||
),
|
||||
},
|
||||
shortName: t(
|
||||
'pages.assistants.declaration-revenus-pamc.shortname',
|
||||
'Assistant à la déclaration de revenus des PAMC'
|
||||
),
|
||||
title: t(
|
||||
'pages.assistants.declaration-revenus-pamc.title',
|
||||
'Assistant à la déclaration de revenus pour les PAMC'
|
||||
),
|
||||
component: DéclarationRevenusPAMC,
|
||||
} as const)
|
||||
}
|
116
site/source/pages/assistants/declaration-revenus-pamc/index.tsx
Normal file
116
site/source/pages/assistants/declaration-revenus-pamc/index.tsx
Normal file
|
@ -0,0 +1,116 @@
|
|||
import { Trans } from 'react-i18next'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { styled } from 'styled-components'
|
||||
|
||||
import { TrackPage } from '@/components/ATInternetTracking'
|
||||
import Warning from '@/components/ui/WarningBlock'
|
||||
import { Message } from '@/design-system'
|
||||
import { Spacing } from '@/design-system/layout'
|
||||
import { Strong } from '@/design-system/typography'
|
||||
import { Link } from '@/design-system/typography/link'
|
||||
import { Li, Ul } from '@/design-system/typography/list'
|
||||
import { Body } from '@/design-system/typography/paragraphs'
|
||||
import useSimulationConfig from '@/hooks/useSimulationConfig'
|
||||
import { useSitePaths } from '@/sitePaths'
|
||||
import { situationSelector } from '@/store/selectors/simulationSelectors'
|
||||
|
||||
import Formulaire from './components/Formulaire'
|
||||
import Résultats from './components/Résultats'
|
||||
import { configDéclarationRevenusPAMC } from './simulationConfig'
|
||||
|
||||
export default function DéclarationRevenusPAMC() {
|
||||
const { absoluteSitePaths } = useSitePaths()
|
||||
useSimulationConfig({
|
||||
key: absoluteSitePaths.assistants['déclaration-revenus-pamc'],
|
||||
config: configDéclarationRevenusPAMC,
|
||||
autoloadLastSimulation: true,
|
||||
})
|
||||
const situation = useSelector(situationSelector)
|
||||
|
||||
return (
|
||||
<>
|
||||
{Object.keys(situation).length ? (
|
||||
<TrackPage name="simulation commencée" />
|
||||
) : (
|
||||
<TrackPage name="accueil" />
|
||||
)}
|
||||
|
||||
<Warning localStorageKey="pages.assistants.declaration-revenus-pamc.warning">
|
||||
<Ul>
|
||||
<StyledLi>
|
||||
Cet assistant est à destination des{' '}
|
||||
<Strong>
|
||||
praticiens et auxiliaires médicaux conventionnés (PAMC)
|
||||
</Strong>
|
||||
.
|
||||
</StyledLi>
|
||||
<StyledLi>
|
||||
Il a pour but de vous aider à remplir le{' '}
|
||||
<Strong>volet social de votre déclaration de revenus</Strong> à
|
||||
réaliser sur{' '}
|
||||
<Link
|
||||
href="https://www.impots.gouv.fr"
|
||||
aria-label="impots.gouv.fr, nouvelle fenêtre"
|
||||
>
|
||||
impots.gouv.fr
|
||||
</Link>
|
||||
.
|
||||
</StyledLi>
|
||||
<StyledLi>
|
||||
<Strong>En cas de déficit</Strong>, renseignez le signe « - » devant
|
||||
le montant.
|
||||
</StyledLi>
|
||||
<StyledLi>
|
||||
<Strong>
|
||||
L’assistant ne prend pas en compte les situations suivantes :
|
||||
</Strong>
|
||||
<Ul>
|
||||
<Li>revenus étrangers,</Li>
|
||||
<Li>revenus non professionnels,</Li>
|
||||
<Li>changement de régime en cours d’année,</Li>
|
||||
<Li>comptabilités d’engagement,</Li>
|
||||
<Li>médecins adhérents au dispositif RSPM.</Li>
|
||||
</Ul>
|
||||
Si vous êtes dans l’une de ces situations, nous vous invitons à
|
||||
contacter votre Urssaf pour vous accompagner.
|
||||
</StyledLi>
|
||||
</Ul>
|
||||
<Body>
|
||||
<Trans i18nKey="simulateurs.warning.general">
|
||||
<Strong>Les calculs sont indicatifs.</Strong> Ils sont faits à
|
||||
partir des éléments que vous avez saisis et des éléments
|
||||
réglementaires applicables, mais ils ne tiennent pas compte de
|
||||
l’ensemble de votre situation.{' '}
|
||||
<Strong>Ils ne se substituent pas aux décomptes réels</Strong> de
|
||||
l’Urssaf, de l’administration fiscale ou de tout autre organisme.
|
||||
</Trans>
|
||||
</Body>
|
||||
</Warning>
|
||||
|
||||
<Message type="secondary" icon>
|
||||
<Body>
|
||||
Afin de faciliter le remplissage, préparez :
|
||||
<Ul>
|
||||
<Li>l’ensemble des recettes encaissées,</Li>
|
||||
<Li>le détail des cotisations versées à l’Urssaf,</Li>
|
||||
<Li>
|
||||
le détail des cotisations versées à votre caisse de retraite.
|
||||
</Li>
|
||||
</Ul>
|
||||
</Body>
|
||||
</Message>
|
||||
|
||||
<Formulaire />
|
||||
|
||||
<Spacing xxxl />
|
||||
|
||||
<Résultats />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const StyledLi = styled(Li)`
|
||||
&::before {
|
||||
color: ${({ theme }) => theme.colors.bases.tertiary[800]} !important;
|
||||
}
|
||||
`
|
|
@ -0,0 +1,8 @@
|
|||
import { SimulationConfig } from '@/domaine/SimulationConfig'
|
||||
|
||||
export const configDéclarationRevenusPAMC: SimulationConfig = {
|
||||
situation: {
|
||||
'déclaration revenus PAMC': 'oui',
|
||||
},
|
||||
'unité par défaut': '€',
|
||||
}
|
|
@ -2,6 +2,7 @@ import { ImmutableType } from '@/types/utils'
|
|||
|
||||
import { choixStatutJuridiqueConfig } from '../assistants/choix-du-statut/config'
|
||||
import { déclarationChargesSocialesIndépendantConfig } from '../assistants/declaration-charges-sociales-independant/config'
|
||||
import { déclarationRevenusPAMCConfig } from '../assistants/declaration-revenus-pamc/config'
|
||||
import { demandeMobilitéConfig } from '../assistants/demande-mobilité/config'
|
||||
import { pourMonEntrepriseConfig } from '../assistants/pour-mon-entreprise/config'
|
||||
import { rechercheCodeApeConfig } from '../assistants/recherche-code-ape/config'
|
||||
|
@ -71,6 +72,7 @@ const getMetadataSrc = (params: SimulatorsDataParams) => {
|
|||
// assistants:
|
||||
...choixStatutJuridiqueConfig(params),
|
||||
...déclarationChargesSocialesIndépendantConfig(params),
|
||||
...déclarationRevenusPAMCConfig(params),
|
||||
...demandeMobilitéConfig(params),
|
||||
...pourMonEntrepriseConfig(params),
|
||||
...rechercheCodeApeConfig(params),
|
||||
|
|
|
@ -10,6 +10,7 @@ const rawSitePathsFr = {
|
|||
'recherche-code-ape': 'recherche-code-ape',
|
||||
'déclaration-charges-sociales-indépendant':
|
||||
'declaration-charges-sociales-independant',
|
||||
'déclaration-revenus-pamc': 'declaration-revenus-pam',
|
||||
économieCollaborative: {
|
||||
index: 'économie-collaborative',
|
||||
},
|
||||
|
@ -105,6 +106,7 @@ const rawSitePathsEn = {
|
|||
'recherche-code-ape': 'search-code-ape',
|
||||
'déclaration-charges-sociales-indépendant':
|
||||
'declaration-social-charges-independent',
|
||||
'déclaration-revenus-pamc': 'income-declaration-pam',
|
||||
économieCollaborative: {
|
||||
index: 'sharing-economy',
|
||||
votreSituation: 'your-situation',
|
||||
|
|
Loading…
Add table
Reference in a new issue