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

[WIP] - assurance chômage #1481

Closed
wants to merge 92 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
57e7d93
Initie la variable Allocation chômage d'Aide de Retour à l'Emploi
Feb 19, 2021
9e5b325
Calcul salaire de reference - assurance chomage
lauradelmas8 Feb 24, 2021
54575fd
WIP : ajout de paramètres assurance chomage et tentatives de calcul ARE
lauradelmas8 Feb 24, 2021
f6561c1
WIP - Ajout de paramètres assurance chomage et tests
lauradelmas8 Feb 24, 2021
232edd6
WIP - Salaire de reference - chomage
lauradelmas8 Mar 4, 2021
ee92083
WIP - Travail sur salaire de référence sal_ref
lauradelmas8 Mar 4, 2021
20ee05b
WIT - Calcul de l'ARE et début de travail conditions d'éligibilité
lauradelmas8 Mar 11, 2021
96f8b33
Remove non-essential changes
benjello Mar 12, 2021
7078622
Cleaning
benjello Mar 12, 2021
9530c49
WIP - Conditions éligibilité ARE
lauradelmas8 Mar 23, 2021
e897ced
WIT - Test condition affiliation
lauradelmas8 Mar 23, 2021
aed9090
Fix indent and missing argument
benjello Mar 23, 2021
67b03bd
Modifications tests
lauradelmas8 Mar 23, 2021
becd720
WIT - conditions eligibilite (age et affiliation)
lauradelmas8 Mar 23, 2021
8443298
WIT - Tests à vérifier
lauradelmas8 Mar 23, 2021
ad995d6
WIT - Fichiers supprimés
lauradelmas8 Mar 24, 2021
a8d0e95
WIT - Modifications conditons
lauradelmas8 Mar 24, 2021
8bf0558
WIT - différents cas pour les tests
lauradelmas8 Mar 24, 2021
025988b
Refactor
benjello Mar 24, 2021
9dce879
WIT - tests
lauradelmas8 Mar 24, 2021
80836b6
WIP - changements tests
lauradelmas8 Mar 24, 2021
6829038
WIP - Tests validés
lauradelmas8 Mar 25, 2021
d7e38ec
WIP - Modifications et tests ASS
lauradelmas8 Mar 29, 2021
bfc9425
WIP - Modifications et tests ppa
lauradelmas8 Apr 1, 2021
b410210
WIP - Duree versement are
lauradelmas8 Apr 1, 2021
985eeb7
WIP - Nombre jours travailles chomage
lauradelmas8 Apr 6, 2021
2933801
WIP - Chomage nette
lauradelmas8 Apr 12, 2021
1845ed3
Point chomage_brut to ARE. Fix test
benjello Apr 13, 2021
fd102ba
Add blank ARE test
benjello Apr 13, 2021
4ba23f1
Première itération duree_versement_are
benjello Apr 13, 2021
c37579b
WIP - Problème durée versement test 2020
lauradelmas8 Apr 14, 2021
288d871
WIP - Problème durée (2)
lauradelmas8 Apr 14, 2021
6f299ae
Dispatch input for are_eligibilite_individu
benjello Apr 14, 2021
75298ea
WIP - Test durée (valide)
lauradelmas8 Apr 14, 2021
eabdb7f
WIT - durée intégrée à l'ARE
lauradelmas8 Apr 14, 2021
ed8304c
Improve dure_versement_are
benjello Apr 14, 2021
e3e3ef9
WIP - Test durée (2021)
lauradelmas8 Apr 14, 2021
c6416d2
Improve are
benjello Apr 14, 2021
c85fc91
WIT - Tests durée qui fonctionnent
lauradelmas8 Apr 15, 2021
48dac19
WIT - test cumul ARE - salaires
lauradelmas8 Apr 15, 2021
1b01d52
WIP - Participation Tax Rate
lauradelmas8 Apr 22, 2021
8361795
Add set_input_dispatch_by_period for various variables
benjello Apr 23, 2021
7a1c1e2
Test debug
lauradelmas8 May 10, 2021
2a4ed57
Add set_input_dispatch _by_period to salaire_de_reference_mensuel
benjello May 10, 2021
660db44
ASS test yaml
lauradelmas8 May 10, 2021
877235f
WIP
benjello May 18, 2021
31e88b4
Working ASS
benjello May 18, 2021
ebcd332
WIT - ARE nette
lauradelmas8 May 18, 2021
c63e911
WIP - ARE nette
lauradelmas8 May 18, 2021
1d12999
WIP - ARE nette
lauradelmas8 May 18, 2021
7f7901c
WIP - ARE nette cotisations sociales
lauradelmas8 May 19, 2021
d345cf8
Improve test
benjello May 19, 2021
9b20cfa
Fix rsa test by neutralizing variables
benjello May 19, 2021
df77a34
WIP - ASS sans are nulle
lauradelmas8 May 19, 2021
0ed804d
Fix Essai
benjello May 19, 2021
37bb593
WIP - Problème neutralisation RSA
lauradelmas8 May 25, 2021
8f88d14
WIP
benjello May 20, 2021
4ca2ffa
Fix age condition
benjello May 25, 2021
a802df6
WIP
benjello May 25, 2021
2351319
WIP test
benjello May 25, 2021
1bbb783
WIP - Allocations logement
lauradelmas8 May 26, 2021
9bedae2
WIP- allocations logement bug
lauradelmas8 May 27, 2021
37b10cd
Simplify tests
benjello May 27, 2021
d07858d
WIP - Family
lauradelmas8 May 28, 2021
8500186
Improve aide_logement
benjello May 29, 2021
92361af
WIP - allocations logement validées
lauradelmas8 May 30, 2021
d477758
WIP Essai.yaml
lauradelmas8 May 30, 2021
21e70fb
WIP failing test
benjello May 31, 2021
c6e3f64
WIP - Suppression Essai (voir Essai 2 et 3)
lauradelmas8 May 31, 2021
cfe0e44
Corrige condition chomeur dans aide_logement_abattement_chomage_indem…
benjello May 31, 2021
5ab2be3
WIP - Problème AL
lauradelmas8 Jun 1, 2021
3dbfece
WIP - Rectifcation formule
lauradelmas8 Jun 1, 2021
d35c04d
Use date_naissance instead of age
benjello Jun 1, 2021
f02723f
Cumul APL RSA ARE
lauradelmas8 Jun 2, 2021
f195584
Aide_logement
lauradelmas8 Jun 2, 2021
aecb44e
Correct rsa-apl
benjello Jun 2, 2021
ae203ef
WIP - ASS qui varie
lauradelmas8 Jun 2, 2021
f5979ae
WIP - Correction neutralisation ass
lauradelmas8 Jun 2, 2021
5efb0b4
WIP - Cumul APL - RSA - ASS
lauradelmas8 Jun 3, 2021
2c23646
Fix aide_logement_neutralisation_ass
benjello Jun 3, 2021
4607cf0
RSA - couple
lauradelmas8 Jun 3, 2021
b889636
linting
benjello Jun 6, 2021
2bc32fd
Test - Salaire du conjoint pris en compte
lauradelmas8 Jun 7, 2021
0db1b0b
Calcul salaire de base/imposable/net/superbrut
lauradelmas8 Jun 9, 2021
1adae94
Tests revenu disponible - et bug ppa
lauradelmas8 Jun 9, 2021
e35a892
Tests revenu disponible pour un actif
lauradelmas8 Jun 14, 2021
49bd3e3
Test revenu disponible pour un chomeur CT
lauradelmas8 Jun 14, 2021
4bb2a28
Test revenu disponible chomeur LT
lauradelmas8 Jun 14, 2021
4bcbdf0
Quelques modifications et ajouts
lauradelmas8 Jun 14, 2021
8424ca2
Tests revenus disponibles
lauradelmas8 Jun 17, 2021
232213b
PTR - PPA problem
lauradelmas8 Jun 22, 2021
f73676c
Niveau de vie variable
lauradelmas8 Jul 7, 2021
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
1 change: 1 addition & 0 deletions openfisca-france
Submodule openfisca-france added at 79a177
1 change: 1 addition & 0 deletions openfisca_france/model/covid19.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class covid_aide_exceptionnelle_famille_montant(Variable):
entity = Famille
value_type = float
label = "Montant de l'aide exceptionnelle pour les familles pendant la crise sanitaire dûe au COVID-19"
set_input = set_input_divide_by_period
definition_period = MONTH
end = '2020-10-31'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class exoneration_cotisations_employeur_zfu(Variable):
value_type = float
entity = Individu
label = "Exonrérations de cotisations employeur pour l'embauche en zone franche urbaine (ZFU)"
set_input = set_input_divide_by_period
reference = "http://www.apce.com/pid553/exoneration-dans-les-zfu.html?espace=1&tp=1&pagination=2"
definition_period = MONTH

