Esempio n. 1
0
        public static PajakTypeData.EmployeeCondition GetEmployeeCondition(SalaryEmployeePayment salaryEmployeePayment)
        {
            PajakTypeData.EmployeeCondition employeeCondition = PajakTypeData.EmployeeCondition.Normal;
            if (salaryEmployeePayment.EmployeeCondition == null)
            {
                return(employeeCondition);
            }
            switch (salaryEmployeePayment.EmployeeCondition.Value)
            {
            case 0:
                employeeCondition = PajakTypeData.EmployeeCondition.Normal;
                break;

            case 1:
                employeeCondition = PajakTypeData.EmployeeCondition.NewEmployee;
                break;

            case 2:
                employeeCondition = PajakTypeData.EmployeeCondition.Resign;
                break;

            case 3:
                employeeCondition = PajakTypeData.EmployeeCondition.Transfer;
                break;

            default:
                employeeCondition = PajakTypeData.EmployeeCondition.Normal;
                break;
            }
            return(employeeCondition);
        }
Esempio n. 2
0
        public static int GetEndPeriod(PajakTypeData.EmployeeCondition employeeCondition, int periodCurrent)
        {
            int period = 0;

            if (employeeCondition == PajakTypeData.EmployeeCondition.Resign || employeeCondition == PajakTypeData.EmployeeCondition.Transfer)
            {
                period = periodCurrent;
            }
            else
            {
                period = 12;
            }
            return(period);
        }
        public static decimal CalculateTaxMonthly(
            decimal taxYearly,
            decimal sumTaxPrev,
            decimal sumTaxPrevbonus,
            int periodStart,
            int periodEnd,
            int periodCurrent,
            decimal begSalaryPPh21,
            PajakTypeData.TaxCalculationMethod taxCalculationMethod,
            PajakTypeData.EmployeeCondition employeeCondition)
        {
            decimal hasil = 0;
            int     lengthCalculationPeriod = periodEnd - periodStart + 1;
            int     lengthCurrentPeriod     = periodCurrent - periodStart + 1;
            int     lengthForecastPeriod    = periodEnd - periodCurrent + 1;

            if (periodCurrent == periodEnd)
            {
                if (employeeCondition == PajakTypeData.EmployeeCondition.Transfer)
                {
                    hasil = taxYearly * lengthCalculationPeriod / 12;
                    hasil = hasil - sumTaxPrev - sumTaxPrevbonus - begSalaryPPh21;
                }
                else
                {
                    hasil = taxYearly - sumTaxPrev - sumTaxPrevbonus - begSalaryPPh21;
                }
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.WeightedAverage)
            {
                hasil = taxYearly - sumTaxPrevbonus - begSalaryPPh21;
                hasil = hasil * lengthCurrentPeriod / lengthCalculationPeriod;
                hasil = hasil - sumTaxPrev;
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.Forecast)
            {
                hasil = taxYearly - sumTaxPrevbonus - sumTaxPrev - begSalaryPPh21;
                hasil = hasil / lengthForecastPeriod;
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.Annually)
            {
                hasil = taxYearly / lengthCalculationPeriod;
            }
            hasil = Round(hasil, 0);
            return(hasil);
        }
        public static decimal CalculateBrutoYearly(
            PajakTypeData.TaxCalculationMethod taxCalculationMethod,
            decimal brutoCurrent,
            decimal brutoPrev,
            decimal brutoPrevBonus,
            int periodStart,
            int periodEnd,
            int periodCurrent,
            PajakTypeData.EmployeeCondition employeeCondition)
        {
            decimal hasil = 0;
            int     lengthCalculationPeriod = periodEnd - periodStart + 1;
            int     lengthCurrentPeriod     = periodCurrent - periodStart + 1;
            int     lengthForecastPeriod    = periodEnd - periodCurrent + 1;

            if (periodCurrent == periodEnd)
            {
                if (employeeCondition == PajakTypeData.EmployeeCondition.Transfer)
                {
                    hasil = (brutoCurrent + brutoPrev) * 12 / lengthCalculationPeriod + brutoPrevBonus;
                }
                else
                {
                    hasil = brutoPrev + brutoPrevBonus + brutoCurrent;
                }
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.WeightedAverage)
            {
                decimal brutoAvg = (brutoPrev + brutoCurrent) / lengthCurrentPeriod;
                hasil = brutoAvg * lengthCalculationPeriod;
                hasil = hasil + brutoPrevBonus;
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.Forecast)
            {
                hasil = brutoPrev + brutoPrevBonus + brutoCurrent * lengthForecastPeriod;
            }
            else if (taxCalculationMethod == PajakTypeData.TaxCalculationMethod.Annually)
            {
                hasil = brutoCurrent * lengthCalculationPeriod;
            }
            return(hasil);
        }
        public static decimal CalculateBiayaJabatan(
            decimal bruto,
            int periodStart,
            int periodEnd,
            PajakTypeData.EmployeeCondition employeeCondition)
        {
            decimal hasil = 0;
            int     lengthCalculationPeriod;

            if (employeeCondition == PajakTypeData.EmployeeCondition.Transfer)
            {
                lengthCalculationPeriod = 12 - periodStart + 1;
            }
            else
            {
                lengthCalculationPeriod = periodEnd - periodStart + 1;
            }
            hasil = Min(PajakTypeData.MaxBiayaJabatan * lengthCalculationPeriod / 12, bruto * PajakTypeData.PersentaseBiayaJabatan / 100);
            return(hasil);
        }