@extends('admin.layouts.master') @section('title', 'تقرير المخزون') @section('page-header') @include('admin.reports._header', [ 'title' => 'تقرير المخزون الشامل', 'subtitle' => 'تحليل قيمة المخزون والأصناف منخفضة الرصيد', 'icon' => 'ti-building-warehouse', 'color' => 'success', ]) @endsection @php $totalItems = $stocks->groupBy('item_id')->count(); $lowStockCount = $lowStock->count(); $byCategory = $byCategory->sortByDesc('value'); $insights = []; if ($lowStockCount > 0) $insights[] = ['type'=>'warning', 'text'=>"{$lowStockCount} صنف وصل للحد الأدنى - يحتاج إعادة طلب"]; if ($totalValue > 0 && $byCategory->isNotEmpty()) { $top = $byCategory->first(); $pct = round($top['value'] / $totalValue * 100, 1); if ($pct > 50) $insights[] = ['type'=>'warning', 'text'=>"".$top['category']." يمثل {$pct}% من قيمة المخزون - تركز عالي"]; } @endphp @section('content')
| الفئة | عدد الأصناف | القيمة (ج) | النسبة |
|---|---|---|---|
| {{ $row['category'] }} | {{ $row['items'] }} | {{ number_format($row['value'], 0) }} |
{{ $pct }}%
|
| الكود | الصنف | الفئة | الرصيد الحالي | الحد الأدنى | نقطة الطلب | الحالة |
|---|---|---|---|---|---|---|
{{ $item->code }} |
{{ $item->name }} | {{ $item->category?->name ?? '-' }} | {{ number_format($stock, 2) }} {{ $item->unit?->short_name }} | {{ number_format($item->min_stock, 2) }} | {{ number_format($item->reorder_point, 2) }} | @if($stock <= 0) نفذ @elseif($stock <= $item->min_stock) حرج @else منخفض @endif |
كل الأصناف بمستوى آمن | ||||||