changed logic of total box count in wire master print #803

Merged
jothi merged 1 commits from ranjith-dev into master 2026-07-06 06:43:07 +00:00
Showing only changes of commit abf33605f5 - Show all commits

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)