@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')
@if (session('error'))
{{ session('error') }}
@endif @if (session('warning'))
{{ session('warning') }}
@endif @if (session('success'))
{{ session('success') }}
@endif

تسجيل الإنتاج اللحظي

العودة لإدارة الورديات

يُربط الإنتاج بالوردية عبر production_shifts. بدون مستودع لا تُنشأ حركات مخزن ولا قيود محاسبية.

نموذج إدخال الإنتاج
@csrf
@error('production_shift_id')

{{ $message }}

@enderror
@canFeature(\App\Support\PremiumFeatureKeys::MANUFACTURING_INVENTORY_AUTO_LINK)

ميزة الربط المخزني المؤتمت مفعّلة — المستودع إلزامي.

@else

عند اختيار مستودع: يُصرف الخام حسب BOM ويُدخل التام ويُرحَّل القيد. بدون مستودع: تسجيل كميات فقط.

@endcanFeature @error('warehouse_id')

{{ $message }}

@enderror
باركود
@error('item_id')

{{ $message }}

@enderror
@error('quantity')

{{ $message }}

@enderror
@error('rejected_quantity')

{{ $message }}

@enderror
@error('scrap_reason')

{{ $message }}

@enderror
@canFeature(\App\Support\PremiumFeatureKeys::MANUFACTURING_MACHINE_DOWNTIME)
@error('downtime_reason')

{{ $message }}

@enderror
@error('downtime_lost_hours')

{{ $message }}

@enderror
@endcanFeature
@error('logged_at')

{{ $message }}

@enderror
@error('notes')

{{ $message }}

@enderror
آخر 10 سجلات لتاريخ {{ $date }} لوحة التحكم
@forelse($recentLogs as $log) @empty @endforelse
الوقت الوردية الصنف منتج هالك المخزون القيد
{{ $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
لا توجد سجلات إنتاج لهذا التاريخ.
@push('scripts') @endpush @endsection