From 10403bf961420bfdea66b45600481d192d2a822c Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Mon, 27 Jan 2025 16:42:26 +0100 Subject: [PATCH] =?UTF-8?q?feat(pam):=20cr=C3=A9ation=20de=20l'assistant?= =?UTF-8?q?=20=C3=A0=20la=20d=C3=A9claration=20version=20basique=20-=20r?= =?UTF-8?q?=C3=A9gime=20micro-fiscal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Assistant/AssistantGoal.tsx | 118 ++++++++++++++++++ site/source/locales/ui-en.yaml | 6 + site/source/locales/ui-fr.yaml | 7 ++ .../components/Formulaire.tsx | 62 +++++++++ .../components/Résultats.tsx | 83 ++++++++++++ .../declaration-revenus-pamc/config.ts | 39 ++++++ .../declaration-revenus-pamc/index.tsx | 116 +++++++++++++++++ .../simulationConfig.ts | 8 ++ .../simulateurs-et-assistants/metadata-src.ts | 2 + site/source/sitePaths.ts | 2 + 10 files changed, 443 insertions(+) create mode 100644 site/source/components/Assistant/AssistantGoal.tsx create mode 100644 site/source/pages/assistants/declaration-revenus-pamc/components/Formulaire.tsx create mode 100644 site/source/pages/assistants/declaration-revenus-pamc/components/Résultats.tsx create mode 100644 site/source/pages/assistants/declaration-revenus-pamc/config.ts create mode 100644 site/source/pages/assistants/declaration-revenus-pamc/index.tsx create mode 100644 site/source/pages/assistants/declaration-revenus-pamc/simulationConfig.ts diff --git a/site/source/components/Assistant/AssistantGoal.tsx b/site/source/components/Assistant/AssistantGoal.tsx new file mode 100644 index 000000000..3378e1280 --- /dev/null +++ b/site/source/components/Assistant/AssistantGoal.tsx @@ -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 ( + + + + + + + + {rule.title} + + + + + + + + + + + + {!isFocused && ( + + )} + setFocused(true)} + onBlur={() => setFocused(false)} + showSuggestions={false} + aria-labelledby={`${dottedName.replace(/\s|\./g, '_')}-title`} + aria-describedby={`${dottedName.replace( + /\s|\./g, + '_' + )}-description`} + /> + + + + + ) +} + +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; +` diff --git a/site/source/locales/ui-en.yaml b/site/source/locales/ui-en.yaml index 5a89950a2..d4a477623 100644 --- a/site/source/locales/ui-en.yaml +++ b/site/source/locales/ui-en.yaml @@ -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.<1>If you would like us to develop diff --git a/site/source/locales/ui-fr.yaml b/site/source/locales/ui-fr.yaml index 0ef610128..c3f5bf3c0 100644 --- a/site/source/locales/ui-fr.yaml +++ b/site/source/locales/ui-fr.yaml @@ -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.<1>Si vous souhaitez diff --git a/site/source/pages/assistants/declaration-revenus-pamc/components/Formulaire.tsx b/site/source/pages/assistants/declaration-revenus-pamc/components/Formulaire.tsx new file mode 100644 index 000000000..d0557add0 --- /dev/null +++ b/site/source/pages/assistants/declaration-revenus-pamc/components/Formulaire.tsx @@ -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 ( + <> +

Profession

+ + + + +

Recettes

+ + + + +

Données du relevé SNIR

+ + + + + + + +

Structures de soins

+
+ + + +

Déductions et exonérations

+ + + + + + +

Autres revenus non salariés

+ + + + + + + +

Actes conventionnés

+
+ + +

Revenus de remplacement

+ + +
+ + ) +} diff --git a/site/source/pages/assistants/declaration-revenus-pamc/components/Résultats.tsx b/site/source/pages/assistants/declaration-revenus-pamc/components/Résultats.tsx new file mode 100644 index 000000000..0c8ec9c85 --- /dev/null +++ b/site/source/pages/assistants/declaration-revenus-pamc/components/Résultats.tsx @@ -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 ( + + theme.colors.bases.primary[600]} + > +

