Skip to content

Commit

Permalink
Fix salaire_de_base by applying net to brut inversion on other values…
Browse files Browse the repository at this point in the history
… of categorie_salarie
  • Loading branch information
sandcha committed Oct 22, 2019
1 parent b6a62ad commit 3b0b471
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions openfisca_france_data/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,17 @@ def create_salaire_de_base(individus, period = None, revenu_type = 'imposable',
target['prive_cadre'] = set(
['maladie', 'arrco', 'vieillesse_deplafonnee', 'agirc', 'cet', 'apec', 'vieillesse', 'agff', 'assedic']
)
target['public_titulaire_etat'] = set(['pension', 'rafp', 'excep_solidarite'])
# Pas de data pour categorie_salarie == "public_titulaire_militaire"
target['public_titulaire_territoriale'] = set(['cnracl1', 'cnracl2', 'excep_solidarite', 'rafp'])
target['public_titulaire_hospitaliere'] = set(['cnracl1', 'cnracl2', 'excep_solidarite', 'rafp'])
target['public_non_titulaire'] = set(['excep_solidarite', 'maladie', 'ircantec', 'vieillesse_deplafonnee', 'vieillesse'])

for categorie in ['prive_non_cadre', 'prive_cadre', 'public_non_titulaire']:

categories = ['prive_non_cadre', 'prive_cadre',
'public_titulaire_etat', 'public_titulaire_territoriale', 'public_titulaire_hospitaliere',
'public_non_titulaire'
]
for categorie in categories:
baremes_collection = salarie[categorie]
baremes_to_remove = list()
for name, bareme in baremes_collection._children.items():
Expand All @@ -100,7 +108,7 @@ def create_salaire_de_base(individus, period = None, revenu_type = 'imposable',
for name in baremes_to_remove:
del baremes_collection._children[name]

for categorie in ['prive_non_cadre', 'prive_cadre', 'public_non_titulaire']:
for categorie in categories:
test = set(
name for name, bareme in salarie[categorie]._children.items()
if isinstance(bareme, MarginalRateTaxScale)
Expand Down Expand Up @@ -142,7 +150,7 @@ def add_agirc_gmp_to_agirc(agirc, parameters):
agirc.thresholds[2] = salaire_charniere

salaire_de_base = 0.0
for categorie in ['prive_non_cadre', 'prive_cadre', 'public_non_titulaire']:
for categorie in categories:
if categorie == 'prive_cadre':
add_agirc_gmp_to_agirc(salarie[categorie].agirc, parameters)

Expand Down

0 comments on commit 3b0b471

Please sign in to comment.