@extends('layouts.app') @section('title',$item->sku . ' — ' . $item->name) @section('content')

{{ $item->name }}

@if(!$item->is_active)Inactive@endif @if($item->is_expired)Expired@elseif($item->is_expiring_soon)Expiring Soon@endif @if($item->is_low_stock)Low Stock@endif
@can('update',$item)Edit@endcan Back
@include('partials._alerts')

Current Stock

{{ number_format((float)$item->current_quantity,3) }}

{{ $item->unit_of_measure }}


Reorder{{ number_format((float)$item->reorder_level,3) }}
Stock ValueLKR {{ number_format($item->stock_value,2) }}
Item Details
@php $rows=[['SKU',''.e($item->sku).''],['Category',e($item->category?->name??'—')],['Supplier',e($item->supplier?->name??'—')],['Unit',e($item->unit_of_measure)],['Cost Price','LKR '.number_format((float)$item->cost_price,2)],['Sell Price','LKR '.number_format((float)$item->selling_price,2)],['Batch No.',e($item->batch_number??'—')],['Expiry',$item->expiry_date?''.$item->expiry_date->format('d M Y').'':'Non-expiring'],['Location',e($item->storage_location??'—')],['Created',e($item->created_at->format('d M Y'))]]; @endphp @foreach($rows as [$l,$v])
{{ $l }}
{!! $v !!}
@endforeach
Stock Transaction History
@forelse($recentTransactions as $tx) @php $badge=['purchase_in'=>'bg-success','consumption_out'=>'bg-danger','return'=>'bg-info text-dark','adjustment'=>'bg-warning text-dark','write_off'=>'bg-dark'][$tx->transaction_type]??'bg-secondary'; @endphp @empty @endforelse
DateTypeQtyBeforeAfterReferenceOperator
{{ $tx->created_at->format('d M Y H:i') }} {{ str_replace('_',' ',$tx->transaction_type) }} {{ (float)$tx->quantity>=0?'+':'' }}{{ number_format((float)$tx->quantity,3) }} {{ number_format((float)$tx->quantity_before,3) }} {{ number_format((float)$tx->quantity_after,3) }} {{ $tx->reference_type?Str::title(str_replace('_',' ',$tx->reference_type)).' #'.$tx->reference_id:'—' }} {{ $tx->createdBy?->name ?? 'System' }}
No transactions recorded yet.
@endsection