@extends('layouts.app') @section('title', 'عرض أمر تصنيع') @section('page_heading', $order->title) @section('content') @include('layouts.partials.workspace-page-styles') @php $statusMap = ['draft' => ['label' => 'مسودة', 'class' => 'app-badge--secondary'], 'in_progress' => ['label' => 'قيد التنفيذ', 'class' => 'app-badge--warning'], 'completed' => ['label' => 'مكتمل', 'class' => 'app-badge--success'], 'canceled' => ['label' => 'ملغي', 'class' => 'app-badge--danger']]; $typeMap = ['shop_stock' => 'تصنيع للمحل', 'customer_owned' => 'تصنيع شخصي للعميل', 'customer_returnable' => 'تصنيع للعميل ويرجع للمحل']; $s = $statusMap[$order->status] ?? ['label' => $order->status, 'class' => 'app-badge--secondary']; @endphp

ملخص الأمر

المرجع{{ $order->reference_code }}
{{ __('dashboard.type_label') }}{{ $typeMap[$order->manufacturing_type] ?? $order->manufacturing_type }}
العميل{{ $order->customer?->name ?? '—' }}
موعد الاستحقاق{{ optional($order->target_date)->format('Y-m-d') ?? '—' }}

تكلفة المواد{{ number_format($order->total_material_cost, 2) }}
اليد العاملة{{ number_format((float)$order->labor_cost, 2) }}
إجمالي التكلفة{{ number_format($order->total_manufacturing_cost, 2) }}
المنتج الناتج @if($order->product) {{ $order->product->name }} @else {{ $order->createsInventoryProduct() ? ($order->output_product_name ?: '—') : 'لا ينشئ منتجًا' }} @endif
@if($order->description)
الوصف
{{ $order->description }}
@endif

الإجراءات التشغيلية

@if($order->status === 'draft')
@csrf
@endif @if(in_array($order->status, ['draft', 'in_progress'], true))
@csrf
@csrf
@endif @if($order->status === 'completed') مكتمل @endif

المواد الخام المستخدمة

@forelse($order->materials as $material) @empty @endforelse
المادة الكمية الوحدة تكلفة الوحدة إجمالي السطر
{{ $material->rawMaterial?->name ?? '—' }} {{ number_format((float)$material->quantity, 2) }} {{ $material->rawMaterial?->unitOfMeasure?->name ?? '—' }} {{ number_format((float)$material->unit_cost_snapshot, 2) }} {{ number_format($material->line_cost, 2) }}
لا توجد مواد خام مضافة.
@if($order->embroideryOrder)

مصدر الأمر

تم إنشاء هذا الأمر من طلب التطريز {{ $order->embroideryOrder->reference_code }}.

عرض طلب التطريز
@endif
@endsection