@extends('layouts.app') @section('content') @php $periods = [ 'daily' => 'Daily', 'weekly' => 'Weekly', 'fortnightly' => 'Fortnightly', 'bi_monthly' => 'Bi Monthly', 'monthly' => 'Monthly', 'quarterly' => 'Quarterly', 'annually' => 'Annually', ]; $reportTypes = [ 'performance' => 'Performance (Periodically)', 'history' => 'General Report (History)', ]; $statuses = ['new' => 'New', 'pending' => 'Pending', 'ongoing' => 'Ongoing', 'completed' => 'Completed', 'verified' => 'Verified', 'rejected' => 'Rejected', 'cancelled' => 'Cancelled']; @endphp
Task Report
Period: {{ $fromDate->format('Y-m-d') }} to {{ $toDate->format('Y-m-d') }}
Back to Tasks
Total Tasks{{ number_format($summary['tasks']) }}
Total Target{{ number_format($summary['target'], 2) }}
Total Achieved{{ number_format($summary['achieved'], 2) }}
Overdue{{ number_format($summary['overdue']) }}
@if(($filters['report_type'] ?? 'performance') === 'history')
@forelse($historyRows as $task) @php $latest = $task->progressUpdates->sortByDesc('created_at')->first(); $isOverdue = $task->due_date && $task->due_date->isPast() && !in_array($task->status, ['completed', 'verified', 'cancelled']); @endphp @empty @endforelse
Date Task No Employee Branch Category Subject Description Target Achieved Status Supervisor Latest Note
{{ ($task->start_date ?: $task->created_at)->format('Y-m-d H:i') }} {{ $task->task_no }} {{ $task->assignedTo?->name ?: 'Unassigned' }} {{ $task->branch?->name ?: '-' }} {{ $task->category?->name ?: '-' }} {{ $task->subject }} {{ $task->description ?: '-' }} {{ $task->target_value !== null ? number_format($task->target_value, 2) : '-' }} {{ number_format($task->achieved_value, 2) }} {{ $isOverdue ? 'Overdue' : ($statuses[$task->status] ?? $task->status) }} {{ $task->supervisor?->name ?: '-' }} {{ $latest?->progress_note ?: '-' }}
No task history found.
@else
@forelse($performanceRows as $row) @empty @endforelse @if($performanceRows->count()) @endif
Employee Branch Tasks Target Achieved Completion % New Pending Ongoing Completed Verified Overdue Score
{{ $row['employee'] }} {{ $row['branch'] }} {{ number_format($row['tasks']) }} {{ number_format($row['target'], 2) }} {{ number_format($row['achieved'], 2) }} {{ number_format($row['completion_percent'], 2) }}% {{ number_format($row['new']) }} {{ number_format($row['pending']) }} {{ number_format($row['ongoing']) }} {{ number_format($row['completed']) }} {{ number_format($row['verified']) }} {{ number_format($row['overdue']) }} {{ number_format($row['score'], 2) }}%
No performance records found.
Totals {{ number_format($performanceRows->sum('tasks')) }} {{ number_format($performanceRows->sum('target'), 2) }} {{ number_format($performanceRows->sum('achieved'), 2) }} {{ number_format($performanceRows->sum('new')) }} {{ number_format($performanceRows->sum('pending')) }} {{ number_format($performanceRows->sum('ongoing')) }} {{ number_format($performanceRows->sum('completed')) }} {{ number_format($performanceRows->sum('verified')) }} {{ number_format($performanceRows->sum('overdue')) }}
@endif
@endsection