Exemple #1
0
        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));
        }