@php /** @var \App\Models\Invoice|null $invoice */ $isEdit = isset($invoice) && $invoice; $clientValue = old('client_id', $invoice->client_id ?? ($selectedClientId ?? null)); $projectValue = old('project_id', $invoice->project_id ?? ($selectedProjectId ?? null)); $amountValue = old('amount', $invoice->amount ?? null); $paidValue = old('paid_amount', $invoice->paid_amount ?? 0); $statusValue = old('status', $invoice->status ?? \App\Models\Invoice::STATUS_UNPAID); $issueDateValue = old('issue_date', isset($invoice) && $invoice->issue_date ? $invoice->issue_date->format('Y-m-d') : now()->toDateString()); $dueDateValue = old('due_date', isset($invoice) && $invoice->due_date ? $invoice->due_date->format('Y-m-d') : null); $invoiceNumberValue = old('invoice_number', $invoice->invoice_number ?? ($defaultInvoiceNumber ?? '')); @endphp
@csrf @if(($method ?? 'POST') !== 'POST') @method($method) @endif
@error('client_id')
{{ $message }}
@enderror
@error('project_id')
{{ $message }}
@enderror {{ __('سيتم إظهار مشاريع العميل المختار فقط.') }}
@error('invoice_number')
{{ $message }}
@enderror
@error('issue_date')
{{ $message }}
@enderror
@error('due_date')
{{ $message }}
@enderror
@error('amount')
{{ $message }}
@enderror
@error('paid_amount')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror {{ __('الحالة تتحدث تلقائياً بناء على المدفوع ما لم تختار ملغاة.') }}
@error('notes')
{{ $message }}
@enderror
{{ __('المتبقي للتحصيل') }} 0.00 {{ __('ر.س') }}
@if(! $isEdit)
@endif
{{ __('إلغاء') }}
@push('scripts') @endpush