Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prise en compte des statuts apprenti et des stagiaire dans calcul de l'éligibilité à la PPA #2328

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

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

* Corrigent ou améliorent un calcul déjà existant.
* Périodes concernées : Après 2024/10/01
Expand All @@ -10,6 +10,15 @@
* Détails :
- Prise en compte du passe M-1 M-3 à M-2 à M-4 pour les aides PPA et RSA

### 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 @@ -582,8 +582,8 @@ def ppa_base_formula(famille, parameters, period, three_months_of_reference):
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', three_months_of_reference, options = [ADD]) / 3
ppa = ppa * ppa_eligibilite_etudiants * (ppa >= seuil_non_versement)
ppa = ppa * ppa_eligibilite_apprenants * (ppa >= seuil_non_versement)

return ppa
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.5',
version = '155.2.6',
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
Loading