From 0caeca001cb05c5a82775fbbe4b652b217fdb449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 20 Mar 2026 10:47:34 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[=EC=97=B0=EC=B0=A8=EC=B4=89=EC=A7=84]?= =?UTF-8?q?=201=EB=85=84=20=EB=AF=B8=EB=A7=8C=20=EA=B7=BC=EB=A1=9C?= =?UTF-8?q?=EC=9E=90=20=EC=B4=89=EC=A7=84=EA=B8=B0=EA=B0=84=20=EA=B3=84?= =?UTF-8?q?=EC=82=B0=20=EA=B3=B5=EC=8B=9D=20=EB=B6=84=EB=A6=AC=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 1년 이상: 만료 6개월/2개월 전 (제61조 1항) - 1년 미만: 만료 3개월/1개월 전 (제61조 2항) - 대상자 목록에 1년미만 배지 표시 --- app/Services/HR/LeaveService.php | 34 ++++++++++++++----- .../views/hr/leave-promotions/index.blade.php | 7 +++- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/app/Services/HR/LeaveService.php b/app/Services/HR/LeaveService.php index 4125aa79..291b37f5 100644 --- a/app/Services/HR/LeaveService.php +++ b/app/Services/HR/LeaveService.php @@ -864,19 +864,37 @@ public function getPromotionCandidates(int $year): Collection $hireDate = $balance->employee?->hire_date; if ($hireDate) { $hire = Carbon::parse($hireDate); - // 연차 만료일: 입사기념일(year+1) 전날 - $anniversary = $hire->copy()->setYear($year + 1); - $expiryDate = $anniversary->copy()->subDay(); + $firstAnniversary = $hire->copy()->addYear(); - // 1차 촉진기간: 만료 6개월 전 ~ +10일 - $balance->first_promotion_start = $expiryDate->copy()->subMonths(6); - $balance->first_promotion_end = $expiryDate->copy()->subMonths(6)->addDays(10); - // 2차 촉진 마감: 만료 2개월 전 - $balance->second_promotion_deadline = $expiryDate->copy()->subMonths(2); + if ($firstAnniversary->greaterThan(Carbon::create($year, 1, 1))) { + // 1년 미만 근로자 (제61조 제2항) + // 만료일: 입사 1주년 전날 + $expiryDate = $firstAnniversary->copy()->subDay(); + + // 1차 촉진: 만료 3개월 전 ~ +10일 + $balance->first_promotion_start = $expiryDate->copy()->subMonths(3); + $balance->first_promotion_end = $expiryDate->copy()->subMonths(3)->addDays(10); + // 2차 촉진: 만료 1개월 전 + $balance->second_promotion_deadline = $expiryDate->copy()->subMonth(); + $balance->is_under_one_year = true; + } else { + // 1년 이상 근로자 (제61조 제1항) + // 만료일: 입사기념일(year+1) 전날 + $anniversary = $hire->copy()->setYear($year + 1); + $expiryDate = $anniversary->copy()->subDay(); + + // 1차 촉진: 만료 6개월 전 ~ +10일 + $balance->first_promotion_start = $expiryDate->copy()->subMonths(6); + $balance->first_promotion_end = $expiryDate->copy()->subMonths(6)->addDays(10); + // 2차 촉진: 만료 2개월 전 + $balance->second_promotion_deadline = $expiryDate->copy()->subMonths(2); + $balance->is_under_one_year = false; + } } else { $balance->first_promotion_start = null; $balance->first_promotion_end = null; $balance->second_promotion_deadline = null; + $balance->is_under_one_year = false; } return $balance; diff --git a/resources/views/hr/leave-promotions/index.blade.php b/resources/views/hr/leave-promotions/index.blade.php index 8db17b50..e2432a14 100644 --- a/resources/views/hr/leave-promotions/index.blade.php +++ b/resources/views/hr/leave-promotions/index.blade.php @@ -106,7 +106,12 @@ class="inline-flex items-center gap-2 px-4 py-2 bg-red-500 hover:bg-red-600 text class="employee-checkbox rounded border-gray-300 text-blue-600" onchange="updateSelectedCount()"> - {{ $candidate->employee?->display_name ?? '-' }} + + {{ $candidate->employee?->display_name ?? '-' }} + @if($candidate->is_under_one_year) + 1년미만 + @endif + {{ $candidate->employee?->department?->name ?? '-' }} {{ $candidate->total_days }}일 {{ $candidate->used_days }}일