|
|
|
@ -15,7 +15,7 @@ |
|
|
|
0 as totalLabels, |
|
|
|
0 as availableLabels, |
|
|
|
SUM(CAST(d.required_qty AS float)) as totalQty, |
|
|
|
ISNULL(d.actual_out_qty,0) as availableQty, |
|
|
|
SUM(CAST(d.actual_out_qty AS float)) as availableQty, |
|
|
|
h.required_outbound_date AS createDate |
|
|
|
FROM outbound_notification_head h |
|
|
|
INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no |
|
|
|
@ -23,17 +23,14 @@ |
|
|
|
AND h.order_type = '销售出库' |
|
|
|
AND h.close_flag = 'N' |
|
|
|
AND h.order_status = '待出库' |
|
|
|
AND d.out_warehouse = #{warehouseId} |
|
|
|
AND d.out_warehouse = #{warehouseId} and d.show_flag = 'Y' |
|
|
|
<if test="searchCode != null and searchCode != ''"> |
|
|
|
AND ( |
|
|
|
h.order_no LIKE CONCAT('%', #{searchCode}, '%') |
|
|
|
OR d.related_order_no LIKE CONCAT('%', #{searchCode}, '%') |
|
|
|
) |
|
|
|
</if> |
|
|
|
<!-- <if test="searchCode == null or searchCode == ''">--> |
|
|
|
<!-- AND CONVERT(DATE, h.required_outbound_date) = CONVERT(DATE, GETDATE())--> |
|
|
|
<!-- </if>--> |
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no, d.actual_out_qty |
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no |
|
|
|
ORDER BY h.required_outbound_date DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
@ -49,14 +46,14 @@ |
|
|
|
0 as totalLabels, |
|
|
|
0 as availableLabels, |
|
|
|
SUM(CAST(d.required_qty AS float)) as totalQty, |
|
|
|
ISNULL(d.actual_out_qty,0) as availableQty, |
|
|
|
SUM(CAST(d.actual_out_qty AS float)) as availableQty, |
|
|
|
h.required_outbound_date AS createDate |
|
|
|
FROM outbound_notification_head h |
|
|
|
INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no |
|
|
|
WHERE h.order_no = #{outboundNo} |
|
|
|
AND h.site = #{site} |
|
|
|
AND h.bu_no = #{buNo} |
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no, d.actual_out_qty |
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 验证标签与销售出库单是否匹配 --> |
|
|
|
|