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); }