@extends('layouts.app') @section('title', ($run->reference ?? 'أمر عمل').' - '.config('app.name')) @section('breadcrumb') الرئيسية لوحة التحكم جميع الأوامر {{ $run->reference }} @endsection @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

{{ $run->reference }}

@if($run->isPosted()) تم الترحيل محاسبياً ومخزنياً. @else مسودة — الترحيل ينفّذ صرف المدخلات وإضافة التام والقيد. @endif

جميع الأوامر @if($run->isDraft())
@csrf
@csrf @method('DELETE')
@endif

البيانات الأساسية

@if($run->bomList)
قائمة المواد {{ $run->bomList->name }} — {{ $run->bomList->version }}
@endif
تاريخ المخزون والقيد {{ $run->production_date?->format('Y-m-d') }}
@if($run->start_date)
تاريخ البدء {{ $run->start_date->format('Y-m-d') }}
@endif @if($run->due_date)
تاريخ الاستحقاق {{ $run->due_date->format('Y-m-d') }}
@endif
المستودع {{ $run->warehouse?->name_ar }}
@if($run->machine)
الماكينة {{ $run->machine->code }} — {{ $run->machine->name_ar }}
@endif
المنتج التام {{ $run->finishedItem?->code }} — {{ $run->finishedItem?->name_ar }}
كمية الإنتاج {{ rtrim(rtrim(number_format((float) $run->quantity_produced, 4, '.', ''), '0'), '.') ?: '0' }}
@if($run->total_materials_cost !== null)
تكلفة المواد {{ number_format((float) $run->total_materials_cost, 2) }}
@endif @if($run->journalEntry) @endif @if($run->notes)

ملاحظات {{ $run->notes }}

@endif
بنود المدخلات
@if($run->isPosted()) @endif @foreach($run->lines as $line) @if($run->isPosted()) @endif @endforeach
الصنف كمية مخططة هدر مخطط % كمية فعلية هدر فعلي % تكلفة السطر
{{ $line->ingredientItem?->code }} — {{ $line->ingredientItem?->name_ar }} {{ $line->planned_quantity !== null ? (rtrim(rtrim(number_format((float) $line->planned_quantity, 4, '.', ''), '0'), '.') ?: '0') : '—' }} {{ $line->planned_scrap_percent !== null ? (rtrim(rtrim(number_format((float) $line->planned_scrap_percent, 4, '.', ''), '0'), '.') ?: '0') : '—' }} {{ rtrim(rtrim(number_format((float) $line->quantity_consumed, 4, '.', ''), '0'), '.') ?: '0' }} {{ $line->actual_scrap_percent !== null ? (rtrim(rtrim(number_format((float) $line->actual_scrap_percent, 4, '.', ''), '0'), '.') ?: '0') : '—' }}{{ $line->line_cost !== null ? number_format((float) $line->line_cost, 2) : '—' }}
@endsection