fix: [payroll] 공제 항목 전체 원단위 절삭(10원 단위) 적용
- 건강보험, 장기요양보험, 국민연금, 고용보험: round() → floor(x/10)*10 - 고소득 구간 근로소득세 공식 계산도 10원 단위 절삭 적용 - 지방소득세는 이전 커밋에서 이미 적용됨
This commit is contained in:
@@ -504,33 +504,27 @@ private function calculateHighIncomeTax(int $salaryThousand, int $familyCount):
|
||||
$excessWon = $excessThousand * 1000;
|
||||
|
||||
if ($salaryThousand <= 14000) {
|
||||
return (int) ($baseTax + ($excessWon * 0.98 * 0.35) + 25000);
|
||||
}
|
||||
if ($salaryThousand <= 28000) {
|
||||
$tax = $baseTax + ($excessWon * 0.98 * 0.35) + 25000;
|
||||
} elseif ($salaryThousand <= 28000) {
|
||||
$excessWon = ($salaryThousand - 14000) * 1000;
|
||||
|
||||
return (int) ($baseTax + 1397000 + ($excessWon * 0.98 * 0.38));
|
||||
}
|
||||
if ($salaryThousand <= 30000) {
|
||||
$tax = $baseTax + 1397000 + ($excessWon * 0.98 * 0.38);
|
||||
} elseif ($salaryThousand <= 30000) {
|
||||
$excessWon = ($salaryThousand - 28000) * 1000;
|
||||
|
||||
return (int) ($baseTax + 6610600 + ($excessWon * 0.98 * 0.40));
|
||||
}
|
||||
if ($salaryThousand <= 45000) {
|
||||
$tax = $baseTax + 6610600 + ($excessWon * 0.98 * 0.40);
|
||||
} elseif ($salaryThousand <= 45000) {
|
||||
$excessWon = ($salaryThousand - 30000) * 1000;
|
||||
|
||||
return (int) ($baseTax + 7394600 + ($excessWon * 0.40));
|
||||
}
|
||||
if ($salaryThousand <= 87000) {
|
||||
$tax = $baseTax + 7394600 + ($excessWon * 0.40);
|
||||
} elseif ($salaryThousand <= 87000) {
|
||||
$excessWon = ($salaryThousand - 45000) * 1000;
|
||||
|
||||
return (int) ($baseTax + 13394600 + ($excessWon * 0.42));
|
||||
$tax = $baseTax + 13394600 + ($excessWon * 0.42);
|
||||
} else {
|
||||
// 87,000천원 초과
|
||||
$excessWon = ($salaryThousand - 87000) * 1000;
|
||||
$tax = $baseTax + 31034600 + ($excessWon * 0.45);
|
||||
}
|
||||
|
||||
// 87,000천원 초과
|
||||
$excessWon = ($salaryThousand - 87000) * 1000;
|
||||
|
||||
return (int) ($baseTax + 31034600 + ($excessWon * 0.45));
|
||||
// 10원 단위 절삭
|
||||
return (int) (floor($tax / 10) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -538,7 +532,7 @@ private function calculateHighIncomeTax(int $salaryThousand, int $familyCount):
|
||||
*/
|
||||
private function calculateHealthInsurance(float $grossSalary, PayrollSetting $settings): int
|
||||
{
|
||||
return (int) round($grossSalary * ($settings->health_insurance_rate / 100));
|
||||
return (int) (floor($grossSalary * ($settings->health_insurance_rate / 100) / 10) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -548,7 +542,7 @@ private function calculateLongTermCare(float $grossSalary, PayrollSetting $setti
|
||||
{
|
||||
$healthInsurance = $grossSalary * ($settings->health_insurance_rate / 100);
|
||||
|
||||
return (int) round($healthInsurance * ($settings->long_term_care_rate / 100));
|
||||
return (int) (floor($healthInsurance * ($settings->long_term_care_rate / 100) / 10) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -558,7 +552,7 @@ private function calculatePension(float $grossSalary, PayrollSetting $settings):
|
||||
{
|
||||
$base = min(max($grossSalary, (float) $settings->pension_min_salary), (float) $settings->pension_max_salary);
|
||||
|
||||
return (int) round($base * ($settings->pension_rate / 100));
|
||||
return (int) (floor($base * ($settings->pension_rate / 100) / 10) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -566,7 +560,7 @@ private function calculatePension(float $grossSalary, PayrollSetting $settings):
|
||||
*/
|
||||
private function calculateEmploymentInsurance(float $grossSalary, PayrollSetting $settings): int
|
||||
{
|
||||
return (int) round($grossSalary * ($settings->employment_insurance_rate / 100));
|
||||
return (int) (floor($grossSalary * ($settings->employment_insurance_rate / 100) / 10) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user