Fix: Always inject holiday metadata into attendance record so banner shows even when employee worked

This commit is contained in:
2026-05-12 12:12:31 +08:00
parent ec88361a38
commit e07927abe1

View File

@@ -1127,7 +1127,7 @@ class AttendanceRecordController extends Controller
}
}
// Only overlay if there is NO existing attendance record for the day with clock times
// Only overlay STATUS if there is NO existing attendance record for the day with clock times
// Note: If they have an approved leave, leave it as LV.
if ($isHolidayDate && $status !== 'LV' && (!$recordDetail || empty($recordDetail['clock_in']))) {
$status = 'HD';
@@ -1141,6 +1141,12 @@ class AttendanceRecordController extends Controller
}
}
// Always inject holiday metadata so the modal banner shows even when employee worked
if ($isHolidayDate && $recordDetail) {
$recordDetail['is_holiday'] = true;
$recordDetail['holiday_name'] = $holidayTitle;
}
$grid[$dateKey] = [
'status' => $status,
'label' => $label,