Skip to content

Commit

Permalink
Ajoute les aides de la ville de Antony
Browse files Browse the repository at this point in the history
  • Loading branch information
frtomas authored and Shamzic committed Nov 6, 2024
1 parent 05ad6ce commit 9e13c13
Show file tree
Hide file tree
Showing 18 changed files with 293 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore


class antony_aide_depart_sejour_adapte(Variable):
value_type = float
entity = Famille
definition_period = MONTH
label = "Montant total de l'Aide au depart en sejour adapté de la ville de Antony"

def formula(famille, period, parameters):
residence_antony = famille.demandeur.menage('antony_eligibilite_residence', period)

condition_ressources_remplies = famille('antony_eligibilite_ressources', period)

handicap = famille.members('handicap', period)
montant_individuel = famille('antony_aide_depart_sejour_adapte_montant_individuel', period)
montant_total = famille.sum(montant_individuel * handicap)

return residence_antony * condition_ressources_remplies * montant_total


class antony_aide_depart_sejour_adapte_montant_individuel(Variable):
value_type = float
entity = Famille
definition_period = MONTH
label = "Montant individuel de l'Aide au depart en sejour adapté de la ville de Antony"

def formula(famille, period, parameters):
parameters_antony = parameters(period).communes.antony.plafonds_revenus.sejour_adapte

ressources_famille = famille('antony_base_ressources', period)

montant = select(
[
ressources_famille < parameters_antony.tranches.tranche_1,
ressources_famille < parameters_antony.tranches.tranche_2
],
[
parameters_antony.montants.montant_tranche_1,
parameters_antony.montants.montant_tranche_2
],
default=0
)

return montant
22 changes: 22 additions & 0 deletions openfisca_france_local/communes/antony/antony_bourse_communale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore
from openfisca_france.model.prestations.education import TypesScolarite


