@extends('index') @section('content')

Move PTC to Next Stage

@csrf
PTC No: PTC-{{ $ptc->stock_no }}
Product: {{ $product ? $product->name . ' - ' . $product->size_name : 'N/A' }}
Order: {{ $ptc->job_no ?? 'Default PTC' }}
Quantity: {{ $ptc->product_quantity ?? 1 }}
@foreach($stages as $index => $stage) @php $isCompleted = false; $isCurrent = $ptc->current_stage_id == $stage->head_id; $isNext = $ptc->next_stage_id == $stage->head_id; if (!$isCurrent && !$isNext) { $currentIndex = collect($stages)->search(fn($s) => $s->head_id == $ptc->current_stage_id); $isCompleted = $index < $currentIndex; } @endphp
@if($isCompleted) @endif @if($isCurrent) @endif @if($isNext) @endif {{ $index + 1 }}. {{ $stage->name }} @if($isCurrent) (Current) @endif @if($isNext) (Next) @endif
@if($index < count($stages) - 1)
@endif @endforeach

{{-- ============== SECTION 1: RECEIVE FROM CURRENT STAGE ============== --}}
Receive from Current Stage: {{ $currentStage ? $currentStage->name : 'N/A' }}
{{-- Material Receive Section --}}

{{-- Product Receive Section --}}

{{-- Receive Items Table with Tabs --}}
{{-- Receive Items Table --}}
Sr. Item / Product Material / Stage Work/Cost Quantity Action
{{-- Issued Items Tab --}}
@if($issueItem->count()) @foreach($issueItem as $item) @endforeach @endif
Sr. Item / Product Material / Stage Quantity Average
{{$loop->index + 1}} {{$item->article_no}} - Size {{$item->sname}} {{($item->name)? $item->name:$item->stage}} {{$item->quantity}} {{($item->uname)? $item->uname:$item->puname}} {{ $item->pqty != 0 ? bcdiv($item->quantity, $item->pqty, 1) : '0' }} Units
{{-- Received Items Tab --}}
@if($issueSum->count()) @foreach($issueSum as $item) @endforeach @endif
Sr. Article No Material / Stage Quantity
{{$loop->index + 1}} {{$item->article_no}} - Size {{$item->sname}} {{($item->name)? $item->name:$item->stage}} {{$item->total_quantity}} {{($item->uname)? $item->uname:$item->puname}}
@if($nextStage)
{{-- ============== SECTION 2: ISSUE TO NEXT STAGE ============== --}}
Issue to Next Stage: {{ $nextStage->name }}
{{-- Material Issue Section --}}

{{-- Product Issue Section --}}

{{-- Issue Items Table --}}
Sr. Item / Product Material / Stage Quantity Action
@endif
@if($nextStage) @else @endif
@endsection