|
|
@ -16,10 +16,10 @@ |
|
|
<!-- SUM(CAST(d.required_qty AS float)) as totalQty,--> |
|
|
<!-- SUM(CAST(d.required_qty AS float)) as totalQty,--> |
|
|
<!-- 0 as availableQty,--> |
|
|
<!-- 0 as availableQty,--> |
|
|
h.customer_id as customerId, |
|
|
h.customer_id as customerId, |
|
|
C.CustomerName as customerName |
|
|
|
|
|
|
|
|
C.SupplierName as customerName |
|
|
FROM outbound_notification_head h |
|
|
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 |
|
|
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 |
|
|
INNER JOIN Customer C ON H.site = C.Site AND H.customer_id = C.CustomerID |
|
|
|
|
|
|
|
|
INNER JOIN Supplier C ON H.site = C.Site AND H.customer_id = C.SupplierID |
|
|
WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName}) |
|
|
WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName}) |
|
|
AND h.order_type = '采购退货' |
|
|
AND h.order_type = '采购退货' |
|
|
AND h.close_flag = 'N' |
|
|
AND h.close_flag = 'N' |
|
|
@ -34,7 +34,7 @@ |
|
|
<!-- <if test="searchCode == null or searchCode == ''">--> |
|
|
<!-- <if test="searchCode == null or searchCode == ''">--> |
|
|
<!-- AND CONVERT(DATE, h.required_outbound_date) = CONVERT(DATE, GETDATE())--> |
|
|
<!-- AND CONVERT(DATE, h.required_outbound_date) = CONVERT(DATE, GETDATE())--> |
|
|
<!-- </if>--> |
|
|
<!-- </if>--> |
|
|
GROUP BY h.site, h.order_no, h.bu_no,h.customer_id,C.CustomerName,required_outbound_date |
|
|
|
|
|
|
|
|
GROUP BY h.site, h.order_no, h.bu_no,h.customer_id,C.SupplierName,required_outbound_date |
|
|
ORDER BY h.required_outbound_date DESC |
|
|
ORDER BY h.required_outbound_date DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
@ -56,7 +56,7 @@ |
|
|
h.order_no AS returnNo, |
|
|
h.order_no AS returnNo, |
|
|
h.bu_no AS buNo, |
|
|
h.bu_no AS buNo, |
|
|
h.customer_id as customerId, |
|
|
h.customer_id as customerId, |
|
|
C.CustomerName as customerName, |
|
|
|
|
|
|
|
|
C.SupplierName as customerName, |
|
|
D.related_order_no AS relatedNo, |
|
|
D.related_order_no AS relatedNo, |
|
|
D.related_order_line_no AS relatedLineNo, |
|
|
D.related_order_line_no AS relatedLineNo, |
|
|
D.part_no, |
|
|
D.part_no, |
|
|
@ -65,12 +65,12 @@ |
|
|
SUM(D.actual_out_qty) AS availableQty |
|
|
SUM(D.actual_out_qty) AS availableQty |
|
|
FROM outbound_notification_head h |
|
|
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 |
|
|
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 |
|
|
INNER JOIN Customer C ON H.site = C.Site AND H.customer_id = C.CustomerID |
|
|
|
|
|
|
|
|
INNER JOIN supplier C ON H.site = C.Site AND H.customer_id = C.SupplierID |
|
|
WHERE h.order_no = #{returnNo} |
|
|
WHERE h.order_no = #{returnNo} |
|
|
AND h.site = #{site} |
|
|
AND h.site = #{site} |
|
|
AND h.bu_no = #{buNo} |
|
|
AND h.bu_no = #{buNo} |
|
|
and d.part_no = #{partNo} |
|
|
and d.part_no = #{partNo} |
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.customer_id, C.CustomerName, required_outbound_date ,D.related_order_no ,D.related_order_line_no ,D.part_no,D.part_desc |
|
|
|
|
|
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.customer_id, C.SupplierName, required_outbound_date ,D.related_order_no ,D.related_order_line_no ,D.part_no,D.part_desc |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!-- 验证标签与采购退货单是否匹配 --> |
|
|
<!-- 验证标签与采购退货单是否匹配 --> |
|
|
@ -157,7 +157,7 @@ |
|
|
h.order_no AS returnNo, |
|
|
h.order_no AS returnNo, |
|
|
h.bu_no AS buNo, |
|
|
h.bu_no AS buNo, |
|
|
h.customer_id as customerId, |
|
|
h.customer_id as customerId, |
|
|
C.CustomerName as customerName, |
|
|
|
|
|
|
|
|
C.SupplierName as customerName, |
|
|
D.related_order_no AS relatedNo, |
|
|
D.related_order_no AS relatedNo, |
|
|
D.related_order_line_no AS relatedLineNo, |
|
|
D.related_order_line_no AS relatedLineNo, |
|
|
D.part_no AS partNo, |
|
|
D.part_no AS partNo, |
|
|
@ -166,7 +166,7 @@ |
|
|
SUM(D.actual_out_qty) AS availableQty |
|
|
SUM(D.actual_out_qty) AS availableQty |
|
|
FROM outbound_notification_head h |
|
|
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 |
|
|
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 |
|
|
INNER JOIN Customer C ON H.site = C.Site AND H.customer_id = C.CustomerID |
|
|
|
|
|
|
|
|
INNER JOIN supplier C ON H.site = C.Site AND H.customer_id = C.SupplierID |
|
|
WHERE h.site = #{site} |
|
|
WHERE h.site = #{site} |
|
|
AND h.bu_no in (select bu_no from AccessBu where username = #{userName}) |
|
|
AND h.bu_no in (select bu_no from AccessBu where username = #{userName}) |
|
|
AND h.order_type = '采购退货' |
|
|
AND h.order_type = '采购退货' |
|
|
@ -180,7 +180,7 @@ |
|
|
OR h.related_order_no LIKE CONCAT('%', #{searchCode}, '%') |
|
|
OR h.related_order_no LIKE CONCAT('%', #{searchCode}, '%') |
|
|
) |
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.customer_id, C.CustomerName, h.required_outbound_date, D.related_order_no, D.related_order_line_no, D.part_no, D.part_desc |
|
|
|
|
|
|
|
|
GROUP BY h.site, h.order_no, h.bu_no, h.customer_id, C.SupplierName, h.required_outbound_date, D.related_order_no, D.related_order_line_no, D.part_no, D.part_desc |
|
|
ORDER BY h.required_outbound_date DESC |
|
|
ORDER BY h.required_outbound_date DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|