@csrf
@php
$isEdit = isset($quotation);
$q = $isEdit ? $quotation : null;
$existingItems = $isEdit
? $quotation->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,
'board_portion' => $item->board_portion ?? '',
'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();
@endphp
{{-- ── HEADER ────────────────────────────────────────────────────────────── --}}
@error('customer_id')
{{ $message }}
@enderror
@error('price_type')
{{ $message }}
@enderror
@error('quotation_date')
{{ $message }}
@enderror
{{-- ── ITEMS TABLE ──────────────────────────────────────────────────────────── --}}
| # |
النوع |
الصنف / الخدمة |
الوصف |
نسبة |
الكمية |
الوحدة |
سعر الوحدة |
الخصم |
الإجمالي |
|
{{-- ── TOTALS ───────────────────────────────────────────────────────────────── --}}
| الإجمالي قبل الخصم |
0.00 |
| الخصم |
0.00 |
| بعد الخصم |
0.00 |
| الضريبة |
0.00 |
| الإجمالي النهائي |
0.00 |
{{-- Hidden calculated fields --}}
@if($errors->has('items'))
{{ $errors->first('items') }}
@endif
{{-- Row template (hidden, cloned by JS) --}}
|
|
|
|
|
|
|
|
|
|
|