@if (session()->has('success'))
{{ session('success') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif
@if($customer_id && $selectedCustomerName)
{{ $selectedCustomerName }}
@else @if($showCustomerDropdown && !empty($customerResults))
@foreach($customerResults as $customer)
{{ $customer->name }}
{{ $customer->phone }}
{{ ucfirst($customer->customer_type) }}
@endforeach
@endif @if($showCustomerDropdown && strlen($customerSearch) >= 2 && empty($customerResults))
No customers found
@endif @endif
@error('customer_id') {{ $message }} @enderror
@error('invoice_date') {{ $message }} @enderror
@if(!empty($searchResults) && count($searchResults) > 0) @foreach($searchResults as $product)

{{ $product->name }}

@if($product->style)

Style: {{ $product->style }}

@endif @if($product->brand) {{ $product->brand->name }} @endif
@if($product->category && $product->category->sizeGroup && $product->category->sizeGroup->sizes->count() > 0)
@foreach($product->category->sizeGroup->sizes->sortBy('sort_order') as $size) @php $price = $product->prices->firstWhere('size_id', $size->id); @endphp @endforeach
@else

No sizes available

@endif
@endforeach @else @if(strlen($searchQuery) >= 2)

No products found matching "{{ $searchQuery }}"

@else

Start typing to search for products...

@endif @endif

{{ count($selectedItems) }} item(s)

@if(count($selectedItems) > 0)
@foreach($selectedItems as $key => $item)

{{ $item['product_name'] }} @if(isset($item['discount_rate']) && $item['discount_rate'] > 0) {{ $item['discount_rate'] }}% OFF @endif

@if($item['brand_name']) {{ $item['brand_name'] }} @endif Size: {{ $item['size_name'] }}
Qty:
Disc: %
₹{{ number_format($item['effective_price'] ?? $item['unit_price'], 2) }}
Total:
@if(isset($item['discount_rate']) && $item['discount_rate'] > 0)
₹{{ number_format($item['quantity'] * $item['unit_price'], 2) }}
@endif

₹{{ number_format($item['quantity'] * ($item['effective_price'] ?? $item['unit_price']), 2) }}

@endforeach
@else

No items added yet

@endif
Subtotal: ₹{{ number_format($subtotal, 2) }}
Tax Amount: ₹{{ number_format($tax_amount, 2) }}
Total: ₹{{ number_format($total, 2) }}
Cancel
@if($showCustomerModal)

Add New Customer

@error('newCustomer.name') {{ $message }} @enderror
@error('newCustomer.phone') {{ $message }} @enderror
@endif