public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results)
        {
            PaymentResult  advanceBaseResult      = (PaymentResult)GetResultBy(results, TAX_ADVANCE);
            TaxClaimResult reliefClaimPayerResult = (TaxClaimResult)GetResultBy(results, TAX_CLAIM_PAYER);
            TaxClaimResult reliefClaimDisabResult = (TaxClaimResult)GetResultBy(results, TAX_CLAIM_DISAB);
            TaxClaimResult reliefClaimStudyResult = (TaxClaimResult)GetResultBy(results, TAX_CLAIM_STUDY);

            decimal advanceBaseValue = advanceBaseResult.Payment();
            decimal reliefPayerValue = reliefClaimPayerResult.TaxRelief();
            decimal reliefDisabValue = reliefClaimDisabResult.TaxRelief();
            decimal reliefStudyValue = reliefClaimStudyResult.TaxRelief();

            decimal taxReliefValue = 0m;
            decimal taxClaimsValue = reliefPayerValue + reliefDisabValue + reliefStudyValue;

            decimal resultValue = ComputeResultValue(advanceBaseValue,
                                                     taxReliefValue, taxClaimsValue);

            var resultValues = new Dictionary <string, object>()
            {
                { "tax_relief", resultValue }
            };

            return(new TaxReliefResult(TagCode, Code, this, resultValues));
        }
예제 #2
0
        public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results)
        {
            PaymentResult   advanceBaseResult = (PaymentResult)GetResultBy(results, TAX_ADVANCE);
            TaxReliefResult reliefPayerResult = (TaxReliefResult)GetResultBy(results, TAX_RELIEF_PAYER);
            decimal         reliefClaimValue  = SumReliefBy(results, TAX_CLAIM_BASE);

            decimal advanceBaseValue = advanceBaseResult.Payment();
            decimal reliefPayerValue = reliefPayerResult.TaxRelief();

            decimal taxReliefValue = ComputeResultValue(advanceBaseValue,
                                                        reliefPayerValue, reliefClaimValue);

            var resultValues = new Dictionary <string, object>()
            {
                { "tax_relief", taxReliefValue }
            };

            return(new TaxReliefResult(TagCode, Code, this, resultValues));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
        public override PayrollResult Evaluate(PayrollPeriod period, PayTagGateway tagConfig, IDictionary <TagRefer, PayrollResult> results)
        {
            PaymentResult   advanceBaseResult = (PaymentResult)GetResultBy(results, TAX_ADVANCE);
            TaxReliefResult reliefPayerResult = (TaxReliefResult)GetResultBy(results, TAX_RELIEF_PAYER);
            TaxReliefResult reliefChildResult = (TaxReliefResult)GetResultBy(results, TAX_RELIEF_CHILD);

            decimal advanceBaseValue = advanceBaseResult.Payment();
            decimal reliefPayerValue = reliefPayerResult.TaxRelief();
            decimal reliefChildValue = reliefChildResult.TaxRelief();

            decimal taxAdvanceAfterA = ComputeResultValueA(advanceBaseValue, reliefPayerValue, reliefChildValue);
            decimal taxAdvanceAfterC = ComputeResultValueC(advanceBaseValue, reliefPayerValue, reliefChildValue);

            decimal taxAdvanceValue = taxAdvanceAfterC;

            var resultValues = new Dictionary <string, object>()
            {
                { "after_reliefA", taxAdvanceAfterA },
                { "after_reliefC", taxAdvanceAfterC },
                { "payment", taxAdvanceValue }
            };

            return(new TaxAdvanceResult(TagCode, Code, this, resultValues));
        }