@props(['loading' => false])
@php
$lowStockCount = $loading ? 0 : \App\Models\Warehouse\Inventory::join('items', 'inventory.item_id', '=', 'items.id')
->where('items.reorder_point', '>', 0)
->where('inventory.quantity_available', '>', 0)
->whereColumn('inventory.quantity_available', '<=', 'items.reorder_point')
->count();
@endphp
@php
$todayIncoming = $loading ? 0 : \App\Models\Warehouse\IncomingOperation::whereDate('created_at', today())->count();
@endphp
@php
$todayOutgoing = $loading ? 0 : \App\Models\Warehouse\OutgoingTransaction::whereDate('created_at', today())->count();
@endphp
@php
$activeSuppliers = $loading ? 0 : \App\Models\Warehouse\Supplier::where('status', 'active')->count();
@endphp