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

ملخص المشتريات حسب الفئة

تحليل تفصيلي للمشتريات موزعة حسب فئات المنتجات

@forelse($data as $index => $category) @empty @endforelse
# اسم الفئة عدد الأصناف الكمية الإجمالية المبلغ الإجمالي النسبة المئوية متوسط السعر
{{ $index + 1 }} {{ $category['category'] ?? 'بدون فئة' }} {{ $category['item_count'] ?? 0 }} {{ number_format($category['quantity'] ?? 0, 2) }} {{ number_format($category['total_amount'] ?? 0, 2) }} ريال
{{ number_format($data->sum('total_amount') > 0 ? ($category['total_amount'] / $data->sum('total_amount')) * 100 : 0, 1) }}%
{{ number_format($category['item_count'] > 0 ? $category['total_amount'] / $category['item_count'] : 0, 2) }} ريال

لا توجد بيانات متاحة

يرجى التحقق من معايير البحث المحددة

@if($data && count($data) > 0)

إجمالي الفئات

{{ count($data) }}

إجمالي الأصناف

{{ $data->sum('item_count') }}

إجمالي المشتريات

{{ number_format($data->sum('total_amount'), 2) }}

متوسط الفئة

{{ number_format($data->sum('total_amount') / count($data), 2) }}

الفئات الأكثر مشتريات

@foreach($data->take(3) as $topCategory)

{{ $topCategory['category'] ?? 'بدون فئة' }}

{{ number_format($topCategory['total_amount'], 2) }} ريال

{{ $topCategory['item_count'] }} صنف

@endforeach
@endif
تصدير Excel تصدير PDF تصدير CSV
@endsection