@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->product_code }}
| Variant: {{ $pricingLabel }}
| Group Under: {{ $product->group?->name ?? '—' }}
| Last Updated: {{ $pricing->stock_updated_at?->format('d/m/Y') ?? '—' }}
Available Stock Available Stock Low Stock Threshold Stock Status Current Stock Value {{ $log->created_at->format('d/m/Y') }} {{ $log->created_at->format('h:i A') }} {{ $actionLabel }} {{ $log->reason }}
{{ $product->name }}
@if($product->name_tamil)
({{ $product->name_tamil }})
@endif
{{ $statusLabel }}
{{ str_pad($pricing->stock_qty, 3, '0', STR_PAD_LEFT) }}
Stock Info
@forelse ($logs as $log)
Date & Time
Action Type
Qty Change
Action By
@empty
@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
@php
$qtyClass = match(true) {
$log->qty_change > 0 => 'status-green',
$log->action_type === 'wastage' => 'color-orange',
default => 'color-red',
};
@endphp
{{ $log->qty_change > 0 ? '+' : '' }}{{ $log->qty_change }}
{{ $log->createdBy?->name ?? 'System' }}
@endforelse
No inventory logs yet.