叫料修改:装配只叫辅料类型为9的,其他叫原材料。

master
Leon 3 years ago
parent 54772894f5
commit d0666401f1

@ -612,13 +612,17 @@
SC.QTY*BC.QTY ISSUE_QTY, SC.QTY*BC.QTY-NVL(ZCI.REQUIRED_QTY,0) REQUIRED_QTY, ZSD.PLANNED_START_DATE REQUIRED_DATE_TIME, ZCI.HANDLE, ZCI.CALL_TYPE
FROM Z_SFC_DISPATCH ZSD
INNER JOIN SFC SC ON SC.SITE = ZSD.SITE AND SC.SFC = ZSD.SFC
INNER JOIN SHOP_ORDER SO ON SO.HANDLE = SC.SHOP_ORDER_BO
INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF.ATTRIBUTE = 'FACTORY'
INNER JOIN SFC_BOM SB ON SB.SFC_BO = SC.HANDLE
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SB.BOM_BO
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN CUSTOM_FIELDS CS ON CS.HANDLE = CP.HANDLE AND CS.ATTRIBUTE = 'ACCESSORY_TYPE'
INNER JOIN BOM_OPERATION BO ON BO.BOM_COMPONENT_BO = BC.HANDLE AND BO.OPERATION_BO = 'OperationBO:'||SC.SITE||','||ZSD.OPERATION||',#'
INNER JOIN CUSTOM_FIELDS CF ON CF.HANDLE = BC.HANDLE AND CF."ATTRIBUTE" = 'STEP_ID' AND CF.VALUE = ZSD.STEP_ID
LEFT JOIN Z_CALL_ITEM ZCI ON ZCI.SFC_DISPATCH_BO = ZSD.HANDLE AND ZCI.COMPONENT_BO = CP.HANDLE AND ZCI.STEP_ID = ZSD.STEP_ID
WHERE ZSD.HANDLE IN
WHERE ( (CF.VALUE ='6100' AND CS.VALUE = '9') OR (CF.VALUE = '6106' OR CP.MATERIAL_TYPE='ROH') )
AND ZSD.HANDLE IN
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
#{item.handle}
</foreach>

Loading…
Cancel
Save