|
|
@ -686,6 +686,12 @@ |
|
|
C.standard_dosage AS standardDosage, |
|
|
C.standard_dosage AS standardDosage, |
|
|
C.QtyToIssue AS qtyToIssue, |
|
|
C.QtyToIssue AS qtyToIssue, |
|
|
ISNULL(C.actual_out_qty, 0) AS actualOutQty, |
|
|
ISNULL(C.actual_out_qty, 0) AS actualOutQty, |
|
|
|
|
|
SUM(ISNULL(S.roll_qty,0)) AS returnQrt,--新增,累计退料数量 |
|
|
|
|
|
CASE |
|
|
|
|
|
WHEN ISNULL(C.actual_out_qty, 0) - ISNULL(qtyToIssue, 0) - ISNULL(SUM(S.roll_qty), 0) <![CDATA[<]]> 0 |
|
|
|
|
|
THEN 0 |
|
|
|
|
|
ELSE ROUND(ISNULL(C.actual_out_qty, 0) - ISNULL(qtyToIssue, 0) - ISNULL(SUM(S.roll_qty), 0), 2) |
|
|
|
|
|
END AS reQtyToIssue, --新增,应退数量 |
|
|
A.work_center_no AS workCenterNo, |
|
|
A.work_center_no AS workCenterNo, |
|
|
so.out_batchNo AS outBatchNo, |
|
|
so.out_batchNo AS outBatchNo, |
|
|
W.WareHouseName AS warehouseName, |
|
|
W.WareHouseName AS warehouseName, |
|
|
@ -697,6 +703,7 @@ |
|
|
INNER JOIN Part P ON C.Site = P.Site AND C.ComponentPartNo = P.PartNo |
|
|
INNER JOIN Part P ON C.Site = P.Site AND C.ComponentPartNo = P.PartNo |
|
|
INNER JOIN UM U ON U.Site = P.Site AND U.UMID = P.UMID |
|
|
INNER JOIN UM U ON U.Site = P.Site AND U.UMID = P.UMID |
|
|
LEFT JOIN WareHouse W ON C.Site = W.Site AND C.warehouse_id = W.WareHouseID |
|
|
LEFT JOIN WareHouse W ON C.Site = W.Site AND C.warehouse_id = W.WareHouseID |
|
|
|
|
|
LEFT JOIN StockTransactionLog S ON S.site = A.Site AND S.order_no = B.SOOrderNo AND S.part_no = C.ComponentPartNo AND S.document_type = '生产退仓' --新增 |
|
|
<where> |
|
|
<where> |
|
|
A.site IN (SELECT site FROM AccessSite WHERE userID = #{query.userName}) |
|
|
A.site IN (SELECT site FROM AccessSite WHERE userID = #{query.userName}) |
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
<if test="query.notifyNo != null and query.notifyNo != ''"> |
|
|
@ -739,6 +746,6 @@ |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
ORDER BY A.NotifyNo, B.SOOrderNo, C.BOMItemNo |
|
|
|
|
|
|
|
|
GROUP BY A.NotifyNo, CONVERT(VARCHAR(10), A.NotifyDate, 23), A.Status, B.SOOrderNo, C.BOMItemNo, C.ComponentPartNo, P.PartDescription, P.Spec, U.UMName, C.component_scrap, C.first_inspection_qty, C.standard_dosage, C.QtyToIssue, C.actual_out_qty, A.work_center_no, so.out_batchNo, W.WareHouseName, C.warehouse_id |
|
|
</select> |
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |