Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
leximpact-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur dotations aux communes
leximpact-server
Commits
af0c4b43
Commit
af0c4b43
authored
Sep 26, 2022
by
benoit-cty
Browse files
Options
Downloads
Patches
Plain Diff
Fix decote
parent
1d213935
No related branches found
No related tags found
1 merge request
!77
PLF 2023
Pipeline
#6248
canceled
Sep 26, 2022
Stage: init
Stage: check
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Simulation_engine/reforms.py
+6
-2
6 additions, 2 deletions
Simulation_engine/reforms.py
Simulation_engine/simulate_pop_from_reform.py
+2
-0
2 additions, 0 deletions
Simulation_engine/simulate_pop_from_reform.py
with
8 additions
and
2 deletions
Simulation_engine/reforms.py
+
6
−
2
View file @
af0c4b43
...
...
@@ -18,12 +18,15 @@ class IncomeTaxReform(Reform):
"""
Une réforme de l
'
impôt sur le revenu
"""
def
__init__
(
self
,
tbs
:
FranceTaxBenefitSystem
,
payload
:
dict
,
period
:
str
)
->
None
:
logger
.
debug
(
"
IncomeTaxReform->init
"
)
self
.
payload
=
payload
.
get
(
"
impot_revenu
"
,
{})
# logger.debug(f'IncomeTaxReform {self.payload.get("calcul_impot_revenu")}')
self
.
instant
=
periods
.
instant
(
period
)
self
.
period
=
periods
.
period
(
"
year:1900:200
"
)
super
().
__init__
(
tbs
)
def
modifier
(
self
,
parameters
:
ParameterNode
)
->
ParameterNode
:
logger
.
debug
(
"
IncomeTaxReform->modifier
"
)
reform
=
ParametricReform
(
parameters
,
self
.
payload
,
self
.
instant
,
self
.
period
)
parameters
,
*
_
=
compose
(
*
reforms
(
mapping
(),
self
.
payload
))(
reform
)
return
parameters
...
...
@@ -53,10 +56,10 @@ def reforms(mapping: dict, payload: dict) -> tuple:
def
mapping
()
->
dict
:
return
{
"
decote
"
:
decote
,
"
bareme_ir_depuis_1945
"
:
bareme
,
"
calcul_impot_revenu
"
:
compose
(
plaf_qf
,
decote
,
abat_dom
,
reduction_ss_condition_revenus
),
# TODO: Changer en abat_rni et l'implémenter dans le front
"
abattements_rni
"
:
abattements_rni
,
"
plaf_qf
"
:
compose
(
plaf_qf
,
abat_dom
,
reduction_ss_condition_revenus
),
}
...
...
@@ -90,6 +93,7 @@ def bareme(reform: T) -> T:
def
decote
(
reform
:
T
)
->
T
:
logger
.
debug
(
"
decote
"
)
logger
.
debug
(
reform
.
payload
)
if
reform
.
payload
.
get
(
"
bareme
"
):
logger
.
debug
(
reform
.
payload
)
...
...
This diff is collapsed.
Click to expand it.
Simulation_engine/simulate_pop_from_reform.py
+
2
−
0
View file @
af0c4b43
...
...
@@ -1060,7 +1060,9 @@ def CompareOldNew(taux=None, isdecile=True, dictreform=None, castypedesc=None):
if
castypedesc
is
None
else
simulation_from_cas_types
(
castypedesc
)
)
# logging.debug(dictreform)
reform
=
IncomeTaxReform
(
TBS
,
dictreform
,
PERIOD
)
# logging.debug( reform.parameters("2023").impot_revenu.calcul_impot_revenu.plaf_qf)
simulation_reform
=
simulation
(
PERIOD
,
data
,
reform
)
default_sims
[
"
apres
"
]
=
simulation_reform
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment