@csrf
@php
$isEdit = isset($invoice);
$model = $isEdit ? $invoice : null;
$existingItems = $isEdit
? $invoice->items->map(fn($item) => [
'line_type' => $item->line_type,
'product_id' => $item->product_id,
'service_type_id' => $item->service_type_id,
'unit_id' => $item->unit_id,
'unit_name' => $item->unit?->name_ar ?? '',
'description_ar' => $item->description_ar,
'quantity' => (float) $item->quantity,
'unit_price' => (float) $item->unit_price,
'discount_amount' => (float) $item->discount_amount,
'line_total' => (float) $item->line_total,
'notes_ar' => $item->notes_ar,
])
: collect();
$existingPayments = $isEdit
? $invoice->customerPayments->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
@error('customer_id')
{{ $message }}
@enderror
@error('warehouse_id')
{{ $message }}
@enderror
@error('invoice_date')
{{ $message }}
@enderror
| # |
نوع البند |
الصنف / الخدمة |
الوصف |
الوحدة |
الكمية |
سعر الوحدة |
خصم |
الإجمالي |
|
| # |
الطريقة |
حساب السداد |
القيمة |
المرجع |
ملاحظات |
|
| الإجمالي قبل الخصم | 0.00 |
| الخصم | 0.00 |
| بعد الخصم | 0.00 |
| الضريبة | 0.00 |
| الإجمالي النهائي | 0.00 |
| إجمالي المدفوع | 0.00 |
| المتبقي | 0.00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|