-------------杂项接收-------------------
select /*PR.release_num,*/
rsh.receipt_num,
/* rsl.item_description, */
pv.VENDOR_NAME,rt.quantity,rt.po_unit_price
-- sum(rt.quantity*rt.po_unit_price)
from RCV_SHIPMENT_HEADERS rsh,
RCV_SHIPMENT_LINES rsl,
RCV_TRANSACTIONS rt,
PO_HEADERS_ALL POH,
PO_LINES_ALL POL,
PO_VENDORS PV
where rsh.shipment_header_id = rsl.shipment_header_id
and rsh.shipment_header_id = rt.shipment_header_id
and rsl.shipment_line_id = rt.shipment_line_id
and poh.po_header_id = rt.po_header_id
and pol.po_line_id = rt.po_line_id
and poh.org_id = pol.org_id
AND PV.VENDOR_ID = RT.VENDOR_ID
AND RT.TRANSACTION_TYPE='DELIVER'
and poh.org_id = 81/*
AND PR.po_release_id=RT.PO_RELEASE_ID*/
/* and poh.segment1 = '采购单号' */
and rsh.receipt_num='接收编号'
AND TO_CHAR(RT.TRANSACTION_DATE, 'YYYY-MM-DD') BETWEEN '2011-04-01' AND
'2011-05-31'
group by rsh.receipt_num,
pv.VENDOR_NAME/*,rsh.receipt_num*/
-------------------------原物料接收---------------------------
select/* PR.release_num, */pv.VENDOR_NAME,/*rt.quantity,rt.po_unit_price*/sum( rt.quantity*rt.po_unit_price)
from PO_RELEASES_ALL pr,
RCV_TRANSACTIONS RT,
PO_HEADERS_ALL POH,
PO_VENDORS PV
WHERE PR.po_release_id = RT.PO_RELEASE_ID
and poh.po_header_id = rt.po_header_id
AND PV.VENDOR_ID = RT.VENDOR_ID
AND RT.TRANSACTION_TYPE = 'DELIVER'
/* AND TO_CHAR(RT.TRANSACTION_DATE, 'YYYY-MM-DD') BETWEEN '2011-04-01' AND
'2011-05-31' */
AND poh.segment1 =‘ 采购单号'
/* and pr.release_num='发放版本号'*/
group by /* PR.release_num, */pv.VENDOR_NAME
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24899662/viewspace-696963/ ,如需转载,请注明出处,否则将追究法律责任。