Ejemplo n.º 1
0
        public override NationalInsuranceCalculation CalculateNationalInsurance(decimal gross, char niCategory, PayPeriods payPeriods)
        {
            // The ST is back! But lower than PT.
            var niRates = TaxYearConfigurationData.NiRates[niCategory];

            // 'X' NI Code does not pay NI contributions
            if (niCategory == 'X')
            {
                gross = 0m;
            }

            var limitThresholds = GetLimitThresholdsForPeriods(payPeriods);

            var niCalc = new NationalInsuranceCalculation
            {
                EarningsUptoIncludingLEL        = SubtractRound(gross, limitThresholds.LowerEarningsLimit, 0),
                EarningsAboveLELUptoIncludingPT = SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.LowerEarningsLimit),
                EarningsAboveUEL = SubtractRound(gross, gross, limitThresholds.UpperEarningsLimit),
                EarningsAboveSTUpToIncludingPT  = SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.SecondaryThreshold),
                EarningsAbovePTUptoIncludingUEL = SubtractRound(gross, limitThresholds.UpperEarningsLimit, limitThresholds.PrimaryThreshold),
            };

            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveSTUpToIncludingPT * (niRates.EeC / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAbovePTUptoIncludingUEL * (niRates.EeD / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveUEL * (niRates.EeE / 100));

            niCalc.EmployerNiGross += TaxMath.HmrcRound((niCalc.EarningsAboveSTUpToIncludingPT + niCalc.EarningsAbovePTUptoIncludingUEL) * (niRates.ErD / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveUEL * (niRates.ErE / 100));

            return(niCalc);
        }
        public override NationalInsuranceCalculation CalculateNationalInsurance(decimal gross, char niCategory, PayPeriods payPeriods)
        {
            var niRates         = TaxYearConfigurationData.NiRates[niCategory];
            var limitThresholds = GetLimitThresholdsForPeriods(payPeriods);

#pragma warning disable IDE0017 // Simplify object initialization
            var niCalc = new NationalInsuranceCalculation();
#pragma warning restore IDE0017 // Simplify object initialization
            // Employee NI Gross
            niCalc.EmployeeNiGross  = TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.UpperAccrualPoint, limitThresholds.PrimaryThreshold) * (niRates.EeD / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.UpperEarningsLimit, limitThresholds.UpperAccrualPoint) * (niRates.EeE / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(SubtractRound(gross, gross, limitThresholds.UpperEarningsLimit) * (niRates.EeF / 100));

            niCalc.EmployeeNiRebate  = TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.SecondaryThreshold, limitThresholds.LowerEarningsLimit) * (niRates.EeB / 100));
            niCalc.EmployeeNiRebate += TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.SecondaryThreshold) * (niRates.EeC / 100));

            // Employer NI Gross
            niCalc.EmployerNiGross  = TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.SecondaryThreshold) * (niRates.ErC / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.UpperAccrualPoint, limitThresholds.PrimaryThreshold) * (niRates.ErD / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.UpperEarningsLimit, limitThresholds.UpperAccrualPoint) * (niRates.ErE / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(SubtractRound(gross, gross, limitThresholds.UpperEarningsLimit) * (niRates.ErF / 100));

            niCalc.EmployerNiRebate = TaxMath.HmrcRound(SubtractRound(gross, limitThresholds.SecondaryThreshold, limitThresholds.LowerEarningsLimit) * (niRates.ErB / 100));

            return(niCalc);
        }
Ejemplo n.º 3
0
        public override NationalInsuranceCalculation CalculateNationalInsurance(decimal gross, char niCategory, PayPeriods payPeriods)
        {
            var niRates = TaxYearConfigurationData.NiRates[niCategory];

            var niCalc          = new NationalInsuranceCalculation();
            var limitThresholds = GetLimitThresholdsForPeriods(payPeriods);

            // Employee NI Gross
            var lelToPt  = SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.LowerEarningsLimit);
            var ptToSt   = SubtractRound(gross, limitThresholds.SecondaryThreshold, limitThresholds.PrimaryThreshold);
            var stToUap  = SubtractRound(gross, limitThresholds.UpperAccrualPoint, limitThresholds.SecondaryThreshold);
            var uapToUel = SubtractRound(gross, limitThresholds.UpperEarningsLimit, limitThresholds.UpperAccrualPoint);
            var aboveUel = SubtractRound(gross, gross, limitThresholds.UpperEarningsLimit);

            niCalc.EmployeeNiGross  = TaxMath.HmrcRound(ptToSt * (niRates.EeC / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(stToUap * (niRates.EeD / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(uapToUel * (niRates.EeE / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(aboveUel * (niRates.EeF / 100));

            niCalc.EmployeeNiRebate = TaxMath.HmrcRound(lelToPt * (niRates.EeB / 100));

            // Employer NI Gross
            //niCalc.EmployerNiGross = TaxMath.HmrcRound(ptToSt * (niRates.ErC / 100));
            if (!(niCategory == 'I' || niCategory == 'K' || niCategory == 'V'))
            {
                niCalc.EmployerNiGross += TaxMath.HmrcRound(stToUap * (niRates.ErD / 100));
            }
            niCalc.EmployerNiGross += TaxMath.HmrcRound(uapToUel * (niRates.ErE / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(aboveUel * (niRates.ErF / 100));

            niCalc.EmployerNiRebate  = TaxMath.HmrcRound(lelToPt * (niRates.ErB / 100));
            niCalc.EmployerNiRebate += TaxMath.HmrcRound(ptToSt * (niRates.ErC / 100));
            if ((niCategory == 'I' || niCategory == 'K' || niCategory == 'V'))
            {
                niCalc.EmployerNiRebate += TaxMath.HmrcRound(stToUap * (niRates.ErD / 100));
            }

            return(niCalc);
        }
        public override NationalInsuranceCalculation CalculateNationalInsurance(decimal gross, char niCategory, PayPeriods payPeriods)
        {
            var niRates = TaxYearConfigurationData.NiRates[niCategory];

            var limitThresholds = GetLimitThresholdsForPeriods(payPeriods);

            var niCalc = new NationalInsuranceCalculation
            {
                EarningsUptoIncludingLEL        = SubtractRound(gross, limitThresholds.LowerEarningsLimit, 0),
                EarningsAboveLELUptoIncludingPT = SubtractRound(gross, limitThresholds.PrimaryThreshold, limitThresholds.LowerEarningsLimit),
                EarningsAbovePTUptoIncludingST  = SubtractRound(gross, limitThresholds.SecondaryThreshold, limitThresholds.PrimaryThreshold),
                EarningsAboveSTUptoIncludingUEL = SubtractRound(gross, limitThresholds.UpperEarningsLimit, limitThresholds.SecondaryThreshold),
                EarningsAboveUEL = SubtractRound(gross, gross, limitThresholds.UpperEarningsLimit)
            };

            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAbovePTUptoIncludingST * (niRates.EeC / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveSTUptoIncludingUEL * (niRates.EeD / 100));
            niCalc.EmployeeNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveUEL * (niRates.EeE / 100));

            niCalc.EmployerNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveSTUptoIncludingUEL * (niRates.ErD / 100));
            niCalc.EmployerNiGross += TaxMath.HmrcRound(niCalc.EarningsAboveUEL * (niRates.ErE / 100));

            return(niCalc);
        }