{{ __('Task Reports & Analytics') }}

{{-- Date Range Filter --}}
{{-- Summary Statistics --}}
{{ __('Total Tasks') }}
{{ number_format($stats['total_issues']) }}
{{ __('Open Tasks') }}
{{ number_format($stats['open_issues']) }}
{{ __('Closed Tasks') }}
{{ number_format($stats['closed_issues']) }}
{{ __('Overdue Tasks') }}
{{ number_format($stats['overdue_issues']) }}
{{-- Charts Section --}}
{{-- Tasks by Status --}}

{{ __('Tasks by Status') }}

@foreach(['new', 'assigned', 'in_progress', 'review', 'closed'] as $status)
{{ ucfirst(str_replace('_', ' ', $status)) }} {{ $issuesByStatus[$status] ?? 0 }}
@php $percentage = $stats['total_issues'] > 0 ? (($issuesByStatus[$status] ?? 0) / $stats['total_issues']) * 100 : 0; @endphp
@endforeach
{{-- Tasks by Priority --}}

{{ __('Tasks by Priority') }}

@foreach(['low', 'medium', 'high', 'urgent'] as $priority) @php $colors = ['low' => 'green', 'medium' => 'yellow', 'high' => 'orange', 'urgent' => 'red']; @endphp
{{ ucfirst($priority) }} {{ $issuesByPriority[$priority] ?? 0 }}
@php $percentage = $stats['total_issues'] > 0 ? (($issuesByPriority[$priority] ?? 0) / $stats['total_issues']) * 100 : 0; @endphp
@endforeach
{{-- Tasks by Type --}}

{{ __('Tasks by Type') }}

@foreach(['work_item', 'project_task', 'maintenance', 'member_request'] as $type)
{{ ucfirst(str_replace('_', ' ', $type)) }} {{ $issuesByType[$type] ?? 0 }}
@php $percentage = $stats['total_issues'] > 0 ? (($issuesByType[$type] ?? 0) / $stats['total_issues']) * 100 : 0; @endphp
@endforeach
{{-- Time Tracking Metrics --}} @if($timeTrackingMetrics && $timeTrackingMetrics->total_estimated > 0)

{{ __('Time Tracking Metrics') }}

{{ __('Total Estimated Hours') }}
{{ number_format($timeTrackingMetrics->total_estimated, 1) }}
{{ __('Total Actual Hours') }}
{{ number_format($timeTrackingMetrics->total_actual, 1) }}
{{ __('Avg Estimated Hours') }}
{{ number_format($timeTrackingMetrics->avg_estimated, 1) }}
{{ __('Avg Actual Hours') }}
{{ number_format($timeTrackingMetrics->avg_actual, 1) }}
@php $variance = $timeTrackingMetrics->total_actual - $timeTrackingMetrics->total_estimated; $variancePercentage = $timeTrackingMetrics->total_estimated > 0 ? ($variance / $timeTrackingMetrics->total_estimated) * 100 : 0; @endphp

{{ __('Variance') }}: {{ $variance > 0 ? '+' : '' }}{{ number_format($variance, 1) }} hours ({{ number_format($variancePercentage, 1) }}%)

@endif {{-- Average Resolution Time --}} @if($avgResolutionTime)

{{ __('Average Resolution Time') }}

{{ number_format($avgResolutionTime, 1) }} {{ __('days') }}

@endif {{-- Assignee Performance --}} @if($assigneePerformance->isNotEmpty())

{{ __('Assignee Performance (Top 10)') }}

@foreach($assigneePerformance as $user) @endforeach
{{ __('Assignee') }} {{ __('Total Assigned') }} {{ __('Completed') }} {{ __('Overdue') }} {{ __('Completion Rate') }}
{{ $user->name }} {{ $user->total_assigned }} {{ $user->completed }} {{ $user->overdue }}
{{ $user->completion_rate }}%
@endif {{-- Top Labels Used --}} @if($topLabels->isNotEmpty())

{{ __('Top Labels Used') }}

@foreach($topLabels as $label)
{{ $label->name }}
{{ $label->usage_count }} {{ __('uses') }}
@php $maxUsage = $topLabels->max('usage_count'); $percentage = $maxUsage > 0 ? ($label->usage_count / $maxUsage) * 100 : 0; @endphp
@endforeach
@endif {{-- Recent Tasks --}}

{{ __('Recent Tasks') }}

@foreach($recentIssues as $issue) @endforeach
{{ __('Task') }} {{ __('Status') }} {{ __('Priority') }} {{ __('Assignee') }} {{ __('Created') }}
{{ $issue->issue_number }}: {{ Str::limit($issue->title, 50) }} {{ $issue->assignee?->name ?? '—' }} {{ $issue->created_at->format('Y-m-d') }}