@extends('layouts.app') @section('title', 'Weekly Timesheet Report') @section('breadcrumb')Reports Weekly Timesheet@endsection @section('content')

Weekly Timesheet Report

Hours and earnings summary for all hourly staff

@csrf
Export CSV
Viewing week
{{ $weekStart->format('d M') }} – {{ $weekEnd->format('d M Y') }}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Staff Tracked
{{ count($staffSummaries) }}
with hourly rates
Total Hours
{{ number_format($totalHours, 1) }}h
this week
Total Earnings
${{ number_format($totalEarnings, 2) }}
labour cost
Uninvoiced Hours
@php $uninvoicedHours = collect($staffSummaries)->sum(fn($s) => max(0, $s['hours'] - $s['invoiced_hours'])); @endphp
{{ number_format($uninvoicedHours, 1) }}h
not yet invoiced

Staff Breakdown

{{ $weekStart->format('D d M') }} — {{ $weekEnd->format('D d M Y') }}
@forelse($staffSummaries as $s) @php $uninv = max(0, $s['hours'] - $s['invoiced_hours']); @endphp @empty @endforelse @if($totalHours > 0) @endif
Staff Member Role Entries Hours Rate Earnings Invoiced Uninvoiced
{{ collect(explode(' ', $s['name']))->map(fn($p)=>substr($p,0,1))->take(2)->join('') }}
{{ $s['name'] }}
{{ $s['email'] }}
{{ $s['role'] }} {{ $s['entries'] }} {{ number_format($s['hours'], 2) }}h ${{ number_format($s['rate'], 2) }}/hr ${{ number_format($s['earnings'], 2) }} @if($s['invoiced_hours'] > 0) {{ number_format($s['invoiced_hours'], 1) }}h @else @endif @if($uninv > 0) {{ number_format($uninv, 1) }}h @elseif($s['hours'] > 0) All invoiced @else @endif
No staff with hourly rates found.
TOTAL {{ number_format($totalHours, 2) }}h ${{ number_format($totalEarnings, 2) }} {{ number_format(collect($staffSummaries)->sum('invoiced_hours'), 1) }}h {{ number_format($uninvoicedHours, 1) }}h
@if(count($dailyBreakdown) > 0)

Daily Hours — This Week

@php $maxH = max(0.1, collect($dailyBreakdown)->max('hours')); @endphp @foreach($dailyBreakdown as $day) @php $pct = $day['hours'] > 0 ? max(4, ($day['hours'] / $maxH) * 100) : 0; @endphp
{{ $day['hours'] > 0 ? number_format($day['hours'],1).'h' : '' }}
{{ $day['label'] }}
@endforeach
@endif @if($reportHistory->count() > 0)

Report Send History

@foreach($reportHistory as $log)
{{ $log->description }}
{{ $log->created_at->diffForHumans() }}
@endforeach
@endif
@endsection