@extends('layouts.master') @section('title', 'Stock Levels Dashboard (ปรับปรุง)') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.sidebar') @include('layouts.header-sub')
@yield('title')
@php $outOfStock = $stocks->where('product_current_stock', 0)->count(); $lowStock = $stocks ->where('product_current_stock', '>', 0) ->where('product_current_stock', '<', 10) ->count(); $normalStock = $stocks->where('product_current_stock', '>=', 10)->count(); @endphp
หมดสต๊อก
{{ $outOfStock }}
รายการ
เหลือน้อย
{{ $lowStock }}
รายการ
ปกติ
{{ $normalStock }}
รายการ
@forelse ($stocks as $index => $product) @php $balance = $product->product_current_stock ?? 0; // Status Logic according to image if ($balance == 0) { $statusLabel = 'Out of Stock'; $statusClass = 'bg-danger'; } elseif ($balance < 10) { $statusLabel = 'เหลือน้อย'; $statusClass = 'bg-warning text-dark'; } else { $statusLabel = 'ปกติ'; $statusClass = 'bg-success'; } @endphp @empty @endforelse
ลำดับ (No.) ชื่อ (Name) จำนวนคงเหลือ (Balance) ค่าต่ำสุด (Min) ค่าสูงสุด (Max) หน่วยนับ (Unit) ความถี่การเบิก (ครั้ง/เดือน) อัตราเบิกเฉลี่ย (ชิ้น/เดือน) สถานะ (Status)
{{ $index + 1 }} {{ $product->product_name }} {{ $balance }} {{ $product->product_min_stock_level ?? '-' }} {{ $product->product_max_stock_level ?? '-' }} {{ $product->name ?? 'ชิ้น' }} {{ $product->withdraw_frequency ?? 0 }} {{ $product->avg_withdraw_rate ?? 0 }} {{ $statusLabel }}
ไม่พบข้อมูล
@include('layouts.footer') @endsection