@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)
@endif
{{-- Status quick-filter --}}
| Kode |
Nama Produk |
Kategori |
Stok |
Min. |
Status |
Aksi |
|
@foreach($produk as $p)
| {{ $p->kode_produk }} |
{{ $p->nama }} |
{{ $p->kategori->nama }} |
{{ $p->stok }} |
{{ $p->stok_minimum }} |
{{ $p->isStokRendah() ? 'Rendah' : 'Aman' }}
|
|
|
@endforeach
{{-- 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