changed logic of total box count in wire master print
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 3m57s
Laravel Larastan / larastan (pull_request) Failing after 5m44s

This commit is contained in:
dhanabalan
2026-07-06 12:12:55 +05:30
parent 60eb3c05a5
commit abf33605f5

View File

@@ -201,10 +201,20 @@ class PalletPrintController extends Controller
// ->distinct('wire_packing_number') // ->distinct('wire_packing_number')
// ->count('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) $totalBoxes = WireMasterPacking::where('plant_id', $plant)
->whereIn('customer_po_master_id', $customerPoIds) ->whereIn('customer_po_master_id', $customerPoIds)
->distinct('wire_packing_number') ->select('wire_packing_number')
->count('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) // $completedPallets = WireMasterPacking::where('plant_id', $plant)
// ->where('customer_po_master_id', $customerId) // ->where('customer_po_master_id', $customerId)