@extends('layouts.app') @push('style') @endpush @section('main')

Product Stock Report

Total Products {{ number_format($totalProducts) }}
Total Stock Quantity {{ number_format($totalStock) }}
Total Stock Value BHD {{ number_format($totalBuyValue, 2) }}
Potential Revenue BHD {{ number_format($totalSellValue, 2) }}
In Stock (Good) {{ $inStockProducts }}
Low Stock (≤5) {{ $lowStockCount }}
Out of Stock {{ $outOfStockCount }}

Stock by Condition

Stock by Type

{{ number_format($newConditionStock) }}

New Condition Stock

Value: BHD {{ number_format($newConditionValue, 2) }}

{{ number_format($usedConditionStock) }}

Used Condition Stock

Value: BHD {{ number_format($usedConditionValue, 2) }}

{{ number_format($refurbishedConditionStock) }}

Refurbished Stock

Value: BHD {{ number_format($refurbishedConditionValue, 2) }}

{{ number_format($oldConditionStock) }}

Old Condition Stock

Value: BHD {{ number_format($oldConditionValue, 2) }}

Top 10 Most Valuable Products by Stock Value

@foreach($topValueProducts as $index => $product) @endforeach
Rank Product Name Brand Model Stock Qty Buy Price Total Value Condition
@if($index == 0) @elseif($index == 1) @elseif($index == 2) @else {{ $index + 1 }} @endif {{ $product->name ?? 'N/A' }} @php $brandName = $product->brand; if (is_numeric($brandName)) { $brand = \App\Models\Brand::find($brandName); $brandName = $brand ? $brand->name : 'Unknown Brand'; } @endphp {{ $brandName }} @php $modelName = $product->model; if (is_numeric($modelName)) { $mobileModel = \App\Models\MobileModel::find($modelName); $modelName = $mobileModel ? $mobileModel->name : 'Unknown Model'; } @endphp {{ $modelName }} {{ $product->stock }} BHD {{ number_format($product->buy_price, 2) }} BHD {{ number_format($product->buy_price * $product->stock, 2) }} @switch($product->condition) @case('new') New @break @case('used') Used @break @case('refurbished') Refurbished @break @default {{ ucfirst($product->condition) }} @endswitch
@if($lowStockProducts->count() > 0)

Low Stock Alert (Stock ≤ 5)

@foreach($lowStockProducts as $product) @endforeach
Product Name Brand Model Current Stock Buy Price Total Value Status Action
{{ $product->name ?? 'N/A' }} @php $brandName = $product->brand; if (is_numeric($brandName)) { $brand = \App\Models\Brand::find($brandName); $brandName = $brand ? $brand->name : 'Unknown Brand'; } @endphp {{ $brandName }} @php $modelName = $product->model; if (is_numeric($modelName)) { $mobileModel = \App\Models\MobileModel::find($modelName); $modelName = $mobileModel ? $mobileModel->name : 'Unknown Model'; } @endphp {{ $modelName }} {{ $product->stock }} BHD {{ number_format($product->buy_price, 2) }} BHD {{ number_format($product->buy_price * $product->stock, 2) }} @if($product->stock <= 0) Out of Stock @else Low Stock @endif Restock
@endif

Complete Product Stock Details

@foreach($products as $product) @endforeach
ID Product Name Type Brand Model IMEI/SN Condition Stock Qty Buy Price Total Value Stock Status Last Updated
{{ $product->id }} {{ $product->name ?? 'N/A' }} @php $productType = $product->type ?? 'Phone'; @endphp {{ $productType }} @php $brandName = $product->brand; if (is_numeric($brandName)) { $brand = \App\Models\Brand::find($brandName); $brandName = $brand ? $brand->name : 'Unknown Brand'; } @endphp {{ $brandName }} @php $modelName = $product->model; if (is_numeric($modelName)) { $mobileModel = \App\Models\MobileModel::find($modelName); $modelName = $mobileModel ? $mobileModel->name : 'Unknown Model'; } @endphp {{ $modelName }} {{ $product->imei_or_sn ?: 'N/A' }} @switch($product->condition) @case('new') New @break @case('used') Used @break @case('refurbished') Refurbished @break @default {{ ucfirst($product->condition) }} @endswitch {{ $product->stock }} BHD {{ number_format($product->buy_price, 2) }} BHD {{ number_format($product->buy_price * $product->stock, 2) }} @if($product->stock <= 0) Out of Stock @elseif($product->stock <= 5) Low Stock @else In Stock @endif {{ $product->updated_at ? $product->updated_at->format('d M, Y H:i') : 'N/A' }}
TOTALS: {{ number_format($totalStock) }} - BHD {{ number_format($totalBuyValue, 2) }} -
@endsection @push('script') @endpush