{{-- Flash Message --}} @if (session()->has('message'))
{{ session('message') }}
@endif {{-- Error Message --}} @if (session()->has('error'))
{{ session('error') }}
@endif {{-- Header --}}

Manajemen Inventaris

Kelola produk, stok, dan harga.

{{-- Stats Cards --}} {{-- Stats Cards Layout --}}
{{-- 1. Total Produk --}}

Total Produk

{{ $stats['total'] }}

{{-- 2. Stok Menipis --}}

Stok Menipis

{{ $stats['low_stock'] }}

{{-- 3. Stok Habis --}}

Stok Habis

{{ $stats['out_of_stock'] }}

{{-- 4. Titip Jual Baru --}}

Titip Jual Baru

{{ $stats['consignment_waiting'] ?? 0 }}

{{-- 5 & 6. Profitability Stats (Merged Card) --}}

Profitabilitas

Rata-rata Markup

{{ number_format($stats['avg_markup'] ?? 0, 1) }}%

Margin Laba

{{ number_format($stats['avg_margin'] ?? 0, 1) }}%

{{-- Filters --}}
{{-- Products Table --}}
@if(!auth()->user()->isKasir()) @else @endif @forelse($products as $product) @empty @endforelse
Nama Produk Kategori Harga & AnalisisHarga Jual Sisa Stok Status Aksi
@if($product->image) {{ $product->name }} @else
{{ $product->category?->icon ?? '📦' }}
@endif
{{ $product->name }}
@if($product->supplierId) Konsinyasi @endif

SKU: {{ $product->sku }}

{{ $product->category?->name ?? '-' }} @if(!auth()->user()->isKasir())
{{-- Harga Jual (Primary) --}} @if($product->sellPrice > 0) Rp {{ number_format($product->sellPrice, 0, ',', '.') }} @else - @endif @if($product->approvalStatus === 'APPROVED') @if($product->buyPrice > 0) {{-- Modal (Secondary) --}} Modal: Rp {{ number_format($product->buyPrice, 0, ',', '.') }} {{-- Analysis Badges (Compact but Explicit) --}}
Markup: {{ number_format($product->markup, 0) }}% Laba: {{ number_format($product->grossMargin, 0) }}%
@else Belum ada modal @endif @endif
@else Rp {{ number_format($product->sellPrice, 0, ',', '.') }} @endif
{{ $product->stock }} / {{ $product->threshold }}
@if($product->approvalStatus === 'PENDING') Menunggu Review @elseif($product->approvalStatus === 'REJECTED') Ditolak @elseif($product->stock == 0 && $product->supplierId) @if($this->hasPendingBatch($product->id)) Diminta @elseif($this->hasActiveBatch($product->id)) Habis @else Belum Masuk @endif @elseif($product->stock == 0) Habis @elseif($product->stock <= $product->threshold) Menipis @else Tersedia @endif
@if($product->supplierId && $product->approvalStatus === 'APPROVED') @php $hasPending = $this->hasPendingBatch($product->id); $hasPendingSettlement = $this->hasPendingSettlement($product->id); @endphp @if($hasPending) {{-- Ada batch REQUESTED - menunggu supplier kirim barang --}} Menunggu Supplier @elseif($hasPendingSettlement) {{-- Ada batch PENDING_SETTLEMENT - TIDAK BOLEH order restock, harus settle dulu! --}} Pending Settlement @elseif($product->stock == 0) {{-- Stok habis DAN tidak ada pending settlement - boleh order restock --}} @elseif($product->stock <= $product->threshold) {{-- Warning: Stok menipis --}} @else {{-- Normal: Stok cukup --}} @endif @endif

Tidak ada produk ditemukan

Coba ubah filter atau tambah produk baru

{{-- Pagination --}} @if($products->hasPages())
{{ $products->links() }}
@endif
{{-- Category Modal --}} @if($showCategoryModal)
{{-- Overlay --}}
{{-- Modal Panel --}}
{{-- Modal Header --}}

Kelola Kategori

Tambah, edit, atau hapus kategori produk.

{{-- Flash Messages --}} @if (session()->has('categoryMessage'))
{{ session('categoryMessage') }}
@endif @if (session()->has('categoryError'))
{{ session('categoryError') }}
@endif
{{-- Left: Category List --}}
{{-- Search --}}
{{-- Category Table --}}
@forelse($categoryList as $category) @empty @endforelse
Kategori Produk Status Aksi
{{ $category->icon ?: '📦' }}
{{ $category->name }}

/{{ $category->slug }}

{{ $category->products_count }}

Belum ada kategori

{{-- Right: Add/Edit Form --}}

{{ $isEditingCategory ? '✏️ Edit Kategori' : '➕ Tambah Baru' }}

@if($isEditingCategory) @endif
{{-- Name --}}
@error('categoryName') {{ $message }} @enderror
{{-- Icon --}}
{{-- Slug --}}
{{-- Description --}}
{{-- Status --}}
{{-- Submit Button --}}
@endif {{-- Refactored Order Restock Modal --}} @if($showQuickBatchModal && $quickBatchProduct) @endif