@extends('layouts.app') @section('title', $order->exists ? 'تعديل أمر تصنيع' : 'إضافة أمر تصنيع') @section('page_heading', $order->exists ? 'تعديل أمر تصنيع' : 'إضافة أمر تصنيع') @section('content') @php $oldMaterials = old('materials', $materialRows->toArray()); if (!count($oldMaterials)) $oldMaterials = [['raw_material_id'=>'','quantity'=>'']]; @endphp
@csrf @if($order->exists) @method('PUT') @endif {{-- Section 1: Basic Info --}}
بيانات الأمر
أوامر التصنيع
@error('title')
{{ $message }}
@enderror
@if($order->embroideryOrder)
@endif
{{-- Section 2: Output Product --}}
بيانات المنتج الناتج
{{-- Section 3: Raw Materials --}}
المواد الخام المستخدمة
@foreach($oldMaterials as $index => $row)
@endforeach
{{-- Actions --}}
إلغاء
@endsection @section('scripts') @php $materialOptions = $rawMaterials->map(fn($m) => [ 'id' => $m->id, 'name' => $m->name, 'stock' => number_format((float)$m->stock,2,'.',''), 'unit_cost' => number_format((float)$m->unit_cost,2,'.',''), ])->values(); @endphp @endsection