@extends('layouts.app') @section('title', 'Stok') @section('page-title', 'Stok Barang') @section('page-sub', 'Kelola stok barang dan riwayat mutasi masuk/keluar.') @section('page-actions') Riwayat @endsection @section('content') @if($lowStockCount > 0)
{{ $lowStockCount }} produk stok rendah. Lihat sekarang
@endif {{-- Status quick-filter --}}
@foreach($produk as $p) @endforeach
Kode Nama Produk Kategori Stok Min. Status Aksi
{{ $p->kode_produk }} {{ $p->nama }} {{ $p->kategori->nama }} {{ $p->stok }} {{ $p->stok_minimum }} {{ $p->isStokRendah() ? 'Rendah' : 'Aman' }}
{{-- Restock modal --}} @endsection @push('scripts') @include('partials.dt-init', [ 'tableId' => 'tbl-stok', 'config' => "{ order: [[1, 'asc']], columnDefs: [ { className: 'dtr-control', orderable: false, targets: -1 }, { orderable: false, targets: [6] }, { responsivePriority: 1, targets: 1 }, { responsivePriority: 2, targets: 3 }, { responsivePriority: 3, targets: 5 }, { responsivePriority: 10, targets: [0, 2, 4, 6] }, ], buttons: window.DT_EXPORT_BUTTONS, }", 'extra' => " window.filterStatus = function(val) { dt.column(5).search(val, false, false).draw(); document.getElementById('filter-status').value = val; }; ", ]) @endpush