public PersonReport(IPensionAgeCalc pensionAgeCalc, IIncomeTaxCalculator incomeTaxCalculator, Person person, DateTime now, DateTime?givenRetirementDate, IAssumptions assumptions, decimal monthlySpending, ITaxSystem taxSystem) { Person = person; StatePensionDate = pensionAgeCalc.StatePensionDate(person.Dob, person.Sex); PrivatePensionDate = pensionAgeCalc.PrivatePensionDate(StatePensionDate, person.Dob); TargetRetirementDate = givenRetirementDate; var salaryAfterDeductions = person.EmployeeContribution.SubtractContribution(person.Salary); var taxResult = incomeTaxCalculator.TaxFor(salaryAfterDeductions); var taxResultWithRental = incomeTaxCalculator.TaxFor(salaryAfterDeductions, rentalIncome: person.RentalPortfolio.RentalIncome()); NationalInsuranceBill = Convert.ToInt32(taxResult.NationalInsurance); IncomeTaxBill = Convert.ToInt32(taxResult.IncomeTax); RentalTaxBill = Convert.ToInt32(taxResultWithRental.TotalTaxFor(IncomeType.RentalIncome)); TakeHomeSalary = Convert.ToInt32(taxResult.AfterTaxIncome); TakeHomeRentalIncome = Convert.ToInt32(person.RentalPortfolio.TotalNetIncome() - RentalTaxBill); SalarySteps = SetupSalarySteps(person, now).ToList(); var niContributingYearsSoFar = NiContributingYearsCalc.CalculateContributingYearsSoFar(person, MonthlySalaryAfterDeductionsAt(now), now, taxSystem); var mode = givenRetirementDate.HasValue ? StepType.GivenDate : StepType.CalcMinimum; StepReport = new StepsReport(person, niContributingYearsSoFar, mode, now, assumptions, monthlySpending, PrivatePensionDate, taxSystem); _take25 = assumptions.Take25; }
public RetirementReport(IPensionAgeCalc pensionAgeCalc, IIncomeTaxCalculator incomeTaxCalculator, Family family, DateTime now, DateTime?givenRetirementDate, IAssumptions assumptions, ITaxSystem taxSystem) { _family = family; _assumptions = assumptions; TimeToRetirement = new DateAmount(DateTime.MinValue, DateTime.MinValue); TargetRetirementDate = givenRetirementDate; var spendingStepInputs = family.SpendingStepInputs.OrderBy(input => input.Date).ToList(); for (int i = 0; i < spendingStepInputs.Count; i++) { var endDate = i < spendingStepInputs.Count - 1 ? spendingStepInputs[i + 1].Date : family.PrimaryPerson.Dob.AddYears(100); SpendingSteps.Add(new SpendingStepReport(spendingStepInputs[i].Date, endDate.AddDays(-1), spendingStepInputs[i].NewAmount)); } var monthlySpending = MonthlySpendingAt(now) / family.Persons.Count; foreach (var person in family.Persons) { Persons.Add(new PersonReport(pensionAgeCalc, incomeTaxCalculator, person, now, givenRetirementDate, _assumptions, monthlySpending, taxSystem)); } }
public NetSalaryCalculator(IIncomeTaxCalculator incomeTaxCalculator, ISocialContributionsCalculator socialContributionsCalculator) { this.incomeTaxCalculator = incomeTaxCalculator; this.socialContributionsCalculator = socialContributionsCalculator; }
public TaxCalculatorDomainInterface(IIncomeTaxCalculator taxCalculator) { _taxCalculator = taxCalculator; }