-
Notifications
You must be signed in to change notification settings - Fork 101
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
Ameliore taxation capital + mesures #1065
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai fait quelques commentaires à discuter.
@@ -135,71 +135,10 @@ def formula(menage, period): | |||
return revenu_net / uc | |||
|
|||
|
|||
class revenu_initial_individu(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bfabre01 Pourquoi retirer ces notions de revenu_initial
et revenu_primaire
? Elles sont extraites de ce rapport
https://www.tresor.economie.gouv.fr/Ressources/File/333203.
Si tu penses qu'elles devraient se trouver ailleurs ou mieux documenter, on peut essayer de les déplacer.
Ou penses-tu qu'il faut les virer ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjello : je les ai supprimées car elles ne sont jamais utilisées dans openfisca. Je pense qu'il est dangereux de garder des variables jamais utilisées, car cela augmente la chance d'avoir des erreurs non-repérées. D'ailleurs, si je ne me trompe pas, revenu_primaire
, qui doit représenter les revenus superbruts, est le revenu avant déduction des cotisations sociales, mais après déduction de la CSG et de la CRDS, ce qui je pense est une erreur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je les ai utilisées ailleurs pour faire des kakwani mais tu as raison, je vais les déplacer surtout si personne ne comprend le contexte.
# TODO: add tax credit 8TK for all years ? | ||
|
||
|
||
class acompte_irpp_elus_locaux(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'utiliserais ir
plutôt que irpp
car ce dernier n'existe pas dans la législation.
https://droit-finances.commentcamarche.com/faq/25625-irpp-definition.
Et oui il faudrait faire la chasse à irpp dans dans tout openfisca ...
|
||
return f2ck | ||
|
||
class acomptes_irpp(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IR au lieu d'IRPP
|
||
|
||
class csg_deduc(Variable): # f6de | ||
class csg_deductible_patrimoine_irpp(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis plus pour un nom type ir_csg_deductible_patrimoine
(le terme général ir
arrivant en tête) ou csg_patrimoine_deductible_ir
(pour avoir un squelette de phrase).
@@ -0,0 +1,95 @@ | |||
class assurance_vie_pl_non_anonyme_plus8ans_depuis1990(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crois qu'il faut rajouter cette ligne en début de ton fichier, sinon ça ne tourne pas car il ne reconnait pas l'encodage :
# -*- coding: utf-8 -*-
openfisca_france/model/mesures.py
Outdated
# CRDS sur revenus du capital, définie à l'échelle du foyer fiscal, mais projetée sur le déclarant principal | ||
crds_revenus_capital = individu.foyer_fiscal('crds_revenus_capital', period) | ||
crds_revenus_capital_projetee = crds_revenus_capital * individu.has_role(FoyerFiscal.DECLARANT_PRINCIPAL) | ||
return crds_individu + crds_famille_projetes + crds_revenus_capital_projetee | ||
|
||
|
||
class csg(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est-ce que la CSG et la CRDS ne devrait pas plutôt figurer dans prelevements_obligatoires\contributions_sociales
? puisque ce sont de vrais prélèvements et non pas juste des mesures économiques comme les autres variables de mesures.py
. Je me permets de proposer ça comme je vois que tu fais déjà un grand ménage dans mesures.py
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis d'accord. Et en fait on pourrait également déplacer aides_logement
, voire minima_sociaux
et prestations_familiales
. Et comme tu as remarqué, minimum_vieillesse
est surement à enlever (l'ASI ne devrait pas y être inclus). Je déplace csg et crds ici. Pour le reste, on fait ça dans une autre branche ?
6f1d3d5
to
da86d20
Compare
@@ -1951,6 +1926,23 @@ def formula(foyer_fiscal, period, parameters): | |||
(pre_result < 0) * (-pre_result) + (pre_result >= 0) * 0 * iai) | |||
) | |||
|
|||
class irpp_eco(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utiliser irpp_economique
Je ne suis pas très sûr de comprendre ce qu'est vraiment l'IRPP "économique". Y a-t-il une référence ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est une notion économique qui nous sera utile alors que irpp
correspond à l'impôt à payer calculé par la DGFiP (il ne prends pas en compte certaines parties de l'impôt sur le revenu donc). On peut mettre cette variable dans mesures.py
si tu veux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui cela me paraît bien. Et mettre une référence (doc DGFiP, lien).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je ne vois pas de référence directe pour irpp_economique
, c'est simplement nous qui trouvons que le concept d'impôt de la DGFiP est trop étroit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjello : en fait, il s'agit de l'impôt total, "acomptes" compris. Par exemple, pour tous les revenus du capital qui étaient soumis au prélèvement libératoire avant la réforme Hollande de 2012, et qui depuis sont au barème, les bénéficiaires de ces revenus paient toujours à la source un prélèvement forfaitaire, qui ensuite est considéré comme un acompte d'impôt sur le revenu. Lors de la déclaration des revenus, l'impôt qui inclus ces revenus au barème est calculé. S'il est inférieur au prélèvement à la source, l'excédent est restitué. Ces prélèvements à la source qui font office d'acomptes sont inclus dans la case 2CK, qui est prise en compte comme un crédit d'impôt d'un point administratif. Bref, si par exemple, tu a un impôt au barème de 100, mais que tu as versé un acompte de 70 à la source, la variable irpp
ne vaudra que 30 euros. Le simulateur de la DGFiP aussi te donnera 30 euros. Mais le vrai impôt est de 100 (qu'on a appelé "impôt économique").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mais il n'y a pas vraiment de référence officielle pour ce concept.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK @bfabre01 : Que penses-tu rajouter cette explication dans la docstring de la Variable ? Je pense que cela très utile pour la suite pour les gens comme moi qui vont vite oublier.
@@ -2,6 +2,8 @@ description: Contribution additionnelle solidarité autonomie (revenus du patrim | |||
reference: ipp | |||
unit: /1 | |||
values: | |||
1945-01-01: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La crds n'existe que depuis 1996.
Il ne devréait pas être nécessaire de remonter si loin. Si cela fait changer beaucoup càd trop de choses, ouvrir une issue pour dire qu'il faut corriger cela.
b772a42
to
5675cf4
Compare
…ajout de CSG-CRDS)
…a législation a changé de manière complexe)
92691f6
to
b9f585a
Compare
…éductible sur les revenus du patrimoine
…l et le transfert de ir_pv_immo dans impots_directs
@benjello : peux-tu stp faire la review pour pouvoir merger cette PR ? |
openfisca_france/model/mesures.py
Outdated
faisant office d'acompte. Puis, l'impôt au barème sur ces revenus est calculé, et confronté à l'acompte. | ||
Cet acompte, est en case 2CK, et considéré comme un crédit d'impôt. Retrancher de l'impôt au barème ce | ||
crédit permet d'obtenir l'impôt dû suite à la déclaration de revenus, qui correspond à la variable 'irpp'. | ||
Cette notion est administrative. L'impît total payé correspond à cette notion administrative, augmentée des acomptes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: impôt
@@ -668,7 +663,7 @@ def formula_2006_01_01(foyer_fiscal, period, parameters): | |||
f8wt = foyer_fiscal('f8wt', period) | |||
f8wu = foyer_fiscal('f8wu', period) | |||
|
|||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8th + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + | |||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi 2 espaces ?
@@ -695,7 +689,7 @@ def formula_2007_01_01(foyer_fiscal, period, parameters): | |||
f8wv = foyer_fiscal('f8wv', period) | |||
f8wx = foyer_fiscal('f8wx', period) | |||
|
|||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8th + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + | |||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -723,7 +716,7 @@ def formula_2008_01_01(foyer_fiscal, period, parameters): | |||
f8wv = foyer_fiscal('f8wv', period) | |||
f8wx = foyer_fiscal('f8wx', period) | |||
|
|||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8th + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + | |||
return (f2ab + f8ta + f8tb + f8tc + f8te - f8tf + f8tg + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wc + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -749,7 +741,7 @@ def formula_2009_01_01(foyer_fiscal, period, parameters): | |||
f8wv = foyer_fiscal('f8wv', period) | |||
f8wx = foyer_fiscal('f8wx', period) | |||
|
|||
return (f2ab + f8ta + f8tb + f8te - f8tf + f8tg + f8th + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wd + | |||
return (f2ab + f8ta + f8tb + f8te - f8tf + f8tg + f8to - f8tp + f8tz + f8uz + f8wa + f8wb + f8wd + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
@@ -2196,11 +2238,11 @@ def formula_2015_01_01(foyer_fiscal, period, parameters): | |||
t2 = ((f7wc + f7wb + f7xb) > 0) * 1 | |||
t3 = ((f7vg + f7vh + f7wh) > 0) * 1 | |||
t4 = ((f7sn + f7rn + f7tn) > 0) * 1 | |||
t5 = ((f7sr + f7rr + f7tr + | |||
t5 = ((f7sr + f7rr + f7tr + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il faut mettre mes + en début de ligne (jurisprudence @Anna-Livia ;-))
Heures supplémentaires comptées négativement | ||
""" | ||
return -hsup | ||
######################################################################################################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mettre moins de ######
Utiliser un seul commentaire mais mettre des numéros.
P.prelevements_solidarite.revenus_du_patrimoine | ||
) | ||
return -revenus_capitaux_prelevement_bareme * total | ||
################################################################################################################# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pareil
|
||
|
||
# Revenus fonciers | ||
################################################################################################################# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem
@bfabre01 : Si tu élimines/modifie le nom des variables il faut suivre ces règles dans les messages de commit Si tu ne l'a pas fait je ne sais pas ce que préconisent les @openfisca/france-contributors |
@benjello : merci. Je viens juste de commiter. Est-ce bon pour toi ? Pour les commits, je viens de regarder le doc. Les messages de commit ne sont pas exactement ceux préconisés. Mais (1) ils sont assez explicites, (2) le CHANGELOG reprend les différentes modifs. |
Description:
(1) Amélioration de la taxation du capital : des revenus 2013 aux revenus 2017
imp_lib
parameters\impot_revenu\rvcm\prelevement_liberatoire
prelevement_forfaitaire_liberatoire
dans un fichier à part demodel\prelevements_obligatoires
parameters\taxation_capital\pfl
+ mets à jour ces paramètresassiette_csg_revenus_capital
,assiette_csg_plus_values
csg_cap_bar
,csg_pv_mo
,csg_pv_immo
,csg_fon
,csg_cap_lib
dans une unique nouvelle variablecsg_revenus_capital
.crds_cap_bar
,crds_pv_mo
,crds_pv_immo
,crds_fon
,crds_cap_lib
dans une unique nouvelle variablecrds_revenus_capital
.prelsoc_cap_bar
,prelsoc_pv_mo
,prelsoc_pv_immo
,prelsoc_fon
,prelsoc_cap_lib
dans une unique nouvelle variableprelevements_sociaux_revenus_capital_hors_csg_crds
.(2) Modification liées à l'IR
plus_values
=>taxation_plus_values_hors_bareme
retraite_titre_onereux_net
=>rente_viagere_titre_onereux_net
rev_cap_bar
=>revenus_capitaux_prelevement_bareme
rev_cap_lib
=>revenus_capitaux_prelevement_liberatoire
- Correction csg déductible (
csg_deduc
=>csg_deductible_patrimoine_ir
) et suppression de variables intermédiaires liéescsg_deduc_patrimoine_simulated
etcsg_deduc_patrimoine
(3) Amélioration de
openfisca_france/model/mesures.py
pensions_i
,revenus_du_capital_i
,revenus_du_travail_i
,pensions
,revenus_du_capital
,revenus_du_travail
=> rajout de "net" dans leur nomrevenu_primaire
,revenu_initial
,revenu_initial_individu
,niveau_de_vie_initial
,cotisations_non_contributives
,check_csk
,check_csg
,check_crds
,cotsoc_bar
,cotsoc_lib
,prelsoc_cap
model\prelevements_sociaux\contributions_sociales
revenu_primaire
: enlève le chomage imposableimpots_directs
: prends en compte les prélèvements libératoires (qui ne rentrent donc plus dans le calcul des revenus du capital nets)Ces changements :