Skip to content

Commit

Permalink
Corrige les periods dans calculs de ressources pour le RFR et le RNI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-CodeWorks authored Dec 12, 2023
1 parent d41a7de commit d3d9a8d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog
## [6.11.3] - 2023-12-12

_Pour les changements détaillés et les discussions associées, référencez la pull request [#197](https://github.com/openfisca/openfisca-france-local/pull/197)_

### Fixed

- Corrige des période de calculs de `RFR` et `RNI`

## [6.11.2] - 2023-12-06

_Pour les changements détaillés et les discussions associées, référencez la pull request [#194](https://github.com/openfisca/openfisca-france-local/pull/194)_
Expand Down
4 changes: 2 additions & 2 deletions openfisca_france_local/aides_jeunes_reform.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def is_quotient_familial_eligible(individu: Population, period: Period, paramete
condition_QF = parameters.quotient_familial.year
period_divider = 1

individus_rfr = individu.foyer_fiscal('rfr', period.this_year)
individus_nbptr = individu.foyer_fiscal('nbptr', period.this_year)
individus_rfr = individu.foyer_fiscal('rfr', period.n_2)
individus_nbptr = individu.foyer_fiscal('nbptr', period.n_2)
individus_quotient_familial = (individus_rfr / period_divider / individus_nbptr)

QF_constraints = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def formula(famille, period, parameters):
) + (plafond_ressource.famille_biparentale * couple)
smic = parameters(period).marche_travail.salaire_minimum.smic.smic_b_mensuel

rni = famille.demandeur.foyer_fiscal('rni', period.this_year)
rni = famille.demandeur.foyer_fiscal('rni', period.n_2)
eligibilite_revenus = rni / 12 < plafond_ressources_smic * smic

return montant_total * eligibilite_geographique * eligibilite_statut * eligibilite_revenus
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ def formula(individu, period, parameters):
age = individu('age', period)
eligibilite_age = (age >= params.age.minimum) * (age <= params.age.maximum)


af_nbenf = individu.famille('af_nbenf', period)
plafond_ressources = ars_params.plafond_ressources * (1 + af_nbenf * ars_params.majoration_par_enf_supp)
eligibilite_plafond_ressources = individu.foyer_fiscal('rfr', period.this_year) <= plafond_ressources
eligibilite_plafond_ressources = individu.foyer_fiscal('rfr', period.n_2) <= plafond_ressources
smic_brut_mensuel = smic.smic_b_horaire * smic.nb_heures_travail_mensuel
eligibilite_salaire = individu('salaire_de_base', period) <= smic_brut_mensuel

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='OpenFisca-France-Local',
version='6.11.2',
version='6.11.3',
author='OpenFisca Team',
author_email='[email protected]',
classifiers=[
Expand Down
4 changes: 2 additions & 2 deletions tests/reforms/aides_jeunes/test_aides_jeunes_reform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
- openfisca_france_local.aides_jeunes_reform.aides_jeunes_reform_dynamic
input:
rfr:
2022: ["9600", "9612"]
2020: ["9600", "9612"]
nbptr:
2022: ["1", "1"]
2020: ["1", "1"]
output:
test_condition_quotient_familial: [200, 0]
test_condition_quotient_familial_year: [200, 0]
Expand Down
19 changes: 6 additions & 13 deletions tests/regions/hauts-de-france/aide_garde_enfant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
enfants: [ "enfant1", "enfant2"]
foyer_fiscal:
declarants: [ "parent1", "parent2" ]
personnes_a_charge: [ "enfant1", "enfant2"]
rni:
2022: 50000
2020: 50000
menage:
personne_de_reference: parent1
conjoint: parent2
Expand All @@ -35,9 +34,8 @@
enfants: [ "enfant1", "enfant2"]
foyer_fiscal:
declarants: [ "parent1" ]
personnes_a_charge: [ "enfant1", "enfant2"]
rni:
2022: 30000
2020: 30000
menage:
personne_de_reference: parent1
enfants: [ "enfant1", "enfant2"]
Expand All @@ -61,9 +59,8 @@
enfants: [ "enfant1"]
foyer_fiscal:
declarants: [ "parent1" ]
personnes_a_charge: [ "enfant1"]
rni:
2022: 30000
2020: 30000
menage:
personne_de_reference: parent1
enfants: [ "enfant1"]
Expand All @@ -84,9 +81,8 @@
enfants: [ "enfant1"]
foyer_fiscal:
declarants: [ "parent1" ]
personnes_a_charge: [ "enfant1"]
rni:
2022: 30000
2020: 30000
menage:
personne_de_reference: parent1
enfants: [ "enfant1"]
Expand All @@ -108,9 +104,8 @@
enfants: [ "enfant1", "enfant2"]
foyer_fiscal:
declarants: [ "parent1", "parent2" ]
personnes_a_charge: [ "enfant1", "enfant2"]
rni:
2022: 80000
2020: 80000
menage:
personne_de_reference: parent1
conjoint: parent2
Expand Down Expand Up @@ -141,7 +136,7 @@
foyer_fiscal:
declarants: [ "parent1", "parent2" ]
rni:
2022: 80000
2020: 80000
menage:
personne_de_reference: parent1
conjoint: parent2
Expand All @@ -150,8 +145,6 @@
demandeur:
age: [18]
annee_etude: 'cap_2'
enfant_a_charge:
2022: [True]
activite: 'etudiant'
regime_securite_sociale: regime_general
parent1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
age: [18, 18, 18, 18, 30, 18, 18]
af_nbenf: [3, 3, 3, 3, 3, 1, 3]
rfr:
2021:
2019:
[35000, 35000, 35000, 35000, 35000, 35000, 35000]
salaire_de_base: [1000, 1000, 1000, 1000, 1000, 1000, 3000]
output:
Expand Down

0 comments on commit d3d9a8d

Please sign in to comment.