@extends('layout.mainlayout') @section('content')
{{-- --}} @foreach ($records as $attendance) {{-- --}} @if (auth()->user()->employee_type != '2') @else @endif @endforeach
Applied OnDate Range Location Project Type Mode Status Action
{{ $attendance->created_at->format('d M Y') }} {{ \Carbon\Carbon::parse($attendance->start_date)->format('d M Y') }} → {{ \Carbon\Carbon::parse($attendance->end_date)->format('d M Y') }} {{ optional($attendance->location)->name ?? '-' }} {{ $attendance->getForm('location_city', '-') }}, {{ $attendance->getForm('location_country', '-') }}{{ optional($attendance->project)->name ?? '-' }} Attendance {{ ucfirst($attendance->attendance_mode ?? 'manual') }} @php $leadStatus = strtolower((string) $attendance->status_lead); $managerStatus = strtolower((string) $attendance->status_manager); $finalStatus = strtolower((string) $attendance->final_status); // For lead_manager flow, derive effective final state from both approvals. $effectiveFinal = $finalStatus; if ($attendance->approval_route === 'lead_manager') { if ($leadStatus === 'rejected' || $managerStatus === 'rejected') { $effectiveFinal = 'rejected'; } elseif ($leadStatus === 'approved' && $managerStatus === 'approved') { $effectiveFinal = 'approved'; } else { $effectiveFinal = 'pending'; } } @endphp Lead {{ ucfirst($leadStatus ?: 'pending') }} Manager {{ ucfirst($managerStatus ?: 'pending') }} Final {{ ucfirst($effectiveFinal ?: 'pending') }} @if ($attendance->final_status === 'pending')
@csrf @method('DELETE')
@endif
@endsection @push('scripts') @endpush