1
0
forked from poc/pds

Merge pull request 'changed logic of total box count in wire master print' (#803) from ranjith-dev into master

Reviewed-on: poc/pds#803
This commit is contained in:
2026-07-06 06:43:06 +00:00

View File

@@ -201,10 +201,20 @@ class PalletPrintController extends Controller
// ->distinct('wire_packing_number')
// ->count('wire_packing_number');
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
// ->whereIn('customer_po_master_id', $customerPoIds)
// ->distinct('wire_packing_number')
// ->count('wire_packing_number');
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
->whereIn('customer_po_master_id', $customerPoIds)
->distinct('wire_packing_number')
->count('wire_packing_number');
->select('wire_packing_number')
->groupBy('wire_packing_number')
->havingRaw(
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
['Completed']
)
->count();
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerId)