@forelse($projectTasks->longTermProjectActivities as $task) @php $totalWeight = 0; $completedWeight = 0; $totalWeight += $task->activity_weight ?? 0; if ($task->state === 'COMPLETED') { $completedWeight += $task->activity_weight ?? 0; } // Sub activities weight foreach ($task->longTermProjectSubActivities as $sub) { $totalWeight += $sub->sub_activity_weight ?? 0; if ($sub->state === 'COMPLETED') { $completedWeight += $sub->sub_activity_weight ?? 0; } } $percentage = $totalWeight > 0 ? round(($completedWeight / $totalWeight) * 100) : 0; if ($task->state === 'COMPLETED') { $percentage = 100; } $activeSubTasks = $task->longTermProjectSubActivities ->where('state', '!=', 'DELETED'); $subTaskCount = $activeSubTasks->count(); @endphp
{{ $task->activity_description }}
No Tasks available
@endforelse