Skip to content

Commit

Permalink
fix(ppa): prise en compte des statuts apprenti et stagiaire dans le c…
Browse files Browse the repository at this point in the history
…alcul de l eligibilite a la prime d activite
  • Loading branch information
GF committed Jul 25, 2024
1 parent 03139fe commit 3acf420
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 19 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

### 155.2.5 [2328](https://github.com/openfisca/openfisca-france/pull/2328)

* Évolution du système socio-fiscal.
* Périodes concernées : Toujours
* Zones impactées :
- `openfisca_france/model/prestations/minima_sociaux/ppa.py`
* Détails :
- Ajoute la prise en compte des statuts apprenti et stagiaire au calcul de l'éligibilité à la PPA.

### 155.2.4 [2279](https://github.com/openfisca/openfisca-france/pull/2279)

* Évolution du système socio-fiscal.
Expand Down
28 changes: 14 additions & 14 deletions openfisca_france/model/prestations/minima_sociaux/ppa.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ def formula(famille, period, parameters):
return condition_age


class ppa_plancher_revenu_activite_etudiant(Variable):
class ppa_plancher_revenu_activite_apprenant(Variable):
value_type = float
entity = Individu
label = "Plancher des revenus d'activité pour être éligible à la PPA en tant qu'étudiant"
label = "Plancher des revenus d'activité pour être éligible à la PPA en tant qu'apprenant (étudiant/stagiaire ou apprenti)"
definition_period = MONTH
set_input = set_input_divide_by_period

Expand All @@ -36,7 +36,7 @@ def formula(individu, period, parameters):
)


class ppa_eligibilite_etudiants(Variable):
class ppa_eligibilite_apprenants(Variable):
value_type = bool
entity = Famille
label = 'Eligibilité à la PPA (condition sur tout le trimestre)'
Expand All @@ -52,8 +52,8 @@ class ppa_eligibilite_etudiants(Variable):
def formula(famille, period, parameters):
ppa_majoree_eligibilite = famille('rsa_majore_eligibilite', period)

etudiant_i = famille.members('etudiant', period)
plancher_etudiant = famille.members('ppa_plancher_revenu_activite_etudiant', period)
apprenant_i = famille.members('etudiant', period) + famille.members('stagiaire', period) + famille.members('apprenti', period)
plancher_apprenant = famille.members('ppa_plancher_revenu_activite_apprenant', period)

def condition_ressource(period2, plancher):
revenu_activite = famille.members('ppa_revenu_activite_individu', period2)
Expand All @@ -63,21 +63,21 @@ def condition_ressource(period2, plancher):
m_2 = period.offset(-2, 'month')
m_3 = period.offset(-3, 'month')

condition_etudiant_i = (
condition_ressource(m_1, plancher_etudiant)
* condition_ressource(m_2, plancher_etudiant)
* condition_ressource(m_3, plancher_etudiant)
condition_apprenant_i = (
condition_ressource(m_1, plancher_apprenant)
* condition_ressource(m_2, plancher_apprenant)
* condition_ressource(m_3, plancher_apprenant)
)

condition_non_etudiant_i = (
not_(etudiant_i) * (
condition_non_apprenant_i = (
not_(apprenant_i) * (
condition_ressource(m_1, 0)
+ condition_ressource(m_2, 0)
+ condition_ressource(m_3, 0)
)
)

condition_famille = famille.any(condition_non_etudiant_i + condition_etudiant_i, role = Famille.PARENT)
condition_famille = famille.any(condition_non_apprenant_i + condition_apprenant_i, role = Famille.PARENT)
return ppa_majoree_eligibilite + condition_famille


Expand Down Expand Up @@ -506,9 +506,9 @@ def formula_2016_01_01(famille, period, parameters):
seuil_non_versement = parameters(period).prestations_sociales.solidarite_insertion.minima_sociaux.ppa.pa_m.montant_minimum_verse
# éligibilité étudiants

ppa_eligibilite_etudiants = famille('ppa_eligibilite_etudiants', period)
ppa_eligibilite_apprenants = famille('ppa_eligibilite_apprenants', period)
ppa = famille('ppa_fictive', period.last_3_months, options = [ADD]) / 3
ppa = ppa * ppa_eligibilite_etudiants * (ppa >= seuil_non_versement)
ppa = ppa * ppa_eligibilite_apprenants * (ppa >= seuil_non_versement)

return ppa

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

setup(
name = 'OpenFisca-France',
version = '155.2.4',
version = '155.2.5',
author = 'OpenFisca Team',
author_email = '[email protected]',
classifiers = [
Expand Down
56 changes: 52 additions & 4 deletions tests/formulas/ppa/ppa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@
2015-10: 900
etudiant: true
output:
ppa_eligibilite_etudiants: true
ppa_eligibilite_apprenants: true
ppa: 244.21

- name: 'PPA: étudiant non éligible (ressources < plancher)'
Expand All @@ -614,7 +614,31 @@
2015-10: 890
etudiant: true
output:
ppa_eligibilite_etudiants: false
ppa_eligibilite_apprenants: false
ppa: 0

- name: 'PPA: stagiaire non éligible (ressources < plancher)'
period: 2016-01
input:
salaire_net:
2015-12: 890
2015-11: 890
2015-10: 890
stagiaire: true
output:
ppa_eligibilite_apprenants: false
ppa: 0

- name: 'PPA: apprenti non éligible (ressources < plancher)'
period: 2016-01
input:
salaire_net:
2015-12: 890
2015-11: 890
2015-10: 890
apprenti: true
output:
ppa_eligibilite_apprenants: false
ppa: 0

- name: 'PPA: étudiant éligible (majoré)'
Expand All @@ -627,7 +651,7 @@
etudiant: true
rsa_majore_eligibilite: true
output:
ppa_eligibilite_etudiants: true
ppa_eligibilite_apprenants: true

- name: 'PPA: étudiant non éligible car plancher non atteint pour un mois du trimestre de référence'
period: 2016-01
Expand All @@ -638,7 +662,31 @@
2015-10: 900
etudiant: true
output:
ppa_eligibilite_etudiants: false
ppa_eligibilite_apprenants: false
ppa: 0

- name: 'PPA: stagiaire non éligible car plancher non atteint pour un mois du trimestre de référence'
period: 2016-01
input:
salaire_net:
2015-12: 800
2015-11: 900
2015-10: 900
stagiaire: true
output:
ppa_eligibilite_apprenants: false
ppa: 0

- name: 'PPA: apprenti non éligible car plancher non atteint pour un mois du trimestre de référence'
period: 2016-01
input:
salaire_net:
2015-12: 800
2015-11: 900
2015-10: 900
apprenti: true
output:
ppa_eligibilite_apprenants: false
ppa: 0

- name: "PPA: couple d'étudiants avec enfant: pas de ppa"
Expand Down

0 comments on commit 3acf420

Please sign in to comment.