Skip to content

Commit

Permalink
added function to check for eligibility of Erwerbsminderungsrente
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Klotz committed Aug 28, 2023
1 parent c6ad1f3 commit 14c73b2
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/_gettsim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def set_array_backend(backend: str):
"kind_unterh_erhalt_m": float,
"steuerklasse": int,
"durchschn_entgeltp_y": float,
"erwerbsm_rentner": bool,
"erwerbsgemindert": bool,
"teilw_erwerbsm_rente": bool,
"anz_eig_kind_bis_24": int,
}
38 changes: 33 additions & 5 deletions src/_gettsim/transfers/erwerbsm_rente.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def erwerbsm_rente_m(
entgeltp_erwerbsm_rente: float,
rentenwert: float,
rentenartfaktor_erwerbsm_rente: float,
erwerbsm_rentner: bool,
ges_rente_vorauss_erwerbsm: bool,
) -> float:
"""Calculating the Erwerbsminderungsrente pension claim
Expand All @@ -21,27 +21,55 @@ def erwerbsm_rente_m(
See :func:`rentenwert`.
rentenartfaktor_erwerbsm_rente
See :func:`rentenartfaktor_erwerbsm_rente`.
erwerbsm_rentner
See basic input variable :ref:`erwerbsm_rentner <erwerbsm_rentner>.
ges_rente_vorauss_erwerbsm
See :func:`ges_rente_vorauss_erwerbsm`.
Returns
-------
Erwerbsminderungsrente pension claim
"""

if erwerbsm_rentner:
if ges_rente_vorauss_erwerbsm:
out = (
entgeltp_erwerbsm_rente
* erwerbsm_rente_zugangsfaktor
* rentenwert
* rentenartfaktor_erwerbsm_rente
)

else:
out = 0.0
return out


def ges_rente_vorauss_erwerbsm(
erwerbsgemindert: bool,
m_pflichtbeitrag: float,
ges_rente_wartezeit_5: bool,
) -> bool:
"""
Determine eligibility Erwerbsminderungsrente
(pension for reduced earning capacity)
Parameters
----------
erwerbsgemindert
See basic input variable :ref:`erwerbsgemindert <erwerbsgemindert>.
m_pflichtbeitrag
See basic input variable :ref:`m_pflichtbeitrag <m_pflichtbeitrag>.
ges_rente_wartezeit_5
See :func:`ges_rente_wartezeit_5`.
Returns
-------
Erwerbsminderungsrente pension claim
"""

anspruch_erwerbsm_rente = (
erwerbsgemindert and ges_rente_wartezeit_5 and m_pflichtbeitrag >= 36
)

return anspruch_erwerbsm_rente


@dates_active(start="2004-01-01")
def entgeltp_erwerbsm_rente(
entgeltp: float,
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2001/hh_id_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2004/hh_id_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2008/hh_id_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2012/hh_id_4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2018/hh_id_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down
20 changes: 19 additions & 1 deletion src/_gettsim_tests/test_data/erwerbsm_rente/2020/hh_id_6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inputs:
- 6
- 4
- 2
erwerbsm_rentner:
erwerbsgemindert:
- true
- true
- true
Expand Down Expand Up @@ -76,6 +76,24 @@ inputs:
- 1.2
- 0.8
- 0.45
m_freiw_beitrag:
- 0
- 0
- 0
- 0
- 0
m_ersatzzeit:
- 0
- 0
- 0
- 0
- 0
m_pflichtbeitrag:
- 60
- 60
- 60
- 60
- 60
assumed: {}
outputs:
entgeltp_erwerbsm_rente:
Expand Down

0 comments on commit 14c73b2

Please sign in to comment.