Skip to content
Snippets Groups Projects
Commit eb6f3661 authored by Toufic Batache's avatar Toufic Batache
Browse files

Budget: add type "allegement"

parent 4bc7a892
Branches
Tags
No related merge requests found
Pipeline #15127 passed
......@@ -172,6 +172,17 @@
}
}
if (type === "allegement") {
return {
amendment: showAmendment
? amendmentStateBudget[variableName]
: undefined,
bill: showBill ? billStateBudget[variableName] : undefined,
law: showRevaluation ? undefined : lawStateBudget[variableName],
revaluation: showRevaluation ? lawStateBudget[variableName] : undefined,
}
}
return undefined
}
......@@ -213,7 +224,9 @@
? -lawQuantile[variableMeanKey]
: undefined,
}
} else {
}
if (type === "prestation") {
return {
amendment: showAmendment
? Math.abs(-amendmentQuantile[variableMeanKey])
......@@ -227,6 +240,19 @@
: undefined,
}
}
if (type === "allegement") {
return {
amendment: showAmendment
? amendmentQuantile[variableMeanKey]
: undefined,
bill: showBill ? billQuantile[variableMeanKey] : undefined,
law: showRevaluation ? undefined : lawQuantile[variableMeanKey],
revaluation: showRevaluation
? lawQuantile[variableMeanKey]
: undefined,
}
}
}
}
......@@ -279,6 +305,24 @@
}
}
if (type === "allegement") {
return {
amendment: showAmendment
? yFromQuantile(amendmentQuantile) /
amendmentStateBudget[variableName]
: undefined,
bill: showBill
? yFromQuantile(billQuantile) / billStateBudget[variableName]
: undefined,
law: showRevaluation
? undefined
: yFromQuantile(lawQuantile) / lawStateBudget[variableName],
revaluation: showRevaluation
? yFromQuantile(lawQuantile) / lawStateBudget[variableName]
: undefined,
}
}
return undefined
}
......@@ -335,6 +379,24 @@
}
}
if (type === "allegement") {
return {
amendment: showAmendment
? amendmentQuantile[variableMeanKey] /
amendmentQuantile[revenueMeanKey]
: undefined,
bill: showBill
? billQuantile[variableMeanKey] / billQuantile[revenueMeanKey]
: undefined,
law: showRevaluation
? undefined
: lawQuantile[variableMeanKey] / lawQuantile[revenueMeanKey],
revaluation: showRevaluation
? lawQuantile[variableMeanKey] / lawQuantile[revenueMeanKey]
: undefined,
}
}
return undefined
}
......@@ -436,6 +498,10 @@
return quantile[`${variableName}_sum`]
}
if (type === "allegement") {
return quantile[`${variableName}_sum`]
}
return undefined
}
</script>
......@@ -827,7 +893,7 @@
{:else if organisme === "unedic"}
de l'Unédic.
{/if}
{:else}
{:else if type === "prelevement"}
contribue pour <span class="text-xl font-bold"
><ValueChange
compact
......@@ -858,6 +924,28 @@
{:else if organisme === "unedic"}
pour l'Unédic.
{/if}
{:else if type === "allegement"}
est allégé de <span class="text-xl font-bold"
><ValueChange
compact
inline
unitName="currency-EUR"
valueByCalculationName={{
amendment: showAmendment
? Math.abs(yFromQuantile(amendmentQuantile))
: undefined,
bill: showBill
? Math.abs(yFromQuantile(billQuantile))
: undefined,
law: showRevaluation
? undefined
: Math.abs(yFromQuantile(lawQuantile)),
revaluation: showRevaluation
? Math.abs(yFromQuantile(lawQuantile))
: undefined,
}}
/></span
>{variableLabels.of}.
{/if}
{:else}
représente <span class="text-xl font-bold"
......@@ -904,8 +992,10 @@
du total des
{#if type === "prestation"}
dépenses
{:else}
{:else if type === "prelevement"}
recettes
{:else if type === "allegement"}
non-recettes
{/if}
{variableLabels.ofThe}.
</p>
......@@ -924,7 +1014,11 @@
foyer
{/if}
{#if (!showAmendment || -amendmentQuantile[variableMeanKey] < 0) && (!showBill || -billQuantile[variableMeanKey] < 0) && -lawQuantile[variableMeanKey] < 0}
{#if type === "prestation"}
reçoit
{:else if type === "allegement"}
est allégé de
{/if}
{:else if (!showAmendment || -amendmentQuantile[variableMeanKey] > 0) && (!showBill || -billQuantile[variableMeanKey] > 0) && -lawQuantile[variableMeanKey] > 0}
est prélevé de
{:else}
......
......@@ -103,8 +103,10 @@
<span slot="title">
{#if budgetVariable.type === "prestation"}
Dépenses {budgetVariable.labels.ofThe}
{:else}
{:else if budgetVariable.type === "prelevement"}
Recettes
{:else if budgetVariable.type === "allegement"}
Non-recettes
{/if}
{#if budgetVariable.organisme === "etat"}
pour l'État
......
......@@ -151,9 +151,14 @@
</span>
</div>
</div>
</Tooltip>&nbsp;sont {type === "prestation"
? "bénéficiaires"
: "prélevés"}
</Tooltip>
{#if type === "allegement"}
bénéficient de l'allègement
{:else if type === "prelevement"}
sont prélevés
{:else if type === "prestation"}
sont bénéficiaires
{/if}
{variableLabels.of}.</span
>
</div>
......
......@@ -15,7 +15,7 @@ export type BudgetVariableOrganisme =
| "securite_sociale"
| "unedic"
export type BudgetVariableType = "prelevement" | "prestation"
export type BudgetVariableType = "allegement" | "prelevement" | "prestation"
export interface BudgetVariable {
// Variables groupées par l'impact budgétaire commun qu'elles partagent (celle du nom du groupe) :
......@@ -118,7 +118,11 @@ export const budgetEditableParametersNameByVariableName: {
agirc_arrco_salarie: new Set([
"prelevements_sociaux.regimes_complementaires_retraite_secteur_prive.agirc_arrco.salarie.agirc_arrco",
]),
allegement_general: new Set(["prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.plafond", "prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.entreprises_de_50_salaries_et_plus", "prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.entreprises_de_moins_de_50_salaries"]),
allegement_general: new Set([
"prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.plafond",
"prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.entreprises_de_50_salaries_et_plus",
"prelevements_sociaux.reductions_cotisations_sociales.allegement_general.ensemble_des_entreprises.entreprises_de_moins_de_50_salaries",
]),
contribution_equilibre_general_employeur: new Set([
"prelevements_sociaux.regimes_complementaires_retraite_secteur_prive.ceg.employeur.ceg",
]),
......@@ -129,8 +133,12 @@ export const budgetEditableParametersNameByVariableName: {
"prelevements_sociaux.cotisations_securite_sociale_regime_general.csa.employeur.csa",
]),
cotisations_employeur_assurance_chomage: new Set([]),
chomage_employeur: new Set(["prelevements_sociaux.cotisations_regime_assurance_chomage.chomage.employeur.chomage"]),
ags: new Set(["prelevements_sociaux.cotisations_regime_assurance_chomage.ags.employeur.ags"]),
chomage_employeur: new Set([
"prelevements_sociaux.cotisations_regime_assurance_chomage.chomage.employeur.chomage",
]),
ags: new Set([
"prelevements_sociaux.cotisations_regime_assurance_chomage.ags.employeur.ags",
]),
csg_deductible_retraite: new Set([
"prelevements_sociaux.contributions_sociales.csg.remplacement.pensions_retraite_invalidite.deductible.taux_median",
"prelevements_sociaux.contributions_sociales.csg.remplacement.pensions_retraite_invalidite.deductible.taux_plein",
......@@ -201,10 +209,12 @@ export const budgetEditableParametersNameByVariableName: {
"prelevements_sociaux.pss.plafond_securite_sociale_mensuel",
]),
famille_net_allegement: new Set([]),
famille: new Set(["prelevements_sociaux.cotisations_securite_sociale_regime_general.famille.employeur.famille"]),
famille: new Set([
"prelevements_sociaux.cotisations_securite_sociale_regime_general.famille.employeur.famille",
]),
allegement_cotisation_allocations_familiales: new Set([
"prelevements_sociaux.reductions_cotisations_sociales.allegement_cotisation_allocations_familiales.reduction",
"prelevements_sociaux.reductions_cotisations_sociales.allegement_cotisation_allocations_familiales.plafond_smic"
"prelevements_sociaux.reductions_cotisations_sociales.allegement_cotisation_allocations_familiales.plafond_smic",
]),
fnal: new Set([
"prelevements_sociaux.autres_taxes_participations_assises_salaires.fnal.contribution_moins_de_50_salaries",
......@@ -235,8 +245,13 @@ export const budgetEditableParametersNameByVariableName: {
"impot_revenu.calcul_impot_revenu.plaf_qf.decote.taux",
]),
mmid_employeur_net_allegement: new Set([]),
mmid_employeur: new Set(["prelevements_sociaux.cotisations_securite_sociale_regime_general.mmid.employeur.maladie"]),
allegement_cotisation_maladie: new Set(["prelevements_sociaux.reductions_cotisations_sociales.alleg_gen.mmid.plafond", "prelevements_sociaux.reductions_cotisations_sociales.alleg_gen.mmid.taux"]),
mmid_employeur: new Set([
"prelevements_sociaux.cotisations_securite_sociale_regime_general.mmid.employeur.maladie",
]),
allegement_cotisation_maladie: new Set([
"prelevements_sociaux.reductions_cotisations_sociales.alleg_gen.mmid.plafond",
"prelevements_sociaux.reductions_cotisations_sociales.alleg_gen.mmid.taux",
]),
vieillesse_deplafonnee_employeur: new Set([
"prelevements_sociaux.cotisations_securite_sociale_regime_general.cnav.employeur.vieillesse_deplafonnee",
]),
......@@ -318,17 +333,75 @@ export const budgetVariablesConfig: { [variableName: string]: BudgetVariable } =
quantileCompareVariables: ["agirc_arrco_salarie", "rfr"],
type: "prelevement",
},
ags: {
labels: {
default: "AGS",
of: "de contribution au régime de garantie des salaires",
ofThe: "des contributions au régime de garantie des salaires",
the: "les contributions au régime de garantie des salaires",
},
organisme: "unedic",
outputVariables: ["rfr_par_part", "ags"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["ags", "rfr"],
type: "prelevement",
},
allegement_cotisation_allocations_familiales: {
labels: {
default: "Allègement de cotisations d'allocations familiales",
of: "de cotisations d'allocations familiales",
ofThe: "des cotisations d'allocations familiales",
the: "les cotisations d'allocations familiales",
},
organisme: "securite_sociale",
outputVariables: [
"rfr_par_part",
"allegement_cotisation_allocations_familiales",
],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: [
"allegement_cotisation_allocations_familiales",
"rfr",
],
type: "allegement",
},
allegement_cotisation_maladie: {
labels: {
default: "Allègement MMID",
of: "de cotisations maladie-maternité-invalidité-décès",
ofThe: "des cotisations maladie-maternité-invalidité-décès",
the: "les cotisations maladie-maternité-invalidité-décès",
},
organisme: "securite_sociale",
outputVariables: ["rfr_par_part", "allegement_cotisation_maladie"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["allegement_cotisation_maladie", "rfr"],
type: "allegement",
},
allegement_general: {
labels: {
default: "Réduction générale",
of: "de réduction générale des cotisations employeur",
ofThe: "des réductions générale des cotisations employeur",
the: "les réductions générale des cotisations employeur",
of: "de cotisations employeur",
ofThe: "des cotisations employeur",
the: "les cotisations employeur",
},
organisme: "securite_sociale",
outputVariables: ["rfr_par_part", "allegement_general"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["allegement_general", "rfr"],
type: "allegement",
},
chomage_employeur: {
labels: {
default: "Cotisation d'assurance chômage",
of: "de cotisation assurance chômage",
ofThe: "des cotisations d'assurance chômage",
the: "les cotisations d'assurance chômage",
},
organisme: "unedic",
outputVariables: ["rfr_par_part", "chomage_employeur"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["chomage_employeur", "rfr"],
type: "prelevement",
},
contribution_equilibre_general_employeur: {
......@@ -401,44 +474,6 @@ export const budgetVariablesConfig: { [variableName: string]: BudgetVariable } =
],
type: "prelevement",
},
chomage_employeur: {
labels: {
default: "Cotisation d'assurance chômage",
of: "de cotisation assurance chômage",
ofThe: "des cotisations d'assurance chômage",
the: "les cotisations d'assurance chômage",
},
organisme: "unedic",
outputVariables: [
"rfr_par_part",
"chomage_employeur",
],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: [
"chomage_employeur",
"rfr",
],
type: "prelevement",
},
ags: {
labels: {
default: "AGS",
of: "de contribution au régime de garantie des salaires",
ofThe: "des contributions au régime de garantie des salaires",
the: "les contributions au régime de garantie des salaires",
},
organisme: "unedic",
outputVariables: [
"rfr_par_part",
"ags",
],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: [
"ags",
"rfr",
],
type: "prelevement",
},
csg_retraite: {
labels: {
default: "CSG",
......@@ -567,19 +602,6 @@ export const budgetVariablesConfig: { [variableName: string]: BudgetVariable } =
quantileCompareVariables: ["famille", "rfr"],
type: "prelevement",
},
allegement_cotisation_allocations_familiales: {
labels: {
default: "Allègement de cotisations d'allocations familiales",
of: "d'allègement de cotisations d'allocations familiales",
ofThe: "des allègements de cotisations d'allocations familiales",
the: "les allègements de cotisations d'allocations familiales",
},
organisme: "securite_sociale",
outputVariables: ["rfr_par_part", "allegement_cotisation_allocations_familiales"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["allegement_cotisation_allocations_familiales", "rfr"],
type: "prelevement",
},
fnal: {
labels: {
default: "FNAL",
......@@ -633,19 +655,6 @@ export const budgetVariablesConfig: { [variableName: string]: BudgetVariable } =
quantileCompareVariables: ["mmid_employeur", "rfr"],
type: "prelevement",
},
allegement_cotisation_maladie: {
labels: {
default: "Allègement MMID",
of: "d'allègement MMID'",
ofThe: "des allègements MMID",
the: "les allègements MMID",
},
organisme: "securite_sociale",
outputVariables: ["rfr_par_part", "allegement_cotisation_maladie"],
quantileBaseVariable: ["rfr_par_part"],
quantileCompareVariables: ["allegement_cotisation_maladie", "rfr"],
type: "prelevement",
},
vieillesse_employeur: {
labels: {
default: "Cotisations employeurs d'assurance vieillesse",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment