@extends('layouts.master') @section('title') إذن صرف مرتجع — طلب {{ $issue->id }} @endsection @section('page-header') @endsection @section('content') @include('financial_years.partials.alerts') @php $open = in_array($issue->status, ['pending', 'partial'], true); $canPartial = auth()->user()->can('warehouse_issues_partial') || auth()->user()->can('warehouse_receipts_manage'); $canPrint = auth()->user()->can('warehouse_issues_print') || auth()->user()->can('warehouse_receipts_manage'); $fmt = fn ($v) => rtrim(rtrim(number_format((float) $v, 4, '.', ''), '0'), '.'); @endphp
@if (!$open)
تم صرف هذا المرتجع بالكامل وتسليمه للمورد.
@endif
@csrf
@foreach ($issue->items as $i => $it) @php $remaining = $it->remaining(); @endphp @endforeach
# كود الصنف الصنف رصيد المخزن الكمية المرتجعة المصروف سابقاً المتبقي الكمية المصروفة الآن
{{ $i + 1 }} {{ $productCodes[$it->product_id] ?? '-' }} {{ $it->product_name }} {{ $fmt($stock[$it->product_id] ?? 0) }} {{ $fmt($it->qty) }} {{ $fmt($it->issued_qty) }} {{ $fmt($remaining) }} @if ($open && $remaining > 0) @else ✓ @endif
@if ($open)
@if ($canPartial) @endif
@if ($canPartial) لصرف جزئي: اكتب الكمية اللي اتسلمت للمورد فعلاً لكل صنف، واترك الباقي. المتبقي يفضل في انتظار إذن صرف لاحق. @else صرف كلي فقط (ليس لديك صلاحية الصرف الجزئي). @endif @endif
@if ($vouchers->count())
أذون الصرف السابقة لهذا المرتجع
@foreach ($vouchers as $v) @endforeach
رقم الإذنالنوعالتاريخبواسطةالكميةالقيمةرقم القيد
{{ $v->id }} {{ $v->type === 'full' ? 'كلي' : 'جزئي' }} {{ $v->created_at->format('Y-m-d H:i') }} {{ $v->issuer->name ?? '-' }} {{ $fmt($v->total_qty) }} {{ number_format($v->total_value, 2) }} {{ $v->dely_record ?: '-' }} @if ($canPrint)طباعة@endif
@endif @endsection @section('js') @endsection