@extends('layouts.app') @section('title', 'Product Details - ' . $product->name) @section('content')
Product Details: {{ $product->name }}
@csrf @method('DELETE')
{{-- ═══════════════════════════════════════════════════════════ --}} {{-- LEFT SIDEBAR: Product Profile Card --}} {{-- ═══════════════════════════════════════════════════════════ --}}
{{-- Image Area --}}
@if($product->image) {{ $product->name }} @else
@endif {{-- Status Badge Overlay --}}
@if($product->is_active) ACTIVE @else INACTIVE @endif
{{-- Profile Info --}}
{{ $product->name }}
{{ $product->code }} @if($product->category) {{ $product->category }} @endif
Unit Price LKR {{ number_format($product->unit_price, 2) }}
UOM {{ $product->unit_of_measure ?? 'Each' }}
Created {{ $product->created_at->format('d M, Y') }}
{{-- Quick Actions Footer --}}
{{-- ═══════════════════════════════════════════════════════════ --}} {{-- RIGHT CONTENT: Details Cards --}} {{-- ═══════════════════════════════════════════════════════════ --}}
{{-- ROW 1: Key Metric Cards --}}
{{-- Available Stock --}}
Available Stock
{{ number_format($product->actual_stock) }}
{{ $product->unit_of_measure ?? 'Units' }}
{{-- Reorder Level --}}
Reorder Level
{{ number_format($product->reorder_level) }}
Alert Threshold
{{-- Total Value --}}
Total Value
@php $totalVal = $product->unit_price * $product->actual_stock; @endphp {{ $totalVal >= 1000000 ? number_format($totalVal / 1000000, 1) . 'M' : number_format($totalVal, 0) }}
LKR On-Hand
{{-- Last Updated --}}
Last Updated
{{ $product->updated_at->format('d M, Y') }}
{{ $product->updated_at->format('h:i A') }}
{{-- ROW 2: Description Card --}}
Description

{{ $product->description ?: 'No detailed description provided for this POSM asset.' }}

{{-- ROW 3: Stock Health & Product Details --}}
{{-- Stock Health Card --}}
Stock Health
@php $stockPct = $product->reorder_level > 0 ? min(100, ($product->actual_stock / ($product->reorder_level * 2)) * 100) : ($product->actual_stock > 0 ? 100 : 0); $isLow = $product->actual_stock <= $product->reorder_level && $product->reorder_level > 0; @endphp @if($isLow) LOW STOCK @else HEALTHY @endif
{{-- Progress Bar --}}
Stock Level {{ round($stockPct) }}%
{{-- Stock Breakdown --}}
On Hand
{{ number_format($product->actual_stock) }}
Reorder Point
{{ number_format($product->reorder_level) }}
{{-- Product Specifications Card --}}
Product Specifications
SKU Code {{ $product->code }}
Category {{ $product->category ?? 'N/A' }}
Unit Price LKR {{ number_format($product->unit_price, 2) }}
Unit of Measure {{ $product->unit_of_measure ?? 'Each' }}
Status @if($product->is_active) Active @else Inactive @endif
{{-- ROW 4: Timeline / Audit Info --}}
Activity Timeline
Created
{{ $product->created_at->format('d M, Y') }}
{{ $product->created_at->format('h:i A') }}
Last Modified
{{ $product->updated_at->format('d M, Y') }}
{{ $product->updated_at->format('h:i A') }}
Record ID
#{{ str_pad($product->id, 5, '0', STR_PAD_LEFT) }}
System Reference
@endsection @push('css') @endpush