@extends('backEnd.layouts.master') @section('title', 'Inventory Ledger — ' . $product->name) @section('content') {{-- Product Summary --}}
@if($product->thumbnail) @endif
{{ $product->name }}
SKU: {{ $product->sku ?? 'N/A' }} Category: {{ $product->category?->name ?? 'N/A' }} Price: ৳{{ number_format($product->sale_price ?? $product->price) }}
{{ $product->stock }}
Current Stock
{{-- Ledger Table --}}
Stock Movement History ({{ $ledger->total() }} entries)
@forelse($ledger as $i => $entry) @empty @endforelse
# Type Stock In Stock Out Reference Note Date
{{ ($ledger->currentPage() - 1) * $ledger->perPage() + $i + 1 }} @php $typeConfig = [ 'purchase' => ['label' => 'Purchase', 'class' => 'bg-success', 'icon' => 'fa-arrow-down'], 'sale' => ['label' => 'Sale', 'class' => 'bg-primary', 'icon' => 'fa-shopping-cart'], 'return' => ['label' => 'Return', 'class' => 'bg-info', 'icon' => 'fa-undo'], 'reserve' => ['label' => 'Reserved', 'class' => 'bg-secondary','icon' => 'fa-lock'], 'release' => ['label' => 'Released', 'class' => 'bg-secondary','icon' => 'fa-unlock'], 'adjustment' => ['label' => 'Adjustment', 'class' => 'bg-warning text-dark', 'icon' => 'fa-edit'], 'damage' => ['label' => 'Damage', 'class' => 'bg-danger', 'icon' => 'fa-exclamation-triangle'], ]; $cfg = $typeConfig[$entry->type] ?? ['label' => ucfirst($entry->type), 'class' => 'bg-secondary', 'icon' => 'fa-circle']; @endphp {{ $cfg['label'] }} @if($entry->qty_in > 0) +{{ $entry->qty_in }} @else @endif @if($entry->qty_out > 0) -{{ $entry->qty_out }} @else @endif @if($entry->reference_type && $entry->reference_id) {{ $entry->reference_type }} #{{ $entry->reference_id }} @else @endif {{ $entry->note ?? '—' }}
{{ $entry->created_at->format('d M Y') }}
{{ $entry->created_at->format('h:i A') }}
No inventory movements recorded yet.
@if($ledger->hasPages())
{{ $ledger->links() }}
@endif
{{-- Adjust Stock Modal --}} @endsection @push('scripts') @endpush