Fabrics History {{-- Fabrics History --}}
@if (is_null($fabricsChallanDataInputs) || empty($fabricsChallanDataInputs))

Currently No Information Available!

@else @if (session('message'))
× {{ session('message') }}.
@endif
{{-- --}}
NTG

Northern Tosrifa Group.


Holding No 4/2 A, Plot 49 & 57 135 Gopalpur Munnu Nagar, Tongi, Gazipur Bangladesh
BUYER NAME {{ $fabricsChallanDataInputs[0]['buyer_name'] }} ORDER / STYLE {{ $fabricsChallanDataInputs[0]['order_style'] }}
Sesson {{ $fabricsChallanDataInputs[0]['sesson'] }} Book No {{ $fabricsChallanDataInputs[0]['book_no'] }}
{{-- spl Table goes here --}}
@php $itemList = \App\Models\FabricsReceive::select('book_no', 'buyer_id', 'buyer_name', 'order_style', 'batch_id', 'color_name', 'lot', 'dia', 'gsm', 'cons_dz', 'parts', 'rack_no', 'self_bin_no','fabric_type', DB::raw('SUM(receive_qty) as total_receive_qty')) ->where('buyer_id', $fabricsChallanDataInputs[0]['buyer_id']) ->where('order_style', $fabricsChallanDataInputs[0]['order_style']) ->groupBy('book_no', 'buyer_id', 'buyer_name', 'order_style', 'batch_id', 'color_name', 'lot', 'dia', 'gsm', 'cons_dz', 'parts', 'rack_no', 'self_bin_no','fabric_type') ->get(); $dlv_cutting = \App\Models\FabricsIssue::select('book_no', 'buyer_id', 'buyer_name', 'order_style', 'batch_id', 'color_name', 'lot', 'dia', 'gsm', 'cons_dz', 'parts', 'rack_no', 'self_bin_no','fabric_type', DB::raw('SUM(dlv_cutting) as total_dlv_cutting')) ->where('buyer_id', $fabricsChallanDataInputs[0]['buyer_id']) ->where('order_style', $fabricsChallanDataInputs[0]['order_style']) ->groupBy('book_no', 'buyer_id', 'buyer_name', 'order_style', 'batch_id', 'color_name', 'lot', 'dia', 'gsm', 'cons_dz', 'parts', 'rack_no', 'self_bin_no','fabric_type') ->get(); // Calculate balance quantity for each item $balance_qty = []; foreach ($itemList as $item) { $found = false; foreach ($dlv_cutting as $issue) { if ($item->parts == $issue->parts) { $total_dlv_cutting[$item->parts] = $issue->total_dlv_cutting; $found = true; break; } } // If no issue found for a particular part, set balance_qty as total received qty if (!$found) { $total_dlv_cutting[$item->parts] = 0; } } foreach ($itemList as $item) { $found = false; foreach ($dlv_cutting as $issue) { if ($item->parts == $issue->parts) { $balance_qty[$item->parts] = $item->total_receive_qty - $issue->total_dlv_cutting; $found = true; break; } } // If no issue found for a particular part, set balance_qty as total received qty if (!$found) { $balance_qty[$item->parts] = 0; } } // dd($balance_qty) // dd($dlv_cutting, $itemList) // die @endphp @php $sl=0 @endphp @foreach ($itemList as $item) @endforeach
Sl# Book No Batch Id Type Name Total Receive Qty
@csrf
Total Issue Qty
@csrf
Balance Qty
{{ ++$sl }} {{ $item->book_no }} {{ $item->batch_id }} {{ $item->parts }} {{ $item->total_receive_qty }} {{ $total_dlv_cutting[$item->parts] ?? 0 }} {{ $balance_qty[$item->parts] ?? 0 }}
@endif
@csrf
@csrf