+ Montants à reporter dans votre déclaration de + revenus +

+ + + +

Recettes brutes

+ + + +

Montant des revenus de remplacement

+
+ + + +

Déductions et exonérations

+
+ + + +

Cotisations sociales obligatoires

+ + +

Répartition des revenus nets

+ + + + +

Données transmises par l’Assurance Maladie

+ + + + + +
+
+ ) +} diff --git a/site/source/pages/assistants/declaration-revenus-pamc/config.ts b/site/source/pages/assistants/declaration-revenus-pamc/config.ts new file mode 100644 index 000000000..af7d8823c --- /dev/null +++ b/site/source/pages/assistants/declaration-revenus-pamc/config.ts @@ -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) +} diff --git a/site/source/pages/assistants/declaration-revenus-pamc/index.tsx b/site/source/pages/assistants/declaration-revenus-pamc/index.tsx new file mode 100644 index 000000000..f5eb46153 --- /dev/null +++ b/site/source/pages/assistants/declaration-revenus-pamc/index.tsx @@ -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 ? ( + + ) : ( + + )} + + +
    + + Cet assistant est à destination des{' '} + + praticiens et auxiliaires médicaux conventionnés (PAMC) + + . + + + Il a pour but de vous aider à remplir le{' '} + volet social de votre déclaration de revenus à + réaliser sur{' '} + + impots.gouv.fr + + . + + + En cas de déficit, renseignez le signe « - » devant + le montant. + + + + L’assistant ne prend pas en compte les situations suivantes : + +
      +
    • revenus étrangers,
    • +
    • revenus non professionnels,
    • +
    • changement de régime en cours d’année,
    • +
    • comptabilités d’engagement,
    • +
    • médecins adhérents au dispositif RSPM.
    • +
    + Si vous êtes dans l’une de ces situations, nous vous invitons à + contacter votre Urssaf pour vous accompagner. +
    +
+ + + Les calculs sont indicatifs. 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.{' '} + Ils ne se substituent pas aux décomptes réels de + l’Urssaf, de l’administration fiscale ou de tout autre organisme. + + +
+ + + + Afin de faciliter le remplissage, préparez : +
    +
  • l’ensemble des recettes encaissées,
  • +
  • le détail des cotisations versées à l’Urssaf,
  • +
  • + le détail des cotisations versées à votre caisse de retraite. +
  • +
+ +
+ + + + + + + + ) +} + +const StyledLi = styled(Li)` + &::before { + color: ${({ theme }) => theme.colors.bases.tertiary[800]} !important; + } +` diff --git a/site/source/pages/assistants/declaration-revenus-pamc/simulationConfig.ts b/site/source/pages/assistants/declaration-revenus-pamc/simulationConfig.ts new file mode 100644 index 000000000..0ef921b15 --- /dev/null +++ b/site/source/pages/assistants/declaration-revenus-pamc/simulationConfig.ts @@ -0,0 +1,8 @@ +import { SimulationConfig } from '@/domaine/SimulationConfig' + +export const configDéclarationRevenusPAMC: SimulationConfig = { + situation: { + 'déclaration revenus PAMC': 'oui', + }, + 'unité par défaut': '€', +} diff --git a/site/source/pages/simulateurs-et-assistants/metadata-src.ts b/site/source/pages/simulateurs-et-assistants/metadata-src.ts index 293406670..9359d86f4 100644 --- a/site/source/pages/simulateurs-et-assistants/metadata-src.ts +++ b/site/source/pages/simulateurs-et-assistants/metadata-src.ts @@ -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), diff --git a/site/source/sitePaths.ts b/site/source/sitePaths.ts index 164f9b736..cbce8847e 100644 --- a/site/source/sitePaths.ts +++ b/site/source/sitePaths.ts @@ -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',