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 8 : Update réduction et crédit IR pour emploi à domicile #914

Merged
merged 25 commits into from
Apr 5, 2018

Conversation

claireleroy
Copy link
Contributor

Les modifications de cette PR sont comparées à la branche ipp-update-tax-reduction-quaenv (#913)

  • É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/model/prelevements_obligatoires/impot_revenu/reductions_impots.py.
  • Détails :
    • Mise à jour des formules (2014-2016) du crédit d'impôt 'saldom2' et de la réduction d'impôt 'saldom'
    • Correction de la formule du crédit d'IR (sur la majoration pour nombre d'ascendants sd eplus de 65 bénéficiaires de l'APA et pour lesquels des dépenses d'emploi à domicile ont été engagées - case 7DL)
    • Ajout de la case 7DD dans les inputs variables

Ces changements :

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

Sommes versées pour l'emploi d'un salariés à domicile
2011 -
'''
nb_pac2 = simulation.calculate('nb_pac2', period)
Copy link
Member

Choose a reason for hiding this comment

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

Virer ces simulation.calculate

f7dl = simulation.calculate('f7dl', period)
f7dq = simulation.calculate('f7dq', period)
f7dg = simulation.calculate('f7dg', period)
_P = simulation.parameters_at(period.start)
Copy link
Member

Choose a reason for hiding this comment

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

Virer ce _P

f7dq = simulation.calculate('f7dq', period)
f7dg = simulation.calculate('f7dg', period)
_P = simulation.parameters_at(period.start)
P = simulation.parameters_at(period.start).impot_revenu.reductions_impots.salarie_domicile
Copy link
Member

Choose a reason for hiding this comment

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

Remplacer ce P par salarie_domicile

f7jy = foyer_fiscal('f7jy', period)
P = parameters(period).impot_revenu.reductions_impots.locmeu

m18 = (maxi(f7id, f7ie, f7if, f7ig) == max_(f7ie, f7if))
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 nom de variable plus explicite pour m18et m20?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cf. PR #910


m18 = (maxi(f7id, f7ie, f7if, f7ig) == max_(f7ie, f7if))
m20 = (maxi(f7ij, f7il, f7in, f7iv) == max_(f7il, f7in))
return ((min_(P.max, maxi(f7ij, f7il, f7in, f7iv)) * (P.taux20 * m20 + P.taux18 * not_(m20)) +
Copy link
Contributor

Choose a reason for hiding this comment

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

concernant P.taux20et consorts, Si le taux n'est pas amené à changer, il me semble qu'il vaut mieux le mettre en dur dans la formule. S'il peut changer, un nom de paramètre plus générique me semble de mise.


m18 = (maxi(f7id, f7ie, f7if, f7ig) == max_(f7ie, f7if))
m20 = (maxi(f7ij, f7il, f7in, f7iv) == max_(f7il, f7in))
return ((min_(P.max, maxi(f7ij, f7il, f7in, f7iv)) * (P.taux20 * m20 + P.taux18 * not_(m20)) +
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cf. PR #910

2002-2004
'''
f7df = foyer_fiscal('f7df', period)
f7dg = foyer_fiscal('f7dg', period)
isinvalid = foyer_fiscal('f7dg', period)
Copy link
Contributor

Choose a reason for hiding this comment

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

proposition: invalide

Sommes versées pour l'emploi d'un salariés à domicile
2011 -
'''
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.

Il y aurait-il un nom de variable plus explicite ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je change en "nb_pac_majoration_plafond" comme dans PR #909


nbpacmin = nb_pac2 + f7dl
maxBase = P.max1 * not_(annee1) + P.max1_1ereAnnee * annee1
maxDuMaxNonInv = P.max2 * not_(annee1) + P.max2_1ereAnnee * annee1
Copy link
Contributor

Choose a reason for hiding this comment

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

En python, il est plutôt recommandé d'utiliser du "camel case" c'est à dire de plutot écrire max_du_max_non_inv https://www.python.org/dev/peps/pep-0008/#id45

@claireleroy claireleroy force-pushed the ipp-update-tax-reduction-quaenv branch 3 times, most recently from b4debc3 to 70934e2 Compare April 4, 2018 12:59
@claireleroy claireleroy force-pushed the ipp-update-tax-reduc-and-credit-saldom branch from f86edef to 8b9973b Compare April 4, 2018 16:41
@claireleroy claireleroy changed the base branch from ipp-update-tax-reduction-quaenv to master April 4, 2018 16:42
Claire Leroy and others added 16 commits April 4, 2018 18:43
…Update formula for tax reduction 'duflot' (common tax base ceiling with 'rpinel')
…n 2013 - f7.. variables were replaced by fh.. variables
…vious formula (ceiling applies to tax base not tax credit)

+ update parameters
…se of the ceiling due to f7dl only applies to tax reduction not tax credit
@claireleroy claireleroy force-pushed the ipp-update-tax-reduc-and-credit-saldom branch from 8b9973b to 2a1e7eb Compare April 4, 2018 16:43
@benjello
Copy link
Member

benjello commented Apr 4, 2018

@ClaireLeroyIPP : il va te falloir éditer le CHANGELOG avant de merger.
Il faudra virer les .pydes fichiers impactés mentionnées dans le premier post de cette conversation.

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