make(Illuminate\Contracts\Console\Kernel::class); $kernel->bootstrap(); use App\Models\BiometricAttendance; use App\Models\AttendanceRecord; use App\Models\Employee; $emp = Employee::where('biometric_emp_id', '2109')->first(); if (!$emp) { echo "Employee 2109 not found\n"; exit; } echo "Employee: {$emp->user->name} (User ID: {$emp->user_id}, Biometric ID: 2109)\n"; if ($emp->shift) { echo "Shift: {$emp->shift->name} | Start: {$emp->shift->start_time} | End: {$emp->shift->end_time} | Grace: {$emp->shift->grace_period} | Night Shift: " . ($emp->shift->is_night_shift ? 'Yes' : 'No') . "\n"; } else { echo "No shift assigned to employee\n"; } $startDate = '2026-05-25'; $endDate = '2026-05-30'; echo "\n--- BIOMETRIC ATTENDANCE PUNCHES ({$startDate} to {$endDate}) ---\n"; $punches = BiometricAttendance::where('biometric_emp_id', '2109') ->whereBetween('punch_time', [$startDate . ' 00:00:00', $endDate . ' 23:59:59']) ->orderBy('punch_time') ->get(); foreach ($punches as $p) { $workDate = \App\Http\Controllers\BiometricAttendanceController::getWorkDateForPunch($p->punch_time, $emp); echo "ID: {$p->id} | Punch: {$p->punch_time} | Type: {$p->punch_type} | Terminal: {$p->terminal_alias} | Work Date: {$workDate} | Status: {$p->sync_status}\n"; } echo "\n--- ATTENDANCE RECORDS ({$startDate} to {$endDate}) ---\n"; $records = AttendanceRecord::where('employee_id', $emp->user_id) ->whereBetween('date', [$startDate, $endDate]) ->orderBy('date') ->get(); foreach ($records as $r) { echo "ID: {$r->id} | Date: {$r->date} | Clock In: {$r->clock_in} | Clock Out: {$r->clock_out} | Biometric ID: {$r->biometric_id}\n"; }