Expand Down
31 changes: 26 additions & 5 deletions openfisca_france/model/prestations/aides_logement.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def formula(famille, period, parameters):
participation_personnelle = famille('aide_logement_participation_personnelle', period)

montant_accedant_et_foyer = famille('aides_logement_accedant_et_foyer', period)
montant_locataire = max_(0, loyer_retenu + charges_retenues - participation_personnelle)
montant_locataire = max_(0, loyer_retenu + charges_retenues - participation_personnelle - 5)

montant = select([locataire, accedant + locataire_logement_foyer],
[montant_locataire, montant_accedant_et_foyer])
Expand Down Expand Up @@ -218,6 +218,7 @@ class logement_conventionne(Variable):
entity = Menage
label = "Logement conventionné"
definition_period = MONTH
set_input = set_input_dispatch_by_period


class TypeEtatLogement(Enum):
Expand Down Expand Up @@ -418,7 +419,8 @@ def formula_2016_10_01(famille, period, parameters):
valeur_locative_terrains_non_loues_i = famille.members('valeur_locative_terrains_non_loues', period)
valeur_locative_terrains_non_loues = famille.sum(valeur_locative_terrains_non_loues_i)

# Les abatements sont les mêmes que pour le RSA
# Les abatements sont les mêmes que pour le

