Skip to content

Commit

Permalink
Ajoute la neutralisation des loyers
Browse files Browse the repository at this point in the history
  • Loading branch information
guillett committed Nov 28, 2024
1 parent 59030ef commit 573ed04
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions openfisca_nouvelle_caledonie/variables/aide_logement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 573ed04

Please sign in to comment.