Consolidated Product Summary
Product Name: {{ $item->name }}
| #SL | Unit Name | Avalable Qty | Avarage Price | Value |
|---|---|---|---|---|
| {{ $key + 1 }} | {{ $unit->name }} | @php $abalavailqty = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('qty') - App\GoodsIssueProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('qty'); $count = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->count('qty'); if ($count != 0) { $price = App\GoodsinProduct::where('unit_id', $unit->id) ->where('product_id', $item->id) ->sum('price') / $count; if ($abalavailqty != 0) { $averageprice = $price; } else { $averageprice = 0; } } else { $averageprice = 0; } $totalprice = $averageprice * $abalavailqty; @endphp{{ $abalavailqty }} | {{ round($averageprice, 2) }} | {{ round($totalprice, 2) }} |
| Grand Total (BDT) | {{ number_format($total_cash,2) }} | {{ number_format($total_credit,2) }} | {{ number_format($total_cash + $total_credit,2) }} | |