@extends('layouts.app')
@section('title', __('dashboard.manufacturing_orders_title'))
@section('page_heading', __('dashboard.manufacturing_orders_title'))
@section('content')
@php
$hasFilter = request()->hasAny(['search','customer_id','status','manufacturing_type']);
$statusBadge = ['draft'=>['var(--border-subtle)','var(--text-muted)','مسودة'],'in_progress'=>['#fffbeb','#d97706','قيد التنفيذ'],'completed'=>['#f0fdf4','#16a34a','مكتمل'],'canceled'=>['#fef2f2','#dc2626','ملغي']];
$typeMap = ['shop_stock'=>'للمحل','customer_owned'=>'شخصي للعميل','customer_returnable'=>'للعميل ويرجع'];
@endphp
{{-- Filter --}}
@if($orders->isEmpty())
@include('layouts.partials.index-empty-state',['icon'=>'fa-solid fa-gears','title'=>'لا توجد أوامر تصنيع','message'=>''])
@else
@foreach(['المرجع','العنوان','نوع التصنيع','العميل',__('dashboard.status_label'),'تكلفة المواد','اليد العاملة','الإجمالي'] as $h)
| {{ $h }} |
@endforeach
إجراءات |
@foreach($orders as $order)
@php [$sbg,$scolor,$slabel] = $statusBadge[$order->status] ?? ['var(--border-subtle)','var(--text-muted)',$order->status]; @endphp
| {{ $order->reference_code }} |
{{ $order->title }} |
{{ $typeMap[$order->manufacturing_type] ?? $order->manufacturing_type }} |
{{ $order->customer?->name ?? '—' }} |
{{ $slabel }}
|
{{ number_format($order->total_material_cost, 2) }} |
{{ number_format((float)$order->labor_cost, 2) }} |
{{ number_format($order->total_manufacturing_cost, 2) }} |
|
@endforeach
{{ $orders->links() }}
@endif
@endsection