-
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
Ipp 12 : Update calcul du quotient familial, ajout nouvelle réduction sous conditions de revenus #918
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.
@ClaireLeroyIPP : s-tu bien testé le QF ?
Normalement il était bien foutu donc j'ai un peu peur qu'il en soit pas assez testé.
@benjello Pour cette PR je peux construire (ou récupérer dans ce que j'ai déjà fait) des tests précis de cas type de foyers dont le QF est plafonné, et intégrer les tests à cette PR. Comme ça, on est plus sereins ? |
unit: currency | ||
values: | ||
2001-01-01: | ||
value: 5100.0 |
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.
@ClaireLeroyIPP @Anna-Livia : est-on obligé de mettre un chiffre après la virgule nul ?
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 ne sais pas pourquoi mais en tout cas c'est comme ça dans quasiment tous les paramètres de l'IR, c'est pour ça que j'en ai mis.
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.
@Anna-Livia @fpagnoux @sandcha : sauriez-vous nous en dire plus ?
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.
À mon avis les .0
sont apparus quand les paramètres ont été migrés automatiquement du XML vers le YAML.
Il n'y a pas de raison que ce soit nécessaire de les mettre.
b7566b5
to
71eae06
Compare
@@ -1066,28 +1066,22 @@ def formula(foyer_fiscal, period, parameters): | |||
A = ir_ss_qf |
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.
Quel est le role de ces variables ? pourquoi ne pas utiliser ir_ss_qf
ou ìr_brut` directement ?
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.
Ce n'est pas moi qui ai introduit cela, mais j'ai repris la notation utilisée avant. Enfait, ces "A", "B", "C" etc. reprennent les notations des lignes de la "Fiche facultative de calculs" des brochures pratiques de l'impôt (ex: p.314 de la brochure IR 2014 http://www2.impots.gouv.fr/documentation/2014/brochure_ir/index.html#314).
- L'avantage c'est que ça permet de rendre le code plus lisible pour quelqu'un comme moi qui arrive après et qui veut verrifier ou modifier le code de l'IRPP
- L'inconvénient c'est que c'est incompréhensible pour un utilisateur lambda qui n'a pas la fiche devant les yeux...
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.
En règle général, c'est compliqué de trouver des noms qui font "sens" pour l'impôt, car justement c'est souvent des calculs purement techniques et très long. C'est très différent de la partie prestations sociales selon moi, où là on peut faire des formules et des noms de variables explicites et compréhensibles, et faire en sorte que les étapes de calculs soient claires pour n'importe quel utilisateur.
(Autre exemple du côté un peu abstrait de l'IR, c'est les cases des déclarations, comme 'f7ba' par exemple, ça n'avancerais pas vraiment d'essayer de toutes leur trouver un nom explicite à chacune, et ce serait impossible comme il y en a plus de 1000, c'est même presque inutile de leur donner un label car le nom d'une case est limite plus explicite que le sens qu'elle revêt bien souvent)
|
||
# TODO: année en dur... pour caseH | ||
condition63 = (celibataire_ou_divorce | (veuf & not_(jeune_veuf))) & not_(caseN) & (nb_pac == 0) & (caseK | caseE) & (caseH < 1981) | ||
aa0 = (nbptr - nb_adult) * 2 # nombre de demi part excédant nbadult |
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-il possible de trouver des noms de variables plus explicites ? demi_parts_hors_adultes
?
idem pour aa1, B1, B2, B3 ...
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.
Cf. commentaires précédents, les étapes du calcul du plafonnement du quotient familial sont assez longues et c'est difficile de leur donner du sens avec des noms de variables plus explicites
ir_plaf_qf = foyer_fiscal('ir_plaf_qf', period) | ||
decote = foyer_fiscal('decote', period) | ||
nb_adult = foyer_fiscal('nb_adult', period) | ||
nbptr = foyer_fiscal('nbptr', period) |
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 nbptr
pourrait être plus explicite ?
nb_adult = foyer_fiscal('nb_adult', period) | ||
nbptr = foyer_fiscal('nbptr', period) | ||
rfr = foyer_fiscal('rfr', period) | ||
parameters = parameters(period).impot_revenu.plafond_qf.reduction_ss_condition_revenus |
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 mettrai plutôt P
pour cohérence avec les autres ou reduction_ss_condition_revenus
pour le sens métier
plafond1 = (parameters.seuil1 * nb_adult + parameters.seuil_maj_enf * 2 * (nbptr - nb_adult)) | ||
plafond2 = (parameters.seuil2 * nb_adult + parameters.seuil_maj_enf * 2 * (nbptr - nb_adult)) | ||
|
||
reduc = ((rfr < plafond1) * (parameters.taux * (ir_plaf_qf - decote)) + |
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.
Cette expression est peu lisible. Est ce que ce serait possible de la découper ?
unit: currency | ||
values: | ||
2001-01-01: | ||
value: 5100.0 |
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 faudrait ajouter une ligne vide à la fin du fichier
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 est en général possible de configurer son éditeur pour que ce soit fait automatiquement à la sauvegarde. (here for vscode)
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 bon à savoir ! je corrige
unit: currency | ||
values: | ||
2001-01-01: | ||
value: 6700.0 |
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 faudrait ajouter une ligne vide à la fin du fichier
unit: currency | ||
values: | ||
2001-01-01: | ||
value: 40.0 |
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 faudrait ajouter une ligne vide à la fin du fichier
2012-01-01: | ||
value: 120.0 | ||
2013-01-01: | ||
value: Null |
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 faudrait ajouter une ligne vide à la fin du fichier
2015-01-01: | ||
value: 1682.0 | ||
2016-01-01: | ||
value: 1684.0 |
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 faudrait ajouter une ligne vide à la fin du fichier
e2e9f8a
to
bb2995a
Compare
…vious formula (ceiling applies to tax base not tax credit) + update parameters
…an, update formulas and simplify formula for 2013 onwards
…e is an invalid member in the family
…us' (which is imputed before other tax reductions)
… 0) follow the same rules as married individuals
…es an additional half share for single person
0573fa1
to
28fc100
Compare
Fixes #338
Les modifications de cette PR sont comparées à la branche
ipp-update-rpnst
(#917)openfisca_france/model/caracteristiques_socio_demographiques/demographie.py
. (label juste)openfisca_france/model/revenus/autres.py
(start_date juste)openfisca_france/model/prelevements_obligatoires/impot_revenu/ir.py
openfisca_france/parameters/impot_revenu/plafond_qf
openfisca_france/parameters/impot_revenu/quotient_familial/veuf.yaml
Ces changements :