@extends('layouts.app') @section('title', $timesheet->reference) @section('page-title','Timesheets') @section('content') {{-- Rejection banner --}} @if($timesheet->status === 'rejected' && $timesheet->rejection_notes)
Rejected by {{ $timesheet->reviewer?->name }}
{{ $timesheet->rejection_notes }}
@if(auth()->user()->employee?->id === $timesheet->employee_id) Revise & Resubmit @endif
@endif
{{-- Day-by-day entries --}}
Daily Activity Log {{ number_format($timesheet->total_hours, 1) }} hrs total
@foreach($timesheet->entries as $entry) @php $isWork = $entry->day_type === 'work'; $hasWork = $isWork && ($entry->deliverables || $entry->project_or_task); @endphp
{{ $entry->entry_date->format('l') }} {{ $entry->entry_date->format('d M Y') }}
@if($entry->day_type !== 'work') {{ $entry->day_type_label }} @else {{ number_format($entry->hours_worked, 1) }} hrs @endif
@if($isWork) @if($entry->project_or_task)
Project / Task: {{ $entry->project_or_task }}
@endif @if($entry->deliverables)
{{ $entry->deliverables }}
@else
No deliverables recorded.
@endif @if($entry->notes)
{{ $entry->notes }}
@endif @endif
@endforeach
{{-- Evaluator actions --}} @if($timesheet->status === 'submitted' && !auth()->user()->isEmployee())
Review This Timesheet

Review the daily entries above. If everything is satisfactory, approve the timesheet. If anything needs correction, reject it with clear feedback so the employee can revise.

@csrf
{{-- Reject Modal --}} @endif
{{-- Sidebar --}}
Timesheet Details
Employee
{{ $timesheet->employee->full_name }}
Department
{{ $timesheet->employee->department?->name ?? '—' }}
Work Mode
@if($timesheet->employee->isRemote()) Remote @else Not Required to Clock In @endif
Week
{{ $timesheet->week_label }}
Total Hours
{{ number_format($timesheet->total_hours, 1) }} hrs
Reference
{{ $timesheet->reference }}
Submitted
{{ $timesheet->created_at->format('d M Y, H:i') }}
@if($timesheet->reviewed_at)
Reviewed by
{{ $timesheet->reviewer?->name }}
{{ $timesheet->reviewed_at->format('d M Y, H:i') }}
@endif
@if($timesheet->notes)
Week Notes
{{ $timesheet->notes }}
@endif {{-- Hours by day chart --}}
Hours Overview
@foreach($timesheet->entries as $entry) @php $pct = $timesheet->total_hours > 0 ? ($entry->hours_worked / $timesheet->total_hours) * 100 : 0; @endphp
{{ $entry->entry_date->format('D') }} @if($entry->day_type === 'work') {{ number_format($entry->hours_worked, 1) }}h @else {{ $entry->day_type_label }} @endif
@if($entry->day_type === 'work')
@endif
@endforeach
@endsection