@extends('layouts.admin') @section('title','Inventory movements') @section('content') @php $columns = [ 'when' => 'When', 'type' => 'Type', 'sku' => 'SKU / Product', 'location' => 'Location', 'qty' => 'Qty', 'reason' => 'Reason', 'actor' => 'Actor', ]; $label = fn (string $v) => ucwords(str_replace(['_', '-'], ' ', $v)); $activeChips = collect([ 'type' => request('type'), 'location_id' => request('location_id') ? ($locations->firstWhere('id', (int) request('location_id'))?->code ?? request('location_id')) : null, 'from' => request('from'), 'to' => request('to'), ])->filter(); $types = ['adjust','reserve','commit','release','incoming','receive','transfer_out','transfer_in','restock']; @endphp Inventory levels
Available {{ number_format($stats['available']) }} Across filtered locations
Moves (24h) {{ number_format($stats['recent_moves']) }} Ledger activity
Low stock {{ number_format($stats['low_stock']) }} Needs replenishment
Out of stock {{ number_format($stats['out_of_stock']) }} Zero available
@if($activeChips->isNotEmpty())
Active @foreach($activeChips as $key => $value) {{ $label($key) }}: {{ $label((string) $value) }} @endforeach Clear all
@endif
When Type SKU / Product Location Qty Reason Actor @forelse($movements as $movement) @php $sku = $movement->item?->sku ?? $movement->item?->variant?->sku ?? '#'.$movement->inventory_item_id; $title = $movement->item?->variant?->product?->title; @endphp {{ $movement->created_at?->timezone(config('app.timezone'))->format('Y-m-d H:i') }} {{ $label($movement->type) }}
{{ $sku }}
@if($title)
{{ $title }}
@endif {{ $movement->location?->code ?? $movement->location_id }} {{ $movement->quantity > 0 ? '+' : '' }}{{ $movement->quantity }} {{ $movement->reason }} {{ $movement->actor?->name ?? 'System' }} @empty No movements match these filters. @endforelse
{{ $movements->links() }}
@endsection