From c36543af4c85eed0f8d01cfc897a52a40a09bc11 Mon Sep 17 00:00:00 2001 From: Georges Faye Date: Wed, 2 Oct 2024 17:55:57 +0200 Subject: [PATCH] Fiabilisation du calcul des ressources pour l eligibilite a la CSS par application des abattements --- CHANGELOG.md | 25 +- .../minima_sociaux/cs/ressources.py | 105 ++++- .../cs/css/abattements/aah.yaml | 15 + .../cs/css/abattements/asi/couple.yaml | 11 + .../css/abattements/asi/personne_seule.yaml | 11 + .../cs/css/abattements/aspa_asv/couple.yaml | 11 + .../abattements/aspa_asv/personne_seule.yaml | 11 + .../cs/css/abattements/index.yaml | 1 + setup.py | 2 +- tests/formulas/cs/css.yaml | 6 +- tests/formulas/cs/css_abattement_aah.yaml | 299 ++++++++++++ tests/formulas/cs/css_abattement_asi.yaml | 436 ++++++++++++++++++ tests/formulas/cs/css_abattement_aspa.yaml | 185 ++++++++ 13 files changed, 1095 insertions(+), 23 deletions(-) create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aah.yaml create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/couple.yaml create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/personne_seule.yaml create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/couple.yaml create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/personne_seule.yaml create mode 100644 openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/index.yaml create mode 100644 tests/formulas/cs/css_abattement_aah.yaml create mode 100644 tests/formulas/cs/css_abattement_asi.yaml create mode 100644 tests/formulas/cs/css_abattement_aspa.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index f8651d3507..1ce878ab42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +### 168.2.1 [2361](https://github.com/openfisca/openfisca-france/pull/2361) + +* Évolution du système socio-fiscal. +* Périodes concernées : à partir du 01/04/2021. +* Zones impactées : + - `openfisca_france/model/prestations/minima_sociaux/cs/ressources.py` + - `openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/` +* Détails : + Prise en compte des abattements pour palier les revalorisations exceptionnelles de + - l’allocation aux adultes handicapés (AAH), + - l’allocation de solidarité aux personnes âgées (ASPA), + - l’allocation supplémentaire vieillesse (ASV), + - l’allocation supplémentaire d’invalidité (ASI) + + ## 168.2.0 [2360](https://github.com/openfisca/openfisca-france/pull/2360) * Évolution du système socio-fiscal. | Correction d'un crash. @@ -862,7 +877,7 @@ Zones impactées : * Évolution du système socio-fiscal. * Périodes concernées : à partir du 01/01/2024. -* Zones impactées : +* Zones impactées : - `openfisca_france/parameters/impot_revenu/calcul_revenus_imposables/charges_deductibles/pensions_alimentaires/plafond.yaml`. - `openfisca_france/parameters/impot_revenu/calcul_revenus_imposables/charges_deductibles/pensions_alimentaires/plafond.yaml` * Détails : @@ -878,7 +893,7 @@ Zones impactées : ### 155.2.1 [2237](https://github.com/openfisca/openfisca-france/pull/2237) -* Amélioration technique. +* Amélioration technique. * Périodes concernées : à partir du 01/07/2022. * Zones impactées : `openfisca_france/model/revenus/activite/salarie.py` * Détails : @@ -886,9 +901,9 @@ Zones impactées : ### 155.2.0 [2232](https://github.com/openfisca/openfisca-france/pull/2232) -* Amélioration technique. +* Amélioration technique. * Périodes concernées : toutes. -* Zones impactées : +* Zones impactées : - `openfisca_france/model/prestations/minima_sociaux/rsa.py` - `openfisca_france/model/prestations/minima_sociaux/ppa.py` - `openfisca_france/model/prestations/minima_sociaux/anciens_ms.py` @@ -4218,7 +4233,7 @@ git log --oneline commit_debut^..commit_fin | grep "variable_name" - `parameters/prelevements_sociaux/cotisations_securite_sociale_regime_general/famille` - `parameters/prelevements_sociaux/cotisations_securite_sociale_regime_general/csa` * Détails : - - Met à jour certaines valeurs et références de cotisations employeur, dont : la contribution apprentissage, la contribution solidarité autonomie, les cotisations famille, la contribution au dialogue social et le versement transport + - Met à jour certaines valeurs et références de cotisations employeur, dont : la Contribution apprentissage, la Contribution solidarité autonomie, les cotisations famille, la contribution au dialogue social et le versement transport ## 80.4.0 [#1725](https://github.com/openfisca/openfisca-france/pull/1725) diff --git a/openfisca_france/model/prestations/minima_sociaux/cs/ressources.py b/openfisca_france/model/prestations/minima_sociaux/cs/ressources.py index 6699e6ead0..6b25d7891b 100644 --- a/openfisca_france/model/prestations/minima_sociaux/cs/ressources.py +++ b/openfisca_france/model/prestations/minima_sociaux/cs/ressources.py @@ -1,4 +1,4 @@ -from numpy import absolute as abs_, logical_or as or_, logical_not as not_ +from numpy import absolute as abs_, logical_and as and_, logical_or as or_, logical_not as not_, maximum as max_, select, where, sum as sum_ from openfisca_core.periods import Period @@ -6,6 +6,7 @@ Variable, Individu, Famille, + FoyerFiscal, MONTH, ADD, TypesStatutOccupationLogement, @@ -31,17 +32,16 @@ class css_cmu_base_ressources_individu(Variable): def formula(individu, period, parameters): # Rolling year - previous_year = Period(('year', period.start, 1)).offset(-1) + previous_year = compute_previous_year(period) # N-1 last_year = period.last_year last_month = period.last_month - P = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.cmu + parametres_cmu = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.cmu ressources_a_inclure = [ - 'aah', + 'css_base_ressources_aah_individu', 'allocation_securisation_professionnelle', - 'asi', 'ass', 'bourse_recherche', 'caah', @@ -82,10 +82,80 @@ def formula(individu, period, parameters): + bourse + revenus_tns(individu, previous_year, last_year) - pensions_alim_versees - - abbattement_chomage(individu, period, previous_year, P) + - abattement_chomage(individu, period, previous_year, parametres_cmu) - neutralisation_stage_formation_pro(individu, previous_year, last_month) ) +class css_base_ressources_aah_individu(Variable): + value_type = float + label = "Base de ressources AAH de l'individu prise en compte pour l'éligibilité à la CSS après application de l'abattement" + reference = [ + 'Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021', + 'https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75', + 'Bulletin officiel Santé - Protection sociale - Solidarité n° 2023/24 du 29 décembre 2023 - Instruction interministérielle N° DSS/SD2A/2023/98 du 22 décembre 2023', + 'https://sante.gouv.fr/fichiers/bo/2023/2023.24.sante.pdf#page=82', + ] + entity = Individu + definition_period = MONTH + set_input = set_input_divide_by_period + + def formula(individu, period, parameters): + return individu('aah', period) + + def formula_2021_04_01(individu, period, parameters): + return max_(individu('aah', period) - parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.css.abattements.aah, 0) + +class css_abattement_asi_individu(Variable): + value_type = float + label = "Base de ressources ASI de l'individu prise en compte pour l'éligibilité à la CSS après application de l'abattement" + reference = [ + 'Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021', + 'https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75' + ] + entity = Individu + definition_period = MONTH + set_input = set_input_divide_by_period + + def formula(individu, period, parameters): + return 0 + + def formula_2021_04_01(individu, period, parameters): + + abattement_asi_personne_seule = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.css.abattements.asi.personne_seule + abattement_asi_couple = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.css.abattements.asi.couple/2 + adulte_ayant_asi = where(and_( + individu.has_role(FoyerFiscal.DECLARANT), + individu('asi', period)), + True, False) + appliquer_abattement_couple = sum_(adulte_ayant_asi) > 1 + aah = individu('aah', period) + return select( + [aah > 0, appliquer_abattement_couple and adulte_ayant_asi, adulte_ayant_asi], + [0, abattement_asi_couple, abattement_asi_personne_seule], + 0) + +class css_base_ressources_aspa_asv(Variable): + value_type = float + label = "Base de ressources ASPA/ASV de pour une famille prise en compte pour l'éligibilité à la CSS après application de l'abattement" + reference = [ + 'Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021', + 'https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75' + ] + entity = Famille + definition_period = MONTH + set_input = set_input_divide_by_period + + def formula(famille, period, parameters): + return famille('aspa', period) + def formula_2021_04_01(famille, period, parameters): + aspa = famille('aspa', period) + aspa_couple = famille('aspa_couple', period) + abattement_aspa_personne_seule = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.css.abattements.aspa_asv.personne_seule + abattement_aspa_couple = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.css.abattements.aspa_asv.couple + return select( + [aspa > 0 and aspa_couple, aspa > 0], + [max_(aspa - abattement_aspa_couple, 0), max_(aspa - abattement_aspa_personne_seule, 0)], + aspa) class css_cmu_base_ressources(Variable): value_type = float @@ -95,12 +165,12 @@ class css_cmu_base_ressources(Variable): set_input = set_input_divide_by_period def formula(famille, period, parameters): - previous_year = Period(('year', period.start, 1)).offset(-1) + previous_year = compute_previous_year(period) ressources_famille_a_inclure = [ 'af', 'asf', - 'aspa', + 'css_base_ressources_aspa_asv', 'cf', 'paje_clca', 'paje_prepare', @@ -115,7 +185,7 @@ def formula(famille, period, parameters): css_cmu_forfait_logement_base = famille('css_cmu_forfait_logement_base', period) css_cmu_forfait_logement_al = famille('css_cmu_forfait_logement_al', period) - P = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.cmu + parametres_cmu = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.cs.cmu proprietaire = (statut_occupation_logement == TypesStatutOccupationLogement.proprietaire) heberge_titre_gratuit = (statut_occupation_logement == TypesStatutOccupationLogement.loge_gratuitement) @@ -127,23 +197,30 @@ def formula(famille, period, parameters): ) ressources_individuelles = famille.members('css_cmu_base_ressources_individu', period) - ressources_parents = famille.sum(ressources_individuelles, role = Famille.PARENT) + ressources_individuelles_asi = famille.members('asi', previous_year, options = [ADD]) + abattements_asi_individuelles = famille.members('css_abattement_asi_individu', previous_year, options = [ADD]) + + ressources_asi_parents = max_(famille.sum(ressources_individuelles_asi, role = Famille.PARENT) - famille.sum(abattements_asi_individuelles), 0) + ressources_parents = famille.sum(ressources_individuelles, role = Famille.PARENT) + ressources_asi_parents age = famille.members('age', period) - condition_enfant_a_charge = (age >= 0) * (age <= P.age_limite_pac) - ressources_enfants = famille.sum(ressources_individuelles * condition_enfant_a_charge, role = Famille.ENFANT) + condition_enfant_a_charge = (age >= 0) * (age <= parametres_cmu.age_limite_pac) + ressources_asi_enfants = famille.sum(ressources_individuelles_asi * condition_enfant_a_charge, role = Famille.ENFANT) + ressources_enfants = famille.sum(ressources_individuelles * condition_enfant_a_charge, role = Famille.ENFANT) + ressources_asi_enfants return forfait_logement + ressources_famille + ressources_parents + ressources_enfants # Helper functions +def compute_previous_year(period): + return Period(('year', period.start, 1)).offset(-1).offset(-1, 'month') # Abattement sur revenus d'activité si : # - IJ maladie # - chômage # - ass # - formation professionnelle -def abbattement_chomage(individu, period, previous_year, P): +def abattement_chomage(individu, period, previous_year, parametres_cmu): indemnites_journalieres_maladie = individu('indemnites_journalieres_maladie', period) chomage = individu('activite', period) == TypesActivite.chomeur @@ -163,7 +240,7 @@ def abbattement_chomage(individu, period, previous_year, P): salaire_net = individu('salaire_net', previous_year, options = [ADD]) - return eligibilite_abattement_chomage * salaire_net * P.abattement_chomage + return eligibilite_abattement_chomage * salaire_net * parametres_cmu.abattement_chomage # Revenus de stage de formation professionnelle exclus si plus perçus depuis 1 mois diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aah.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aah.yaml new file mode 100644 index 0000000000..f414569bfb --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aah.yaml @@ -0,0 +1,15 @@ +description: Abattement sur le montant des ressources AAH pour le calcul de l'éligibilité à la CSS +values: + 2021-04-01: + value: 68 +metadata: + short_label: Abattement + unit: currency + reference: + 2021-04-01: + title: Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021 + href: https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75 + notes: + 2024-01-01: + title: Précisions sur la formule - Bulletin officiel Santé - Protection sociale - Solidarité n° 2023/24 du 29 décembre 2023 - Instruction interministérielle N° DSS/SD2A/2023/98 du 22 décembre 2023 + href: https://sante.gouv.fr/fichiers/bo/2023/2023.24.sante.pdf#page=82 diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/couple.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/couple.yaml new file mode 100644 index 0000000000..063f0fb2e1 --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/couple.yaml @@ -0,0 +1,11 @@ +description: Abattement sur le montant des ressources ASI pour le calcul de l'éligibilité à la CSS pour un couple dont les deux personnes beneficient de l'aide +values: + 2021-04-01: + value: 86 +metadata: + short_label: Abattement + unit: currency + reference: + 2021-04-01: + title: Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021 + href: https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75 diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/personne_seule.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/personne_seule.yaml new file mode 100644 index 0000000000..9934177b5b --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/asi/personne_seule.yaml @@ -0,0 +1,11 @@ +description: Abattement sur le montant des ressources ASI pour le calcul de l'éligibilité à la CSS +values: + 2021-04-01: + value: 49 +metadata: + short_label: Abattement + unit: currency + reference: + 2021-04-01: + title: Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021 + href: https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75 diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/couple.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/couple.yaml new file mode 100644 index 0000000000..e05e33d8b4 --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/couple.yaml @@ -0,0 +1,11 @@ +description: Abattement sur le montant des ressources ASPA/ASV pour le calcul de l'éligibilité à la CSS pour un couple +values: + 2021-04-01: + value: 110 +metadata: + short_label: Abattement + unit: currency + reference: + 2021-04-01: + title: Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021 + href: https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75 diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/personne_seule.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/personne_seule.yaml new file mode 100644 index 0000000000..50926fd6d4 --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/aspa_asv/personne_seule.yaml @@ -0,0 +1,11 @@ +description: Abattement sur le montant des ressources ASPA/ASV pour le calcul de l'éligibilité à la CSS pour une personne seule +values: + 2021-04-01: + value: 71 +metadata: + short_label: Abattement + unit: currency + reference: + 2021-04-01: + title: Bulletin officiel Santé - Protection sociale - Solidarité n° 2021/6 du 16 avril 2021 - Instruction interministérielle N° DSS/SD2A/2021/71 du 30 mars 2021 + href: https://sante.gouv.fr/fichiers/bo/2021/2021.6.sante.pdf#page=75 diff --git a/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/index.yaml b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/index.yaml new file mode 100644 index 0000000000..e557a322fe --- /dev/null +++ b/openfisca_france/parameters/prestations_sociales/solidarite_insertion/minima_sociaux/cs/css/abattements/index.yaml @@ -0,0 +1 @@ +description: Abattements sur le montant de certaines ressources pour le calcul de l'éligibilité à la CSS diff --git a/setup.py b/setup.py index a9c757003d..5a9433d476 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name = 'OpenFisca-France', - version = '168.2.0', + version = '168.2.1', author = 'OpenFisca Team', author_email = 'contact@openfisca.fr', classifiers = [ diff --git a/tests/formulas/cs/css.yaml b/tests/formulas/cs/css.yaml index bf64887bd8..5af1fb33b9 100644 --- a/tests/formulas/cs/css.yaml +++ b/tests/formulas/cs/css.yaml @@ -45,7 +45,7 @@ acs_plafond: 30209.49 - name: "CSS: Base de ressource d'une personne seule" - period: 2019-11 + period: 2019-12 absolute_error_margin: 0.1 input: individus: @@ -78,7 +78,7 @@ css_cmu_base_ressources: 10000 - name: "CSS: Base de ressource de deux personnes" - period: 2019-11 + period: 2019-12 absolute_error_margin: 0.1 input: individus: @@ -179,7 +179,7 @@ css_cmu_base_ressources: 14000 - name: "CSS: Base de ressource de cinq personnes" - period: 2019-11 + period: 2019-12 absolute_error_margin: 0.1 input: individus: diff --git a/tests/formulas/cs/css_abattement_aah.yaml b/tests/formulas/cs/css_abattement_aah.yaml new file mode 100644 index 0000000000..224864a3db --- /dev/null +++ b/tests/formulas/cs/css_abattement_aah.yaml @@ -0,0 +1,299 @@ +- name: "CSS: Base de ressource d'une personne seule beneficiant de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + aah: + 2023-10: 1068 + 2023-09: 0 + 2023-08: 1068 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource de deux personnes dont une seule beneficie de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + parent2: + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource de deux personnes beneficiant toutes les deux de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + parent2: + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 22000 + +- name: "CSS: Base de ressource AAH de cinq personnes" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + parent2: + date_naissance: 1951-05-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + enfant1: + date_naissance: 2009-07-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + enfant2: + date_naissance: 2015-02-25 + enfant3: + date_naissance: 2011-06-01 + famille: + parents: [parent1, parent2] + enfants: [enfant1, enfant2, enfant3] + aide_logement: 0 + rsa: 0 + af: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + cf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + asf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + enfants: [enfant1, enfant2, enfant3] + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + personnes_a_charge: [enfant1, enfant2, enfant3] + output: + acs: 0.0 + css_cmu_base_ressources: 33000 + +- name: "CSS: Base de ressource d'une personne seule beneficiant de l'aah avec valeurs negatives" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + aah: + 2023-10: 50 + 2023-09: 0 + 2023-08: 50 + 2023-07: 50 + 2023-06: 50 + 2023-05: 168 + 2023-04: 50 + 2023-03: 50 + 2023-02: 50 + 2023-01: 50 + 2022-12: 50 + 2022-11: 50 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 100 diff --git a/tests/formulas/cs/css_abattement_asi.yaml b/tests/formulas/cs/css_abattement_asi.yaml new file mode 100644 index 0000000000..b7854d7f62 --- /dev/null +++ b/tests/formulas/cs/css_abattement_asi.yaml @@ -0,0 +1,436 @@ +- name: "CSS: Base de ressource d'une personne seule beneficiant de l'asi" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + asi: + 2023-10: 1049 + 2023-09: 0 + 2023-08: 1049 + 2023-07: 1049 + 2023-06: 1049 + 2023-05: 1049 + 2023-04: 1049 + 2023-03: 1049 + 2023-02: 1049 + 2023-01: 1049 + 2022-12: 1049 + 2022-11: 1049 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource d'une personne seule beneficiant de l'asi et de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + asi: + 2023-10: 1000 + 2023-09: 1000 + 2023-08: 0 + 2023-07: 1000 + 2023-06: 1000 + 2023-05: 1000 + 2023-04: 1000 + 2023-03: 1000 + 2023-02: 1000 + 2023-01: 1000 + 2022-12: 1000 + 2022-11: 1000 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 22000 + +- name: "CSS: Base de ressource de deux personnes dont une seule beneficie de l'asi" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + asi: + 2023-10: 1049 + 2023-09: 1049 + 2023-08: 0 + 2023-07: 1049 + 2023-06: 1049 + 2023-05: 1049 + 2023-04: 1049 + 2023-03: 1049 + 2023-02: 1049 + 2023-01: 1049 + 2022-12: 1049 + 2022-11: 1049 + parent2: + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource de deux personnes dont une seule beneficie de l'asi et de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + asi: + 2023-10: 1000 + 2023-09: 1000 + 2023-08: 0 + 2023-07: 1000 + 2023-06: 1000 + 2023-05: 1000 + 2023-04: 1000 + 2023-03: 1000 + 2023-02: 1000 + 2023-01: 1000 + 2022-12: 1000 + 2022-11: 1000 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + parent2: + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 22000 + +- name: "CSS: Base de ressource de deux personnes dont une beneficie de l'asi et l'autre de l'aah" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + asi: + 2023-10: 1049 + 2023-09: 1049 + 2023-08: 0 + 2023-07: 1049 + 2023-06: 1049 + 2023-05: 1049 + 2023-04: 1049 + 2023-03: 1049 + 2023-02: 1049 + 2023-01: 1049 + 2022-12: 1049 + 2022-11: 1049 + parent2: + date_naissance: 1951-05-01 + aah: + 2023-10: 1068 + 2023-09: 1068 + 2023-08: 0 + 2023-07: 1068 + 2023-06: 1068 + 2023-05: 1068 + 2023-04: 1068 + 2023-03: 1068 + 2023-02: 1068 + 2023-01: 1068 + 2022-12: 1068 + 2022-11: 1068 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 22000 + +- name: "CSS: Base de ressource de deux personnes beneficiant toutes les deux de l'asi" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + asi: + 2023-10: 1043 + 2023-09: 1043 + 2023-08: 0 + 2023-07: 1043 + 2023-06: 1043 + 2023-05: 1043 + 2023-04: 1043 + 2023-03: 1043 + 2023-02: 1043 + 2023-01: 1043 + 2022-12: 1043 + 2022-11: 1043 + parent2: + asi: + 2023-10: 1043 + 2023-09: 1043 + 2023-08: 0 + 2023-07: 1043 + 2023-06: 1043 + 2023-05: 1043 + 2023-04: 1043 + 2023-03: 1043 + 2023-02: 1043 + 2023-01: 1043 + 2022-12: 1043 + 2022-11: 1043 + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 22000 + +- name: "CSS: Base de ressource de cinq personnes et allocation inférieure à abattement" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1994-01-01 + asi: + 2023-10: 30 + 2023-09: 30 + 2023-08: 0 + 2023-07: 0 + 2023-06: 30 + 2023-05: 30 + 2023-04: 30 + 2023-03: 30 + 2023-02: 30 + 2023-01: 30 + 2022-12: 30 + 2022-11: 30 + parent2: + date_naissance: 1984-02-01 + asi: + 2023-10: 86 + 2023-09: 86 + 2023-08: 0 + 2023-07: 86 + 2023-06: 86 + 2023-05: 86 + 2023-04: 86 + 2023-03: 86 + 2023-02: 86 + 2023-01: 86 + 2022-12: 86 + 2022-11: 86 + enfant1: + date_naissance: 2009-07-01 + asi: + 2023-10: 10 + 2023-09: 10 + 2023-08: 10 + 2023-07: 10 + 2023-06: 10 + 2023-05: 10 + 2023-04: 10 + 2023-03: 10 + 2023-02: 10 + 2023-01: 10 + 2022-12: 10 + 2022-11: 10 + enfant2: + date_naissance: 2015-02-25 + enfant3: + date_naissance: 2011-06-01 + famille: + parents: [parent1, parent2] + enfants: [enfant1, enfant2, enfant3] + aide_logement: 0 + rsa: 0 + af: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + cf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + asf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + aspa: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + menage: + personne_de_reference: parent1 + conjoint: parent2 + enfants: [enfant1, enfant2, enfant3] + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + personnes_a_charge: [enfant1, enfant2, enfant3] + output: + acs: 0.0 + css_cmu_base_ressources: 457 diff --git a/tests/formulas/cs/css_abattement_aspa.yaml b/tests/formulas/cs/css_abattement_aspa.yaml new file mode 100644 index 0000000000..2fbf4e4e0c --- /dev/null +++ b/tests/formulas/cs/css_abattement_aspa.yaml @@ -0,0 +1,185 @@ +- name: "CSS: Base de ressource ASPA d'une personne seule" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 1071 + 2023-09: 0 + 2023-08: 1071 + 2023-07: 1071 + 2023-06: 1071 + 2023-05: 1071 + 2023-04: 1071 + 2023-03: 1071 + 2023-02: 1071 + 2023-01: 1071 + 2022-12: 1071 + 2022-11: 1071 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource ASPA d'une personne seule avec des ressources inférieures à l'abattement" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1973-05-01 + famille: + parents: [parent1] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 50 + 2023-09: 0 + 2023-08: 50 + 2023-07: 50 + 2023-06: 50 + 2023-05: 50 + 2023-04: 171 + 2023-03: 50 + 2023-02: 50 + 2023-01: 50 + 2022-12: 50 + 2022-11: 50 + menage: + personne_de_reference: parent1 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1] + output: + acs: 0.0 + css_cmu_base_ressources: 100 + +- name: "CSS: Base de ressource de deux personnes" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1961-01-01 + parent2: + date_naissance: 1951-05-01 + famille: + parents: [parent1, parent2] + aide_logement: 0 + rsa: 0 + aspa: + 2023-10: 1110 + 2023-09: 1110 + 2023-08: 0 + 2023-07: 1110 + 2023-06: 1110 + 2023-05: 1110 + 2023-04: 1110 + 2023-03: 1110 + 2023-02: 1110 + 2023-01: 1110 + 2022-12: 1110 + 2022-11: 1110 + menage: + personne_de_reference: parent1 + conjoint: parent2 + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + output: + acs: 0.0 + css_cmu_base_ressources: 11000 + +- name: "CSS: Base de ressource de cinq personnes" + period: 2023-12 + absolute_error_margin: 0.1 + input: + individus: + parent1: + date_naissance: 1994-01-01 + parent2: + date_naissance: 1984-02-01 + enfant1: + date_naissance: 2009-07-01 + enfant2: + date_naissance: 2015-02-25 + enfant3: + date_naissance: 2011-06-01 + famille: + parents: [parent1, parent2] + enfants: [enfant1, enfant2, enfant3] + aide_logement: 0 + rsa: 0 + af: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + cf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + asf: + 2023-10: 0 + 2023-09: 0 + 2023-08: 0 + 2023-07: 0 + 2023-06: 0 + 2023-05: 0 + 2023-04: 0 + 2023-03: 0 + 2023-02: 0 + 2023-01: 0 + 2022-12: 0 + 2022-11: 0 + aspa: + 2023-10: 1110 + 2023-09: 1110 + 2023-08: 0 + 2023-07: 1110 + 2023-06: 1110 + 2023-05: 1110 + 2023-04: 1110 + 2023-03: 1110 + 2023-02: 1110 + 2023-01: 1110 + 2022-12: 1110 + 2022-11: 1110 + menage: + personne_de_reference: parent1 + conjoint: parent2 + enfants: [enfant1, enfant2, enfant3] + statut_occupation_logement: locataire_vide + foyer_fiscal: + declarants: [parent1, parent2] + personnes_a_charge: [enfant1, enfant2, enfant3] + output: + acs: 0.0 + css_cmu_base_ressources: 11000