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

Ipp 3 : Minor updates of tax credit and tax reductions #909

Merged
merged 82 commits into from
Mar 16, 2018

Conversation

claireleroy
Copy link
Contributor

@claireleroy claireleroy commented Feb 19, 2018

Les modifications de cette PR sont comparées à la branche ipp-update-revenus-du-capital (#908)

  • Évolution du système socio-fiscal.
  • Périodes concernées : à partir du 01/01/2004
  • Zones impactées :
  • openfisca_france/model/prelevements_obligatoires/impot_revenu/credits_impots.py.
  • openfisca_france/model/prelevements_obligatoires/impot_revenu/reductions_impots.py.
  • Détails :
    • La plupart des crédits et réductions d'impôt avaient une 'end_date' au 31/12/2014 (dernière année où cette partie avait été mis à jour apparement) => pour les réductions et les crédits dont la formule ne varie pas (ou peu), on supprime cette 'end_date' après vérification. (Pour les modifications plus lourdes, des PR séparées seront faites)
    • La réduction 'garext' devient un crédit d'impôt à partir de 2005
    • Mise à jour 'end_date' de 'donapd', 'spfcpi', 'assloy', 'prlire'
    • Correction formule 'dfppce'
    • Mise à jour formule 'patnat' pour 2014

Ces changements :

  • Ajoutent une fonctionnalité (par exemple ajout d'une variable).
  • Corrigent ou améliorent un calcul déjà existant.

@@ -888,7 +888,7 @@ class inthab(Variable):
entity = FoyerFiscal
label = u"Crédit d’impôt intérêts des emprunts pour l’habitation principale"
definition_period = YEAR
end = '2013-12-31'
end = '2016-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ?

f7vv = foyer_fiscal('f7vv', period)
f7vx = foyer_fiscal('f7vx', period)
f7vz = foyer_fiscal('f7vz', period)
_P = parameters(period)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est ce que cette variable pourrait être mergée avec la ligne 1087 ?
P = parameters(period).impot_revenu.credits_impot.inthab
ou
credit_interets_emprunt_habitation = parameters(period).impot_revenu.credits_impot.inthab

2014
'''
maries_ou_pacses = foyer_fiscal('maries_ou_pacses', period)
nb_pac2 = foyer_fiscal('nb_pac2', period)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce que certaines de ces variables pourraient être plus explicites ?
nb_pac2, caseP, nbG ...

max3 = max_(max2 - f7vz, 0)
max4 = max_(max3 - f7vv, 0)
return (P.taux1 * min_(f7vx, max0) +
P.taux3 * min_(f7vu, max1) +
Copy link
Contributor

@Anna-Livia Anna-Livia Feb 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour plus de lisibilité, tu peux écrire :

return (
    P.taux1 * min_(f7vx, max0)
    + P.taux3 * min_(f7vu, max1)
    [...] 
    + P.taux6 * min_(f7vt, max4)
)

P = _P.impot_revenu.credits_impot.inthab

invalide = caseP | caseF | (nbG != 0) | (nbR != 0) | (nbI != 0)
max0 = P.max * (maries_ou_pacses + 1) * (1 + invalide) + nb_pac2 * P.add
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'il serait possible de synthétiser la signification des max0, max1, ... en un commentaire ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai mis ça :

# NB : max0 = plafond initial du montant d'intérêts retenus pour calculer le crédit
#      max1..max4 = plafonds après imputations successives (dans l'ordre décrit dans la législation) des intérêts éligibles au crédit d'impôt 


invalide = caseP | caseF | (nbG != 0) | (nbR != 0) | (nbI != 0)
max0 = P.max * (maries_ou_pacses + 1) * (1 + invalide) + nb_pac2 * P.add

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'il serait possible de synthétiser la signification des max0, max1, ... en un commentaire ?

P = _P.impot_revenu.credits_impot.inthab

invalide = caseP | caseF | (nbG != 0) | (nbR != 0) | (nbI != 0)
max0 = P.max * (maries_ou_pacses + 1) * (1 + invalide) + nb_pac2 * P.add
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'il serait possible de synthétiser la signification des max0, max1, ... en un commentaire ?

f7vt = foyer_fiscal('f7vt', period)
f7vx = foyer_fiscal('f7vx', period)
f7vz = foyer_fiscal('f7vz', period)
_P = parameters(period)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est ce que cette variable pourrait être mergée avec la ligne 1087 ?
P = parameters(period).impot_revenu.credits_impot.inthab
ou
credit_interets_emprunt_habitation = parameters(period).impot_revenu.credits_impot.inthab

max1 = max_(max0 - f7vx, 0)
max2 = max_(max1 - f7vz, 0)
max3 = max_(max2 - f7vv, 0)
return (P.taux1 * min_(f7vx, max0) +
Copy link
Contributor

@Anna-Livia Anna-Livia Feb 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour plus de lisibilité, tu peux écrire :

return (
    P.taux1 * min_(f7vx, max0) +
    + P.taux3 * min_(f7vu, max1) +
    [...] 
    + P.taux6 * min_(f7vt, max4)
)


max1 = max_(max0 - f7vx, 0)
max2 = max_(max1 - f7vz, 0)
return (P.taux1 * min_(f7vx, max0) +
Copy link
Contributor

@Anna-Livia Anna-Livia Feb 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour plus de lisibilité, tu peux écrire :

return (
    P.taux1 * min_(f7vx, max0)
    + P.taux3 * min_(f7vu, max1)
    [...] 
    + P.taux6 * min_(f7vt, max4)
)

f7vc = foyer_fiscal('f7vc', period)
P = parameters(period).impot_revenu.reductions_impots.dons
P2 = parameters(period).impot_revenu.reductions_impots.donapd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il y a t'il un moyen plus explicite pour différencier P et P2? Sachant qu'il semble que P2n'est utilisé qu'une fois, avec P2.max

f7xq = simulation.calculate('f7xq', period)
f7xr = simulation.calculate('f7xr', period)
f7xv = simulation.calculate('f7xv', period)
_P = simulation.parameters_at(period.start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cette ligne ne semble pas être utilisée

f7xq = simulation.calculate('f7xq', period)
f7xr = simulation.calculate('f7xr', period)
f7xv = simulation.calculate('f7xv', period)
_P = simulation.parameters_at(period.start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

f7xp = simulation.calculate('f7xp', period)
f7xq = simulation.calculate('f7xq', period)
f7xr = simulation.calculate('f7xr', period)
f7xv = simulation.calculate('f7xv', period)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si certaines lignes sont des reports des années précédente, il serait intéressant d'ajouter un commentaire en fin de ligne le mentionnant (cette remarque vaut pour les formules des autres années)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai modifié les noms de variables pour que la formule soit plus claire mais seulement à partir de 2014 (les années que j'ai updaté) car je ne peux pas revenir sur toutes les formules de toutes les années maintenant, cela prendrais vraiment beaucoup de temps de corriger tout ce qui a été fait par le passé. Cela peut faire l'objet d'une issue à part ceci dit.

f7xq = simulation.calculate('f7xq', period)
f7xr = simulation.calculate('f7xr', period)
f7xv = simulation.calculate('f7xv', period)
_P = simulation.parameters_at(period.start)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

@@ -1538,7 +1574,7 @@ class garext(Variable):
entity = FoyerFiscal
label = u"garext"
definition_period = YEAR
end = '2005-12-31'
end = '2004-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sachant que cette réduction a disparu en 2004 (pour devenir un crédit), j'ai du mal à trouver une référence. Je mets celle du crédit, sauf si quelqu'un trouve une meilleure référence

@@ -1449,7 +1486,6 @@ class donapd(Variable):
entity = FoyerFiscal
label = u"donapd"
definition_period = YEAR
end = '2013-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ?

@@ -752,7 +787,6 @@ class dfppce(Variable):
entity = FoyerFiscal
label = u"dfppce"
definition_period = YEAR
end = '2013-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ?

@@ -1205,7 +1276,6 @@ class prlire(Variable):
value_type = float
entity = FoyerFiscal
label = u"Prélèvement libératoire à restituer (case 2DH)"
end = '2013-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A vrai dire je ne sais pas trop ce que c'est que ce crédit d'impôt... J'ai juste enlever la "end_date" (qui avait été mise de manière automatique à 2013 pour pas mal de réductions et crédits) car les cases 2DH et 2CH existent encore, mais c'est vrai que je n'ai pas plus checké que ça je crois. @benjello a peut-être une référence ?

@@ -2185,7 +2291,6 @@ class patnat(Variable):
entity = FoyerFiscal
label = u"patnat"
definition_period = YEAR
end = '2013-12-31'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serait-il possible d'avoir une référence pour cette variable ? Et un label plus explicite ?

@Anna-Livia Anna-Livia force-pushed the ipp-update-revenus-du-capital branch from 0f8e2af to 6b4350e Compare March 9, 2018 08:51
@Anna-Livia Anna-Livia changed the base branch from ipp-update-revenus-du-capital to master March 13, 2018 13:59
@Anna-Livia Anna-Livia force-pushed the ipp-update-credit-and-reduction branch 2 times, most recently from 2ca5328 to 2d3efa0 Compare March 13, 2018 14:52
@claireleroy
Copy link
Contributor Author

claireleroy commented Mar 13, 2018

J'ai l'impression que le rebase n'a pas pris en compte certains des changements les plus récents de ipp-update-revenus-du-capital qui ont pourtant été intégrés sur master..
Exemple :

 def formula_2012_01_01(foyer_fiscal, period, parameters): 
         """
         Plus-values 2012 entrant dans le calcul du revenu fiscal de référence
         """
-        f3sa = foyer_fiscal('f3sa', period) # Nouveauté 2012 : Plus values de cessions de titres réalisées par un entrepreneur (imposable forfaitairement sur option en 2012)
+        f3sa = foyer_fiscal('f3sa', period)
         f3vc = foyer_fiscal('f3vc', period)

J'avais rajouté le commentaire dans la PR #908 mais maintenant il disparait..

@claireleroy claireleroy force-pushed the ipp-update-credit-and-reduction branch from 2d3efa0 to 9605ceb Compare March 14, 2018 10:25
@Anna-Livia Anna-Livia force-pushed the ipp-update-credit-and-reduction branch from b4fc1c1 to 9379b4b Compare March 15, 2018 09:28
@claireleroy claireleroy force-pushed the ipp-update-credit-and-reduction branch from 963626e to 77146a4 Compare March 15, 2018 13:22
Claire Leroy and others added 24 commits March 15, 2018 18:43
…household tax deduction on financial profit and loss)
…s de raison de penser que le crédit s'arrêtera en 2017)
…e aux 5 premières annuités des dépenses effectuées jusqu'en 2011 et aux 7 premières annuités des dépenses effectuées jusqu'en 2009)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants