@extends('layouts.app') @section('title', 'Materials & Inventory') @php $f = $filters ?? []; $stats = $stats ?? []; $stockBadge = function (string $label): string { return match ($label) { 'Critical', 'Expired' => 'r', 'Low', 'Reorder', 'Expiring Soon' => 'a', default => 'g', }; }; @endphp @section('content')
Import row notes
Total Materials
{{ $stats['total_materials'] ?? 0 }}
Low Stock Alerts
{{ $stats['low_stock'] ?? 0 }}
Stock Value
{{ \App\Support\Format::mwkDecimal($stats['stock_value'] ?? 0) }}
Expiring Soon
{{ $stats['expiring_soon'] ?? 0 }}
Stock lines (30 days)
| Material | SKU | Category | Stock | Min | Unit | Stock value | Expiry | Status | Action |
|---|---|---|---|---|---|---|---|---|---|
|
{{ $m->name }}
@if($m->description)
{{ $m->description }} @endif |
{{ $m->sku ?: '—' }} | {{ $m->category ?: '—' }} | {{ rtrim(rtrim((string) $m->current_stock, '0'), '.') }} | {{ rtrim(rtrim((string) $m->minimum_stock_level, '0'), '.') }} | {{ $m->unit_of_measure }} | {{ \App\Support\Format::mwkDecimal($m->stock_value) }} | @if(! $m->is_expirable) Not expirable @elseif($expLine && $expLine->expiry_date) @php $ed = $expLine->expiry_date; $isPast = $ed->isPast(); $soon = ! $isPast && $ed->lte(now()->addDays(30)); @endphp {{ $ed->format('M j, Y') }} @else — @endif | {{ $health }} {{ $m->status }} | View Edit |
Expiry & stock alerts
Critical stock
@include('inventory.partials.alert-materials-table', ['rows' => $criticalMaterials, 'empty' => 'No critical items.'])Low stock
@include('inventory.partials.alert-materials-table', ['rows' => $lowStockMaterials, 'empty' => 'No low-stock items.'])Expiring soon (30 days)
@include('inventory.partials.alert-expiry-table', ['rows' => $expiringLines, 'showWriteOff' => false])Expired on hand
@include('inventory.partials.alert-expiry-table', ['rows' => $expiredLines, 'showWriteOff' => true])Add material
Stock in / receive
Issue materials
Return materials
Stock adjustment
Import materials