@csrf
@php
$isEdit = isset($invoice);
$model = $isEdit ? $invoice : null;
$existingItems = $isEdit
? $invoice->items->map(fn($item) => [
'product_id' => $item->product_id,
'unit_id' => $item->unit_id,
'unit_name' => $item->unit?->name_ar ?? '',
'description_ar' => $item->description_ar,
'quantity' => (float) $item->quantity,
'unit_cost' => (float) $item->unit_cost,
'discount_amount' => (float) $item->discount_amount,
'line_total' => (float) $item->line_total,
'notes_ar' => $item->notes_ar,
])
: collect();
$existingPayments = $isEdit
? $invoice->supplierPayments->map(fn($pay) => [
'payment_account_id' => $pay->payment_account_id,
'payment_method' => $pay->payment_method,
'amount' => (float) $pay->amount,
'reference_number' => $pay->reference_number,
'notes_ar' => $pay->notes_ar,
])
: collect();
@endphp
| # |
الصنف |
الوصف |
الوحدة |
الكمية |
تكلفة الوحدة |
خصم |
الإجمالي |
|
| # |
طريقة السداد |
حساب السداد |
القيمة |
المرجع |
ملاحظات |
|
| إجمالي البنود | 0.00 |
| الخصم | 0.00 |
| بعد الخصم | 0.00 |
| الضريبة | 0.00 |
| المصاريف الإضافية | 0.00 |
| الإجمالي النهائي | 0.00 |
| إجمالي المدفوع | 0.00 |
| المتبقي | 0.00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|