@php $editing = isset($invoice); $quotationMode = !$editing && request('mode') === 'quotation'; $initialItems = $editing ? $invoice->items->map(fn($item) => [ 'description' => $item->description, 'quantity' => $item->quantity, 'rate' => $item->unit_price, 'discount' => $item->discount_amount ?? 0, 'vat_rate' => $item->vat_rate ?? 0, 'fee_type' => match($item->fee_type) {'gov_fee'=>'government_fee','typing_fee'=>'typing_fee','service_charge'=>'service_revenue',default=>$item->fee_type}, 'account_id' => $item->account_id, ])->values()->all() : [ ['description' => 'Government / authority fee', 'quantity' => 1, 'rate' => '', 'discount' => 0, 'vat_rate' => 0, 'fee_type' => 'government_fee', 'account_id' => ''], ['description' => 'Typing / professional service charge', 'quantity' => 1, 'rate' => '', 'discount' => 0, 'vat_rate' => 5, 'fee_type' => 'service_revenue', 'account_id' => ''], ]; $formAction = $editing ? route('app.billing.invoices.update', $invoice) : ($quotationMode ? route('app.finance.quotations.store') : route('app.finance.invoices.store')); @endphp
@csrf @if($editing) @method('PUT') @endif

Customer & document

Choose an individual or corporate account; quick-create is available for new walk-ins.

{{ $quotationMode ? 'Quotation' : ($editing ? 'Revision V'.($invoice->version+1) : 'Draft Invoice') }}
@unless($editing)@endunless @if($quotationMode) @else @endif

Line items

Government fees remain clearing liabilities; only service lines become revenue.

DescriptionFee typeAccount mappingQtyRateDiscountVAT %Amount
@foreach([['Custom line','miscellaneous'],['Service','service_revenue'],['Government fee','government_fee'],['Expense reimbursement','expense_reimbursement']] as [$label,$type])@endforeach

Notes & terms

@if($editing)@endif