Edit Invoice #{{ $invoice->invoice_number }}

@if ($errors->any())
Please fix the following errors:
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@if($isEditingPatient && $selectedPatientId)
Editing: {{ $name }} ({{ $code }})
@endif
@error('code')
{{ $message }}
@enderror @if($showSearchResults && count($searchResults) > 0)
@foreach($searchResults as $result) @endforeach
@endif
@error('name')
{{ $message }}
@enderror @if($showSearchResults && count($searchResults) > 0)
@foreach($searchResults as $result) @endforeach
@endif
@error('phone')
{{ $message }}
@enderror
@error('address')
{{ $message }}
@enderror
Invoice Items
@error('items')
{{ $message }}
@enderror @if(count($selectedServices) == 0 && count($selectedProducts) == 0)
No items added yet. Click "Add Service" or "Add Drug" to add items to the invoice.
@else
@php $totalAmount = 0; @endphp @foreach($selectedServices as $index => $service) @php $totalAmount += $service['cost']; @endphp @endforeach @foreach($selectedProducts as $index => $product) @php $itemTotal = $product['sale_price'] * $product['quantity']; $totalAmount += $itemTotal; @endphp @endforeach
Type Item Name Category Quantity Unit Price Total Actions
Service {{ $service['name'] }} @php $category = \App\Models\Category::find($service['category_id']); @endphp {{ $category->name ?? 'N/A' }} 1 ${{ number_format($service['cost'], 2) }} ${{ number_format($service['cost'], 2) }}
Drug {{ $product['name'] }} -
@if(isset($productBatchesMap[$product['product_id']]) && $productBatchesMap[$product['product_id']]->count() > 0) @endif
${{ number_format($product['sale_price'], 2) }} ${{ number_format($itemTotal, 2) }}
Total Amount: ${{ number_format($totalAmount, 2) }}
@endif
Notes
Cancel
@if($showServiceModal) @endif @if($showProductModal) @endif