@extends('layouts.app') @section('content')

Total Bahan

{{ $stats['total_materials'] }}

Stok Rendah

{{ $stats['low_stock'] }}

Stok Habis

{{ $stats['out_of_stock'] }}

{{ $title }}

@forelse ($materials as $material) @php $isCustom = (bool) ($material->is_custom ?? false); $isOut = !$isCustom && (float) $material->stock <= 0; $isLow = !$isCustom && (bool) ($material->is_low_stock ?? false); @endphp @empty @endforelse
Bahan Kategori Stok Min. Stok Status
{{ $material->name }} @if($isCustom) Custom @endif
{{ $material->getCategoryName() }} @if($isCustom)
Mengikuti komponen
Stok bahan custom tidak dipakai
@else {{ number_format((float) $material->stock, 2, ',', '.') }} {{ $material->unit }} @endif
@if($isCustom) - @else {{ number_format((float) $material->min_stock, 2, ',', '.') }} {{ $material->unit }} @endif @if ($isCustom) Custom @elseif ($isOut) Habis @elseif ($isLow) Rendah @else OK @endif
Tidak ada data stok
{{ $materials->links() }}
@endsection