| # | الصنف | الوحدة | الكمية | السعر | الخصم | الإجمالي |
|---|---|---|---|---|---|---|
| {{ $index + 1 }} | {{ $item['product'] }} | {{ $item['unit'] }} | {{ number_format((float) $item['quantity'], 2) }} | {{ number_format((float) $item['price'], 2) }} | {{ number_format((float) $item['discount'], 2) }} | {{ number_format((float) $item['total'], 2) }} |
| ما قبله (الرصيد السابق) | {{ number_format($previousBalance, 2) }} |
| الإجمالي قبل الخصم | {{ number_format($totals['subtotal'], 2) }} |
| الخصم | {{ number_format($totals['discount'], 2) }} |
| إجمالي المستند | {{ number_format($totals['total'], 2) }} |
| المدفوع | {{ number_format($totals['paid'], 2) }} |
| الرصيد المتبقي على العميل | @php $finalBalance = $previousBalance; if ($type === 'sale') { $finalBalance += $totals['remaining']; } elseif ($type === 'sale-return') { $finalBalance -= $totals['remaining']; } @endphp {{ number_format($finalBalance, 2) }} |
| المتبقي من المستند | {{ number_format($totals['remaining'], 2) }} |