{{-- spl Table goes here --}}
@php
$itemList = \App\Models\TrimsReceive::select('item_name', 'itemList_id', DB::raw('SUM(receive_qty) as total_receive_qty'))
->where('buyer_id', $trimsChallanDataInputs[0]['buyer_id'])
->where('order_style', $trimsChallanDataInputs[0]['order_style'])
->groupBy('item_name', 'itemList_id')
->get();
$issue_qty = DB::table('trims_issues')
->select('item_name', 'itemList_id', DB::raw('SUM(issue_qty) as total_issue_qty'))
->where('buyer_id', $trimsChallanDataInputs[0]['buyer_id'])
->where('order_style', $trimsChallanDataInputs[0]['order_style'])
->groupBy('item_name', 'itemList_id')
->get();
foreach ($itemList as $item) {
foreach ($issue_qty as $issue) {
if ($item->itemList_id == $issue->itemList_id) {
$balance_qty = $item->total_receive_qty - $issue->total_issue_qty;
} else {
$balance_qty = $item->total_receive_qty;
}
}
}
@endphp
Sl# |
Item Name |
Total Receive Qty |
Total Issue Qty
|
Balance Qty |
@php $sl=0 @endphp
@foreach ($itemList as $item)
{{ ++$sl }} |
{{ $item->item_name }} |
{{ $item->total_receive_qty }}
|
@foreach ($issue_qty as $issue)
@if ($item->itemList_id == $issue->itemList_id)
{{ $issue->total_issue_qty }}
@endif
@endforeach
|
@foreach ($issue_qty as $issue)
@if ($item->itemList_id == $issue->itemList_id)
{{ $item->total_receive_qty - $issue->total_issue_qty }}
@endif
@endforeach
|
@endforeach