| # | الوصف | الكمية | سعر الوحدة | الخصم | الإجمالي |
|---|---|---|---|---|---|
| {{ $index + 1 }} | {{ $item->description }} | {{ number_format($item->quantity ?? 0, 2) }} | {{ number_format($item->unit_price ?? 0, 2) }} ج.م | @php $dtype = $item->line_discount_type ?? 'none'; $dval = (float)($item->line_discount_value ?? 0); @endphp @if($dtype === 'percent') {{ rtrim(rtrim(number_format($dval, 2), '0'), '.') }}% @elseif($dtype === 'amount') {{ number_format($dval, 2) }} ج.م @else 0 @endif | {{ number_format($item->line_total ?? 0, 2) }} ج.م |
| المجموع الفرعي: | {{ number_format($invoice->subtotal ?? 0, 2) }} ج.م | ||||
| الخصم: | -{{ number_format($invoice->discount_amount ?? 0, 2) }} ج.م | ||||
| الضريبة ({{ $invoice->vat_rate }}%): | {{ number_format($invoice->tax_amount ?? 0, 2) }} ج.م | ||||
| المدفوع: | {{ number_format($paid ?? ($invoice->paid_amount ?? 0), 2) }} ج.م | ||||
| المتبقي: | {{ number_format($remaining ?? max(0, ($invoice->total_amount ?? 0) - ($paid ?? ($invoice->paid_amount ?? 0))), 2) }} ج.م | ||||