/** * * * Copyright (c) Wishnu Prasetya, 2009. */ package Hypotheek; import static Hypotheek.Util.* ; /** * * @author Wishnu Prasetya */ public abstract class InkomenBelasting { int schijf1_max ; int schijf2_max ; int schijf3_max ; float schijf1_taxrate ; float schijf2_taxrate ; float schijf3_taxrate ; float schijf4_taxrate ; /** * Calculate the income tax. The income is given in euro-cent, the tax * is also expressed in euro-cent. */ public int calcInkomenBelasting(int income, int age) { assert income >=0 : "PRE" ; assert age >= 0 : "PRE" ; int zgvz = calcBijdrageZorgverzekering(income,age) ; int arbeidkorting = calcArbeidskorting(income,age) ; income += zgvz ; //System.out.println("###" + zgvz) ; int schijf1 = 0 ; int schijf2 = 0 ; int schijf3 = 0 ; int schijf4 = 0 ; schijf1 = Math.min(income, schijf1_max) ; schijf2 = Math.min(Math.max(income - schijf1_max,0), schijf2_max - schijf1_max) ; schijf3 = Math.min(Math.max(income - schijf2_max,0), schijf3_max - schijf2_max) ; schijf4 = Math.max(income - schijf3_max,0) ; //System.out.println(">>> S1 = " + schijf1) ; //System.out.println(">>> S2 = " + schijf2) ; //System.out.println(">>> S3 = " + schijf3) ; //System.out.println(">>> S4 = " + schijf4) ; assert schijf1 >= 0 ; assert schijf2 >= 0 ; assert schijf3 >= 0 ; assert schijf4 >= 0 ; int tax = toInt(calcPercentage(schijf1_taxrate,schijf1) + calcPercentage(schijf2_taxrate,schijf2) + calcPercentage(schijf3_taxrate,schijf3) + calcPercentage(schijf4_taxrate,schijf4)) ; tax = Math.max(0,tax - arbeidkorting) ; assert tax >=0 ; return tax ; } abstract public int caclPremieVolksverzekeringen(int income, int age) ; abstract public int calcBijdrageZorgverzekering(int income, int age) ; public int calcTotInkomenBelasting(int income, int age) { int b = calcInkomenBelasting(income,age) + caclPremieVolksverzekeringen(income,age) + calcBijdrageZorgverzekering(income,age) ; return b ; } /** * Calculate the tax reduction one would receive for the amount he pays * for hypotheek interest. This depends of course on the person's income. * * @income Annual bruto income in euro-cent. * @paidForInterest The amount one pays for hypotheek interest for a year. * Also expressed in euro-cent. */ public int calcHypBelastingAftrek(int income, int age, int paidForInterest) { assert income>=0 : "PRE" ; assert age>=0 : "PRE" ; assert paidForInterest>=0 : "PRE" ; int taxPayedNow = calcTotInkomenBelasting(income,age) ; int taxableIncome = Math.max(0, income - paidForInterest) ; int reduction = taxPayedNow - calcTotInkomenBelasting(taxableIncome,age) ; assert reduction >= 0 ; assert reduction <= taxPayedNow ; return reduction ; } abstract public int calcArbeidskorting(int income, int age) ; }