@forelse($products as $product)
@if($product->image)
 }})
@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
|
@empty
Tidak ada produk ditemukan
Coba ubah filter atau tambah produk baru
|
@endforelse