您的位置: CNOUG博客首页 >> 论坛 >> Oracle Application Server >> 查看帖子
字体: 小 中 大 | 打印 发表于: 2008-8-01 14:05 作者: huangbinghao 来源: CNOUG博客首页
最新回复
huangbinghao (2008-8-01 14:09:46)
huangbinghao (2008-8-01 14:11:36)
farsin (2008-8-08 12:27:44)
farsin (2008-8-08 12:29:25)
koushuishi (2008-8-11 17:17:38)
baicaiyun1 (2008-8-11 19:49:48)
baicaiyun1 (2008-8-11 19:51:09)
11stday (2008-8-29 23:03:00)
xiejia (2008-9-04 15:57:33)
heixue789 (2008-9-08 10:32:43)
magic_jerry (2008-9-10 09:38:07)
tomato19830716 (2008-9-11 17:10:32)
, pla.line_num
, psn.project_number
, msi.segment1 item
, pla.item_description
-- , pla.item_id
, plla.need_by_date
, plla.promised_date
-- , null received_date
, pda.quantity_ordered - pda.quantity_cancelled qty
, pda.quantity_delivered
, (pda.quantity_ordered-pda.quantity_delivered) non_rec_qty
, DECODE(SIGN(APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,TRUNC(SYSDATE))- APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,plla.promised_date)) ,-1,0
, (APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,TRUNC(SYSDATE))- APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,plla.promised_date))) delay_day
FROM po_headers_all pha
, po_lines_all pla
, mtl_system_items msi
, po_line_locations_all plla
, po_distributions_all pda
, pjm_seiban_numberS psn
WHERE pla.po_header_id = pha.po_header_id
AND pla.po_line_id = plla.po_line_id
AND pda.line_location_id = plla.line_location_id
AND NVL(plla.cancel_flag,'N') <> 'Y'
AND NVL(pla.cancel_flag,'N') <> 'Y'
AND NVL(pha.cancel_flag,'N') <> 'Y'
AND pha.authorization_status ='APPROVED'
AND plla.ship_to_organization_id = 143
----
-- AND pda.project_id = 4906
AND msi.inventory_item_id = pla.item_id
AND msi.organization_id = plla.ship_to_organization_id
AND psn.project_id = pda.project_id
AND plla.quantity - plla.quantity_received > 0
AND pla.line_type_id <> 3 --'Outside processing'
AND TO_CHAR(plla.need_by_date,'YYYY/MM/DD') < '2008/07/21'
---------------------------------------------------------------------
SELECT pha.segment1 po_no
, rsh.receipt_num
, pla.line_num
, psn.project_number
, msi.segment1 item
, msi.description
-- , pla.item_id
, plla.need_by_date
, plla.promised_date
, TRUNC(rt.transaction_date) received_date
, pda.quantity_ordered - pda.quantity_cancelled qty
, pda.quantity_delivered
-- , psn.project_id
, DECODE(SIGN(APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,TRUNC(rt.transaction_date))- APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,plla.promised_date)) ,-1,0
, (APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,TRUNC(rt.transaction_date))- APPS.ZBGET_CAL_SEQ(plla.ship_to_organization_id,plla.promised_date))) delay_day
FROM rcv_transactions rt
, rcv_shipment_headers rsh
, rcv_shipment_lines rsl
, po_headers_all pha
, po_lines_all pla
, po_line_locations_all plla
, po_distributions_all pda
, pjm_seiban_numberS psn
, mtl_system_items msi
WHERE rt.organization_id = 143
-- AND rsh.receipt_num= '53702279'
AND rsh.SHIPMENT_HEADER_ID = rt.SHIPMENT_HEADER_ID
AND rsl.SHIPMENT_LINE_ID = rt.SHIPMENT_LINE_ID
-- AND rsl.project_id = 6027
-- AND rt.project_id = 6686
AND rt.po_header_id = pha.po_header_id
AND rt.po_line_id = pla.po_line_id
AND rt.po_line_location_id = plla.line_location_id
AND rt.po_distribution_id = pda.po_distribution_id
AND NVL(pla.cancel_flag,'N') <> 'Y'
AND NVL(pha.cancel_flag,'N') <> 'Y'
AND pha.authorization_status ='APPROVED'
AND plla.ship_to_organization_id = rt.organization_id
-- AND pda.project_id = 4906
AND psn.project_id = pda.project_id
AND rt.transaction_type IN ('RECEIVE')
AND msi.inventory_item_id = pla.item_id
AND msi.organization_id = plla.ship_to_organization_id
AND TO_CHAR(plla.need_by_date,'YYYY/MM/DD') < '2008/07/21'
AND NOT EXISTS(SELECT 1 FROM rcv_transactions rts
WHERE rts.parent_transaction_id = rt.transaction_id
AND rts.transaction_type IN ('RETURN TO VENDOR')
AND rt.quantity - rts.quantity <= 0)
-- AND psn.project_number IN ('T93001R','C37T93002-3','T94001','C37T94002','TA2001A1-2A1','C37TA2003-4','TA8001-2','TA9001-K37TA900B')
-- AND pla.item_id = 12323
ORDER BY 2,5.
incort (2008-9-19 11:59:40)
hongmuer (2008-9-19 12:45:27)
wuleeford (2008-9-22 20:04:53)
lizhenghai (2008-9-22 20:08:14)
lizhenghai (2008-9-22 20:11:09)
LZC8088 (2008-9-23 10:13:57)
lesheng.huang (2008-9-23 12:31:52)
mishong (2008-9-26 21:12:44)