Merge pull request 'changed logic in wire pallet print' (#821) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #821
This commit was merged in pull request #821.
This commit is contained in:
2026-07-08 05:49:11 +00:00

View File

@@ -163,6 +163,11 @@ class PalletPrintController extends Controller
public function print(Request $request, $pallet, $plant) public function print(Request $request, $pallet, $plant)
{ {
$customerPo = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet)
// ->value('customer_po_master_id');
->value('customer_po');
$customerPoMasterId = WireMasterPacking::where('plant_id', $plant) $customerPoMasterId = WireMasterPacking::where('plant_id', $plant)
->where('wire_packing_number', $pallet) ->where('wire_packing_number', $pallet)
->value('customer_po_master_id'); ->value('customer_po_master_id');
@@ -186,7 +191,8 @@ class PalletPrintController extends Controller
$customerName = $customer->customer_name ?? ''; $customerName = $customer->customer_name ?? '';
$totalBoxes = WireMasterPacking::where('plant_id', $plant) $totalBoxes = WireMasterPacking::where('plant_id', $plant)
->where('customer_po_master_id', $customerPoMasterId) // ->where('customer_po_master_id', $customerPoMasterId)
->where('customer_po', $customerPo)
->select('wire_packing_number') ->select('wire_packing_number')
->groupBy('wire_packing_number') ->groupBy('wire_packing_number')
->havingRaw( ->havingRaw(
@@ -195,8 +201,20 @@ class PalletPrintController extends Controller
) )
->count(); ->count();
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerPo)
// ->select('wire_packing_number')
// ->groupBy('wire_packing_number')
// ->havingRaw(
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
// ['Completed']
// )
// ->orderBy('wire_packing_number')
// ->pluck('wire_packing_number')
// ->values();
$completedPallets = WireMasterPacking::where('plant_id', $plant) $completedPallets = WireMasterPacking::where('plant_id', $plant)
->where('customer_po_master_id', $customerPoMasterId) ->where('customer_po', $customerPo)
->select('wire_packing_number') ->select('wire_packing_number')
->groupBy('wire_packing_number') ->groupBy('wire_packing_number')
->havingRaw( ->havingRaw(