{{-- Header --}}
🏪 شيبيرو POS
فاتورة مشتريات
@if ($invoice->branch)
{{ $invoice->branch->name }}
@endif
{{-- Meta --}}
رقم الفاتورة #{{ str_pad($invoice->id, 6, '0', STR_PAD_LEFT) }}
التاريخ {{ $invoice->created_at->format('Y/m/d H:i') }}
@if ($invoice->supplier)
المورد {{ $invoice->supplier->name }}
@endif
بواسطة {{ $invoice->creator?->name ?? '—' }}
الحالة @php $statusMap = [ 'paid' => ['label' => 'مدفوعة', 'class' => 'status-paid'], 'partial' => ['label' => 'جزئي', 'class' => 'status-partial'], 'unpaid' => ['label' => 'غير مدفوعة', 'class' => 'status-unpaid'], ]; $s = $statusMap[$invoice->status] ?? ['label' => $invoice->status, 'class' => 'status-paid']; @endphp {{ $s['label'] }}
{{-- Items --}} @foreach ($invoice->items as $item) @php $lineTotal = $item->quantity * $item->cost_price; @endphp @endforeach
الصنف الكمية التكلفة الإجمالي
{{ $item->product?->name ?? '—' }} @if ($item->variant)
{{ $item->variant->name }} @endif
{{ number_format($item->quantity, 0) }} {{ number_format($item->cost_price, 2) }} {{ number_format($lineTotal, 2) }}
{{-- Totals --}}
الإجمالي {{ number_format($invoice->total, 2) }} ج.م
@if ((float) $invoice->remaining > 0)
المتبقي {{ number_format($invoice->remaining, 2) }} ج.م
@endif
{{-- Footer --}}
{{-- Screen actions (hidden on print) --}}