@extends('layouts.app') @section('title','Timesheets') @section('page-title','Timesheets') @section('content') {{-- Info banner for employees --}} @if(auth()->user()->isEmployee())
How Timesheets Work
As a remote or flexible-schedule employee, you complete a weekly timesheet instead of clocking in. Log what you worked on each day, the hours spent, and your key deliverables. Submit by end of week. Your supervisor will approve or send it back for revision.
@endif {{-- Filters --}}
@if(!auth()->user()->isEmployee())
@endif
{{-- Submitted timesheets that need action first --}} @php $submitted = $timesheets->getCollection()->where('status','submitted'); $others = $timesheets->getCollection()->whereNotIn('status',['submitted']); @endphp @if($submitted->count() && !auth()->user()->isEmployee())
Awaiting Your Approval — {{ $submitted->count() }} Timesheet{{ $submitted->count()!=1?'s':'' }}
@foreach($submitted as $ts) {{-- Reject Modal --}} @endforeach
Employee Week Hours Actions
{{ $ts->employee->full_name }}
{{ $ts->employee->department?->name }} · {{ $ts->employee->isRemote() ? 'Remote' : 'Not Required' }}
{{ $ts->week_label }}
{{ $ts->reference }}
{{ number_format($ts->total_hours, 1) }} hrs
Review
@csrf
@endif {{-- All other timesheets --}}
{{ auth()->user()->isEmployee() ? 'My Timesheets' : 'All Timesheets' }} ({{ $timesheets->total() }})
@if(!auth()->user()->isEmployee())@endif @forelse($timesheets as $ts) @if(!auth()->user()->isEmployee()) @endif @empty @endforelse
ReferenceEmployeeWeek Total Hours Status Actions
{{ $ts->reference }}
{{ $ts->created_at->format('d M Y') }}
{{ $ts->employee->full_name }}
{{ $ts->employee->department?->name }}
{{ $ts->week_label }} {{ number_format($ts->total_hours,1) }} hrs {{ $ts->status_label }} @if($ts->status === 'rejected')
Needs revision
@endif
@if($ts->isEditable() && (auth()->user()->employee?->id === $ts->employee_id || auth()->user()->isHrOrAdmin())) @endif @if($ts->status === 'draft' && auth()->user()->employee?->id === $ts->employee_id)
@csrf
@endif
No timesheets yet. @if(auth()->user()->isEmployee()) Create your first timesheet. @endif
@if($timesheets->hasPages())
{{ $timesheets->links('pagination::bootstrap-5') }}
@endif
@endsection