abattements = parameters(period).prestations.minima_sociaux.rsa.patrimoine

capitaux_non_productifs = livret_a + epargne_revenus_non_imposables
Expand Down Expand Up @@ -523,10 +525,11 @@ class aide_logement_abattement_chomage_indemnise(Variable):
reference = "https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000031694522&cidTexte=LEGITEXT000006073189"

def formula(individu, period, parameters):
activite = individu('activite', period)
# activite = individu('activite', period)
are = individu('are', period)
date_debut_chomage = individu('date_debut_chomage', period)
two_months_ago = datetime64(period.offset(-2, 'month').start)
condition_abattement = (activite == TypesActivite.chomeur) * (date_debut_chomage < two_months_ago)
condition_abattement = (are > 0) * (date_debut_chomage < two_months_ago)
revenus_activite_pro = individu('aide_logement_assiette_abattement_chomage', period.n_2)
taux_abattement = parameters(period).prestations.aides_logement.ressources.abattement_chomage_indemnise

Expand Down Expand Up @@ -575,6 +578,23 @@ def formula(famille, period, parameters):

return revenus_a_neutraliser * (rsa_mois_dernier > 0)

class aide_logement_neutralisation_ass(Variable):
value_type = float
entity = Famille
label = "Abattement sur les revenus n-2 pour les bénéficiaires de l'ASS"
definition_period = MONTH
reference = [
# Article R532-7 du Code de la sécurité sociale
"https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000031694522&cidTexte=LEGITEXT000006073189",
# Article R351-14-1 du Code de la construction et de l'habitation
"https://www.legifrance.gouv.fr/affichCodeArticle.do?cidTexte=LEGITEXT000006074096&idArticle=LEGIARTI000006897410"
]

def formula(famille, period, parameters):
ass_mois_dernier = famille.sum(famille.members('ass', period.last_month))
revenus_a_neutraliser_i = famille.members('revenu_assimile_salaire_apres_abattements', period.n_2)
revenus_a_neutraliser = famille.sum(revenus_a_neutraliser_i)
return revenus_a_neutraliser * (ass_mois_dernier > 0)

