@php $fmtDuration = function (?int $seconds): string { $seconds = max(0, (int) $seconds); $h = intdiv($seconds, 3600); $m = intdiv($seconds % 3600, 60); $s = $seconds % 60; return sprintf('%02d:%02d:%02d', $h, $m, $s); }; @endphp

{{ __('Time Tracking') }}

{{ __('Track time across everyone working on this job.') }}

@if ($canManage) @endif

{{ __('Total logged') }}

{{ number_format($totalHours, 2) }}{{ __('hrs') }}

{{-- Where the job's time went. The single total above answers "how long has this taken"; on a job making several things, this answers the question that decides what to quote next time. --}} @if (count($byProduct) > 1)

{{ __('Where the time went') }}

@foreach ($byProduct as $row) {{ $row['label'] }} {{ number_format($row['hours'], 2) }} h @endforeach
@endif
@if ($active)

{{ __('Timer running') }}, {{ $active->activity }} @unless ($active->is_billable) ({{ __('non-billable') }}) @endunless

00:00:00

@else
{{-- What the hour is for. On a job making several things, "four hours on the job" never says whether the banner took forty minutes and the wrap took the rest. --}} @if (count($workTargets) > 0)

{{ __('Time named here becomes that product’s labour. Left on the job, it is shared across the job’s products.') }}

@endif
@endif
@forelse ($entries as $entry)

{{ $entry->user?->name ?: '—' }} @if ($entry->user_id === $currentUserId) ({{ __('you') }}) @endif

{{ $entry->activity }}

@if ($entry->productPart) {{ $entry->lineItem?->name }} · {{ $entry->productPart->label }} @elseif ($entry->lineItem) {{ $entry->lineItem->name }} @else {{ __('Whole job') }} @endif

{{ optional($entry->started_at)->format('Y-m-d H:i') }} @if ($entry->ended_at) → {{ $entry->ended_at->format('H:i') }} @endif

@if ($entry->ended_at) {{ $fmtDuration($entry->duration_seconds) }} @else {{ __('Running') }} @endif @if ($entry->is_billable) {{ __('Billable') }} @endif

@if ($canManage || $entry->user_id === $currentUserId)
@if ($entry->ended_at) @endif
@endif
@empty
{{ __('No time logged on this job yet.') }}
@endforelse
{{ __('Timer already running') }}

{{ __('You have a timer running on') }} {{ $conflictJobTitle }}. {{ __('Keep it running, or stop it and start this one?') }}

{{ __('Cancel') }} {{ __('Keep both running') }} {{ __('Stop other & start this') }}
{{ $editingId ? __('Edit Time Entry') : __('Add Manual Time') }}
@if (count($workTargets) > 0)
@endif
{{ __('Cancel') }} {{ __('Save') }}