@extends('layouts.app')
@section('title', 'تعديل إشعار مديونية - '.config('app.name'))
@section('breadcrumb')
الرئيسية
›
المحاسبة
›
إشعارات المديونية
›
تعديل إشعار
@endsection
@section('content')
@php
$debitNoteSupplierOptions = $suppliers->map(fn ($supplier) => [
'value' => $supplier->id,
'label' => trim((string) ($supplier->code ?? '').' - '.(string) ($supplier->name ?? '')),
])->all();
$debitNoteReasonTypeOpts = [
['value' => 'مرتجع مشتريات', 'label' => 'مرتجع مشتريات'],
['value' => 'خصم مورد', 'label' => 'خصم مورد'],
['value' => 'تسوية سعر', 'label' => 'تسوية سعر'],
['value' => 'أخرى', 'label' => 'أخرى'],
];
@endphp
@endsection
@php
$debitEditLineDefaults = old('lines', $debitNote->items->map(fn ($item) => [
'description' => $item->description,
'quantity' => (float) $item->quantity,
'unit_price' => (float) $item->unit_price,
'tax_percent' => (float) $item->tax_percent,
])->all());
@endphp
@push('scripts')
@include('finance.partials.note-line-items-script', [
'tableBodyId' => 'debit-edit-lines',
'addButtonId' => 'debit-edit-add-line-btn',
'subtotalId' => 'debit-edit-subtotal-text',
'taxId' => 'debit-edit-tax-text',
'grandTotalId' => 'debit-edit-grand-total-text',
'partySelectId' => 'supplier_id',
'invoiceSelectId' => 'purchase_invoice_id',
'invoicePartyAttr' => 'data-supplier-id',
'currencyLabel' => 'SAR',
'lineDefaults' => $debitEditLineDefaults,
'defaultVatJs' => (float) $defaultVatPercent,
])
@endpush