SELECT ooh.order_number,
ooh.ordered_date,
ooh.flow_status_code,
ooh.credit_card_approval_code,
ooh.order_category_code,
ohd.name "Hold Name",
ohs.released_flag,
ohr.release_reason_code,
ohr.creation_date "Hold Release Date",
ooh.payment_type_code
FROM apps.oe_order_headers_all ooh,
apps.oe_order_lines_all ool,
apps.oe_order_holds_all ohld,
apps.oe_hold_sources_all ohs,
apps.oe_hold_definitions ohd,
apps.oe_hold_releases ohr
WHERE 1=1-- TRUNC (ooh.ordered_date) BETWEEN '10-NOV-15' AND '14-NOV-15'
-- AND ooh.order_category_code = 'RETURN'
AND ohld.header_id(+) = ooh.header_id
AND ohs.hold_source_id(+) = ohld.hold_source_id
AND ohd.hold_id(+) = ohs.hold_id
AND ohr.hold_release_id(+) = ohs.hold_release_id
AND ool.header_id=ooh.header_id
AND ohld.line_id(+) = ool.line_id
and ohs.released_flag='N'
AND ooh.order_number in ('12345')
-- and ohld.line_id=111338124
ORDER BY ooh.order_number
ooh.ordered_date,
ooh.flow_status_code,
ooh.credit_card_approval_code,
ooh.order_category_code,
ohd.name "Hold Name",
ohs.released_flag,
ohr.release_reason_code,
ohr.creation_date "Hold Release Date",
ooh.payment_type_code
FROM apps.oe_order_headers_all ooh,
apps.oe_order_lines_all ool,
apps.oe_order_holds_all ohld,
apps.oe_hold_sources_all ohs,
apps.oe_hold_definitions ohd,
apps.oe_hold_releases ohr
WHERE 1=1-- TRUNC (ooh.ordered_date) BETWEEN '10-NOV-15' AND '14-NOV-15'
-- AND ooh.order_category_code = 'RETURN'
AND ohld.header_id(+) = ooh.header_id
AND ohs.hold_source_id(+) = ohld.hold_source_id
AND ohd.hold_id(+) = ohs.hold_id
AND ohr.hold_release_id(+) = ohs.hold_release_id
AND ool.header_id=ooh.header_id
AND ohld.line_id(+) = ool.line_id
and ohs.released_flag='N'
AND ooh.order_number in ('12345')
-- and ohld.line_id=111338124
ORDER BY ooh.order_number
SELECT frt.responsibility_name,
authorized_action_code,
oha.start_date_active,
oha.end_date_active
FROM apps.oe_hold_authorizations oha,
apps.fnd_responsibility_tl frt,
apps.oe_hold_definitions ohd
WHERE 1 = 1
AND oha.hold_id = ohd.hold_id
AND ohd.NAME ='Deferred Invoice Hold'
AND oha.responsibility_id = frt.responsibility_id
AND oha.application_id = frt.application_id
AND LANGUAGE = 'US'
AND authorized_action_code = 'REMOVE'
No comments:
Post a Comment