@extends('layouts.app') @section('title', 'Inventory & Stok') @section('breadcrumb') Gudang Inventory & Stok @endsection @section('content')

Inventory & Stok

Kelola stok kertas, tinta, dan bahan produksi

{{-- Alert stok kritis --}} @if($stokKritis->isNotEmpty()) @endif {{-- Mini Stats --}}
@php $invStats = [ ['label'=>'Total Item', 'val'=> $totalItem ?? 0, 'icon'=>'bi-box-seam','color'=>'#1B4FD8','bg'=>'#EEF3FF'], ['label'=>'Stok Normal', 'val'=> $stokNormal ?? 0, 'icon'=>'bi-check-circle-fill','color'=>'#059669','bg'=>'#D1FAE5'], ['label'=>'Stok Kritis', 'val'=> $stokKritis->count() ?? 0, 'icon'=>'bi-exclamation-triangle-fill','color'=>'#DC2626','bg'=>'#FEE2E2'], ['label'=>'Nilai Stok', 'val'=> 'Rp '.number_format($nilaiStok ?? 0, 0, ',', '.'), 'icon'=>'bi-currency-dollar','color'=>'#D97706','bg'=>'#FEF3C7'], ]; @endphp @foreach($invStats as $s)
{{ $s['label'] }}
{{ $s['val'] }}
@endforeach
{{-- Filter & Search --}}
{{-- Inventory Table --}}
@foreach($inventory as $item) @php $pct = $item->qty_minimum > 0 ? ($item->qty_aktual / $item->qty_minimum) : 2; $isKritis = $pct <= 1; $isWarning = $pct > 1 && $pct <= 1.5; $statusLabel = $isKritis ? 'Kritis' : ($isWarning ? 'Rendah' : 'Aman'); $statusCls = $isKritis ? 'pf-status-batal' : ($isWarning ? 'pf-status-pending' : 'pf-status-selesai'); $nilaiStok = $item->qty_aktual * $item->harga_beli_terakhir; @endphp @endforeach
Kode Nama Item Kategori Stok Aktual Stok Min Status Harga Beli Nilai Stok Lokasi Aksi
{{ $item->kode_item }}
{{ $item->nama_item }}
@if($item->supplier)
{{ $item->supplier->nama }}
@endif
{{ ucfirst($item->kategori) }}
{{ number_format($item->qty_aktual, 2) }}
{{ $item->satuan }}
{{ number_format($item->qty_minimum, 2) }} {{ $item->satuan }} {{ $statusLabel }} @if($isKritis)
Reorder!
@endif
Rp {{ number_format($item->harga_beli_terakhir, 0, ',', '.') }}/{{ $item->satuan }} Rp {{ number_format($nilaiStok, 0, ',', '.') }} {{ $item->lokasi_gudang ?? '-' }}
{{-- ===== MODAL TRANSAKSI STOK ===== --}} {{-- Modal Tambah Item --}} @endsection @push('scripts') @endpush