@extends('layouts.master') @section('title') سند استلام مجمّع — فاتورة شراء {{ $orderId }} @endsection @section('content') @include('financial_years.partials.alerts') @php $fmt = fn ($v) => rtrim(rtrim(number_format((float) $v, 4, '.', ''), '0'), '.'); @endphp

سند استلام بضاعة مجمّع — فاتورة شراء رقم {{ $orderId }}

{{ $complete ? 'استلام كامل' : 'استلام جزئي' }} — عدد السندات: {{ $receipts->count() }} ({{ $receipts->pluck('id')->map(fn ($id) => '#' . $id)->implode('، ') }})
{{ Namear }}
{{ $receipts->first()->created_at->format('Y-m-d H:i') }} @if ($receipts->count() > 1) → {{ $receipts->last()->created_at->format('Y-m-d H:i') }} @endif
فاتورة الشراء{{ $orderId }}المورد{{ $supplier ?? '-' }}
رقم فاتورة المورد{{ $purchase->Purchase_invoice_number ?? '-' }} أمين المستودع{{ $receipts->map(fn ($r) => $r->receiver->name ?? null)->filter()->unique()->implode('، ') ?: '-' }}
أرقام القيود{{ $receipts->pluck('dely_record')->filter()->unique()->implode('، ') ?: '-' }} ملاحظات{{ $receipts->pluck('notes')->filter()->unique()->implode(' — ') ?: '-' }}
@foreach (array_values($lines) as $i => $l) @endforeach @php $L = collect($lines); @endphp
#الصنفالكمية في الفاتورةإجمالي المستلممرتجع قبل الاستلامالمتبقيتكلفة الوحدةالقيمة
{{ $i + 1 }} {{ $l->product_name }} {{ $fmt($l->ordered) }} {{ $fmt($l->qty) }} @if ($l->returned > 0){{ $fmt($l->returned) }}@else - @endif {{ $l->remaining > 0 ? $fmt($l->remaining) : '-' }} {{ number_format($l->unit_cost, 2) }} {{ number_format($l->value, 2) }}
الإجمالي {{ $fmt($L->sum('ordered')) }} {{ $fmt($L->sum('qty')) }} {{ $L->sum('returned') > 0 ? $fmt($L->sum('returned')) : '-' }} {{ $L->sum('remaining') > 0 ? $fmt($L->sum('remaining')) : '-' }} {{ number_format($L->sum('value'), 2) }}
@if ($receipts->count() > 1)
تفاصيل السندات
@foreach ($receipts as $r) @endforeach
رقم السندالتاريخالنوعأمين المستودعالكميةالقيمةرقم القيد
{{ $r->id }} {{ $r->created_at->format('Y-m-d H:i') }} {{ $r->type === 'full' ? 'كلي' : 'جزئي' }} {{ $r->receiver->name ?? '-' }} {{ $fmt($r->items->sum('qty')) }} {{ number_format($r->total_value, 2) }} {{ $r->dely_record ?: '-' }}
@endif
أمين المستودع
المندوب / المورد
المحاسب
رجوع للسندات السابقة
@endsection