(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_loadscan ldl WHERE ldl.order_id = ldsa.id AND ldl.scan_status != 1 AND ldl.signfor_state = 2) AS signforNub,
(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_loadscan ldl WHERE ldl.order_id = ldsa.id AND ldl.scan_status != 1 AND ldl.signfor_state = 1) AS loadingNub
FROM
logpm_distribution_reservation ldr
JOIN logpm_distribution_reservation_stockarticle ldrs ON ldr.id = ldrs.reservation_id
@ -731,7 +728,8 @@
FROM logpm_distribution_loadscan ldl
WHERE ldl.order_id = ldsa.id
AND ldl.scan_status != 1
AND ldl.signfor_state = 2) AS signforNub
AND ldl.signfor_state = 2) AS signforNub,
(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_loadscan ldl WHERE ldl.order_id = ldsa.id AND ldl.scan_status != 1 AND ldl.signfor_state = 1) AS loadingNub
FROM
logpm_distribution_reservation ldr
JOIN logpm_distribution_reservation_stockarticle ldrs ON ldr.id = ldrs.reservation_id
@ -761,7 +759,8 @@
FROM logpm_distribution_loadscan ldl
WHERE ldl.order_id = ldsa.id
AND ldl.scan_status != 1
AND ldl.signfor_state = 2) AS signforNub
AND ldl.signfor_state = 2) AS signforNub,
(SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_loadscan ldl WHERE ldl.order_id = ldsa.id AND ldl.scan_status != 1 AND ldl.signfor_state = 1) AS loadingNub
FROM
logpm_distribution_reservation ldr
JOIN logpm_distribution_reservation_stockarticle ldrs ON ldr.id = ldrs.reservation_id