select ORDER_NUMBER ,
(select ORGANIZATION_CODE from org_organization_definitions where ORGANIZATION_ID = oola.SHIP_FROM_ORG_ID) ORGANIZATION_CODE,
(select ORGANIZATION_name from org_organization_definitions where ORGANIZATION_ID = oola.SHIP_FROM_ORG_ID) ORGANIZATION_name,
oola.ORDERED_QUANTITY ,
oola.FULFILLED_QUANTITY
from oe_order_headers_all ooha,
oe_order_lines_all oola
where ooha.header_id = oola.header_id
and ooha.org_id = oola.org_id
and ORDER_CATEGORY_CODE = 'RETURN'
and oola.FLOW_STATUS_CODE = 'AWAITING_RETURN'
and oola.OPEN_FLAG = 'Y' --
order by 2
--and order_number = 3711800202
No comments:
Post a Comment