@extends('layouts.app') @section('title', 'POS Items & Categories') @push('styles') @endpush @php $reopen = old('_form'); @endphp @section('content')
@foreach ([ ['Catalog items', $stats['items'], 'bi-menu-button-wide', '#eef2ff', '#4f46e5'], ['Available to sell', $stats['available'], 'bi-check2-circle', '#dcfce7', '#15803d'], ['Hidden from terminal', $stats['unavailable'], 'bi-eye-slash', '#f1f5f9', '#475569'], ['Linked to stock', $stats['stockLinked'], 'bi-box-seam', '#fef3c7', '#b45309'], ] as [$label, $value, $icon, $bg, $fg])
{{ $value }}{{ $label }}
@endforeach
{{-- Categories --}}

Categories

Pick one to filter the catalog.

{{-- Items --}}

{{ $selected ? $selected->category_name : 'All items' }}

{{ $items->total() }} {{ Str::plural('item', $items->total()) }}{{ $selected ? ' in this category' : '' }}{{ $search !== '' || $status ? ' matching your filter' : '' }}.

{{-- Server-side: searches every page of the catalog, not just the one on screen. --}}
@unless ($selected)@endunless @if ($showBranch)@endif @forelse ($items as $item) @php $available = $item->status === 'available'; $sold = $soldItemIds->has($item->item_id); @endphp @unless ($selected)@endunless @if ($showBranch)@endif @empty @endforelse
ItemCategoryStock deductionBranchPrice Status Actions
{{ $item->item_name }}{{ $item->category->category_name ?? '—' }} @if ($item->inventoryItem) {{ rtrim(rtrim(number_format((float) $item->consumption_qty, 2), '0'), '.') }} {{ $item->inventoryItem->unit_of_measure }} of {{ $item->inventoryItem->item_name }} @elseif ($item->linked_inventory_item_id) Linked stock item missing @else Service — no stock @endif {{ $item->branch->branch_name ?? 'All branches' }}₦{{ number_format((float) $item->price, 2) }} {{ $available ? 'Available' : 'Hidden' }} @if ($can['edit'])
@csrf
@endif @if ($can['delete'])
@csrf @method('DELETE')
@endif
@if ($search !== '' || $status)
No items match your search.
@else
{{ $categories->isEmpty() ? 'Create a category first, then add the items you sell.' : ($items->total() ? 'No items on this page.' : 'No items here yet.') }}
@endif
@include('partials.list-pager', ['page' => $items, 'noun' => 'item'])
{{-- ============ Modals ============ --}} @endsection @push('scripts') @endpush