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 }}일