@extends('layouts.app') @section('title', 'Stock History - ' . $product->name) @section('breadcrumb') @endsection @section('content') {{-- Product Info Card --}}
@if($product->image) {{ $product->name }} @else @endif

{{ $product->name }}

SKU: {{ $product->sku ?? 'N/A' }} | Barcode: {{ $product->barcode ?? 'N/A' }}

{{ $product->category?->name ?? 'Uncategorized' }}
{{ number_format($product->stock_quantity, 0) }}
Current Stock
{{ $product->unit ?? 'pcs' }}
{{-- Movements Table --}}
Movement History
{{ $movements->total() }} records
@forelse($movements as $movement) @empty @endforelse
Date & Time Type Quantity Before After User Notes
{{ $movement->created_at->format('M d, Y') }}
{{ $movement->created_at->format('h:i A') }}
@php $typeColors = [ 'sale' => 'status-cancelled', 'purchase' => 'status-completed', 'adjustment' => 'status-refunded', 'damage' => 'status-cancelled', 'expired' => 'status-cancelled', 'transfer' => 'status-pending', 'return' => 'status-completed', ]; $typeIcons = [ 'sale' => 'bi-cart-dash', 'purchase' => 'bi-cart-plus', 'adjustment' => 'bi-plus-slash-minus', 'damage' => 'bi-x-circle', 'expired' => 'bi-calendar-x', 'transfer' => 'bi-arrow-left-right', 'return' => 'bi-arrow-return-left', ]; @endphp {{ ucfirst($movement->type) }} {{ $movement->quantity >= 0 ? '+' : '' }}{{ number_format($movement->quantity, 0) }} {{ number_format($movement->quantity_before, 0) }} {{ number_format($movement->quantity_after, 0) }} @if($movement->user)
{{ strtoupper(substr($movement->user->name, 0, 1)) }}
{{ $movement->user->name }}
@else System @endif
@if($movement->notes) {{ Str::limit($movement->notes, 30) }} @else - @endif

No stock movements recorded yet

@if($movements->hasPages())
{{ $movements->links() }}
@endif
@push('styles') @endpush @endsection