From 0faf4e4d4e77b18ec866f3dbd0dfcc5424354e78 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 15:51:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[payroll]=20=EC=A4=91=EB=B3=B5=20?= =?UTF-8?q?=EA=B8=89=EC=97=AC=20=EB=93=B1=EB=A1=9D=20=EC=8B=9C=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95=20=EB=AA=A8?= =?UTF-8?q?=EB=93=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - store 시 동일 사원/기간 레코드가 존재하면 updatePayroll로 전환 - 기존 INSERT 실패(500) 대신 정상 수정 처리 --- app/Services/HR/PayrollService.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Services/HR/PayrollService.php b/app/Services/HR/PayrollService.php index bdc09621..79f7dddd 100644 --- a/app/Services/HR/PayrollService.php +++ b/app/Services/HR/PayrollService.php @@ -124,9 +124,8 @@ public function storePayroll(array $data): Payroll if ($existing->trashed()) { $existing->forceDelete(); } else { - throw new \InvalidArgumentException( - "해당 직원의 {$data['pay_year']}년 {$data['pay_month']}월 급여가 이미 등록되어 있습니다." - ); + // 이미 존재하는 레코드가 있으면 수정 모드로 전환 + return $this->updatePayroll($existing->id, $data); } } $familyCount = $data['family_count'] ?? $this->resolveFamilyCount($data['user_id']);