PO 在途

SELECT MSIB.SEGMENT1 AA ,MSIB.DESCRIPTION BB ,MSIB.MIN_MINMAX_QUANTITY CC ,(SELECT SUM(MOQD.PRIMARY_TRANSACTION_QUANTITY) FROM INV.MTL_ONHAND_QUANTITIES_DETAIL MOQD WHERE 2 = 2 AND MSIB.ORGANIZATION_ID = MOQD.ORGANIZATION_ID AND MOQD.SUBINVENTORY_CODE = SUB_CODE AND MSIB.INVENTORY_ITEM_ID = MOQD.INVENTORY_ITEM_ID) DD ,NVL((SELECT SUM(MS.QUANTITY) FROM INV.MTL_SUPPLY MS ,PO.PO_REQUISITION_HEADERS_ALL PRH WHERE 2 = 2 AND MS.REQ_HEADER_ID = PRH.REQUISITION_HEADER_ID AND MS.CREATION_DATE > TO_DATE('2006/06/01 00:00:00', 'YYYY/MM/DD HH24:MI:SS') AND MS.SUPPLY_TYPE_CODE = 'REQ' AND MSIB.ORGANIZATION_ID = MS.TO_ORGANIZATION_ID AND MS.ITEM_ID = MSIB.INVENTORY_ITEM_ID), 0) E1 ,NVL((SELECT SUM(MS.QUANTITY) FROM INV.MTL_SUPPLY MS ,PO.PO_HEADERS_ALL PRH WHERE 2 = 2 AND MS.CREATION_DATE > TO_DATE('2006/06/01 00:00:00', 'YYYY/MM/DD HH24:MI:SS') AND MS.PO_HEADER_ID = PRH.PO_HEADER_ID AND MS.SUPPLY_TYPE_CODE = 'PO' AND MSIB.ORGANIZATION_ID = MS.TO_ORGANIZATION_ID AND MS.ITEM_ID = MSIB.INVENTORY_ITEM_ID), 0) E2 FROM INV.MTL_SYSTEM_ITEMS_B MSIB WHERE 2 = 2 AND MSIB.DESCRIPTION NOT LIKE '%加工费%' AND MSIB.DESCRIPTION NOT LIKE '%磨制费%' AND MSIB.DESCRIPTION NOT LIKE '%返磨费%' AND MSIB.DESCRIPTION NOT LIKE '%切断费%' AND MSIB.DESCRIPTION NOT LIKE '%加长费%' AND MSIB.DESCRIPTION NOT LIKE '%检定费%' AND MSIB.DESCRIPTION NOT LIKE '%维护费%' AND MSIB.INVENTORY_ITEM_STATUS_CODE = 'Active' AND MSIB.ORGANIZATION_ID = ORG_ID AND (SEGMENT1 LIKE SS4 OR SEGMENT1 LIKE SS3 OR SEGMENT1 LIKE SS2 OR SEGMENT1 LIKE SS1 OR SEGMENT1 LIKE 'C-T-%' OR SEGMENT1 LIKE 'T-%' OR SEGMENT1 LIKE 'F-T%' OR SEGMENT1 LIKE 'E-T%' OR SEGMENT1 LIKE 'E-F%') ORDER BY SEGMENT1;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值