@php $hours = fn (int $m) => number_format($m / 60, 2, '.', '').' h'; $signed = fn (int $m) => ($m > 0 ? '+' : ($m < 0 ? '−' : '')).number_format(abs($m) / 60, 2, '.', '').' h'; $field = 'h-10 w-full rounded-lg border border-border bg-card px-2.5 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring'; $tone = ['NO_RECORDS' => 'bg-muted text-muted-foreground', 'INCOMPLETE' => 'bg-warning-soft text-warning', 'COMPLETE' => 'bg-success-soft text-success']; @endphp
@if ($error) @else @include('livewire._monthly-journeys') @php($m = $report['month'])

{{ __('reports.monthly.period.title') }}

{{ __('reports.monthly.period.subtitle', ['first' => \App\Domain\Time\BusinessCalendar::formatKey($m['firstKey']), 'last' => \App\Domain\Time\BusinessCalendar::formatKey($m['lastKey']), 'days' => $m['days']]) }}

@if ($workerId !== '' || $status !== '')@endif @if (Route::has('reports.monthly.export')) {{ __('reports.monthly.exportXlsx') }} @endif @if (Route::has('reports.monthly.pdf')) {{ __('reports.monthly.exportPdf') }} @endif
@php($t = $report['totals'])
@foreach ([ ['workers', (string) $t['workersIncluded'], __('reports.monthly.kpi.workersCaption', ['days' => $t['scheduledDays']])], ['scheduledHours', $hours($t['scheduledMinutes']), __('reports.monthly.kpi.scheduledCaption')], ['verifiedHours', $hours($t['verifiedWorkMinutes']), __('reports.monthly.kpi.verifiedCaption', ['days' => $t['verifiedDays']])], ['overtime', $hours($t['overtimeMinutes']), __('reports.monthly.kpi.overtimeCaption')], ['below', $hours($t['belowMinutes']), __('reports.monthly.kpi.belowCaption', ['net' => $signed($t['netVarianceMinutes'])])], ['incompleteDays', (string) $t['incompleteRecords'], __('reports.monthly.kpi.unverifiedCaption', ['count' => $t['unverifiedDays']])], ] as [$key, $value, $caption])

{{ __('reports.monthly.kpi.'.$key) }}

{{ $value }}

{{ $caption }}

@endforeach

{{ __('reports.monthly.kpi.secondary') }}: {{ __('reports.monthly.kpi.days') }} {{ $t['recordedDays'] }} / {{ $t['scheduledDays'] }} · {{ __('reports.monthly.kpi.late') }} {{ $t['lateArrivals'] }} · {{ __('reports.monthly.kpi.travel') }} {{ \App\Support\Format::minutes($t['travelMinutes']) }} · {{ __('reports.monthly.kpi.break') }} {{ \App\Support\Format::minutes($t['breakMinutes']) }} · {{ __('reports.monthly.kpi.private') }} {{ \App\Support\Format::minutes($t['privateLeaveMinutes']) }}

{{ __('reports.monthly.table.title') }}

{{ __('reports.monthly.table.subtitle', ['month' => __('reports.monthly.months.'.$m['month']).' '.$m['year']]) }}

@if ($report['employees'] === [])

{{ __('reports.monthly.table.emptyTitle') }}

{{ __('reports.monthly.table.emptyBody') }}

@else
@foreach (['employee', 'scheduled', 'recorded', 'work', 'break', 'travel', 'late', 'incomplete', 'verifiedDays', 'scheduledHours', 'verifiedHours', 'overtime', 'below', 'net', 'status'] as $col)@endforeach @foreach ($report['employees'] as $e) @foreach ([$e['scheduledDays'], $e['recordedDays'], \App\Support\Format::minutes($e['workMinutes']), \App\Support\Format::minutes($e['breakMinutes']), \App\Support\Format::minutes($e['travelMinutes']), $e['lateArrivals'], $e['incompleteRecords'], $e['verifiedDays'], $hours($e['verifiedScheduledMinutes']), $hours($e['verifiedWorkMinutes']), $hours($e['overtimeMinutes']), $hours($e['belowMinutes']), $signed($e['netVarianceMinutes'])] as $cell)@endforeach @endforeach @foreach ([$t['scheduledDays'], $t['recordedDays'], \App\Support\Format::minutes($t['workMinutes']), \App\Support\Format::minutes($t['breakMinutes']), \App\Support\Format::minutes($t['travelMinutes']), $t['lateArrivals'], $t['incompleteRecords'], $t['verifiedDays'], $hours($t['verifiedScheduledMinutes']), $hours($t['verifiedWorkMinutes']), $hours($t['overtimeMinutes']), $hours($t['belowMinutes']), $signed($t['netVarianceMinutes'])] as $cell)@endforeach
{{ __('reports.monthly.table.'.$col) }}
{{ $cell }}{{ __('reports.monthly.status.'.$e['status']) }}
{{ __('reports.monthly.table.total') }}{{ $cell }}
@endif
@foreach (['factual', 'absence', 'overtime', 'verified'] as $n)

{{ __('reports.monthly.notes.'.$n) }}

@endforeach
@if ($detail) @php($emp = $detail['employee'])
@endif @endif