class aide_logement_base_ressources_defaut(Variable):
value_type = float
Expand All @@ -593,6 +613,7 @@ def formula(famille, period, parameters):
abattement_depart_retraite_i = famille.members('aide_logement_abattement_depart_retraite', period)
abattement_depart_retraite = famille.sum(abattement_depart_retraite_i, role = Famille.PARENT)
neutralisation_rsa = famille('aide_logement_neutralisation_rsa', period)
neutralisation_ass = famille('aide_logement_neutralisation_ass', period)
abattement_ressources_enfant = parameters(period.n_2.stop).prestations.minima_sociaux.aspa.plafond_ressources_seul * 1.25
base_ressources_enfants = famille.sum(
max_(0, base_ressources_i - abattement_ressources_enfant), role = Famille.ENFANT)
Expand All @@ -611,7 +632,7 @@ def formula(famille, period, parameters):
+ base_ressources_enfants
+ ressources_patrimoine
+ aide_logement_base_revenus_fiscaux
- (abattement_chomage_indemnise + abattement_depart_retraite + neutralisation_rsa)
- (abattement_chomage_indemnise + abattement_depart_retraite + neutralisation_rsa + neutralisation_ass)
)

# Abattement forfaitaire pour double activité
Expand Down
44 changes: 40 additions & 4 deletions openfisca_france/model/prestations/minima_sociaux/ass.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,53 @@

from openfisca_france.model.base import *

from numpy import datetime64

from openfisca_core.periods import Instant

class ass_precondition_remplie(Variable):
value_type = bool
entity = Individu
label = "Éligible à l'ASS"
label = "L'individu a travaillé au moins 5 ans durant les 10 dernières années précédant la fin de contrat de travail"
definition_period = MONTH
reference = [
"Article R5423-1 du Code du travail",
"https://www.legifrance.gouv.fr/affichCodeArticle.do?cidTexte=LEGITEXT000006072050&idArticle=LEGIARTI000018525084&dateTexte=20190618&categorieLien=cid#LEGIARTI000018525084"
]
set_input = set_input_dispatch_by_period

def formula(individu,period):
nombre_annees_travaillees_les_10_dernieres_annees = individu('nombre_annees_travaillees_les_10_dernieres_annees', period)
condition_eligibilite = nombre_annees_travaillees_les_10_dernieres_annees >= 5

return condition_eligibilite


class nombre_annees_travaillees_les_10_dernieres_annees(Variable):
value_type = float
entity = Individu
label = "Nombre d'années travaillées dans les 10 dernières années précédent la fin du contrat de travail"
definition_period = MONTH
set_input = set_input_dispatch_by_period

def formula(individu, period):
nombre_jours_travailles_10_dernieres_annees = individu.empty_array()
for months in range(0, 552):
contrat_de_travail_fin_potentiel = period.offset(-months)
nombre_jours_travailles_10_dernieres_annees = where(
individu('contrat_de_travail_fin', period) == datetime64(contrat_de_travail_fin_potentiel.start),
individu(
'nombre_jours_calendaires',
contrat_de_travail_fin_potentiel.offset(-120).start.period('month', 120),
options = [ADD],
),
nombre_jours_travailles_10_dernieres_annees,
)

nombre_mois_travailles_10_dernieres_annees = nombre_jours_travailles_10_dernieres_annees / 30
nombre_annees_travaillees_10_dernieres_annees = nombre_mois_travailles_10_dernieres_annees / 12

return nombre_annees_travaillees_10_dernieres_annees

class ass(Variable):
value_type = float
Expand All @@ -30,6 +65,8 @@ def formula(individu, period, parameters):

elig = individu('ass_eligibilite_individu', period)

non_cumul_avec_aah = not_(individu('aah', period) > 0)

