@extends('layouts.app') @section('title', 'Staff Timesheets') @section('breadcrumb')Timesheet All Staff@endsection @section('content')

Staff Timesheets

View all time entries across factory employees, processors and trades

Manage Invoices
@foreach($users as $u) @php $weekHours = $u->timeEntries()->where('status','completed')->where('started_at','>=',now()->startOfWeek())->sum('duration_minutes') / 60; $weekEarnings = $weekHours * $u->hourly_rate; $running = $u->timeEntries()->where('status','running')->first(); @endphp
{{ $u->initials }}
{{ $u->name }}
{{ $u->role?->display_name }}
@if($running)
@endif
Rate: ${{ number_format($u->hourly_rate, 2) }}/hr
This week: {{ number_format($weekHours,1) }}h
Earnings: ${{ number_format($weekEarnings,2) }}
Status: {{ $running ? 'Working' : 'Idle' }}
@endforeach

All Time Entries

@forelse($entries as $entry) @empty @endforelse
Staff Member Date Task Job Duration Amount Status Invoice
{{ $entry->user->name }}
{{ $entry->user->role?->display_name }}
{{ $entry->started_at->format('d M Y H:i') }} {{ $entry->taskType?->name ?? '—' }} {{ $entry->job?->job_number ?? '—' }} {{ $entry->elapsed }} @if($entry->user->hourly_rate && $entry->duration_hours > 0) ${{ number_format($entry->duration_hours * $entry->user->hourly_rate, 2) }} @else — @endif {{ $entry->status === 'running' ? 'Running' : ($entry->invoiced_in ? 'Invoiced' : ucfirst($entry->status)) }} @if($entry->invoiced_in) SI-{{ str_pad($entry->invoiced_in, 5, '0', STR_PAD_LEFT) }} @else — @endif
No time entries found.
@if($entries->hasPages())
{{ $entries->links() }}
@endif
@endsection