@extends('layouts.master') @section('title', $title) @section('content') @php $badge = ['present' => 'success', 'late' => 'warning', 'absent' => 'danger', 'half' => 'warning', 'leave' => 'info', 'unpaid' => 'danger', 'holiday' => 'primary', 'off' => 'secondary', 'before_hire' => 'secondary', 'future' => 'secondary']; $q = request()->query(); $link = fn ($extra) => route('hrm.attendance_report.index', array_merge($q, $extra)); @endphp {{-- the same figures payroll deducts by (App\Services\AttendanceCalculator) --}}
@if ($mode === 'daily')
@else
@endif @if ($mode !== 'staff')
@endif
@if ($mode === 'summary') @forelse ($rows as $r) @php $t = $r['totals']; $pct = $t['working_days'] ? round($t['present_days'] / $t['working_days'] * 100) : null; @endphp @empty @endforelse
StaffWorking daysPresentAbsent Leave
paid · unpaid
Holidays Late
times · min
Early (min) Overtime (min)HoursAttendance
{{ $r['staff']->name }} @if ($t['exempt'])Exempt@endif @if ($t['own_days'])own days@endif {{ $t['working_days'] }} {{ $t['present_days'] }} {{ $t['absent_days'] }} {{ $t['paid_leave_days'] }} · {{ $t['unpaid_leave_days'] }} {{ $t['holiday_days'] }} {{ $t['late_count'] }} · {{ $t['late_minutes'] }} {{ $t['early_minutes'] }} {{ $t['overtime_minutes'] }} {{ $t['worked_hours'] }} @if ($pct !== null) {{ $pct }}% @else — @endif @if ($t['single_punch'])
{{ $t['single_punch'] }} one-punch
@endif
Days
No staff.
@elseif ($mode === 'daily') @php $counts = collect($rows)->map(fn ($r) => reset($r['days'])['status'])->countBy(); @endphp
@foreach ($counts as $st => $n) {{ $labels[$st] ?? $st }}: {{ $n }} @endforeach
@forelse ($rows as $r) @php $x = reset($r['days']); @endphp @empty @endforelse
StaffStatusInBreakOutLate (min)Early (min)Overtime (min)HoursNote
{{ $r['staff']->name }} {{ $labels[$x['status']] ?? $x['status'] }} {{ $x['time_in'] ?? '—' }} {{ $x['break'] ?? '' }}@if ($x['break_late'])
{{ $x['break_late'] }} min late back
@endif
{{ $x['time_out'] ?? '—' }} {{ $x['late'] ?: '' }}{{ $x['early'] ?: '' }}{{ $x['overtime'] ?: '' }} {{ $x['worked'] ?: '' }}{{ $x['note'] }}
No staff.
@else @if (!$result)
Choose a staff member.
@else @php $t = $result['totals']; @endphp
{{ $result['staff']->name }} Working days {{ $t['working_days'] }}Present {{ $t['present_days'] }} Absent {{ $t['absent_days'] }}Leave {{ $t['paid_leave_days'] }} paid · {{ $t['unpaid_leave_days'] }} unpaid Late {{ $t['late_count'] }} times, {{ $t['late_minutes'] }} minEarly {{ $t['early_minutes'] }} min Overtime {{ $t['overtime_minutes'] }} minHours {{ $t['worked_hours'] }}
@foreach ($result['days'] as $x) @endforeach
DateStatusInBreakOutLate (min)Early (min)Overtime (min)HoursNote
{{ \Carbon\Carbon::parse($x['date'])->format('D d M') }} {{ $labels[$x['status']] ?? $x['status'] }} {{ $x['time_in'] ?? '—' }} {{ $x['break'] ?? '' }}@if ($x['break_late'])
{{ $x['break_late'] }} min late back
@endif
{{ $x['time_out'] ?? '—' }} {{ $x['late'] ?: '' }}{{ $x['early'] ?: '' }}{{ $x['overtime'] ?: '' }} {{ $x['worked'] ?: '' }}{{ $x['note'] }}
@endif @endif
@endsection @section('page_js') @endsection