@extends('backend.template.layouts.template-base') @section('title', 'Manage Inventory - Detail') @php $product = $pricing->product; $status = $pricing->resolveStockStatus(); $statusLabel = \App\Models\ProductPricing::stockLabel($status); $statusClass = match($status) { 'in_stock' => 'color-green', 'low_stock' => 'color-orange', 'pre_order' => 'color-red', default => '', }; $badgeClass = match($status) { 'in_stock' => 'bg-green-light color-green', 'low_stock' => 'bg-orange-light color-orange', 'pre_order' => 'bg-red-light color-red', default => '', }; @endphp @section('content')
{{ $product->name }} @if($product->name_tamil) ({{ $product->name_tamil }}) @endif
{{ $statusLabel }}

{{ $product->product_code }} | Variant: {{ $pricingLabel }} | Group Under: {{ $product->group?->name ?? '—' }} | Last Updated: {{ $pricing->stock_updated_at?->format('d/m/Y') ?? '—' }}

Available Stock

{{ str_pad($pricing->stock_qty, 3, '0', STR_PAD_LEFT) }}

{{-- ── Stock Info ──────────────────────────────────────────────────── --}}

Stock Info


Available Stock

{{ $pricing->stock_qty }}

Low Stock Threshold

{{ $pricing->low_stock_threshold }}

Stock Status

{{ $statusLabel }}

Current Stock Value

₹{{ number_format($stockValue, 2) }}
{{-- ── Inventory Logs ──────────────────────────────────────────────── --}}

Inventory Logs

Total Stock In {{ $totalStockIn }}

Total Wastage {{ $totalWastage }}


@forelse ($logs as $log) @php $qtyClass = match(true) { $log->qty_change > 0 => 'status-green', $log->action_type === 'wastage' => 'color-orange', default => 'color-red', }; @endphp @empty @endforelse
Date & Time Action Type Qty Change Action By

{{ $log->created_at->format('d/m/Y') }}

{{ $log->created_at->format('h:i A') }}

@php $actionLabel = match($log->action_type) { 'stock_in' => 'Stock Added', 'wastage' => 'Wastage', 'order_placed' => 'Order Placed', 'order_cancelled' => 'Order Cancelled', default => ucwords(str_replace('_', ' ', $log->action_type)), }; @endphp

{{ $actionLabel }}

@if($log->reason)

{{ $log->reason }}

@endif
{{ $log->qty_change > 0 ? '+' : '' }}{{ $log->qty_change }} {{ $log->createdBy?->name ?? 'System' }}
No inventory logs yet.
@if ($logs->hasPages())
{{ $logs->links() }}
@endif
{{-- ── Update Stock Modal ──────────────────────────────────────────────────── --}} {{-- ── Update Wastage Modal ────────────────────────────────────────────────── --}} @endsection @section('scripts') @endsection