fix(hr): remove default times and fix calendar status precedence for Late/Early
This commit is contained in:
@@ -924,15 +924,15 @@ class AttendanceRecordController extends Controller
|
||||
} else if ($record->status === 'absent') {
|
||||
$status = 'A';
|
||||
$label = 'Absent';
|
||||
} else if ($record->is_late || (isset($user->employee->shift) && $record->clock_in && \Carbon\Carbon::parse($record->clock_in)->format('H:i:s') > $user->employee->shift->start_time)) {
|
||||
$status = 'L';
|
||||
$label = 'Late';
|
||||
} else if ($record->is_early_departure || (isset($user->employee->shift) && $record->clock_out && \Carbon\Carbon::parse($record->clock_out)->format('H:i:s') < $user->employee->shift->end_time)) {
|
||||
$status = 'E';
|
||||
$label = 'Early Checkout';
|
||||
} else if ($record->overtime_hours > 0) {
|
||||
$status = 'OT';
|
||||
$label = 'Overtime';
|
||||
} else if ($record->is_late) {
|
||||
$status = 'L';
|
||||
$label = 'Late';
|
||||
} else if ($record->is_early_departure) {
|
||||
$status = 'E';
|
||||
$label = 'Early Checkout';
|
||||
} else if ($record->status === 'half_day') {
|
||||
$status = 'H';
|
||||
$label = 'Half Day';
|
||||
|
||||
Reference in New Issue
Block a user