public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { decimal employerIncome = 0m; decimal employeeIncome = 0m; if (!Interest()) { employerIncome = 0m; employeeIncome = 0m; } else { IncomeBaseResult resultIncome = (IncomeBaseResult)GetResultBy(results, TAG_AMOUNT_BASE); employerIncome = Math.Max(0m, resultIncome.EmployerBase()); employeeIncome = Math.Max(0m, resultIncome.EmployeeBase()); } decimal contPaymentValue = InsuranceContribution(period, employerIncome, employeeIncome); var resultValues = new Dictionary <string, object>() { { "payment", contPaymentValue } }; return(new PaymentDeductionResult(TagCode, Code, this, resultValues)); }
public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { bool pensionSaving = false; PaymentResult resultPension = (PaymentResult)GetResultBy(results, TAG_PENSION_CONT); decimal paymentIncome = 0m; if (!Interest()) { paymentIncome = 0m; } else { IncomeBaseResult resultIncome = (IncomeBaseResult)GetResultBy(results, TAG_AMOUNT_BASE); pensionSaving = resultPension.Interest(); paymentIncome = Math.Max(0m, resultIncome.EmployeeBase()); } decimal contPaymentValue = InsuranceContribution(period, paymentIncome, pensionSaving); var resultValues = new Dictionary <string, object>() { { "payment", contPaymentValue } }; return(new PaymentDeductionResult(TagCode, Code, this, resultValues)); }
public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { IncomeBaseResult insIncomeResult = (IncomeBaseResult)GetResultBy(results, TAG_AMOUNT_BASE); decimal employerBase = insIncomeResult.EmployerBase(); decimal paymentValue = ComputeResultValue(period, employerBase); var resultValues = new Dictionary <string, object>() { { "payment", paymentValue } }; return(new PaymentResult(TagCode, Code, this, resultValues)); }
public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { IncomeBaseResult resultIncome = (IncomeBaseResult)GetResultBy(results, TAG_INCOME_BASE); IncomeBaseResult resultAdvance = (IncomeBaseResult)GetResultBy(results, TAG_ADVANCE_BASE); decimal taxableIncome = resultIncome.IncomeBase(); decimal taxablePartial = resultAdvance.IncomeBase(); decimal resultPayment = ComputeResultValue(period, taxableIncome, taxablePartial); var resultValues = new Dictionary <string, object>() { { "payment", resultPayment } }; return(new PaymentResult(TagCode, Code, this, resultValues)); }
public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { PaymentResult healthEmployer = (PaymentResult)GetResultBy(results, TAG_HEALTH_BASE); PaymentResult socialEmployer = (PaymentResult)GetResultBy(results, TAG_SOCIAL_BASE); IncomeBaseResult resultIncome = (IncomeBaseResult)GetResultBy(results, TAG_AMOUNT_BASE); decimal taxableHealth = healthEmployer.Payment(); decimal taxableSocial = socialEmployer.Payment(); decimal taxableBase = resultIncome.IncomeBase(); bool isTaxInterest = resultIncome.Interest(); bool isTaxDeclared = resultIncome.Declared(); decimal resultPayment = ComputeResultValue(period, isTaxInterest, isTaxDeclared, taxableHealth, taxableSocial, taxableBase); var resultValues = new Dictionary <string, object>() { { "income_base", resultPayment } }; return(new IncomeBaseResult(TagCode, Code, this, resultValues)); }
public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results) { IncomeBaseResult resultIncome = (IncomeBaseResult)GetResultBy(results, TAG_AMOUNT_BASE); PaymentResult advanceBaseResult = (PaymentResult)GetResultBy(results, TAX_ADVANCE); TaxReliefResult reliefPayerResult = (TaxReliefResult)GetResultBy(results, TAX_RELIEF_PAYER); TaxReliefResult reliefChildResult = (TaxReliefResult)GetResultBy(results, TAX_RELIEF_CHILD); decimal reliefClaimValue = SumReliefBy(results, TAX_CLAIMS_CHILD); bool isTaxInterest = resultIncome.Interest(); decimal advanceBaseValue = advanceBaseResult.Payment(); decimal reliefPayerValue = reliefPayerResult.TaxRelief(); decimal reliefChildValue = reliefChildResult.TaxRelief(); decimal taxAdvanceValue = ComputeResultValue(period.Year(), isTaxInterest, advanceBaseValue, reliefPayerValue, reliefChildValue, reliefClaimValue); var resultValues = new Dictionary <string, object>() { { "payment", taxAdvanceValue } }; return(new PaymentResult(TagCode, Code, this, resultValues)); }