diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dda34a511e9bf88a515aa87118c1e17ca8276f79..61370f2fc0901664b2006bac9b9ef741c7e1601e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,11 +45,11 @@ deploy-integ: - ssh leximpact@$INTEGRATION_IP "cd $CI_PROJECT_NAME && git fetch && git checkout -B $CI_COMMIT_REF_NAME $CI_COMMIT_SHA && git pull origin $CI_COMMIT_REF_NAME && exit" - ssh leximpact@$INTEGRATION_IP "cd $CI_PROJECT_NAME && npm install && npm run build && exit" - ssh leximpact@$INTEGRATION_IP "systemctl --user restart leximpactclient.service" - when: manual + # when: manual environment: name: integration - + deploy-prod: stage: deploy script: diff --git a/components/common/simulation-page/simulation-menu/legende/Legende.tsx b/components/common/simulation-page/simulation-menu/legende/Legende.tsx index 7234fb6a581fd26963690969615b303cc4c1819b..d85eaad5d0f736b03122d389213ab15647abd18a 100644 --- a/components/common/simulation-page/simulation-menu/legende/Legende.tsx +++ b/components/common/simulation-page/simulation-menu/legende/Legende.tsx @@ -11,7 +11,7 @@ export function Legende({ montrerPLF }: { montrerPLF: boolean }) { {montrerPLF && ( <span className={styles.plf}> {/* <a href="http://www.assemblee-nationale.fr/15/projets/pl2272.asp"> */} - PLF 2022 + PLF 2023 {/* <OpenInNewIcon className={styles.icon} /> </a> */} </span> diff --git a/components/ir/articles/Articles.tsx b/components/ir/articles/Articles.tsx index b700eb1a4c35a3136118c340d9c6e43e5b084ab9..fe7199be1707d771459feddddc4881f3b8e20e05 100644 --- a/components/ir/articles/Articles.tsx +++ b/components/ir/articles/Articles.tsx @@ -37,12 +37,12 @@ export class Articles extends React.Component<Props> { let { plf } = this.props; plf = plf ?? null; - const s = amendement.impot_revenu.bareme.seuils; - const t = amendement.impot_revenu.bareme.taux; - const bases = base.impot_revenu.bareme.seuils; - const baset = base.impot_revenu.bareme.taux; - const plfs = plf && plf.impot_revenu.bareme.seuils; - const plft = plf && plf.impot_revenu.bareme.taux; + const s = amendement.impot_revenu.bareme_ir_depuis_1945.seuils; + const t = amendement.impot_revenu.bareme_ir_depuis_1945.taux; + const bases = base.impot_revenu.bareme_ir_depuis_1945.seuils; + const baset = base.impot_revenu.bareme_ir_depuis_1945.taux; + const plfs = plf && plf.impot_revenu.bareme_ir_depuis_1945.seuils; + const plft = plf && plf.impot_revenu.bareme_ir_depuis_1945.taux; const nbt = s.length; const newTranche = i > 4; @@ -161,7 +161,7 @@ export class Articles extends React.Component<Props> { handleAddTranche, handleRemoveTranche, } = this.props; - const count = amendement.impot_revenu.bareme.seuils.length + 1; + const count = amendement.impot_revenu.bareme_ir_depuis_1945.seuils.length + 1; const articleTranches = fillArrayWith(count, this.gimmeIRPartsOfArticle); return ( diff --git a/components/ir/articles/alinea-4a/Alinea4a.tsx b/components/ir/articles/alinea-4a/Alinea4a.tsx index 05f293cff81eee78a02d1c9fb4da3c2fb65e6cb9..af92f3e517f41c3798339de6a6428bb48fd682df 100644 --- a/components/ir/articles/alinea-4a/Alinea4a.tsx +++ b/components/ir/articles/alinea-4a/Alinea4a.tsx @@ -12,14 +12,14 @@ export class Alinea4a extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.decote.seuil_celib" + path="impot_revenu.calcul_impot_revenu.plaf_qf.decote.seuil_celib" /> {" "} € et {" "} <ParameterValues editable - path="impot_revenu.decote.taux" + path="impot_revenu.calcul_impot_revenu.plaf_qf.decote.taux" /> {" "} % de son montant pour les contribuables célibataires, divorcés ou @@ -27,13 +27,13 @@ export class Alinea4a extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.decote.seuil_couple" + path="impot_revenu.calcul_impot_revenu.plaf_qf.decote.seuil_couple" /> {" "} € et {" "} <ParameterValues - path="impot_revenu.decote.taux" + path="impot_revenu.calcul_impot_revenu.plaf_qf.decote.taux" /> {" "} % de son montant pour les contribuables soumis à imposition diff --git a/components/ir/articles/alinea3/Alinea3.tsx b/components/ir/articles/alinea3/Alinea3.tsx index 6101455c2c589a70f90e2c5e1579a0a443427a3c..4f6f7ff1dc99da1a9f8951a4c10399dafb79135a 100644 --- a/components/ir/articles/alinea3/Alinea3.tsx +++ b/components/ir/articles/alinea3/Alinea3.tsx @@ -44,14 +44,14 @@ class Alinea3 extends PureComponent<PropsFromRedux> { <ParameterValues editable amendementInputSize="small" - path="impot_revenu.plafond_qf.abat_dom.taux_GuadMarReu" + path="impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.taux_GuadMarReu" /> {" "} %, dans la limite de {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.abat_dom.plaf_GuadMarReu" + path="impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.plaf_GuadMarReu" /> {" "} € pour les @@ -61,14 +61,14 @@ class Alinea3 extends PureComponent<PropsFromRedux> { <ParameterValues editable amendementInputSize="small" - path="impot_revenu.plafond_qf.abat_dom.taux_GuyMay" + path="impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.taux_GuyMay" /> {" "} %, dans la limite de {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.abat_dom.plaf_GuyMay" + path="impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.plaf_GuyMay" /> {" "} €, pour les contribuables domiciliés dans les départements de la diff --git a/components/ir/articles/quotient-familial/plafonds/plafonds.tsx b/components/ir/articles/quotient-familial/plafonds/plafonds.tsx index 8e06c60a90779537bcbd536a8d4406ef21968d1a..b7d026747bd578f6c79f81dec79747e9b4d73d8b 100644 --- a/components/ir/articles/quotient-familial/plafonds/plafonds.tsx +++ b/components/ir/articles/quotient-familial/plafonds/plafonds.tsx @@ -11,7 +11,7 @@ export class Plafonds extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.maries_ou_pacses" + path="impot_revenu.calcul_impot_revenu.plaf_qf.maries_ou_pacses" /> {" "} € par demi-part ou @@ -27,7 +27,7 @@ export class Plafonds extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.celib_enf" + path="impot_revenu.calcul_impot_revenu.plaf_qf.celib_enf" /> {" "} €. Lorsque les @@ -43,7 +43,7 @@ export class Plafonds extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.celib" + path="impot_revenu.calcul_impot_revenu.plaf_qf.celib" /> {" "} € ; @@ -55,7 +55,7 @@ export class Plafonds extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.reduc_postplafond" + path="impot_revenu.calcul_impot_revenu.plaf_qf.reduc_postplafond" /> {" "} € @@ -72,7 +72,7 @@ export class Plafonds extends PureComponent { {" "} <ParameterValues editable - path="impot_revenu.plafond_qf.reduc_postplafond_veuf" + path="impot_revenu.calcul_impot_revenu.plaf_qf.reduc_postplafond_veuf" /> {" "} € pour cette diff --git a/components/ir/cartes-impact/carte-etat/CarteEtat.tsx b/components/ir/cartes-impact/carte-etat/CarteEtat.tsx index f3f20cc791dac45bcd4960b0fd508788075c1dc9..9b55f82a20eb64ed7d3f676954599ca5fa37be2c 100644 --- a/components/ir/cartes-impact/carte-etat/CarteEtat.tsx +++ b/components/ir/cartes-impact/carte-etat/CarteEtat.tsx @@ -72,16 +72,14 @@ class CarteEtat extends PureComponent<PropsFromRedux> { <Card content1={( <Fragment> - {!isDisabledEtat && !isLoadingEtat && ( - <div className={styles.explicationPLF2022}> - <span className={styles.bold}>⚠️ Interpréter les résultats ci-dessous :</span> - <br /> - <ul> - <li>Les recettes présentées sont des estimations de recette d'impôt net sur le revenu.*</li> - <li>82.4 Md€ est la recette d'impôt net sur le revenu pour 2022 tel qu'évaluée par le <a href="https://www.economie.gouv.fr/files/2021-09/PLF_2022.PDF#page=13">PLF 2022</a>.</li> - </ul> - </div> - )} + <div className={styles.explicationPLF2023}> + <span className={styles.bold}>Bien comprendre les montants ci-dessous :</span> + <br /> + <ul> + <li>Les recettes présentées sont une estimation des recettes d'impôt <span className={styles.bold}>net</span> sur le revenu, c'est-à-dire après déduction des remboursements, crédits ou réductions.*</li> + <li>Les montants du code en vigueur (86,8 Md€, en noir) et du PLF2023 (86,9 Md€, en rouge) sont ceux indiqués par le <a href="https://www.assemblee-nationale.fr/dyn/16/textes/l16b0273_projet-loi">PLF 2023</a> (page 15). Cette hypothèse de recettes constitue la base de calcul pour l'impact des amendements (en jaune).</li> + </ul> + </div> {isDisabledEtat && ( <div> <div className={`${styles.buttonPosition} ${styles.center}`}> @@ -148,7 +146,7 @@ class CarteEtat extends PureComponent<PropsFromRedux> { [styles.uniteImpotEtat]: true, [styles.plf]: true, })}> - Md€*⚠️ + Md€* </Typography> </div> ) diff --git a/components/ir/cartes-impact/gagnants-perdants/gagnants-perdants-component.tsx b/components/ir/cartes-impact/gagnants-perdants/gagnants-perdants-component.tsx index 350ecd71cb0acb987668fb6752d6fc89a3cf239a..398091490c22e561fae1cbc6da10708e9c118a10 100644 --- a/components/ir/cartes-impact/gagnants-perdants/gagnants-perdants-component.tsx +++ b/components/ir/cartes-impact/gagnants-perdants/gagnants-perdants-component.tsx @@ -91,92 +91,92 @@ class GagnantsPerdantsCard extends PureComponent<PropsFromRedux> { return ( <Card content1={ - (<div className={styles.explicationPLF2022}> - Les données de population disponibles à ce jour ne suffisent pas à fournir une estimation du nombre de foyers ayant une augmentation ou une baisse de leur impôt. - </div>) - - // ( - // <Fragment> - - // {isDisabledEtat && ( - // <div> - // <div className={styles.buttonPosition}> - // <Button - // color="secondary" - // size="medium" - // variant="outlined" - // onClick={onClickSimPop}> - // <AccountBalanceIcon /> - // <FaceIcon className={styles.marginIcon} /> - // Estimer ~60" - // <CachedIcon className={styles.miniIcon} /> - // </Button> - // </div> - // </div> - // )} - // {!isDisabledEtat && isLoadingEtat && ( - // <div className={styles.buttonPosition}> - // <CircularProgress color="secondary" /> - // </div> - // )} - // {!isDisabledEtat && !isLoadingEtat && ( - // <GagnantsPerdantsContent - // amendement={hausseReforme} - // caption="de foyers nouvellement imposables" - // captionAmendement={hausseZeroReforme} - // captionPlf={hausseZeroPlf} - // icon={( - // <ArrowUpwardIcon - // classes={{ root: styles.styleIconPerdant }} - // fontSize="default" - // /> - // )} - // plf={haussePlf} - // title="ayant une augmentation" - // /> - // )} - // </Fragment> - // ) + // (<div className={styles.explicationPLF2022}> + // Les données de population disponibles à ce jour ne suffisent pas à fournir une estimation du nombre de foyers ayant une augmentation ou une baisse de leur impôt. + // </div>) + + ( + <Fragment> + + {isDisabledEtat && ( + <div> + <div className={styles.buttonPosition}> + <Button + color="secondary" + size="medium" + variant="outlined" + onClick={onClickSimPop}> + <AccountBalanceIcon /> + <FaceIcon className={styles.marginIcon} /> + Estimer ~60" + <CachedIcon className={styles.miniIcon} /> + </Button> + </div> + </div> + )} + {!isDisabledEtat && isLoadingEtat && ( + <div className={styles.buttonPosition}> + <CircularProgress color="secondary" /> + </div> + )} + {!isDisabledEtat && !isLoadingEtat && ( + <GagnantsPerdantsContent + amendement={hausseReforme} + caption="de foyers nouvellement imposables" + captionAmendement={hausseZeroReforme} + captionPlf={hausseZeroPlf} + icon={( + <ArrowUpwardIcon + classes={{ root: styles.styleIconPerdant }} + fontSize="default" + /> + )} + plf={haussePlf} + title="ayant une augmentation de plus de 5%" + /> + )} + </Fragment> + ) } - content2={null - // (!isDisabledEtat && !isLoadingEtat) ? ( - // <GagnantsPerdantsContent - // amendement={baisseReforme} - // icon={( - // <ArrowDownwardIcon - // classes={{ root: styles.styleIconGagnant }} - // fontSize="default" - // /> - // )} - // plf={baissePlf} - // title="ayant une baisse" - // /> - // ) : null + content2={ + (!isDisabledEtat && !isLoadingEtat) ? ( + <GagnantsPerdantsContent + amendement={baisseReforme} + icon={( + <ArrowDownwardIcon + classes={{ root: styles.styleIconGagnant }} + fontSize="default" + /> + )} + plf={baissePlf} + title="ayant une baisse de plus de 5%" + /> + ) : null } - content3={null - // (!isDisabledEtat && !isLoadingEtat) ? ( - // <Fragment> - // <GagnantsPerdantsContent - // amendement={neutreReforme} - // caption="de foyers toujours exonérés" - // captionAmendement={neutreZeroReforme} - // captionPlf={neutreZeroPlf} - // icon={( - // <NotInterestedIcon - // classes={{ root: styles.styleIconNeutre }} - // fontSize="default" - // /> - // )} - // plf={neutrePlf} - // title="non concernés" - // /> - // <div className={styles.sourceInsee}> - // * Chiffrages indicatifs. - // <br /> - // Données ERFS-FPR (Insee 2018). - // </div> - // </Fragment> - // ) : null + content3={ + (!isDisabledEtat && !isLoadingEtat) ? ( + <Fragment> + <GagnantsPerdantsContent + amendement={neutreReforme} + caption="de foyers toujours exonérés" + captionAmendement={neutreZeroReforme} + captionPlf={neutreZeroPlf} + icon={( + <NotInterestedIcon + classes={{ root: styles.styleIconNeutre }} + fontSize="default" + /> + )} + plf={neutrePlf} + title="non concernés" + /> + <div className={styles.sourceInsee}> + * Chiffrages indicatifs. + <br /> + Données ERFS-FPR (Insee 2018). + </div> + </Fragment> + ) : null } icon={<Icon height="40" icon={familyManGirlGirl} width="40" />} subTitle="en millions pour population à RFR stable depuis 2019" diff --git a/redux/actions/format-reforme.ts b/redux/actions/format-reforme.ts index b4709cd739b784a6447934f19f09b7d2a7217ef9..5a0c0224ea070b503751c94f604a9cce010e7377 100644 --- a/redux/actions/format-reforme.ts +++ b/redux/actions/format-reforme.ts @@ -3,16 +3,22 @@ import merge from "lodash/merge"; export function formatReforme(reforme) { return merge({}, reforme, { impot_revenu: { - bareme: { - taux: reforme.impot_revenu.bareme.taux.map(taux => taux / 100), + bareme_ir_depuis_1945: { + taux: reforme.impot_revenu.bareme_ir_depuis_1945.taux.map( + (taux) => taux / 100 + ), }, - decote: { - taux: reforme.impot_revenu.decote.taux / 100, - }, - plafond_qf: { - abat_dom: { - taux_GuadMarReu: reforme.impot_revenu.plafond_qf.abat_dom.taux_GuadMarReu / 100, - taux_GuyMay: reforme.impot_revenu.plafond_qf.abat_dom.taux_GuyMay / 100, + calcul_impot_revenu: { + plaf_qf: { + decote: { + taux: reforme.impot_revenu.calcul_impot_revenu.plaf_qf.decote.taux / 100, + }, + abat_dom: { + taux_GuadMarReu: + reforme.impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.taux_GuadMarReu / 100, + taux_GuyMay: + reforme.impot_revenu.calcul_impot_revenu.plaf_qf.abat_dom.taux_GuyMay / 100, + }, }, }, }, diff --git a/redux/actions/reforme-update-by-name.ts b/redux/actions/reforme-update-by-name.ts index 20c6ce5b29d2fdaffa7447a09aeab4cae2c2a3aa..de9c6da540a6b81a17550ca02d38e4884360ec10 100644 --- a/redux/actions/reforme-update-by-name.ts +++ b/redux/actions/reforme-update-by-name.ts @@ -11,7 +11,7 @@ const updateReformeByName = (name, prevValue) => { const shouldUpdateTaux = name.substring(0, 4) === "taux"; if (shouldUpdateTaux) type = "onUpdateReformeTaux"; - const shouldUpdatePlafond = name.substring(0, 10) === "plafond_qf"; + const shouldUpdatePlafond = name.substring(0, 10) === "plaf_qf"; if (shouldUpdatePlafond) type = "onUpdateReformePlafond"; return { name, type, value }; diff --git a/redux/reducers/parameters/amendement/ir.ts b/redux/reducers/parameters/amendement/ir.ts index 167e7a43e02bc120dd043a1d1f8ab7cc44484363..4f47e36662b91d72c90eca2b27cb979e878e46d0 100644 --- a/redux/reducers/parameters/amendement/ir.ts +++ b/redux/reducers/parameters/amendement/ir.ts @@ -19,18 +19,18 @@ const changeValueArray = (arrayToChange, indexToChange, newValue) => { const updateTaux = (prevState: IRState, name, value): IRState => { const identifier = parseInt(name.substring(4), 10); - let list = get(prevState, "bareme.taux"); + let list = get(prevState, "bareme_ir_depuis_1945.taux"); list = changeValueArray(list, identifier, value); - set(prevState, "bareme.taux", list); + set(prevState, "bareme_ir_depuis_1945.taux", list); return prevState; }; const updateBareme = (prevState: IRState, name, value): IRState => { if (Number.isNaN(value)) return prevState; const identifier = parseInt(name.substring(5), 10); - let list = get(prevState, "bareme.seuils"); + let list = get(prevState, "bareme_ir_depuis_1945.seuils"); list = changeValueArray(list, identifier, parseInt(value, 10)); - set(prevState, "bareme.seuils", list); + set(prevState, "bareme_ir_depuis_1945.seuils", list); return prevState; }; @@ -44,34 +44,34 @@ const updateGenerique = (prevState: IRState, name, value): IRState => { }; const addTranche = (prevState: IRState): IRState => { - const seuils = get(prevState, "bareme.seuils"); + const seuils = get(prevState, "bareme_ir_depuis_1945.seuils"); const newbt = seuils.length + 1; const lastIndex = newbt - 2; - let lastSeuil = get(prevState, `bareme.seuils.${lastIndex}`); + let lastSeuil = get(prevState, `bareme_ir_depuis_1945.seuils.${lastIndex}`); lastSeuil += 1; const nextSeuil = seuils.concat(lastSeuil); - set(prevState, "bareme.seuils", nextSeuil); + set(prevState, "bareme_ir_depuis_1945.seuils", nextSeuil); - const taux = get(prevState, "bareme.taux"); - const lastTaux = get(prevState, `bareme.taux.${lastIndex}`); + const taux = get(prevState, "bareme_ir_depuis_1945.taux"); + const lastTaux = get(prevState, `bareme_ir_depuis_1945.taux.${lastIndex}`); const nextTaux = taux.concat(lastTaux); - set(prevState, "bareme.taux", nextTaux); + set(prevState, "bareme_ir_depuis_1945.taux", nextTaux); return prevState; }; const removeTranche = (prevState: IRState): IRState => { - const seuils = get(prevState, "bareme.seuils"); + const seuils = get(prevState, "bareme_ir_depuis_1945.seuils"); const newnbt = seuils.length - 1; if (newnbt <= 0) return prevState; const nextSeuils = seuils.slice(0, newnbt); - set(prevState, "bareme.seuils", nextSeuils); + set(prevState, "bareme_ir_depuis_1945.seuils", nextSeuils); - const taux = get(prevState, "bareme.taux"); + const taux = get(prevState, "bareme_ir_depuis_1945.taux"); const nextTaux = taux.slice(0, newnbt); - set(prevState, "bareme.taux", nextTaux); + set(prevState, "bareme_ir_depuis_1945.taux", nextTaux); return prevState; }; diff --git a/redux/reducers/parameters/base/ir.ts b/redux/reducers/parameters/base/ir.ts index ab13e77c00f706ab39b635e3cd216c79a439ab02..ef8f26edf552814853b7accba3e6479324f40862 100644 --- a/redux/reducers/parameters/base/ir.ts +++ b/redux/reducers/parameters/base/ir.ts @@ -3,7 +3,7 @@ import { IRState } from "../interfaces"; export const BASE_IR_DEFAULT_STATE: IRState = { // Base = 2022 - bareme: { + bareme_ir_depuis_1945: { seuils: [10225, 26070, 74545, 160336], taux: [11, 30, 41, 45], }, @@ -21,45 +21,68 @@ export const BASE_IR_DEFAULT_STATE: IRState = { }, partsSelonNombrePAC: [ { - celibataire: 1, divorce: 1, mariesOuPacses: 2, veuf: 1, + celibataire: 1, + divorce: 1, + mariesOuPacses: 2, + veuf: 1, }, { - celibataire: 1.5, divorce: 1.5, mariesOuPacses: 2.5, veuf: 2.5, + celibataire: 1.5, + divorce: 1.5, + mariesOuPacses: 2.5, + veuf: 2.5, }, { - celibataire: 2, divorce: 2, mariesOuPacses: 3, veuf: 3, + celibataire: 2, + divorce: 2, + mariesOuPacses: 3, + veuf: 3, }, { - celibataire: 3, divorce: 3, mariesOuPacses: 4, veuf: 4, + celibataire: 3, + divorce: 3, + mariesOuPacses: 4, + veuf: 4, }, { - celibataire: 4, divorce: 4, mariesOuPacses: 5, veuf: 5, + celibataire: 4, + divorce: 4, + mariesOuPacses: 5, + veuf: 5, }, { - celibataire: 5, divorce: 5, mariesOuPacses: 6, veuf: 6, + celibataire: 5, + divorce: 5, + mariesOuPacses: 6, + veuf: 6, }, { - celibataire: 6, divorce: 6, mariesOuPacses: 7, veuf: 7, + celibataire: 6, + divorce: 6, + mariesOuPacses: 7, + veuf: 7, }, ], }, - decote: { - seuil_celib: 790, - seuil_couple: 1307, - taux: 45.25, - }, - plafond_qf: { - abat_dom: { - plaf_GuadMarReu: 2450, - plaf_GuyMay: 4050, - taux_GuadMarReu: 30, - taux_GuyMay: 40, + calcul_impot_revenu: { + plaf_qf: { + decote: { + seuil_celib: 790, + seuil_couple: 1307, + taux: 45.25, + }, + abat_dom: { + plaf_GuadMarReu: 2450, + plaf_GuyMay: 4050, + taux_GuadMarReu: 30, + taux_GuyMay: 40, + }, + celib: 951, + celib_enf: 3756, + maries_ou_pacses: 1592, + reduc_postplafond: 1587, + reduc_postplafond_veuf: 1772, }, - celib: 951, - celib_enf: 3756, - maries_ou_pacses: 1592, - reduc_postplafond: 1587, - reduc_postplafond_veuf: 1772, }, }; diff --git a/redux/reducers/parameters/interfaces/ir-state.ts b/redux/reducers/parameters/interfaces/ir-state.ts index 7bd9efd56324920a7573cd8f5b1ed91c6c9b64bd..0b919793415aa1a3abef4b2f5ad3515effd4f292 100644 --- a/redux/reducers/parameters/interfaces/ir-state.ts +++ b/redux/reducers/parameters/interfaces/ir-state.ts @@ -1,52 +1,54 @@ /* eslint-disable camelcase */ export interface IRState { - bareme: { - seuils: number[]; - taux: number[]; - }; - decote: { - seuil_celib: number; - seuil_couple: number; - taux: number; - }; - plafond_qf: { - abat_dom: { - plaf_GuadMarReu: number; - plaf_GuyMay: number; - taux_GuadMarReu: number; - taux_GuyMay: number; + bareme_ir_depuis_1945: { + seuils: number[]; + taux: number[]; }; - celib: number; - celib_enf: number; - maries_ou_pacses: number; - reduc_postplafond: number; - reduc_postplafond_veuf: number; - }; - calculNombreParts: { - partsSelonNombrePAC: { - veuf: number; - mariesOuPacses: number; - celibataire: number; - divorce: number - }[]; - partsParPACAuDela: number; - partsParPACChargePartagee: { - zeroChargePrincipale: { - deuxPremiers: number; - suivants: number + calculNombreParts: { + partsSelonNombrePAC: { + veuf: number; + mariesOuPacses: number; + celibataire: number; + divorce: number; + }[]; + partsParPACAuDela: number; + partsParPACChargePartagee: { + zeroChargePrincipale: { + deuxPremiers: number; + suivants: number; + }; + unChargePrincipale: { + premier: number; + suivants: number; + }; + deuxOuPlusChargePrincipale: { + suivants: number; + }; }; - unChargePrincipale: { - premier: number; - suivants: number - }; - deuxOuPlusChargePrincipale: { - suivants: number + bonusParentIsole: { + auMoinsUnChargePrincipale: number; + zeroChargePrincipaleUnPartage: number; + zeroChargeprincipaleDeuxOuPlusPartage: number; }; }; - bonusParentIsole: { - auMoinsUnChargePrincipale: number; - zeroChargePrincipaleUnPartage: number; - zeroChargeprincipaleDeuxOuPlusPartage: number; + calcul_impot_revenu: { + plaf_qf: { + decote: { + seuil_celib: number; + seuil_couple: number; + taux: number; + }; + abat_dom: { + plaf_GuadMarReu: number; + plaf_GuyMay: number; + taux_GuadMarReu: number; + taux_GuyMay: number; + }; + celib: number; + celib_enf: number; + maries_ou_pacses: number; + reduc_postplafond: number; + reduc_postplafond_veuf: number; + }; }; - } } diff --git a/redux/reducers/parameters/plf/ir.ts b/redux/reducers/parameters/plf/ir.ts index e5dd4a09295f0bf080d136199072290cd3fc2fab..1259dc454dcd29c3000d3be271b7df3d8b655988 100644 --- a/redux/reducers/parameters/plf/ir.ts +++ b/redux/reducers/parameters/plf/ir.ts @@ -2,66 +2,89 @@ import { IRState } from "../interfaces"; export const PLF_IR_DEFAULT_STATE: IRState = { - // PLF 2022 désactivé tant que égal à la loi en vigueur + // PLF 2023 désactivé tant que égal à la loi en vigueur // dans : redux/reducers/parameters/base/ir.ts - bareme: { - seuils: [10225, 26070, 74545, 160336], - taux: [11, 30, 41, 45], - }, - calculNombreParts: { - bonusParentIsole: { - auMoinsUnChargePrincipale: 0.5, - zeroChargePrincipaleUnPartage: 0.25, - zeroChargeprincipaleDeuxOuPlusPartage: 0.5, + bareme_ir_depuis_1945: { + seuils: [10777, 27478, 78570, 168994], + taux: [11, 30, 41, 45], }, - partsParPACAuDela: 1, - partsParPACChargePartagee: { - deuxOuPlusChargePrincipale: { suivants: 0.5 }, - unChargePrincipale: { premier: 0.25, suivants: 0.5 }, - zeroChargePrincipale: { deuxPremiers: 0.25, suivants: 0.5 }, - }, - partsSelonNombrePAC: [ - { - celibataire: 1, divorce: 1, mariesOuPacses: 2, veuf: 1, - }, - { - celibataire: 1.5, divorce: 1.5, mariesOuPacses: 2.5, veuf: 2.5, - }, - { - celibataire: 2, divorce: 2, mariesOuPacses: 3, veuf: 3, + calculNombreParts: { + bonusParentIsole: { + auMoinsUnChargePrincipale: 0.5, + zeroChargePrincipaleUnPartage: 0.25, + zeroChargeprincipaleDeuxOuPlusPartage: 0.5, }, - { - celibataire: 3, divorce: 3, mariesOuPacses: 4, veuf: 4, + partsParPACAuDela: 1, + partsParPACChargePartagee: { + deuxOuPlusChargePrincipale: { suivants: 0.5 }, + unChargePrincipale: { premier: 0.25, suivants: 0.5 }, + zeroChargePrincipale: { deuxPremiers: 0.25, suivants: 0.5 }, }, - { - celibataire: 4, divorce: 4, mariesOuPacses: 5, veuf: 5, - }, - { - celibataire: 5, divorce: 5, mariesOuPacses: 6, veuf: 6, - }, - { - celibataire: 6, divorce: 6, mariesOuPacses: 7, veuf: 7, + partsSelonNombrePAC: [ + { + celibataire: 1, + divorce: 1, + mariesOuPacses: 2, + veuf: 1, + }, + { + celibataire: 1.5, + divorce: 1.5, + mariesOuPacses: 2.5, + veuf: 2.5, + }, + { + celibataire: 2, + divorce: 2, + mariesOuPacses: 3, + veuf: 3, + }, + { + celibataire: 3, + divorce: 3, + mariesOuPacses: 4, + veuf: 4, + }, + { + celibataire: 4, + divorce: 4, + mariesOuPacses: 5, + veuf: 5, + }, + { + celibataire: 5, + divorce: 5, + mariesOuPacses: 6, + veuf: 6, + }, + { + celibataire: 6, + divorce: 6, + mariesOuPacses: 7, + veuf: 7, + }, + ], + }, + calcul_impot_revenu: { + plaf_qf: { + decote: { + seuil_celib: 833, + seuil_couple: 1378, + taux: 45.25, + }, + abat_dom: { + plaf_GuadMarReu: 2450, + plaf_GuyMay: 4050, + taux_GuadMarReu: 30, + taux_GuyMay: 40, + }, + celib: 1002, + celib_enf: 3959, + maries_ou_pacses: 1678, + reduc_postplafond: 1673, + reduc_postplafond_veuf: 1868, }, - ], - }, - decote: { - seuil_celib: 790, - seuil_couple: 1307, - taux: 45.25, - }, - plafond_qf: { - abat_dom: { - plaf_GuadMarReu: 2450, - plaf_GuyMay: 4050, - taux_GuadMarReu: 30, - taux_GuyMay: 40, }, - celib: 951, - celib_enf: 3756, - maries_ou_pacses: 1592, - reduc_postplafond: 1587, - reduc_postplafond_veuf: 1772, - }, }; export const ir = (state = PLF_IR_DEFAULT_STATE) => state; diff --git a/redux/reducers/results/plf/ir.ts b/redux/reducers/results/plf/ir.ts index f5d56bcb454b2b3152e4830b78c00b413512d831..ae04a056e3e1aec1f393857530be3c7f49c2f944 100644 --- a/redux/reducers/results/plf/ir.ts +++ b/redux/reducers/results/plf/ir.ts @@ -30,9 +30,9 @@ export function ir( isFetching: false, state: { //With PLF: - //casTypes: convertCasTypes(action.data, "plf"), + casTypes: convertCasTypes(action.data, "plf"), //Without PLF: - casTypes: convertCasTypes(action.data, "avant"), + //casTypes: convertCasTypes(action.data, "avant"), }, }; case "REMOVE_CAS_TYPE": diff --git a/redux/reducers/results/total-pop.ts b/redux/reducers/results/total-pop.ts index f3a2b86542e7dfdbdd6aaa5c843d4858f34158e7..6b0823999645d8dae3263e9074954853a7251de4 100644 --- a/redux/reducers/results/total-pop.ts +++ b/redux/reducers/results/total-pop.ts @@ -1,10 +1,11 @@ /* eslint-disable camelcase */ import { get } from "lodash"; +// TODO: PLF2023 /** - To update the DEFAULT_STATE below, use leximpact-server Web API response + To update the DEFAULT_STATE below, use leximpact-server Web API response as its format should be identical to the State interface below: * if the "base" (= "avant") law is updated, set the compulsory attributes of the State interface to Web API values, - * if the "plf" is activated, add all the "plf" optional attributes of the State interface + * if the "plf" is activated, add all the "plf" optional attributes of the State interface and set them to Web API values. * and do not set any "apres" attribute as the DEFAULT_STATE should NOT include any "amendement". */ @@ -71,6 +72,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 0, irpp_on_rfr_avant: 0, avg_irpp_on_avg_rfr_avant: 0, + plf: 0.0, + sum_irpp_plf: 0.0, + avg_irpp_plf: 0.0, + irpp_on_rfr_plf: 0.0, + avg_irpp_on_avg_rfr_plf: 0.0, }, { sum_rfr: 23436330862.321556, @@ -81,6 +87,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 0, irpp_on_rfr_avant: 0, avg_irpp_on_avg_rfr_avant: 0, + plf: 0.0, + sum_irpp_plf: 0.0, + avg_irpp_plf: 0.0, + irpp_on_rfr_plf: 0.0, + avg_irpp_on_avg_rfr_plf: 0.0, }, { sum_rfr: 43302552094.83705, @@ -91,6 +102,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 0, irpp_on_rfr_avant: 0, avg_irpp_on_avg_rfr_avant: 0, + plf: 0.0, + sum_irpp_plf: 0.0, + avg_irpp_plf: 0.0, + irpp_on_rfr_plf: 0.0, + avg_irpp_on_avg_rfr_plf: 0.0, }, { sum_rfr: 59109327425.504074, @@ -101,6 +117,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 42.62484639833265, irpp_on_rfr_avant: 0.002764217998220076, avg_irpp_on_avg_rfr_avant: 0.002764217998220076, + plf: 55561764.28025984, + sum_irpp_plf: 55561764.28025984, + avg_irpp_plf: 14.494743901435179, + irpp_on_rfr_plf: 0.0009399829781521129, + avg_irpp_on_avg_rfr_plf: 0.0009399829781521129, }, { sum_rfr: 72143223721.7203, @@ -111,6 +132,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 246.4476941141624, irpp_on_rfr_avant: 0.013095492147211086, avg_irpp_on_avg_rfr_avant: 0.013095492147211086, + plf: 814866633.9530004, + sum_irpp_plf: 814866633.9530004, + avg_irpp_plf: 212.56606106370742, + irpp_on_rfr_plf: 0.011295123007126496, + avg_irpp_on_avg_rfr_plf: 0.011295123007126496, }, { sum_rfr: 87683818162.51213, @@ -121,6 +147,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 444.3374937725895, irpp_on_rfr_avant: 0.019425955992936488, avg_irpp_on_avg_rfr_avant: 0.01942595599293649, + plf: 1677008280.465949, + sum_irpp_plf: 1677008280.465949, + avg_irpp_plf: 437.46802431716037, + irpp_on_rfr_plf: 0.019125628056201122, + avg_irpp_on_avg_rfr_plf: 0.019125628056201126, }, { sum_rfr: 110115965949.4268, @@ -131,6 +162,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 790.919634669199, irpp_on_rfr_avant: 0.02753306555953969, avg_irpp_on_avg_rfr_avant: 0.027533065559539695, + plf: 2863779561.8641014, + sum_irpp_plf: 2863779561.8641014, + avg_irpp_plf: 747.0799493819293, + irpp_on_rfr_plf: 0.026006939374982215, + avg_irpp_on_avg_rfr_plf: 0.026006939374982215, }, { sum_rfr: 137184876883.36745, @@ -141,6 +177,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 1544.3776994119555, irpp_on_rfr_avant: 0.04315351816046735, avg_irpp_on_avg_rfr_avant: 0.04315351816046735, + plf: 5810007005.203121, + sum_irpp_plf: 5810007005.203121, + avg_irpp_plf: 1515.6807399278928, + irpp_on_rfr_plf: 0.04235158541360509, + avg_irpp_on_avg_rfr_plf: 0.04235158541360509, }, { sum_rfr: 179011128573.3233, @@ -151,6 +192,11 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 2890.98796897856, irpp_on_rfr_avant: 0.061904168031273424, avg_irpp_on_avg_rfr_avant: 0.061904168031273424, + plf: 11432749052.604158, + sum_irpp_plf: 11432749052.604158, + avg_irpp_plf: 2982.613872095849, + irpp_on_rfr_plf: 0.06386613320310294, + avg_irpp_on_avg_rfr_plf: 0.06386613320310294, }, { sum_rfr: 379094672499.9683, @@ -161,17 +207,38 @@ const DEFAULT_STATE: State = { avg_irpp_avant: 15538.374444499754, irpp_on_rfr_avant: 0.15710586408855648, avg_irpp_on_avg_rfr_avant: 0.15710586408855648, + plf: 64246027701.62953, + sum_irpp_plf: 64246027701.62953, + avg_irpp_plf: 16761.457746430395, + irpp_on_rfr_plf: 0.16944695903842485, + avg_irpp_on_avg_rfr_plf: 0.16944695903842483, }, ], - foyersFiscauxTouches: {}, + foyersFiscauxTouches: { + avant_to_plf: { + neutre_zero: 19649623, + perdant: 7620826, + neutre: 10289, + gagnant: 11052238 + }, + }, frontieresDeciles: [ - 2350.426513671875, 8942.0009765625, 12885.66796875, 16710.77734375, - 20210.9921875, 25134.4453125, 31086.5, 39143.7265625, 54232.7890625, - 8527243, + 2365.825439453125, + 9034.31640625, + 13487.224609375, + 17108.0, + 20664.244140625, + 25757.998046875, + 31956.744140625, + 40103.5703125, + 55275.3984375, + 8615171.0 ], total: { - avant: 82400000000.00001, + //avant: 82400000000.00001, PLF 2022 + avant: 86800000000.00001, // PLF 2023, chiffre révisé 2022 (page 15 du PLF2023) + plf: 86887586871.0001 // PLF2023 page 136 }, };