function elterngeld(type, income_pre_birth, income) {
// Source: https://familienportal.de/familienportal/familienleistungen/elterngeld/faq
if (type == "mama") {
// Maternity Benefit, 100% of pre-birth income
return income_pre_birth;
} else if (type == "basis") {
// 65% of income difference, but 1800€ max.
return Math.min(1800, 0.65 * (income_pre_birth - income));
} else if (type == "plus" || type == "bonus") {
// 65% of income difference, but max. half of the maximum basic parental allowance
var eg_basic_max = Math.min(1800, 0.65 * income_pre_birth);
return Math.min(
0.5 * eg_basic_max,
0.65 * (income_pre_birth - income)
);
} else {
return 0;
}
}
function elterngeld(type, income_pre_birth, income) {
// Source: https://familienportal.de/familienportal/familienleistungen/elterngeld/faq
if (type == “mama”) {
// Maternity Benefit, 100% of pre-birth income
return income_pre_birth;
} else if (type == “basis”) {
// 65% of income difference, but 1800€ max.
return Math.min(1800, 0.65 * (income_pre_birth – income));
} else if (type == “plus” || type == “bonus”) {
// 65% of income difference, but max. half of the maximum basic parental allowance
var eg_basic_max = Math.min(1800, 0.65 * income_pre_birth);
return Math.min(
0.5 * eg_basic_max,
0.65 * (income_pre_birth – income)
);
} else {
return 0;
}
}