montant_journalier = where(residence_mayotte, ass_params.montant_plein_mayotte, ass_params.montant_plein)
montant_mensuel = 30 * montant_journalier
plafond_mensuel = montant_journalier * (
Expand All @@ -40,7 +77,7 @@ def formula(individu, period, parameters):

ass = min_(montant_mensuel, plafond_mensuel - revenus)
ass = max_(ass, 0)
ass = ass * elig
ass = ass * elig * non_cumul_avec_aah
# pas d'ASS si montant mensuel < montant journalier de base
ass = ass * not_(ass < ass_params.montant_plein)

Expand All @@ -52,6 +89,7 @@ class ass_base_ressources(Variable):
label = "Base de ressources de l'ASS"
entity = Famille
definition_period = MONTH
set_input = set_input_divide_by_period

def formula(famille, period):
ass_base_ressources_demandeur = famille.demandeur('ass_base_ressources_individu', period)
Expand Down Expand Up @@ -221,7 +259,6 @@ def formula(individu, period, parameters):

demandeur_emploi_non_indemnise = and_(individu('activite', period) == TypesActivite.chomeur, individu('chomage_net', period) == 0)

# Indique que l'individu a travaillé 5 ans au cours des 10 dernieres années.
ass_precondition_remplie = individu('ass_precondition_remplie', period)

return demandeur_emploi_non_indemnise * ass_precondition_remplie * sous_age_limite
Expand All @@ -239,7 +276,6 @@ def formula_2017_01_01(individu, period, parameters):
* ((individu('activite', period) == TypesActivite.chomeur) + eligible_cumul_ass)
)

# Indique que l'individu a travaillé 5 ans au cours des 10 dernieres années.
ass_precondition_remplie = individu('ass_precondition_remplie', period)

return not_(aah_eligible) * demandeur_emploi_non_indemnise_et_cumul_accepte * ass_precondition_remplie * sous_age_limite
4 changes: 3 additions & 1 deletion openfisca_france/model/prestations/minima_sociaux/ppa.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ def formula(famille, period, parameters):
age_min = P.minima_sociaux.ppa.age_min
condition_age_i = famille.members('age', period) >= age_min
condition_age = famille.any(condition_age_i)
condition_activite_i = (famille.members('activite', period) == TypesActivite.actif)
condition_activite = famille.sum(condition_activite_i, role = Famille.PARENT)

return condition_age
return condition_age * condition_activite


class ppa_plancher_revenu_activite_etudiant(Variable):
Expand Down
45 changes: 27 additions & 18 deletions openfisca_france/model/prestations/minima_sociaux/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class rsa_jeune_condition_heures_travail_remplie(Variable):
label = "Éligible au RSA si la personne a moins de vingt-cinq ans et a travaillé deux ans sur les trois dernières années"
reference = "https://www.legifrance.gouv.fr/affichCode.do?idSectionTA=LEGISCTA000022743616&cidTexte=LEGITEXT000006074069"
definition_period = MONTH

set_input = set_input_dispatch_by_period

class rsa_base_ressources(Variable):
value_type = float
Expand Down Expand Up @@ -53,8 +53,8 @@ def formula(famille, period):
)


class rsa_has_ressources_substitution(Variable):
value_type = bool
class rsa_ressources_de_substitution(Variable):
value_type = float
label = "Présence de ressources de substitution au mois M, qui désactivent la neutralisation des revenus professionnels interrompus au moins M."
entity = Individu
definition_period = MONTH
Expand All @@ -64,7 +64,7 @@ def formula(individu, period):
individu('chomage_net', period)
+ individu('indemnites_journalieres', period)
+ individu('retraite_nette', period)
) > 0
)


class rsa_base_ressources_individu(Variable):
Expand All @@ -81,13 +81,14 @@ def formula_2009_06_01(individu, period, parameters):
'retraite_nette',
]

possede_ressources_substitution = individu('rsa_has_ressources_substitution', period)
ressources_de_substitution = individu('rsa_ressources_de_substitution', period)
possede_ressources_substitution = ressources_de_substitution > 0

# Les revenus pros interrompus au mois M sont neutralisés s'il n'y a pas de revenus de substitution.
revenus_pro = sum(
individu(type_revenu, period.last_3_months, options = [ADD]) * not_(
(individu(type_revenu, period) == 0)
* (individu(type_revenu, period.last_month) > 0)
* (individu(type_revenu, period.last_3_months, options = [ADD]) > 0)
* not_(possede_ressources_substitution)
)
for type_revenu in types_revenus_pros
Expand Down Expand Up @@ -116,16 +117,19 @@ def formula_2009_06_01(individu, period, parameters):
- (
montant_forfaitaire_neutralisation
* (individu(type_revenu, period) == 0)
* (individu(type_revenu, period.last_month) > 0)
* (individu(type_revenu, period.last_3_months, options = [ADD]) > 0)
)
)
for type_revenu in types_revenus_non_pros
)

