From 573ed04e1f4a363164ff3f9bd8ae59f38c26f6ae Mon Sep 17 00:00:00 2001 From: Thomas Guillet Date: Thu, 28 Nov 2024 11:34:33 +0100 Subject: [PATCH] Ajoute la neutralisation des loyers --- .../variables/aide_logement.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openfisca_nouvelle_caledonie/variables/aide_logement.py b/openfisca_nouvelle_caledonie/variables/aide_logement.py index 0f51aa2..30d5108 100644 --- a/openfisca_nouvelle_caledonie/variables/aide_logement.py +++ b/openfisca_nouvelle_caledonie/variables/aide_logement.py @@ -176,6 +176,7 @@ def formula(household, period, parameters): loyer_reference = household("loyer_mensuel_reference", period) retraite = household("aide_logement_cas_particulier_retraite", period) loyer = where(retraite, loyer_reference, loyer_base) + aide_logement_neutralisation_loyer = household('aide_logement_neutralisation_loyer', period) charges = household("charges_locatives", period) @@ -186,7 +187,7 @@ def formula(household, period, parameters): typologie ] - a = loyer + charges - loyer_reference + a = loyer * (1 - aide_logement_neutralisation_loyer) + charges - loyer_reference * (1 - aide_logement_neutralisation_loyer) b = p * loyer_reference return min_(a, b) @@ -206,13 +207,14 @@ def formula(household, period, parameters): charges = household("charges_locatives", period) loyer_reference = household("loyer_mensuel_reference", period) + aide_logement_neutralisation_loyer = household('aide_logement_neutralisation_loyer', period) typologie = household("typologie_logement", period) pa = parameters( period ).benefits.aide_logement.supplement_loyer.solde_revenu_positif_pourcentage_charges - a = pa * (loyer + charges - loyer_reference) + a = pa * (loyer * (1 - aide_logement_neutralisation_loyer) + charges - loyer_reference * (1 - aide_logement_neutralisation_loyer)) pb = parameters( period @@ -398,6 +400,13 @@ class aide_logement_coef_error(Variable): default_value = 1 +# Clarification nécessaire +class aide_logement_neutralisation_loyer(Variable): + value_type = bool + entity = Household + definition_period = MONTH + + class aide_logement_cas_particulier_retraite(Variable): value_type = bool entity = Household