@extends('layouts.app') @section('title', 'Processing — ' . $job->job_number) @section('breadcrumb')Processing {{ $job->job_number }}@endsection @section('content')

{{ $job->job_number }} — Processing

{{ $job->stageLabel() }} @if($job->sent_to_manufacture) Sent to Manufacture @endif

{{ $job->contact?->full_name }} · {{ $job->site_address }}, {{ $job->site_suburb }}

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Manufacture

@if($job->sent_to_manufacture) Sent to manufacture by {{ $job->sentToManufactureBy?->name ?? 'Unknown' }} on {{ $job->sent_to_manufacture_at?->format('d M Y, g:i A') }}. Factory employees can now see and work on this job. @else When ready, send this job to the factory floor. Factory employees will be notified and can start their assigned tasks. @endif

@if(!$job->sent_to_manufacture) @else Already Sent @endif
@if($job->sent_to_manufacture)
Manufacture Status
@php $empAssignments = $job->employeeTaskAssignments->groupBy('user_id'); @endphp @if($empAssignments->count() > 0)
@foreach($empAssignments as $userId => $assignments) @php $emp = $assignments->first()->user; @endphp
{{ $emp?->initials ?? '?' }}
{{ $emp?->name ?? 'Unknown' }}
@foreach($assignments as $a) @php $badge = match($a->task_status) { 'completed' => 'badge-green', 'in_progress' => 'badge-blue', 'paused' => 'badge-yellow', default => 'badge-gray', }; @endphp {{ $a->taskType?->name }} — {{ ucfirst(str_replace('_',' ',$a->task_status)) }} @endforeach
@endforeach
@else

No task assignments yet. Factory employees will see this job based on their configured tasks.

@endif
@endif {{-- Confirmation popup --}}

Send To Manufacture?

Job {{ $job->job_number }}

This will make the job visible to all factory employees and automatically create task assignments based on each employee's configured tasks. This action cannot be undone.

@csrf
{{-- ═══════════════════════════════════════════════════════════════ FACTORY EMPLOYEE TASK ASSIGNMENTS — commented out as per requirements (assignments are now auto-managed via Send To Manufacture + user_employee_tasks) ═════════════════════════════════════════════════════════════════

Factory Employee Task Assignments

Assign employee tasks to factory employees for this job.

...
--}}

New Processing Order

@csrf
@include('jobs.partials._processor_drawings_tab', ['job' => $job])
@forelse($job->processingOrders as $order)
{{ $order->po_number }} {{ ucwords(str_replace('_', ' ', $order->status)) }}

{{ $order->description }}

{{ $order->supplier }} @if($order->order_date) Ordered {{ $order->order_date->format('d M Y') }} @endif @if($order->eta_date) ETA {{ $order->eta_date->format('d M Y') }} @endif
{{ $order->progress_pct }}%
{{ $order->completed_items }}/{{ $order->total_items }} items
@empty
No processing orders yet.
@endforelse
@if($job->tasks && $job->tasks->count() > 0)

Job Tasks

@foreach($job->tasks as $task)
{{ $task->title }}
{{ $task->assignedTo?->name }} · Due {{ $task->due_date?->format('d M') }}
{{ ucwords(str_replace('_', ' ', $task->status)) }}
@endforeach
@endif
@endsection