public void MaximaltUtnyttjande_GränsFörStatligSkatt() { var calc = new IncomeTaxCalculator(Get2017TestConfig()); // No state tax below. Assert.AreEqual(0, calc.Calculate(452100).statligskatt); // State tax above. Assert.AreNotEqual(0, calc.Calculate(452100 + 100).statligskatt); }
static void Main() { var output = new List <string>(); // Fill in your data here: var calc = new IncomeTaxCalculator(new IncomeTaxConfig() { // Stockholm 2018. skattesats_kommunalskatt = 17.90 / 100, skattesats_landstingsskatt = 12.08 / 100, skattesats_begravning = 0.075 / 100, // Correct for 2018. taxYear = 2018, PBB = 45500, IBB = 62500, nedreSkiktgräns = 455300, övreSkiktgräns = 662300, birthYear = 1980, }); output.Add("Gross salary (year), Net salary (year), Total tax (year), Effective tax rate"); for (int salary = 1000 * 12; salary <= 100000 * 12; salary += 1000 * 12) { var r = calc.Calculate(salary); output.Add(string.Format("{0}, {1}, {2}, {3}", salary, salary - r.slutligSkatt, r.slutligSkatt, r.effektivTotalSkattesats)); } File.WriteAllLines("SalaryRangeOutput.csv", output); }
static void Main() { //// Fill in your data here: //var taxConfig = new IncomeTaxConfig() //{ // // Stockholm 2018. // skattesats_kommunalskatt = 17.90 / 100, // skattesats_landstingsskatt = 12.08 / 100, // skattesats_begravning = 0.075 / 100, // // Correct for 2018. // taxYear = 2018, // PBB = 45500, // IBB = 62500, // nedreSkiktgräns = 455300, // övreSkiktgräns = 662300, // birthYear = 1980, //}; // Fill in your data here: var taxConfig = new IncomeTaxConfig() { // Stockholm 2021. skattesats_kommunalskatt = 17.74 / 100, skattesats_landstingsskatt = 12.08 / 100, skattesats_begravning = 0.065 / 100, // Correct for 2021. taxYear = 2021, PBB = TaxYearConstants_2021.PBB, IBB = TaxYearConstants_2021.IBB, nedreSkiktgräns = 523_200, birthYear = 1980, }; double arbetsinkomstFörHelaÅret = 537_200; // Calculate and present the result. var incomeTaxCalculator = new IncomeTaxCalculator(taxConfig); var r = incomeTaxCalculator.Calculate(arbetsinkomstFörHelaÅret); Console.WriteLine(); Console.WriteLine("Arbetsinkomst: {0}", arbetsinkomstFörHelaÅret); Console.WriteLine("Beskattningsbar förvärvsinkomst: {0}", r.beskattningsbarForvärvsinkomst); Console.WriteLine("Kommunalskatt: {0}", r.kommunalskatt); Console.WriteLine("Statligskatt: {0}", r.statligskatt); Console.WriteLine("Begravningsavgift: {0}", r.begravningsavgift); Console.WriteLine("Grundavdrag: {0}", r.grundavdrag); Console.WriteLine("Allmän pensionsavgift: {0}", r.allmänPensionsavgift); Console.WriteLine("Jobbskatteavdrag: {0}", r.jobbskatteavdrag); Console.WriteLine("Totalskatt: {0}", r.slutligSkatt); Console.WriteLine("Effektiv total skattesats: {0}%", r.effektivTotalSkattesats * 100); Console.WriteLine(); }
private static PaySlip BuildPaySlip(EmployeeDetails employeeDetails) { var incomeTaxCalculator = new IncomeTaxCalculator(); var incomeTax = incomeTaxCalculator.Calculate(employeeDetails.AnnualSalary); var grossIncome = CalculateGrossIncome(employeeDetails.AnnualSalary); return(new PaySlip() { Name = $"{employeeDetails.FirstName} {employeeDetails.Surname}", PayPeriod = employeeDetails.PaymentPeriod, GrossIncome = grossIncome, IncomeTax = incomeTax, NetIncome = grossIncome - incomeTax, Super = CalculateSuper(employeeDetails.SuperRate, grossIncome) }); }
public void GivenAnAnnualSalary_CalculateTheMonthlyIncomeTax(int annualSalary, int expectedResult) { var result = _incomeTaxCalculator.Calculate(annualSalary); Assert.That(result, Is.EqualTo(expectedResult)); }