@extends('layouts.admin-simple') @section('title', 'Item Details - ' . $item->item_code) @section('breadcrumb') @endsection @section('page-title')

{{ $item->item_code }} - Detailed Analysis

{{ $item->item_description }}

arrow_back Back to Report
@endsection @section('content')
info Item Information
Item Code: {{ $item->item_code }}
Description: {{ $item->item_description }}
Category: {{ $item->category->category_name ?? 'Unknown' }}
Unit of Measure: {{ $item->unit_of_measure }}
Total Quantity: {{ number_format($inventoryDetails->sum('quantity'), 2) }} {{ $item->unit_of_measure }}
Total Value: AED {{ number_format($inventoryDetails->sum('total_value'), 2) }}
Purchase History: {{ $pricingHistory->count() }} purchase operations
Storage Locations: {{ $inventoryDetails->groupBy('division')->count() }} divisions
attach_money Purchase Price History ({{ $pricingHistory->count() }} records)
@forelse($pricingHistory as $purchase) @empty @endforelse
Date Operation Supplier Quantity Unit Price (Original) Unit Price (د.إ) Total Value (د.إ) Batch
{{ $purchase->date->format('d M, Y') }} {{ $purchase->operation_number }} {{ $purchase->supplier }} {{ number_format($purchase->quantity, 2) }} {{ $purchase->currency }} {{ number_format($purchase->original_unit_price, 2) }} AED {{ number_format($purchase->unit_price, 2) }} AED {{ number_format($purchase->total_price, 2) }} {{ $purchase->batch_number ?: '-' }}
No purchase history found
inventory_2 Current Inventory Breakdown ({{ $inventoryDetails->count() }} batches)
@forelse($inventoryDetails as $inventory) @empty @endforelse
Division Location Batch Number Quantity Unit Price Total Value Production Date Expiry Date Days to Expiry Status
{{ $inventory->division }} {{ $inventory->location ?: '-' }} {{ $inventory->batch_number ?: '-' }} {{ number_format($inventory->quantity, 2) }} {{ $item->unit_of_measure }} AED {{ number_format($inventory->unit_price, 2) }} AED {{ number_format($inventory->total_value, 2) }} {{ $inventory->production_date ? $inventory->production_date->format('d M, Y') : '-' }} @if($inventory->expiry_date) {{ $inventory->expiry_date->format('d M, Y') }} @else - @endif @if($inventory->days_until_expiry !== null) @if($inventory->days_until_expiry < 0) Expired ({{ abs($inventory->days_until_expiry) }} days ago) @elseif($inventory->days_until_expiry <= 30) {{ $inventory->days_until_expiry }} days @else {{ $inventory->days_until_expiry }} days @endif @else - @endif {{ ucfirst(str_replace('_', ' ', $inventory->status)) }}
No current inventory found
analytics Price Analysis
@if($pricingHistory->count() > 0)
Lowest Purchase Price: AED {{ number_format($pricingHistory->min('unit_price'), 2) }}
Highest Purchase Price: AED {{ number_format($pricingHistory->max('unit_price'), 2) }}
Average Purchase Price: AED {{ number_format($pricingHistory->avg('unit_price'), 2) }}
Current Weighted Average: AED {{ $inventoryDetails->sum('quantity') > 0 ? number_format($inventoryDetails->sum('total_value') / $inventoryDetails->sum('quantity'), 2) : '0.00' }}
Price Variance: AED {{ number_format($pricingHistory->max('unit_price') - $pricingHistory->min('unit_price'), 2) }}
@else

No pricing data available

@endif
donut_large Inventory Distribution
@if($inventoryDetails->count() > 0)
@foreach($inventoryDetails->groupBy('division') as $division => $items)
{{ $division }}
{{ $items->count() }} batches
{{ number_format($items->sum('quantity'), 2) }} {{ $item->unit_of_measure }}
AED {{ number_format($items->sum('total_value'), 2) }}
@endforeach
@else

No inventory distribution data available

@endif
@endsection @push('styles') @endpush @push('scripts') @endpush