@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
Hold
Held
{{-- ADD after held-btn button --}}
Cost
Clear
Sales
@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 --}}
{{-- Card footer: price + size + add btn --}}
{{-- Empty state --}}
No products found
Try a different search
{{-- After closing of prod-grid --}}
{{-- ADD after empty state template, still inside prod-grid div --}}
Scroll for more…
@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 --}}
{{-- Hold tray --}}
{{-- Empty state --}}
Bill is empty
Click any product to add
{{-- Bill items list --}}
{{-- LEFT: name + loose toggle --}}
{{-- Loose toggle row --}}
{{-- Price input --}}
₹
{{-- Loose toggle + unit dropdown --}}
{{-- Unit dropdown — only in loose mode --}}
kg
gm
ml
litre
{{-- QTY controls --}}
{{-- TOTAL --}}
{{-- REMOVE --}}
{{-- Quick qty + loose qty buttons (shows when item active) --}}
{{-- QTY section --}}
Qty
−1
+1
{{-- PRICE section --}}
₹
−10
+10
{{-- Loose unit quick buttons — only when loose mode --}}
{{-- Bill footer --}}
{{-- Hold Bills Popup --}}
{{-- Purchase Cost Popup --}}