@extends('layouts.app') @section('title', 'Production Orders') @section('content')
@forelse($orders as $order) @empty @endforelse
Order # Product Qty to Produce Produced Date Status Actions
{{ $order->order_number ?? 'PRD-' . str_pad($order->id, 5, '0', STR_PAD_LEFT) }} {{ $order->product->item_name ?? '' }} {{ number_format($order->quantity_to_produce, 2) }} {{ number_format($order->quantity_produced ?? 0, 2) }} {{ $order->production_date ? \Carbon\Carbon::parse($order->production_date)->format('d M Y') : '' }} @php $badgeClass = match($order->status ?? 'pending') { 'pending' => 'badge-yellow', 'in_progress' => 'badge-blue', 'completed' => 'badge-green', 'cancelled' => 'badge-red', default => 'badge-gray', }; @endphp {{ ucwords(str_replace('_', ' ', $order->status ?? 'pending')) }}
View @if($order->status === 'pending')
@csrf @method('PATCH')
@endif @if($order->status === 'in_progress')
@csrf @method('PATCH')
@endif Edit
No production orders found.
@if($orders->hasPages())
{{ $orders->links() }}
@endif @endsection