Skip to content

Commit

Permalink
Move to barèmes annuités
Browse files Browse the repository at this point in the history
  • Loading branch information
benjello committed Nov 18, 2024
1 parent 256c295 commit 4d0416e
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description: Taux d'annuité par trimestre validé
brackets:
- threshold:
1960-01-01:
value: 0
rate:
1960-01-01:
value: 0.01
- threshold:
1960-01-01:
value: 40
rate:
1960-01-01:
value: 0.005
- threshold:
1960-01-01:
value: 160
rate:
1960-01-01:
value: 0
metadata:
threshold_unit: trimestre
rate_unit: /1
8 changes: 4 additions & 4 deletions openfisca_tunisia_pension/regimes/regime.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ class taux_de_liquidation(Variable):
label = 'Taux de liquidation de la pension'

def formula(individu, period, parameters):
decote = individu('regime_name_decote', period)
surcote = individu('regime_name_surcote', period)
taux_plein = parameters(period).regime_name.taux_plein.taux_plein
return taux_plein * (1 - decote + surcote)
bareme_annuite = parameters(period).retraite.regime_name.bareme_annuite
duree_assurance = individu('regime_name_duree_assurance', period)
taux_annuite = bareme_annuite.calc(duree_assurance)
return taux_annuite


# def revalorise(variable_31_decembre_annee_precedente, variable_originale, annee_de_liquidation, revalorisation, period):
Expand Down
8 changes: 4 additions & 4 deletions openfisca_tunisia_pension/variables/cnrps.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class cnrps_taux_de_liquidation(Variable):
label = 'Taux de liquidation de la pension'

def formula(individu, period, parameters):
decote = individu('cnrps_decote', period)
surcote = individu('cnrps_surcote', period)
taux_plein = parameters(period).cnrps.taux_plein.taux_plein
return taux_plein * (1 - decote + surcote)
bareme_annuite = parameters(period).retraite.cnrps.bareme_annuite
duree_assurance = individu('cnrps_duree_assurance', period)
taux_annuite = bareme_annuite.calc(duree_assurance)
return taux_annuite
8 changes: 4 additions & 4 deletions openfisca_tunisia_pension/variables/rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class rsa_taux_de_liquidation(Variable):
label = 'Taux de liquidation de la pension'

def formula(individu, period, parameters):
decote = individu('rsa_decote', period)
surcote = individu('rsa_surcote', period)
taux_plein = parameters(period).rsa.taux_plein.taux_plein
return taux_plein * (1 - decote + surcote)
bareme_annuite = parameters(period).retraite.rsa.bareme_annuite
duree_assurance = individu('rsa_duree_assurance', period)
taux_annuite = bareme_annuite.calc(duree_assurance)
return taux_annuite
8 changes: 4 additions & 4 deletions openfisca_tunisia_pension/variables/rsna.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class rsna_taux_de_liquidation(Variable):
label = 'Taux de liquidation de la pension'

def formula(individu, period, parameters):
decote = individu('rsna_decote', period)
surcote = individu('rsna_surcote', period)
taux_plein = parameters(period).rsna.taux_plein.taux_plein
return taux_plein * (1 - decote + surcote)
bareme_annuite = parameters(period).retraite.rsna.bareme_annuite
duree_assurance = individu('rsna_duree_assurance', period)
taux_annuite = bareme_annuite.calc(duree_assurance)
return taux_annuite
55 changes: 55 additions & 0 deletions tests/formulas/cnrps/cnrps_pension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
- name: "5 ans de trimetres CNRPS"

Check warning on line 1 in tests/formulas/cnrps/cnrps_pension.yaml

View workflow job for this annotation

GitHub Actions / lint-files (maximal)

1:1 [document-start] missing document start "---"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 5 * 4
output:
cnrps_taux_de_liquidation: .1

- name: "10 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 10 * 4
output:
cnrps_taux_de_liquidation: .2

- name: "13 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 13 * 4
output:
cnrps_taux_de_liquidation: .2 + .09

- name: "21 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 21 * 4
output:
cnrps_taux_de_liquidation: .5 + .02

- name: "31 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 31 * 4
output:
cnrps_taux_de_liquidation: .5 + .22

- name: "40 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 40 * 4
output:
cnrps_taux_de_liquidation: .9

- name: "50 ans de trimetres CNRPS"
period: 2011
absolute_error_margin: 0.5
input:
cnrps_duree_assurance: 50 * 4
output:
cnrps_taux_de_liquidation: .9

0 comments on commit 4d0416e

Please sign in to comment.