Skip to content

Commit

Permalink
Merge pull request #624 from openfisca/cotsoc-alsace-moselle
Browse files Browse the repository at this point in the history
Cotisations sociales : Régime d'Alsace-Moselle
  • Loading branch information
laem authored Dec 20, 2016
2 parents 2e43603 + 51627d3 commit 32b4169
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 6.1.0

* Add the local regime Alsace-Moselle through the boolean variable `salarie_regime_alsace_moselle`.
* Impacts the cotisations :
* Maladie (MMID)
* Taxe apprentissage
* Contribution supplémentaire à l'apprentissage.

## 6.0.7

* Remove wrong max numbers of enfants in entities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def build_pat(node_json):
pat = copy.deepcopy(node_json['children']['cotsoc']['children']['pat'])
commun = pat['children'].pop('commun')

for bareme in ['apprentissage', 'apprentissage_add']:
for bareme in ['apprentissage', 'apprentissage_add', 'apprentissage_alsace_moselle']:
commun['children'][bareme] = commun['children']['apprentissage_node']['children'][bareme]
del commun['children']['apprentissage_node']

Expand All @@ -43,11 +43,11 @@ def build_pat(node_json):
pat['children']['prive_cadre'] = pat['children'].pop('cadre')

# Rework commun to deal with public employees
for var in ["apprentissage", "apprentissage_add", "assedic", "chomfg", "construction", "maladie", "formprof_09",
for var in ["apprentissage", "apprentissage_add", "apprentissage_alsace_moselle", "assedic", "chomfg", "construction", "maladie", "formprof_09",
"formprof_1019", "formprof_20", "vieillesse_deplafonnee", "vieillesse_plafonnee"]:
del commun['children'][var]

for var in ["apprentissage", "apprentissage_add", "formprof_09", "formprof_1019", "formprof_20", "chomfg",
for var in ["apprentissage", "apprentissage_add", "apprentissage_alsace_moselle", "formprof_09", "formprof_1019", "formprof_20", "chomfg",
"construction", "assedic"]:
del pat['children']['fonc']['children']['contract']['children'][var]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,27 @@ class mmid_salarie(Variable):

def function(self, simulation, period):
period = period.start.period(u'month').offset('first-of')
cotisation = apply_bareme(
salarie_regime_alsace_moselle = simulation.calculate('salarie_regime_alsace_moselle', period)

cotisation_regime_general = apply_bareme(
simulation,
period,
cotisation_type = 'salarie',
bareme_name = 'maladie',
variable_name = self.__class__.__name__,
)

cotisation_regime_alsace_moselle = apply_bareme(
simulation,
period,
cotisation_type = 'salarie',
bareme_name = 'maladie_alsace_moselle',
variable_name = self.__class__.__name__,
)

cotisation = cotisation_regime_general + salarie_regime_alsace_moselle * cotisation_regime_alsace_moselle


return period, cotisation


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,28 @@ def function(self, simulation, period):
assiette_cotisations_sociales = simulation.calculate('assiette_cotisations_sociales', period)
ratio_alternants = simulation.calculate('ratio_alternants', period)
effectif_entreprise = simulation.calculate('effectif_entreprise', period)
taux = simulation.legislation_at(period.start).cotsoc.contribution_supplementaire_apprentissage
salarie_regime_alsace_moselle = simulation.calculate('salarie_regime_alsace_moselle', period)

cotsoc_params = simulation.legislation_at(period.start).cotsoc
csa_params = cotsoc_params.contribution_supplementaire_apprentissage

if period.start.year > 2012:
# Exception Alsace-Moselle : CGI Article 1609 quinvicies IV
# https://www.legifrance.gouv.fr/affichCode.do;jsessionid=36F88516571C1CA136D91A7A84A2D65B.tpdila09v_1?idSectionTA=LEGISCTA000029038088&cidTexte=LEGITEXT000006069577&dateTexte=20161219
multiplier = (salarie_regime_alsace_moselle * csa_params.multiplicateur_alsace_moselle) + (1 - salarie_regime_alsace_moselle)

taxe_due = (effectif_entreprise >= 250) * (ratio_alternants < .05)
taux_conditionnel = (
(effectif_entreprise < 2000) * (ratio_alternants < .01) * taux.moins_2000_moins_1pc_alternants +
(effectif_entreprise >= 2000) * (ratio_alternants < .01) * taux.plus_2000_moins_1pc_alternants +
(.01 <= ratio_alternants) * (ratio_alternants < .02) * taux.entre_1_2_pc_alternants +
(.02 <= ratio_alternants) * (ratio_alternants < .03) * taux.entre_2_3_pc_alternants +
(.03 <= ratio_alternants) * (ratio_alternants < .04) * taux.entre_3_4_pc_alternants +
(.04 <= ratio_alternants) * (ratio_alternants < .05) * taux.entre_4_5_pc_alternants
)
taux_contribution = taxe_due * taux_conditionnel
(effectif_entreprise < 2000) * (ratio_alternants < .01) * csa_params.moins_2000_moins_1pc_alternants +
(effectif_entreprise >= 2000) * (ratio_alternants < .01) * csa_params.plus_2000_moins_1pc_alternants +
(.01 <= ratio_alternants) * (ratio_alternants < .02) * csa_params.entre_1_2_pc_alternants +
(.02 <= ratio_alternants) * (ratio_alternants < .03) * csa_params.entre_2_3_pc_alternants +
(.03 <= ratio_alternants) * (ratio_alternants < .04) * csa_params.entre_3_4_pc_alternants +
(.04 <= ratio_alternants) * (ratio_alternants < .05) * csa_params.entre_4_5_pc_alternants
)
taux_contribution = taxe_due * taux_conditionnel * multiplier
else:
taux_contribution = (effectif_entreprise >= 250) * taux.plus_de_250
taux_contribution = (effectif_entreprise >= 250) * cotsoc_params.contribution_supplementaire_apprentissage.plus_de_250
# TODO: gestion de la place dans le XML pb avec l'arbre des paramètres / preprocessing
return period, - taux_contribution * assiette_cotisations_sociales * redevable_taxe_apprentissage

Expand Down Expand Up @@ -273,14 +280,32 @@ class taxe_apprentissage(Variable):
def function(self, simulation, period):
period = period.start.period(u'month').offset('first-of')
redevable_taxe_apprentissage = simulation.calculate('redevable_taxe_apprentissage', period)
salarie_regime_alsace_moselle = simulation.calculate('salarie_regime_alsace_moselle', period)

cotisation = apply_bareme(
cotisation_regime_alsace_moselle = apply_bareme(
simulation,
period,
cotisation_type = 'employeur',
bareme_name = 'apprentissage_alsace_moselle',
variable_name = self.__class__.__name__,
)

cotisation_regime_general = apply_bareme(
simulation,
period,
cotisation_type = 'employeur',
bareme_name = 'apprentissage',
variable_name = self.__class__.__name__,
)

cotisation = np.where(
salarie_regime_alsace_moselle,
cotisation_regime_alsace_moselle,
cotisation_regime_general,
)

# cotisation = salarie_regime_alsace_moselle * cotisation_regime_alsace_moselle + (1 - salarie_regime_alsace_moselle) * cotisation_regime_general

return period, cotisation * redevable_taxe_apprentissage


Expand Down
8 changes: 8 additions & 0 deletions openfisca_france/model/revenus/activite/salarie.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ class code_postal_entreprise(Variable):
label = u"Localisation entreprise (Code postal)"


class salarie_regime_alsace_moselle(Variable):
entity = Individu
column = BoolCol(default = False)
label = u"Le salarié cotise au régime de l'Alsace-Moselle"
# Attention : ce n'est pas équivalent au fait de travailler en Alsace-Moselle !
# http://regime-local.fr/salaries/


class effectif_entreprise(Variable):
entity = Individu
column = IntCol()
Expand Down
39 changes: 38 additions & 1 deletion openfisca_france/parameters/cotsoc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@
<VALUE deb="2016-01-01" fuzzy="true" valeur=".001" />
<VALUE deb="2013-01-01" fin="2015-12-31" valeur=".001" /> # TODO check and check for coherence with previous taux
<VALUE deb="2010-01-01" fin="2012-12-31" valeur=".001" /> # TODO check and check for coherence with previous taux
</CODE>
</CODE>
<CODE code="multiplicateur_alsace_moselle" description="Multiplicateur CSA Alsace-Moselle" format="percent">
<!-- CGI Article 1609 quinvicies IV
Instauration : LOI n° 2011-1977 du 28 décembre 2011 de finances pour 2012
-->
<VALUE deb="2012-01-01" fuzzy="true" valeur=".52" />
</CODE>
</NODE>

<NODE code="gen" description="Paramètres généraux" origin="openfisca">
<CODE code="nb_heure_travail_mensuel" description="Nombre d'heures travaillées forfaitaires" format="float" origin="openfisca">
<VALUE deb="2016-01-01" fuzzy="true" valeur="151.67" />
Expand Down Expand Up @@ -441,6 +448,18 @@
</TAUX>
</TRANCHE>
</BAREME>
<BAREME code="apprentissage_alsace_moselle" description="Taxe d'apprentissage pour les salariés du régime d'Alsace-Moselle" option="main-d-oeuvre">
<TRANCHE code="tranche0">
<SEUIL>
<VALUE deb="2017-01-01" fuzzy="true" valeur="0" />
<VALUE deb="1993-07-01" fin="2016-12-31" valeur="0" />
</SEUIL>
<TAUX>
<VALUE deb="2014-01-01" fuzzy="true" valeur="0.0044" />
<VALUE deb="1993-07-01" fin="2013-12-31" valeur="0.005" /> <!-- La valeur est vérifiée, pas la date de début (calquée aujourd'hui sur le barème régime général) -->
</TAUX>
</TRANCHE>
</BAREME>
<BAREME code="apprentissage_250" description="Taxe d'apprentissage (plus de 250 salariés)" option="main-d-oeuvre" origin="openfisca">
<TRANCHE code="tranche0">
<SEUIL>
Expand Down Expand Up @@ -1573,6 +1592,24 @@
</TAUX>
</TRANCHE>
</BAREME>
<BAREME code="maladie_alsace_moselle" description="Assurance maladie, maternité, invalidité, décès pour les salariés du régime Alsace-Moselle" option="noncontrib">
<TRANCHE code="tranche0">
<SEUIL>
<VALUE deb="1989-09-01" fuzzy="true" valeur="0" />
</SEUIL>
<TAUX>
<VALUE deb="2012-01-01" fuzzy="true" valeur="0.015" />
<VALUE deb="2008-01-01" fin="2011-12-31" valeur="0.016" />
<VALUE deb="2007-07-01" fin="2007-12-31" valeur="0.017" />
<VALUE deb="2006-01-01" fin="2007-06-30" valeur="0.018" />
<VALUE deb="2003-01-01" fin="2005-12-31" valeur="0.017" />
<VALUE deb="1999-07-01" fin="2002-12-31" valeur="0.015" />
<VALUE deb="1998-07-01" fin="1999-06-30" valeur="0.0125" />
<VALUE deb="1994-01-01" fin="1998-06-30" valeur="0.01" />
<VALUE deb="1989-09-01" fin="1993-12-31" valeur="0.0075" />
</TAUX>
</TRANCHE>
</BAREME>
<BAREME code="vieillesse" description="Vieillesse (régime de base de la retraite CNAV)" option="contrib" origin="openfisca">
<TRANCHE code="tranche0">
<SEUIL>
Expand Down
19 changes: 19 additions & 0 deletions openfisca_france/tests/formulas/maladie_mmid_salarie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- period: "2016-12"
name:
Cotisation maladie MMID salarié
relative_error_margin: 0.001
input_variables:
salaire_de_base: 1467
output_variables:
mmid_salarie: -.0075 * 1467

- period: "2016-12"
name:
Cotisation maladie MMID salarié Alsace-Moselle
relative_error_margin: 0.001
input_variables:
salaire_de_base: 1467
salarie_regime_alsace_moselle: 1
output_variables:
mmid_salarie: -( .0075 + .015 ) * 1467

17 changes: 17 additions & 0 deletions openfisca_france/tests/formulas/taxe_apprentissage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,20 @@
contribution_supplementaire_apprentissage: 0



- period: "2016-06"
description:
Taxe d'apprentissage / CSA A-M
relative_error_margin: 0.001
input_variables:
salaire_de_base: 1467
# nécessaire pour des requêtes sur un mois de salaire :
allegement_fillon_mode_recouvrement: 1
effectif_entreprise: 250
categorie_salarie: 0 # non cadre
contrat_de_travail_duree: 0
ratio_alternants: 0.0178
salarie_regime_alsace_moselle: 1
output_variables:
taxe_apprentissage: -.0044 * 1467
contribution_supplementaire_apprentissage: -.00104 * 1467
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name = 'OpenFisca-France',
version = '6.0.7',
version = '6.1.0',
author = 'OpenFisca Team',
author_email = '[email protected]',
classifiers = [
Expand Down

0 comments on commit 32b4169

Please sign in to comment.