@extends('layouts.admin-simple') @section('title', $good->ig_description) @section('breadcrumb') @endsection @section('page-title')

{{ $good->ig_description }}

IG Code: {{ $good->ig_code }}

arrow_back Back to List @can('warehouse.indirect-goods.edit') edit Edit @endcan
@endsection @section('content')
Indirect Good Information
Basic Information
IG Code
{{ $good->ig_code }}
Description
{{ $good->ig_description }}
Category
@if($good->category) {{ $good->category->category_name }} @else No category assigned @endif
Unit of Measure
{{ $good->unit ? $good->unit->display_name : $good->unit_of_measure }}
Status
@if($good->status === 'active') Active @else Inactive @endif
Created Date
{{ $good->created_at ? $good->created_at->format('M d, Y H:i') : 'N/A' }}
Last Updated
{{ $good->updated_at ? $good->updated_at->format('M d, Y H:i') : 'N/A' }}
Stock Information
Min Stock Level
{{ $good->min_stock_level ? number_format($good->min_stock_level, 2) : 'Not set' }}
Max Stock Level
{{ $good->max_stock_level ? number_format($good->max_stock_level, 2) : 'Not set' }}
Reorder Point
{{ $good->reorder_point ? number_format($good->reorder_point, 2) : 'Not set' }}
Current Stock
@php $totalStock = $good->total_quantity; @endphp @if($good->is_out_of_stock) {{ number_format($totalStock, 2) }} {{ $good->unit ? $good->unit->unit_symbol : $good->unit_of_measure }} Out of Stock @elseif($good->below_reorder_point) {{ number_format($totalStock, 2) }} {{ $good->unit ? $good->unit->unit_symbol : $good->unit_of_measure }} Low Stock @else {{ number_format($totalStock, 2) }} {{ $good->unit ? $good->unit->unit_symbol : $good->unit_of_measure }} @endif
Avg Unit Price
AED {{ number_format($good->average_unit_price, 2) }}
Inventory Batches
{{ $good->inventories->count() }} batch(es)
@if($good->notes)
Notes

{{ $good->notes }}

@endif
@if($good->inventories->count() > 0)
Inventory Batches
{{ $good->inventories->count() }} batch(es)
@foreach($good->inventories as $index => $inv) @endforeach
# Division Supplier Batch / Invoice Qty Available Unit Price Total Value Location Expiry Date Status
{{ $index + 1 }} {{ $inv->division ? $inv->division->division_name : 'N/A' }} {{ $inv->supplier ? $inv->supplier->supplier_name : 'N/A' }} @if($inv->batch_number) {{ $inv->batch_number }}
@endif @if($inv->invoice_number) Inv: {{ $inv->invoice_number }} @endif
@if($inv->quantity_available <= 0) {{ number_format($inv->quantity_available, 2) }} @else {{ number_format($inv->quantity_available, 2) }} @endif AED {{ number_format($inv->unit_price, 2) }} AED {{ number_format($inv->total_value, 2) }} {{ $inv->location ?? 'N/A' }} @if($inv->expiry_date) @if($inv->expiry_date->isPast()) {{ $inv->expiry_date->format('M d, Y') }}
Expired @elseif($inv->expiry_date->diffInDays(now()) <= 30) {{ $inv->expiry_date->format('M d, Y') }}
Expiring soon @else {{ $inv->expiry_date->format('M d, Y') }} @endif @else N/A @endif
@if($inv->status === 'in_stock') In Stock @elseif($inv->status === 'low_stock') Low Stock @elseif($inv->status === 'out_of_stock') Out of Stock @else {{ ucfirst(str_replace('_', ' ', $inv->status ?? 'unknown')) }} @endif
Totals: {{ number_format($good->inventories->sum('quantity_available'), 2) }} - AED {{ number_format($good->inventories->sum('total_value'), 2) }}
@endif @if($stockMovements->count() > 0)
Recent Stock Movements
Last 20 movements
@foreach($stockMovements as $movement) @php $badgeClass = match($movement->movement_type) { 'in' => 'badge-success', 'out' => 'badge-danger', 'return' => 'badge-info', 'adjustment' => 'badge-warning', 'transfer' => 'badge-primary', default => 'badge-secondary' }; $badgeText = match($movement->movement_type) { 'in' => 'Stock In', 'out' => 'Stock Out', 'return' => 'Return', 'adjustment' => 'Adjustment', 'transfer' => 'Transfer', default => ucfirst($movement->movement_type) }; $isIncrease = in_array($movement->movement_type, ['in', 'return', 'transfer_in']) || ($movement->movement_type === 'adjustment' && $movement->quantity_after > $movement->quantity_before); @endphp @endforeach
Date Type Quantity Before After Division Invoice # User Notes
{{ $movement->created_at->format('M d, Y H:i') }} {{ $badgeText }} @if($isIncrease) +{{ number_format($movement->quantity_moved, 2) }} @else -{{ number_format($movement->quantity_moved, 2) }} @endif {{ $good->unit ? $good->unit->unit_symbol : $good->unit_of_measure }} {{ number_format($movement->quantity_before, 2) }} {{ number_format($movement->quantity_after, 2) }} {{ $movement->division ? $movement->division->division_name : 'N/A' }} @if($movement->invoice_number) {{ $movement->invoice_number }} @else - @endif {{ $movement->user ? $movement->user->name : 'System' }} {{ $movement->notes ?? '-' }}
@endif @endsection @push('styles') @endpush