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

تقرير أرصدة المخزون

عرض رصيد كل صنف في كل مخزن

@if(session('success'))

{{ session('success') }}

@endif

تصفية البيانات

@if (count($stockBalances) > 0) @php $itemBalances = []; $balances = []; foreach ($stockBalances as $item) { $key = $item->name . '_' . $item->warehouse_name; $itemBalances[$item->name] = $item->current_quantity; } $finalBalance = array_sum($itemBalances); @endphp

عدد الأصناف

{{ $statistics['count'] }}

إجمالي الكمية

{{ number_format($statistics['total_quantity'], 2) }}

متوسط الكمية

{{ number_format($statistics['average_quantity'], 2) }}

الرصيد النهائي

{{ number_format($finalBalance, 2) }}

@endif
@php $balances = []; foreach ($stockBalances as $mov) { $key = $mov->name . '_' . ($mov->warehouse_name ?? 'unknown'); $currentBalance = $balances[$key] ?? 0; if (isset($mov->inbound_qty) && $mov->inbound_qty > 0) { $currentBalance += floatval($mov->inbound_qty); } elseif (isset($mov->outbound_qty) && $mov->outbound_qty > 0) { $currentBalance -= floatval($mov->outbound_qty); } else { $currentBalance = $mov->current_quantity; } $balances[$key] = $currentBalance; $mov->running_balance = $currentBalance; } @endphp @forelse($stockBalances as $item) @empty @endforelse
# التاريخ نوع الحركة الصنف وارد منصرف محول الرصيد الوحدة من / إلى المستند
{{ $loop->iteration }} - أرصدة {{ $item->name ?? '-' }} الرصيد: {{ number_format($item->current_quantity, 2) }} - - - {{ number_format($item->current_quantity, 2) }} {{ $item->primary_unit_name ?? '-' }} {{ $item->warehouse_name ?? '-' }} {{ $item->code ?? '-' }}

لا توجد بيانات

ابدأ بإضافة حركة للمخزن

@endsection