From b11de7e2949e9ac9b31c4b0c660fe77eea24e6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 27 Feb 2026 14:10:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[payroll]=20=EA=B3=B5=EC=A0=9C=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=20=EC=A0=84=EC=B2=B4=20=EC=9B=90=EB=8B=A8?= =?UTF-8?q?=EC=9C=84=20=EC=A0=88=EC=82=AD(10=EC=9B=90=20=EB=8B=A8=EC=9C=84?= =?UTF-8?q?)=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 건강보험, 장기요양보험, 국민연금, 고용보험: round() → floor(x/10)*10 - 고소득 구간 근로소득세 공식 계산도 10원 단위 절삭 적용 - 지방소득세는 이전 커밋에서 이미 적용됨 --- app/Services/HR/PayrollService.php | 44 +++++++++++++----------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/app/Services/HR/PayrollService.php b/app/Services/HR/PayrollService.php index 58cfc28a..8d787e5a 100644 --- a/app/Services/HR/PayrollService.php +++ b/app/Services/HR/PayrollService.php @@ -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); } /**