rentes_viageres = individu.foyer_fiscal('rente_viagere_titre_onereux', period.last_3_months, options = [ADD])
revenus_foyer_fiscal_projetes = rentes_viageres * individu.has_role(FoyerFiscal.DECLARANT_PRINCIPAL)

return (revenus_pro + revenus_non_pros + revenus_foyer_fiscal_projetes) / 3
return (
max_(revenus_pro, 3 * ressources_de_substitution)
+ revenus_non_pros
+ revenus_foyer_fiscal_projetes
) / 3

def formula(individu, period, parameters):
# Revenus professionels
Expand All @@ -134,14 +138,15 @@ def formula(individu, period, parameters):
'retraite_nette',
]

possede_ressource_substitution = individu('rsa_has_ressources_substitution', period)
ressources_de_substitution = individu('rsa_ressources_de_substitution', period)
possede_ressources_substitution = ressources_de_substitution > 0

# Les revenus pros interrompus au mois M sont neutralisés s'il n'y a pas de revenus de substitution.
revenus_pro = sum(
individu(type_revenu, period.last_3_months, options = [ADD]) * not_(
(individu(type_revenu, period) == 0)
* (individu(type_revenu, period.last_month) > 0)
* not_(possede_ressource_substitution)
* (individu(type_revenu, period.last_3_months, options = [ADD]) > 0)
* not_(possede_ressources_substitution)
)
for type_revenu in types_revenus_pros
)
Expand All @@ -168,7 +173,7 @@ def formula(individu, period, parameters):
individu(type_revenu, period.last_3_months, options = [ADD])
- neutral_max_forfaitaire * (
(individu(type_revenu, period) == 0)
* (individu(type_revenu, period.last_month) > 0)
* (individu(type_revenu, period.last_3_months, options = [ADD]) > 0)
)
)
for type_revenu in types_revenus_non_pros
Expand All @@ -178,7 +183,11 @@ def formula(individu, period, parameters):
rente_viagere_titre_onereux = individu.foyer_fiscal('rente_viagere_titre_onereux', period.last_3_months, options = [ADD])
revenus_foyer_fiscal_projetes = rente_viagere_titre_onereux * individu.has_role(FoyerFiscal.DECLARANT_PRINCIPAL)

return (revenus_pro + revenus_non_pros + revenus_foyer_fiscal_projetes) / 3
return (
max_(revenus_pro, 3 * ressources_de_substitution)
+ revenus_non_pros
+ revenus_foyer_fiscal_projetes
) / 3


class rsa_base_ressources_minima_sociaux(Variable):
Expand Down Expand Up @@ -508,14 +517,14 @@ def formula_2009_06(individu, period):
'rsa_indemnites_journalieres_activite',
]

possede_ressource_substitution = individu('rsa_has_ressources_substitution', period)
possede_ressources_substitution = individu('rsa_ressources_de_substitution', period) > 0

# Les revenus pros interrompus au mois M sont neutralisés s'il n'y a pas de revenus de substitution.
revenus_moyennes = sum(
individu(type_revenu, last_3_months, options = [ADD]) * not_(
(individu(type_revenu, period) == 0)
* (individu(type_revenu, period.last_month) > 0)
* not_(possede_ressource_substitution)
* (individu(type_revenu, period.last_3_months, options = [ADD]) > 0)
* not_(possede_ressources_substitution)
)
for type_revenu in types_revenus_activite
) / 3
Expand All @@ -524,7 +533,7 @@ def formula_2009_06(individu, period):
if period.start.date >= date(2017, 1, 1):
revenus_tns_annualises = individu('ppa_rsa_derniers_revenus_tns_annuels_connus', period.this_year)

return revenus_moyennes + revenus_tns_annualises
return (revenus_moyennes + revenus_tns_annualises) * not_(possede_ressources_substitution)


class rsa_montant(Variable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class autonomie_financiere(Variable):
entity = Individu
label = "Indicatrice d'autonomie financière vis-à-vis des prestations familiales"
definition_period = MONTH
set_input = set_input_dispatch_by_period
reference = [
'https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000006750602&cidTexte=LEGITEXT000006073189',
'https://www.service-public.fr/particuliers/vosdroits/F16947'
Expand Down
Loading