@extends('layouts.app') @section('title', 'تسجيل إنتاج - '.config('app.name')) @php $warehouseOptions = $warehouses->map(fn ($w) => [ 'value' => (string) $w->id, 'label' => trim(($w->code ? $w->code.' — ' : '').$w->name_ar), ])->values()->all(); $itemSelectOptions = $items->map(fn ($i) => [ 'value' => (string) $i->id, 'label' => $i->code.' — '.$i->name_ar, ])->values()->all(); $shiftOptions = $productionShifts->map(fn ($ps) => [ 'value' => (string) $ps->id, 'label' => $ps->date->format('Y-m-d').' — '.($ps->shift?->name_ar ?? 'وردية') .($ps->productionLine ? ' — خط '.$ps->productionLine->code : '') .($ps->machine ? ' — م '.$ps->machine->code : ''), ])->values()->all(); $scrapReasonOptions = [ ['value' => 'quality_defect', 'label' => 'عيب جودة'], ['value' => 'machine_error', 'label' => 'خطأ ماكينة'], ['value' => 'material_defect', 'label' => 'عيب مادة خام'], ['value' => 'operator_error', 'label' => 'خطأ تشغيل'], ['value' => 'other', 'label' => 'أخرى'], ]; $downtimeReasonOptions = [ ['value' => 'electricity', 'label' => 'انقطاع كهرباء'], ['value' => 'machine_failure', 'label' => 'عطل ماكينة'], ['value' => 'maintenance', 'label' => 'صيانة'], ['value' => 'other', 'label' => 'أخرى'], ]; $warehouseRequired = $warehouseRequired ?? false; @endphp @section('content')
يُربط الإنتاج بالوردية عبر production_shifts. بدون مستودع لا تُنشأ حركات مخزن ولا قيود محاسبية.
| الوقت | الوردية | الصنف | منتج | هالك |
|
|
|---|---|---|---|---|---|---|
| {{ $log->logged_at?->format('H:i') ?? '-' }} |
{{ $log->productionShift?->shift?->name_ar ?? '-' }}
{{ $log->productionShift?->date?->format('Y-m-d') }}
|
{{ $log->item?->code ?? '-' }} — {{ $log->item?->name_ar ?? '' }} | {{ number_format($log->quantity, 2) }} | {{ number_format($log->rejected_quantity, 2) }} | @if($log->inventory_synced_at) متزامن @elseif($log->warehouse_id) مستودع بدون مزامنة @else — @endif | @if($log->linked_journal_entry_id ?? null) #{{ $log->linked_journal_entry_id }} @else — @endif |
| لا توجد سجلات إنتاج لهذا التاريخ. | ||||||