@foreach($customers as $customer) @php $qty_report = get_product_stocks($customer->id, $id); @endphp @endforeach
Customer Name Purchase Quantity Sell Quantity Available Quantity Action
{{ $customer->name }} ({{ $customer->user_id }}) {{ $qty_report['purchase_qty'] }} {{ $qty_report['sell_qty'] }} {{ $qty_report['available_qty'] }} Sell
{{-- @foreach($purchases as $purchase) @php $p_qty = 0; $s_qty = 0; @endphp @foreach($purchase->stock_item as $stock_item) @php $p_qty+=$stock_item->quantity; $s_qty+=$stock_item->sell_qty; @endphp @endforeach @endforeach
Customer Name Purchase Quantity Sell Quantity Available Quantity Action
{{ @$purchase->user->name }} ({{ @$purchase->user->user_id }}) {{ $p_qty }} {{ $s_qty }} {{ $p_qty-$s_qty }} Sell
--}}