@extends('layouts.app') @section('content')

Item Details: {{ $item->name }}

Edit Back
Item Code
{{ $item->code }}
Item Name
{{ $item->name }}
@php $isLowStock = $item->current_stock <= $item->minimum_stock && $item->minimum_stock > 0; @endphp
Current Stock @if($isLowStock) @endif
{{ number_format($item->current_stock, 2) }} {{ $item->unit }}

Item Information

Type: @php $typeLabels = ['raw' => 'RAW Material', 'finish' => 'FINISH Product']; $typeColors = ['raw' => ['#fef3c7', '#92400e'], 'finish' => ['#dcfce7', '#166534']]; @endphp {{ $typeLabels[$item->type] ?? strtoupper($item->type) }}
Unit: {{ $item->unit }}
Description: {{ $item->description ?: '-' }}
Status: @if($item->is_active) Active @else Inactive @endif
Created: {{ $item->created_at->format('d M Y, h:i A') }}
Last Updated: {{ $item->updated_at->format('d M Y, h:i A') }}

Pricing & Stock

Purchase Price: Rs. {{ number_format($item->purchase_price, 2) }}
Sale Price: Rs. {{ number_format($item->sale_price, 2) }}
Profit Margin: @php $margin = $item->purchase_price > 0 ? (($item->sale_price - $item->purchase_price) / $item->purchase_price) * 100 : 0; @endphp {{ number_format($margin, 2) }}%
Opening Stock: {{ number_format($item->opening_stock, 2) }} {{ $item->unit }}
Current Stock: {{ number_format($item->current_stock, 2) }} {{ $item->unit }}
Minimum Stock: {{ number_format($item->minimum_stock, 2) }} {{ $item->unit }}
Stock Value: Rs. {{ number_format($item->current_stock * $item->purchase_price, 2) }}

Recent Purchases

@if($item->purchaseItems && $item->purchaseItems->count() > 0) @foreach($item->purchaseItems->take(10) as $purchaseItem) @endforeach
Bill No Date Qty Rate Amount
{{ $purchaseItem->purchase->bill_no }} {{ \Carbon\Carbon::parse($purchaseItem->purchase->date)->format('d M Y') }} {{ number_format($purchaseItem->quantity, 2) }} {{ number_format($purchaseItem->rate, 2) }} Rs. {{ number_format($purchaseItem->amount, 2) }}
@else

No purchases found for this item.

@endif

Recent Sales

@if($item->saleItems && $item->saleItems->count() > 0) @foreach($item->saleItems->take(10) as $saleItem) @endforeach
Bill No Date Qty Rate Amount
{{ $saleItem->sale->bill_no }} {{ \Carbon\Carbon::parse($saleItem->sale->date)->format('d M Y') }} {{ number_format($saleItem->quantity, 2) }} {{ number_format($saleItem->rate, 2) }} Rs. {{ number_format($saleItem->amount, 2) }}
@else

No sales found for this item.

@endif
@endsection