@extends('components.app-layout') @section('title', 'Item Details') @section('subtitle', $item->name) @section('content')

{{ $item->name }}

@if($item->is_active) Active @else Inactive @endif

{{ $item->item_code }}

{{ $item->category->name ?? 'No Category' }} @if($item->location) {{ $item->location }} @endif

Current Stock

{{ $item->current_stock }}

{{ $item->unit_of_measure }}

@php $stockStatus = $item->stock_status; @endphp @if($stockStatus === 'out_of_stock')

Out of Stock

This item is currently out of stock and needs immediate restocking.

@elseif($stockStatus === 'low_stock')

Low Stock Alert

Stock level is below the minimum threshold of {{ $item->minimum_stock }} {{ $item->unit_of_measure }}.

@elseif($stockStatus === 'overstock')

Overstock Notice

Stock level exceeds the maximum threshold of {{ $item->maximum_stock }} {{ $item->unit_of_measure }}.

@endif @if($item->track_expiry && $item->expiry_date) @php $daysToExpiry = $item->days_to_expiry; @endphp @if($daysToExpiry <= 30 && $daysToExpiry > 0)

Expiring Soon

This item will expire in {{ $daysToExpiry }} days on {{ $item->expiry_date->format('M d, Y') }}.

@elseif($daysToExpiry <= 0)

Expired

This item expired on {{ $item->expiry_date->format('M d, Y') }}.

@endif @endif

Item Information

Edit Item

{{ $item->item_code }}

{{ $item->category->name ?? 'No Category' }}

{{ ucfirst($item->unit_of_measure) }}

₵{{ number_format($item->unit_cost, 2) }}

₵{{ number_format($item->stock_value, 2) }}

{{ $item->location ?? 'Not specified' }}

@if($item->barcode)

{{ $item->barcode }}

@endif @if($item->track_expiry && $item->expiry_date)

{{ $item->expiry_date->format('M d, Y') }}

@endif
@if($item->description)

{{ $item->description }}

@endif @if($item->notes)

{{ $item->notes }}

@endif

Stock Levels

Current Stock

{{ $item->current_stock }}

{{ $item->unit_of_measure }}

Minimum Stock

{{ $item->minimum_stock }}

{{ $item->unit_of_measure }}

@if($item->maximum_stock)

Maximum Stock

{{ $item->maximum_stock }}

{{ $item->unit_of_measure }}

@endif
Stock Level {{ $item->current_stock }} / {{ $item->maximum_stock ?? ($item->minimum_stock * 3) }}
@php $maxForProgress = $item->maximum_stock ?? ($item->minimum_stock * 3); $percentage = $maxForProgress > 0 ? min(($item->current_stock / $maxForProgress) * 100, 100) : 0; $minPercentage = $maxForProgress > 0 ? ($item->minimum_stock / $maxForProgress) * 100 : 0; @endphp
0 Min: {{ $item->minimum_stock }} {{ $maxForProgress }}
@if($item->supplier)

Supplier Information

{{ $item->supplier }}

@if($item->supplier_contact)

{{ $item->supplier_contact }}

@endif
@endif

Quick Actions

Recent Activity

Last 10
@if($item->transactions->count() > 0)
@foreach($item->transactions->take(10) as $transaction)

{{ $transaction->type_display }}

{{ $transaction->created_at->diffForHumans() }}

{{ $transaction->type === 'out' ? '-' : '+' }}{{ abs($transaction->quantity) }}

{{ $transaction->new_stock }} total

@endforeach
@else

No transactions yet

@endif
@endsection