@ -315,11 +315,11 @@
ldr.consignee consignee,
ldr.reservation_num reservationNum,
COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id ) ordNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub,
COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40'
WHERE
lds.is_deleted = 0
AND lds.delivery_id = #{id}
@ -337,12 +337,12 @@
lbm.logpm_unit logpmUnit
FROM
logpm_distribution_reservation ldr
join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id
join logpm_distribution_reservation_stocklist ldrs on ldr.id = ldrs.reservation_id and ldrs.stock_article_status in (1,3)
join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id
LEFT JOIN logpm_distribution_loadscaninvn ldl on ldsl.id = ldl.inventory_id
left join logpm_basicdata_material lbm on ldsl.material_id = lbm.id
<where >
ldr.is_deleted = 0
ldr.is_deleted = 0 and ldr.reservation_status != '40'
AND ldr.id = #{param.reservationId}
</where>
</select>
@ -367,7 +367,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
@ -406,7 +406,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where >
@ -442,7 +442,7 @@
GROUP BY
ldsa.id
) AS loading
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id
JOIN logpm_distribution_reservation_stockarticle ldrs ON loading.stock_article_id = ldrs.stock_article_id and ldrs.stock_article_status in (1,3)
JOIN logpm_distribution_reservation ldr ON ldr.id = ldrs.reservation_id
JOIN logpm_distribution_stock_article ldsa ON ldsa.id = ldrs.stock_article_id
<where >