@extends('layouts.app') @section('title', 'Production Order') @section('content')

Order Details

Order Number
{{ $order->order_number ?? 'PRD-' . str_pad($order->id, 5, '0', STR_PAD_LEFT) }}
Product
{{ $order->product->item_name ?? '' }}
Qty to Produce
{{ number_format($order->quantity_to_produce, 2) }}
Qty Produced
{{ number_format($order->quantity_produced ?? 0, 2) }}
Production Date
{{ $order->production_date ? \Carbon\Carbon::parse($order->production_date)->format('d M Y') : '-' }}
Status
@php $badgeClass = match($order->status ?? 'pending') { 'pending' => 'badge-yellow', 'in_progress' => 'badge-blue', 'completed' => 'badge-green', default => 'badge-gray', }; @endphp {{ ucwords(str_replace('_', ' ', $order->status ?? 'pending')) }}
@if($order->notes)
Notes
{{ $order->notes }}
@endif

Bill of Materials

@if(isset($bom) && $bom->count()) @foreach($bom as $bomItem) @endforeach
Material Qty Required UOM
{{ $bomItem->rawMaterial->item_name ?? '' }} {{ number_format($bomItem->quantity_required, 2) }} {{ $bomItem->unit_of_measure }}
@else

No BOM defined for this product.

@endif
@if(isset($materialIssues) && $materialIssues->count())

Material Issues

+ Issue Material
@foreach($materialIssues as $issue) @endforeach
Item Warehouse Qty Date
{{ $issue->item->item_name ?? '' }} {{ $issue->warehouse->name ?? '' }} {{ number_format($issue->quantity, 2) }} {{ $issue->issue_date ? \Carbon\Carbon::parse($issue->issue_date)->format('d M Y') : '' }}
@endif @if(isset($outputs) && $outputs->count())

Production Output

+ Record Output
@foreach($outputs as $output) @endforeach
Item Warehouse Qty Date
{{ $output->item->item_name ?? '' }} {{ $output->warehouse->name ?? '' }} {{ number_format($output->quantity, 2) }} {{ $output->output_date ? \Carbon\Carbon::parse($output->output_date)->format('d M Y') : '' }}
@endif @endsection