fix: [연차촉진] 1년 미만 근로자 촉진기간 계산 공식 분리 적용

- 1년 이상: 만료 6개월/2개월 전 (제61조 1항)
- 1년 미만: 만료 3개월/1개월 전 (제61조 2항)
- 대상자 목록에 1년미만 배지 표시
This commit is contained in:
김보곤
2026-03-20 10:47:34 +09:00
parent dbd06cead0
commit 0caeca001c
2 changed files with 32 additions and 9 deletions

View File

@@ -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;

View File

@@ -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()">
</td>
<td class="px-3 py-2 font-medium text-gray-800">{{ $candidate->employee?->display_name ?? '-' }}</td>
<td class="px-3 py-2 font-medium text-gray-800">
{{ $candidate->employee?->display_name ?? '-' }}
@if($candidate->is_under_one_year)
<span class="ml-1 inline-flex px-1.5 py-0.5 rounded text-[10px] font-medium bg-purple-100 text-purple-700">1년미만</span>
@endif
</td>
<td class="px-3 py-2 text-gray-600">{{ $candidate->employee?->department?->name ?? '-' }}</td>
<td class="px-3 py-2 text-center">{{ $candidate->total_days }}</td>
<td class="px-3 py-2 text-center">{{ $candidate->used_days }}</td>