@extends('layouts.app') @section('title', $material->name) @php $health = $material->stockLevelLabel(); $hb = match ($health) { 'Critical', 'Expired' => 'r', 'Low', 'Reorder', 'Expiring Soon' => 'a', default => 'g', }; @endphp @section('content')
{{ $material->name }}
SKU {{ $material->sku ?: '—' }} · {{ $material->category ?: 'Uncategorised' }}
Current stock
{{ rtrim(rtrim((string) $material->current_stock, '0'), '.') }} {{ $material->unit_of_measure }}
Stock value
{{ \App\Support\Format::mwkDecimal($material->stock_value) }}
Average cost
{{ \App\Support\Format::mwkDecimal($material->average_cost) }}
Expired qty on hand
{{ rtrim(rtrim((string) $expiredQty, '0'), '.') }}
Edit material
Stock lines / batches
| Batch / Lot | Received | Expiry | Qty recv | Avail | Unit cost | Value | Location | Status |
|---|---|---|---|---|---|---|---|---|
| {{ trim(implode(' / ', array_filter([$sl->batch_number, $sl->lot_number]))) ?: '—' }} | {{ $sl->received_date?->format('Y-m-d') }} | {{ $sl->expiry_date?->format('Y-m-d') ?: '—' }} | {{ rtrim(rtrim((string) $sl->quantity_received, '0'), '.') }} | {{ rtrim(rtrim((string) $sl->quantity_available, '0'), '.') }} | {{ \App\Support\Format::mwkDecimal($sl->unit_cost) }} | {{ \App\Support\Format::mwkDecimal($sl->total_cost) }} | {{ $sl->storage_location ?: '—' }} | {{ $sl->status }} |
| No stock lines yet. | ||||||||
Recent movements
| Date | Type | Qty | Project / supplier | Reference | Cost | By |
|---|---|---|---|---|---|---|
| {{ $mv->movement_date?->format('Y-m-d') }} | {{ $mv->movement_type }} | {{ rtrim(rtrim((string) $mv->quantity, '0'), '.') }} | {{ $mv->project?->name ?? $mv->supplier?->company_name ?? '—' }} | {{ $mv->reference ?: '—' }} | {{ \App\Support\Format::mwkDecimal($mv->total_cost) }} | {{ $mv->movedBy?->name ?? '—' }} |
| No movements. | ||||||
Purchase history
| PO | Supplier | Qty | Amount | Status |
|---|---|---|---|---|
| {{ $po?->po_number }} | {{ $po?->supplier?->company_name }} | {{ rtrim(rtrim((string) $it->quantity_ordered, '0'), '.') }} | {{ \App\Support\Format::mwkDecimal($it->total_cost) }} | {{ $po?->status }} |
| No PO lines. | ||||
Project issues
| Project | Date | Qty | Cost | Ref |
|---|---|---|---|---|
| {{ $is->project?->name ?? '—' }} | {{ $is->movement_date?->format('Y-m-d') }} | {{ rtrim(rtrim((string) $is->quantity, '0'), '.') }} | {{ \App\Support\Format::mwkDecimal($is->total_cost) }} | {{ $is->reference ?: '—' }} |
| No issues recorded. | ||||
Adjustment — {{ $material->name }}