@extends('layouts.app') @php // One duration format across every report and export — see App\Support\Duration. $hm = fn ($sec) => \App\Support\Duration::hhmmOrDash((int) $sec); // The free-time rules live in App\Support\FreeTime — Live People colours its // active-hours badge by the same figure, and the two must not drift. $freeMinutes = fn ($sec) => \App\Support\FreeTime::minutes((int) $sec); $hmSigned = fn ($sec) => \App\Support\FreeTime::label((int) $sec); $freeClass = fn ($sec) => \App\Support\FreeTime::textClass((int) $sec); @endphp @section('header')
| {{ $grouped ? 'Date Range' : 'Shift Date' }} | Employee | Total Working | Total Active Hours | Input Activity | Idle/Free Time | |
|---|---|---|---|---|---|---|
|
{{ $span }}
@if ($r['in_progress'])
Working
@endif
{{-- The row is a sum, so say how many shifts it sums.
Without this a light week and a full one look
identical until you read the hours. --}}
{{ $r['shifts'] }} shift{{ $r['shifts'] === 1 ? '' : 's' }}
|
@else
{{ \Illuminate\Support\Carbon::parse($r['shift_date'])->format('D, d M Y') }}
@if ($r['in_progress'])
{{-- Shift hasn't reached its scheduled end, so every
figure on this row is still climbing. --}}
Working
@endif
{{ $r['started_at']->copy()->tz($r['tz'])->format('H:i') }}
→
{{ $r['ended_at']->copy()->tz($r['tz'])->format('H:i') }}
@if ($r['ended_at']->copy()->tz($r['tz'])->toDateString() !== $r['shift_date'])
+1d
@endif
|
@endif
{{ $r['name'] }}
{{ $r['employee_id'] ?: $r['designation'] ?: '—' }}
@if ($r['shift_start'])
· shift {{ substr($r['shift_start'], 0, 5) }}–{{ substr($r['shift_end'], 0, 5) }}
@else
· no shift set
@endif
|
{{ $hm($r['working_sec']) }} | {{ $hm($r['active_sec']) }} | {{-- Measured keyboard/mouse time, with the share of the session it was measured against. An em dash means the agent never sampled — a pre-1.15.0 row — which is not the same as having sat still. --}} {{-- The percentage alone. The measured duration stays on hover: as a column it competed with Total Active Hours right beside it, and the share is the thing being compared between rows. --}}@if ($r['activity_pct'] === null) — @else {{ $r['activity_pct'] }}% @endif | {{ $hmSigned($r['free_sec']) }} |
| No tracked time in this range. | ||||||
| @if ($grouped) {{ $rows->count() }} employee{{ $rows->count() === 1 ? '' : 's' }} · {{ $rows->sum('shifts') }} shift{{ $rows->sum('shifts') === 1 ? '' : 's' }} @else {{ $rows->count() }} shift{{ $rows->count() === 1 ? '' : 's' }} @endif | {{ $hm($totals['working_sec']) }} | {{ $hm($totals['active_sec']) }} | @if ($totals['activity_pct'] === null) — @else {{ $totals['activity_pct'] }}% @endif | {{ $hmSigned($totals['free_sec']) }} | ||