@php $canSubmit = true; $blockingReasons = []; if ($dailyControl->workforce_check_status !== 'Completed') { $canSubmit = false; $blockingReasons[] = "Morning workforce check-in is not complete."; } $stillPresent = $dailyControl->workerAttendances->where('status', 'Present')->count(); if ($stillPresent > 0) { $canSubmit = false; $blockingReasons[] = "There are still $stillPresent workers checked in. All workers must be checked out."; } $incompleteOps = $dailyControl->workActivities->whereIn('status', ['Pending', 'Started'])->count(); if ($incompleteOps > 0) { $canSubmit = false; $blockingReasons[] = "There are $incompleteOps operations still In Progress or Planned. They must be Completed, Incomplete, or Cancelled."; } $incompleteSgr = $dailyControl->sgrTrainOperations->where('status', 'Draft')->count(); if ($incompleteSgr > 0) { $canSubmit = false; $blockingReasons[] = "There are $incompleteSgr SGR train operations still in Draft. They must be finalized and submitted."; } $unreconciledMaterials = $dailyControl->materials->whereIn('status', ['Issued', 'Acknowledged'])->count(); if ($unreconciledMaterials > 0) { $canSubmit = false; $blockingReasons[] = "There are $unreconciledMaterials materials that have not been fully reconciled (must record usage)."; } @endphp
Auto-generated summary for today's operations.
No operations recorded.
@else| {{ $activity->activity_name }} | @if($activity->status === 'Completed') Completed @elseif($activity->status === 'Incomplete') Incomplete @else {{ $activity->status }} @endif |
No trains inspected.
@elseNo materials tracked.
@elseNo issues reported.
@elseFinalize and lock the shift record.
This record is locked and pending coordinator review.