فاتورة مبيعات #{{ $invoice->id }}

@if ($invoice->status !== 'paid' && $invoice->status !== 'refunded') @endif @if ($canRefund) @endif طباعة رجوع
@if (session('pay_success'))
{{ session('pay_success') }}
@endif @if (session('refund_error'))
{{ session('refund_error') }}
@endif @if ($invoice->original_invoice_id)
هذه فاتورة استرداد من الفاتورة #{{ $invoice->original_invoice_id }}
@endif
بيانات الفاتورة
العميل {{ $invoice->customer?->name ?? 'عميل عرضي' }}
الفرع {{ $invoice->branch?->name ?? '-' }}
التاريخ {{ $invoice->created_at->format('Y/m/d H:i') }}
الكاشير {{ $invoice->creator?->name ?? '-' }}
ملخص الدفع
المجموع الفرعي {{ number_format($invoice->subtotal, 2) }} ج.م
الخصم - {{ number_format($invoice->discount, 2) }} ج.م
الإجمالي {{ number_format($invoice->total, 2) }} ج.م
المدفوع {{ number_format($invoice->paid, 2) }} ج.م
المتبقي {{ number_format($invoice->remaining, 2) }} ج.م
الحالة @if ($invoice->status === 'paid') مدفوع @elseif($invoice->status === 'partial') جزئي @elseif($invoice->status === 'refunded') مسترد @else غير مدفوع @endif
{{-- Items --}}
الأصناف المباعة
@foreach ($invoice->items as $item) @php $subtotal = $item->quantity * $item->price; $cost = $item->quantity * $item->cost_price; $profit = $subtotal - $cost; @endphp @endforeach
المنتج المتغير الكمية مسترد سعر البيع التكلفة المجموع الربح
{{ $item->product?->name ?? '-' }} {{ $item->variant?->name ?? '-' }} {{ $item->quantity }} @if ((float) $item->refunded_qty > 0) {{ $item->refunded_qty }} @else @endif {{ number_format($item->price, 2) }} ج.م {{ number_format($item->cost_price, 2) }} ج.م {{ number_format($subtotal, 2) }} ج.م {{ number_format($profit, 2) }} ج.م
{{-- Refund History --}} @if ($invoice->refunds->isNotEmpty())
سجل الاستردادات ({{ $invoice->refunds->count() }})
@foreach ($invoice->refunds as $ref) @endforeach
# التاريخ الأصناف قيمة الاسترداد
{{ $ref->id }} {{ $ref->created_at->format('Y/m/d H:i') }} @foreach ($ref->items as $ri) {{ $ri->product?->name }} @if ($ri->variant) ({{ $ri->variant->name }}) @endif ×{{ $ri->quantity }} @endforeach - {{ number_format($ref->total, 2) }} ج.م
@endif {{-- Payment Modal --}} @if ($showPayModal) @endif {{-- Refund Modal --}} @if ($showRefundModal) @endif