@extends('layouts.master') @section('css') @endsection @section('title') {{__('home.send_product_from_other_branch_other')}} @stop @section('page-header')
@endsection @section('content') {{-- عرض أخطاء التحقق إن وجدت --}} @if ($errors->any())
@endif @if (session()->has('productupdatedlocation')) @endif @php // قيمة الفرع المرسل الافتراضية: old() بعد خطأ تحقق، ثم المسودة، ثم فرع المستخدم $selectedBranchFrom = old('branch_from_id', isset($draftMovement) ? $draftMovement->branch_from : ($branchId ?? null)); $selectedBranchTo = old('branch', isset($draftMovement) ? $draftMovement->branch_to : null); $branchesList = App\Models\branchs::get(); @endphp
{{__('home.send_product_from_other_branch_other')}}
{{ csrf_field() }} {{-- إذا كنا نقوم بتعديل مسودة مسترجعة، نرسل الـ ID الخاص بها --}} @if(isset($draftMovement)) @endif {{-- حقل مخفي لتحديد حالة الإرسال (مسودة draft أو مكتملة completed) --}}
{{-- ✅ الفرع المرسل: name واحد فقط = branch_from_id --}}
{{-- استرجاع وعرض منتجات المسودة تلقائياً إن وجدت --}} @if(isset($draftItems) && count($draftItems) > 0) @foreach($draftItems as $item) @endforeach @endif
# {{ __('home.product') }} {{ __('home.quantity') }} {{ __('home.thecostProduct') }} {{ __('home.operations') }}
{{ $item->product->product_name ?? $item->product->name ?? 'منتج غير معروف' }} {{ $item->cost_per_each_withoud_tax }}
0) style="display:none" @endif>
{{ __('home.no_products_selected_yet') ?? 'لم يتم اختيار أي منتج بعد، اضغط "اختيار منتج" بالأعلى' }}
{{-- زر الطباعة (يظهر فقط إذا كان هناك رقم فاتورة) --}} @if(session()->has('saved_movement_id') || (isset($data) && !empty($data))) @php $invoiceId = session()->get('saved_movement_id') ?? $data; @endphp
{{ csrf_field() }}
@endif
@endsection @section('js') @endsection