class antony_bourse_communale(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Eligibilité de la famille à la Bourse Communale de la ville de Antony"

def formula(famille, period, parameters):
residence_antony = famille.demandeur.menage('antony_eligibilite_residence', period)

condition_ressources_remplies = famille('antony_eligibilite_ressources', period)

scolarite = famille.members('scolarite', period)
scolarise = ((scolarite == TypesScolarite.college) + (scolarite == TypesScolarite.lycee))

au_moins_un_enfant_scolarise = famille.any(scolarise, role = Famille.ENFANT)

return residence_antony * condition_ressources_remplies * au_moins_un_enfant_scolarise
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore


class antony_bourse_conservatoire(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Eligibilité de la famille a la Bourse du Conservatoire de la ville de Antony"

def formula(famille, period, parameters):
residence_antony = famille.demandeur.menage('antony_eligibilite_residence', period)

condition_ressources_remplies = famille('antony_eligibilite_ressources', period)

age_i = famille.members('age', period)
au_moins_un_enfant_moins_de_18_ans = famille.any(age_i < 18, role=Famille.ENFANT)

return residence_antony * condition_ressources_remplies * au_moins_un_enfant_moins_de_18_ans
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore


class antony_bourse_famille_nombreuse(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Eligibilité de la famille a la Bourse Famille Nombreuse de la ville de Antony"

def formula(famille, period, parameters):
residence_antony = famille.demandeur.menage('antony_eligibilite_residence', period)

nb_enfants = famille.nb_persons(role=Famille.ENFANT)
condition_nb_enfants = nb_enfants >= 3

age_i = famille.members('age', period)
au_moins_un_enfant_moins_de_1_an = famille.any(age_i < 1, role=Famille.ENFANT)

return residence_antony * condition_nb_enfants * au_moins_un_enfant_moins_de_1_an
20 changes: 20 additions & 0 deletions openfisca_france_local/communes/antony/antony_noel_pour_tous.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore


class antony_noel_pour_tous(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Eligibilité de la famille au Noel pour Tous de la ville de Antony"

def formula(famille, period, parameters):
residence_antony = famille.demandeur.menage('antony_eligibilite_residence', period)

condition_ressources_remplies = famille('antony_eligibilite_ressources', period)

age_demandeur = famille.demandeur('age', period)

demandeur_moins_de_68_ans = age_demandeur < 68

return residence_antony * condition_ressources_remplies * demandeur_moins_de_68_ans
98 changes: 98 additions & 0 deletions openfisca_france_local/communes/antony/base_ressources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
from openfisca_france.model.base import * # noqa analysis:ignore


class antony_base_ressources(Variable):
value_type = float
entity = Famille
definition_period = MONTH
label = "Éligibilité de ressoures d'une aux dipositifs d'Antony"

def formula(famille, period, parameters):
# N-1
last_year = period.last_year

# M-1 to M-3
last_three_months = period.last_3_months

ressources_individus_a_inclure = [
'salaire_imposable',
'retraite_imposable',
'chomage_imposable',
'pensions_invalidite',
'indemnites_journalieres',
'aah',
'pensions_alimentaires_percues'
]

ressources_famille_a_inclure = [
'af',
'cf',
'paje',
'asf',
'aeeh',
'rsa',
'ppa'
]

# This is a comment
ressources_famille_annuelles_a_inclure = [
'ars'
]

resources_mensuelles_individus_m_3 = sum([
famille.members(resource, last_three_months, options=[ADD])
for resource in ressources_individus_a_inclure
])
ressources_mensuelles_famille_m_3 = sum([
famille(resource, last_three_months, options=[ADD])
for resource in ressources_famille_a_inclure
])
ressources_m_3 = ressources_mensuelles_famille_m_3 + famille.sum(resources_mensuelles_individus_m_3)

resources_mensuelles_individus_n_1 = sum([
famille.members(resource, last_year, options=[ADD])
for resource in ressources_individus_a_inclure
])
ressources_mensuelles_famille_n_1 = sum([
famille(resource, last_year, options=[ADD])
for resource in ressources_famille_a_inclure
])
ressources_annuelles_famille_n_1 = sum([
famille(resource, last_year)
for resource in ressources_famille_annuelles_a_inclure
])
ressources_n_1 = (famille.sum((resources_mensuelles_individus_n_1 / 4))
+ (ressources_mensuelles_famille_n_1 / 4)
+ (ressources_annuelles_famille_n_1 / 4)
)

ressources_considerees = min_(ressources_m_3, ressources_n_1)

return ressources_considerees


class antony_eligibilite_ressources(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Éligibilité de ressoures d'une aux dipositifs d'Antony"

def formula(famille, period, parameters):
parameters_antony = parameters(period).communes.antony.plafonds_revenus
baremes_enfants = parameters_antony.bareme_enfants.bareme_ressources_par_enfant

ressources_considerees = famille('antony_base_ressources', period)

nb_enfants = famille.nb_persons(role=Famille.ENFANT)

en_couple = famille('en_couple', period)

plafond_considere = select(
[not_(en_couple) * (nb_enfants == 0), en_couple * (nb_enfants == 0), nb_enfants > 0],
# Le barème ne va que jusqu'à 7 enfants, on considère donc 7 enfants au plus dans le calcule du barème
# avec min_(nb_enfants, 7)
[parameters_antony.personne_seule, parameters_antony.couple, baremes_enfants.calc(min_(nb_enfants, 7))]
)

return ressources_considerees < plafond_considere
2 changes: 1 addition & 1 deletion openfisca_france_local/communes/antony/eligibilite.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class antony_eligibilite_residence(Variable):
label = "Éligibilité résidentielle d'un ménage aux dipositifs d'Antony"

def formula(menage, period, parameters):
return (menage('depcom', period) == b'92160')
return (menage('depcom', period) == b'92002')

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
bareme_ressources_par_enfant:
description: Barème des plafond de ressources pour le droit aux aides de la ville de Antony
metadata:
type: single_amount
amount_unit: currency
brackets:
- amount:
2021-06-01:
value: 2732
threshold:
2021-06-01:
value: 1
- amount:
2021-06-01:
value: 3559
threshold:
2021-06-01:
value: 2
- amount:
2021-06-01:
value: 4394
threshold:
2021-06-01:
value: 3
- amount:
2021-06-01:
value: 5180
threshold:
2021-06-01:
value: 4
- amount:
2021-06-01:
value: 5961
threshold:
2021-06-01:
value: 5
- amount:
2021-06-01:
value: 6745
threshold:
2021-06-01:
value: 6
- amount:
2021-06-01:
value: 7528
threshold:
2021-06-01:
value: 7
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: Plafond de ressources pour les aides d'Antony pour un couple sans enfants
unit: currency
values:
2021-11-01:
2021-06-01:
value: 1922
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
description: Plafond de ressources pour les aides d'Antony pour une personne seule
unit: currency
values:
2021-11-01:
2021-06-01:
value: 1601
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tranches:
description: Plafond de ressources pour les deux tranches de l'Aide au sejour adapte de la ville de Antony
tranche_1:
values:
2021-06-01: 4394
tranche_2:
values:
2021-06-01: 7528

montants:
description: Montants accordés pour les deux tranches de l'Aide au sejour adapte de la ville de Antony
montant_tranche_1:
values:
2021-06-01: 600
montant_tranche_2:
values:
2021-06-01: 300

0 comments on commit 9e13c13

Please sign in to comment.