@endonce
{{-- ══ TOP BAR ════════════════════════════════════════════ --}}
{{-- Invoice no + Customer lookup --}}
Invoice
{{ $invoiceNo }}
{{-- Show error if tried to save without customer --}}
@if($flashMsg && $flashType === 'error' && str_contains($flashMsg, 'Customer'))
Required
@endif
{{-- Customer status --}}
@if($customerFound)
{{ $customerName ?: $mobile }}
@elseif($newCustomer)
Save
@endif
@endif
{{-- ══ BODY ════════════════════════════════════════════════ --}}
{{-- ── LEFT: Products (col-8) ─────────────────────────── --}}
{{-- Search bar --}}
{{-- Category chips --}}
All
@foreach($categories as $cat)
{{ $cat->category_name }}
@endforeach
{{-- Product grid --}}
{{-- Image area --}}
{{-- Overlay: name + company --}}
{{-- Cart qty badge --}}
{{-- No stock badge --}}
No Stock
{{-- Card footer: price + size + add btn --}}
{{-- Empty state --}}
No products found
Try a different search
@if($showHistoryModal)
Purchase History — {{ $customerName ?: $mobile }}
@forelse($customerHistory as $sale)
{{-- Sale header row — click to expand --}}
{{ $sale['invoice_no'] }}
{{ $sale['date'] }}
₹{{ number_format($sale['net_amount'], 2) }}
{{ count($sale['items']) }} items
{{-- Expandable items --}}
Product
Qty
Price
Total
@foreach($sale['items'] as $item)
{{ $item['name'] }}
{{ $item['qty'] }}
₹{{ number_format($item['price'], 2) }}
₹{{ number_format($item['total'], 2) }}
@endforeach
@empty
No previous purchases found.
@endforelse
@endif
{{-- ── RIGHT: Bill (col-4) ─────────────────────────────── --}}
{{-- Bill header --}}
{{-- Empty state --}}
Bill is empty
Click any product to add
{{-- Bill items list --}}
{{-- Quick qty + loose qty buttons (shows when item active) --}}
Quick Add:
+1
+5
+10
+25
+0.5
+1
+5
+10
{{-- Bill footer --}}