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 7 : Update crédit d'IR "qualité environnementale" #913

Merged
merged 30 commits into from
Apr 4, 2018

Conversation

claireleroy
Copy link
Contributor

Les modifications de cette PR sont comparées à la branche ipp-update-tax-reductions-domtom (#912)

  • Évolution du système socio-fiscal.
  • Périodes concernées : à partir du 01/01/2005
  • Zones impactées :
  • openfisca_france/model/prelevements_obligatoires/impot_revenu/credits_impots.py.
  • openfisca_france/model/prelevements_obligatoires/impot_revenu/variables_reductions_credits.py
  • openfisca_france/parameters/impot_revenu/credits_impot/quaenv/
  • Détails :
    • Mise à jour des formules (2014-2016) du crédit d'impôt 'quaenv' (et de la condition de bouquet : variables 'quaenv_bouquet')
    • Ajout des "inputs variables" (cases de la déclaration fiscales) associées
    • Création de paramètres YAML associés (notamment pour éviter de rentrer "en dur" les plafonds de RFR)
    • Correction de la formule (à partir de 2012) : le plafonnement s'applique aux dépenses et non à la réduction.

Ces changements :

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

f7ay + f7az + f7bb + f7bc + f7bd + f7be + f7bf + f7bh + f7bk + f7bl
)
depenses_transition_energetique = (depenses_transition_energetique_bouquet_2ans_2014_part2 * quaenv_bouquet +
depenses_transition_energetique_bouquet_2ans_2015 +
Copy link
Member

Choose a reason for hiding this comment

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

Indentation

max00 = max_(0, max0 - depenses_transition_energetique)
max1 = max_(0, max00 - quaenv_bouquet * (f7sd + f7se + f7wc + f7vg + f7wt + f7sn + f7sp + f7sr + f7ss + f7sq + f7st) - not_(quaenv_bouquet) * (max00))
credit_quaenv_bouquet_2ans = (quaenv_bouquet * (P.taux25 * (min_(max00,
f7sd + f7se + f7wc + f7vg + f7wt + f7sn + f7sp + f7sr + f7ss + f7sq + f7st)) +
Copy link
Member

Choose a reason for hiding this comment

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

Indentation

f7se + f7sb + f7tb +
f7sp + f7rp + f7tp +
f7sq + f7rq + f7tq +
f7st + f7rt + f7tt > 0)*1
Copy link
Member

Choose a reason for hiding this comment

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

espacesautour du *1
Vérifier les parenthèses : doit-on les fermer avant le > 0


n = nb_pac2
max0 = P.max * (1 + maries_ou_pacses) + P.pac1 * (n >= 1) + P.pac2 * (n >= 2) + P.pac2 * (max_(n - 2, 0))

max1 = max_(0, max0 - f7wf)
max2 = max_(0, max1 - f7wg)
return (P.taux_wf * min_(f7wf, max0) +
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Il vaut mieux mettre les opérateurs (+ ) en début de ligne qu'en fin de ligne : https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

P.taux_wh * min_(f7wh, max6) +
P.taux_sb * min_(f7sb, max7) +
P.taux_wq * min_(f7wq, max8))
return or_(not_(f7we), rfr < P.max_rfr) * (
Copy link
Contributor

Choose a reason for hiding this comment

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

Il vaut mieux mettre les opérateurs (+ ) en début de ligne qu'en fin de ligne : https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

@@ -1353,7 +1354,7 @@ def formula_2010_01_01(foyer_fiscal, period, parameters):
max5 = max_(0, max4 - f7wh)
max6 = max_(0, max5 - f7sb)
max7 = max_(0, max6 - f7wq)
return not_(f7wg) * or_(not_(f7we), (rfr < 45000)) * (
return not_(f7wg) * or_(not_(f7we), (rfr < P.max_rfr)) * (
Copy link
Contributor

Choose a reason for hiding this comment

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

Il vaut mieux mettre les opérateurs (+ ) en début de ligne qu'en fin de ligne : https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

@@ -1413,37 +1414,39 @@ def formula_2012_01_01(foyer_fiscal, period, parameters):
maxi3 = max_(0, maxi2 - f7tw)
maxi4 = max_(0, maxi3 - f7tv)
maxi5 = max_(0, maxi4 - f7tu)
collectif = (P.taux_ty * min_(f7ty, max0) + P.taux_tx * min_(f7tx, maxi1) + P.taux_tw * min_(f7tw, maxi2) +
P.taux_tv * min_(f7tv, maxi3) + P.taux_tu * min_(f7tu, maxi4) + P.taux_tt * min_(f7tt, maxi5))
collectif = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposition :
collectif = (
P.taux_ty * min_(f7ty, max0)
+ P.taux_tx * min_(f7tx, maxi1)
+ P.taux_tw * min_(f7tw, maxi2)
+ P.taux_tv * min_(f7tv, maxi3)
+ P.taux_tu * min_(f7tu, maxi4)
+ P.taux_tt * min_(f7tt, maxi5)
)

min_(max5, P.taux10 * (f7sd + f7wk * (f7sj + f7sk + f7sl))))
))
return not_(f7wg) * or_(not_(f7we), (rfr < 30000)) * (montant + collectif) + f7sz
montant = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Il vaut mieux mettre les opérateurs (+ ) en début de ligne qu'en fin de ligne : https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

@@ -856,7 +1118,7 @@ class f7rz(Variable):
unit = 'currency'
entity = FoyerFiscal
label = u"Investissements outre-mer: report de réduction d'impôt non imputée les années antérieures année n-3"
end = '2010-12-31'
# end = '2010-12-31' changes meaning in 2014
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

@@ -3117,7 +3379,7 @@ class f7xb(Variable):
entity = FoyerFiscal
label = u"Investissements locatifs dans le secteur de touristique: travaux engagés avant 2011 dans une résidence de tourisme classée ou meublée"
# start_date = date(2011, 1, 1)
end = '2012-12-31'
# end = '2012-12-31' changes meaning in 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

@@ -3127,7 +3389,7 @@ class f7xc(Variable):
unit = 'currency'
entity = FoyerFiscal
label = u"Investissements locatifs dans le secteur de touristique: prix d'acquisition ou de revient d'un logement neuf acquis ou achevé en n-1"
end = '2012-12-31'
# end = '2012-12-31' changes meaning in 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

class f7sb(Variable):
cerfa_field = u"7SB"
value_type = int
unit = 'currency'
entity = FoyerFiscal
label = u"Dépenses en faveur de la qualité environnementale des logements donnés en location: crédit à 25 %"
# start_date = date(2009, 1, 1)
end = '2011-12-31'
# end = '2011-12-31' changes meaning in 2014
Copy link
Contributor

Choose a reason for hiding this comment

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

idem

@@ -0,0 +1,6 @@
description: Taux 30%
Copy link
Contributor

Choose a reason for hiding this comment

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

cf remarques dans les formules

@claireleroy claireleroy force-pushed the ipp-update-tax-reductions-domtom branch from b44236a to ca0d4e3 Compare March 27, 2018 12:11
@claireleroy claireleroy force-pushed the ipp-update-tax-reduction-quaenv branch from 29b39b6 to e4e443e Compare March 29, 2018 15:56
@claireleroy claireleroy changed the base branch from ipp-update-tax-reductions-domtom to master March 29, 2018 15:57
@claireleroy claireleroy force-pushed the ipp-update-tax-reduction-quaenv branch from 084b4ba to e73a466 Compare March 30, 2018 13:46
@claireleroy claireleroy force-pushed the ipp-update-tax-reduction-quaenv branch from b4debc3 to 70934e2 Compare April 4, 2018 12:59
@Anna-Livia Anna-Livia dismissed their stale review April 4, 2018 15:31

All good :)

@claireleroy claireleroy merged commit 50b946a into master Apr 4, 2018
@claireleroy claireleroy deleted the ipp-update-tax-reduction-quaenv branch April 5, 2018 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants