diff --git a/CHANGELOG.md b/CHANGELOG.md index 9353a127a7..ddf6679d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 51.14.0 [#1514](https://github.com/openfisca/openfisca-france/pull/1514) + +* Évolution du système socio-fiscal. +* Périodes concernées : toutes. +* Zones impactées : + * `patrimoine/livret_epargne_populaire.py`. + * `prestations/logement_social.py` +* Détails : + - Ajoute la condition d'autonomie à l'éligibilité au livret d'épargne populaire + - Ajoute la condition de majorité au logement social + ## 51.13.0 [#1513](https://github.com/openfisca/openfisca-france/pull/1513) * Évolution du système socio-fiscal. diff --git a/openfisca_france/model/patrimoine/livret_epargne_populaire.py b/openfisca_france/model/patrimoine/livret_epargne_populaire.py index 7b359a3aca..ed3d3b3819 100644 --- a/openfisca_france/model/patrimoine/livret_epargne_populaire.py +++ b/openfisca_france/model/patrimoine/livret_epargne_populaire.py @@ -1,5 +1,4 @@ -from openfisca_france.model.base import * - +from openfisca_france.model.base import Individu, Variable, min_, max_, not_, MONTH from numpy import ceil @@ -31,13 +30,15 @@ class livret_epargne_populaire_eligibilite(Variable): value_type = bool entity = Individu label = "Eligibilité au livret d'épargne populaire" + reference = "https://www.service-public.fr/particuliers/vosdroits/F2367" definition_period = MONTH def formula(individu, period, parameters): rfr = individu.foyer_fiscal('rfr', period.n_2) plafond = individu('livret_epargne_populaire_plafond', period) + independent = not_(individu('enfant_a_charge', period.this_year)) - return rfr <= plafond + return independent * (rfr <= plafond) class livret_epargne_populaire_taux(Variable): diff --git a/openfisca_france/model/prelevements_obligatoires/impot_revenu/ir.py b/openfisca_france/model/prelevements_obligatoires/impot_revenu/ir.py index 538af463a7..9091b9445a 100644 --- a/openfisca_france/model/prelevements_obligatoires/impot_revenu/ir.py +++ b/openfisca_france/model/prelevements_obligatoires/impot_revenu/ir.py @@ -215,18 +215,18 @@ def formula(foyer_fiscal, period, parameters): class enfant_a_charge(Variable): value_type = bool entity = Individu - label = "Enfant à charge non marié, de moins de 18 ans au 1er janvier de l'année de perception des" \ - " revenus, ou né durant la même année, ou handicapés quel que soit son âge" + label = "Enfant à charge non marié, de moins de 18 ans non émancipé au 1er janvier de l'année de perception des revenus, ou né durant la même année, ou handicapé quel que soit son âge" definition_period = YEAR def formula(individu, period): janvier = period.first_month decembre = janvier.offset(11, 'month') - age = individu('age', janvier) + + majeur = individu('majeur', janvier) handicap = individu('handicap', decembre) is_pac = individu.has_role(FoyerFiscal.PERSONNE_A_CHARGE) - return is_pac * ((age < 18) + handicap) + return is_pac * (not_(majeur) + handicap) class nbF(Variable): diff --git a/openfisca_france/model/prestations/logement_social.py b/openfisca_france/model/prestations/logement_social.py index 586ff4c411..f3fa50ba4c 100644 --- a/openfisca_france/model/prestations/logement_social.py +++ b/openfisca_france/model/prestations/logement_social.py @@ -162,8 +162,8 @@ class logement_social_eligible(Variable): label = "Logement social - Éligibilité" def formula_2017(famille, period, parameters): - + parent_majeur = famille.any(famille.members('majeur', period), role = Famille.PARENT) logement_social_plafond_ressources = famille('logement_social_plafond_ressources', period) revenu_fiscal_de_reference = famille.demandeur.foyer_fiscal('rfr', period.n_2) - return revenu_fiscal_de_reference <= logement_social_plafond_ressources + return parent_majeur * (revenu_fiscal_de_reference <= logement_social_plafond_ressources) diff --git a/setup.py b/setup.py index 95b85450be..82014e21ec 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name = "OpenFisca-France", - version = "51.13.0", + version = "51.14.0", author = "OpenFisca Team", author_email = "contact@openfisca.fr", classifiers = [ diff --git a/tests/formulas/logement_social_eligible.yaml b/tests/formulas/logement_social_eligible.yaml index ffe718a694..ae83ba0ace 100644 --- a/tests/formulas/logement_social_eligible.yaml +++ b/tests/formulas/logement_social_eligible.yaml @@ -1,23 +1,12 @@ -- name: Logement social - Paris et communes limitrophes - Éligible +- name: Logement social - Paris et communes limitrophes period: 2018-01 input: - logement_social_categorie_menage: categorie_1 - zone_logement_social: paris_communes_limitrophes + logement_social_categorie_menage: [categorie_1, categorie_1, categorie_1] + zone_logement_social: [paris_communes_limitrophes, paris_communes_limitrophes, paris_communes_limitrophes] + majeur: [true, false, true] rfr: - 2016: 12700 - 2017: 12733 - 2018: 12733 + 2016: [12700, 12700, 12735] + 2017: [12700, 12700, 12700] + 2018: [12700, 12700, 12700] output: - logement_social_eligible: true - -- name: Logement social - Paris et communes limitrophes - Non éligible - period: 2018-01 - input: - logement_social_categorie_menage: categorie_1 - zone_logement_social: paris_communes_limitrophes - rfr: - 2016: 12735 - 2017: 12700 - 2018: 12700 - output: - logement_social_eligible: false + logement_social_eligible: [true, false, false] diff --git a/tests/patrimoine/livret_epargne_populaire/eligibilite.yml b/tests/patrimoine/livret_epargne_populaire/eligibilite.yml index 20304185ee..af26bef1ac 100644 --- a/tests/patrimoine/livret_epargne_populaire/eligibilite.yml +++ b/tests/patrimoine/livret_epargne_populaire/eligibilite.yml @@ -1,15 +1,9 @@ - period: month:2019-05 input: rfr: - 2017: 9 - livret_epargne_populaire_plafond: 10 + 2017: [9, 9, 11] + livret_epargne_populaire_plafond: [10, 10, 10] + enfant_a_charge: + 2019: [true, false, false] output: - livret_epargne_populaire_eligibilite: true - -- period: month:2019-05 - input: - rfr: - 2017: 11 - livret_epargne_populaire_plafond: 10 - output: - livret_epargne_populaire_eligibilite: false + livret_epargne_populaire_eligibilite: [false, true, false]