DBA Data[Home] [Help]

VIEW: APPS.WSH_ORDER_NUMBERS_V

Source

View Text - Preformatted

SELECT h.order_number, h.header_id, h.ordered_date , ot.name order_type , h.order_type_id , substrb ( cust.party_name, 1, 50 ) /*customer_name*/ , cust.account_number /*customer number*/ , h.sold_to_org_id customer_id, h.shipping_method_code , h.shipment_priority_code FROM ( select party.party_name, cust_acct.account_number, cust_acct.cust_account_id from hz_parties party, hz_cust_accounts cust_acct where cust_acct.party_id = party.party_id ) cust, oe_order_headers_all h, OE_TRXT_TYPES_NOORGS_VL ot WHERE ot.transaction_type_id = h.order_type_id AND ot.transaction_type_code = 'ORDER' AND h.open_flag = 'Y' AND h.sold_to_org_id = cust.cust_account_id(+) AND exists ( SELECT source_header_id FROM wsh_delivery_details wdd WHERE wdd.source_header_id = h.header_id AND wdd.source_code = 'OE' AND wdd.released_status = 'R' AND wdd.date_scheduled is not NULL )
View Text - HTML Formatted

SELECT H.ORDER_NUMBER
, H.HEADER_ID
, H.ORDERED_DATE
, OT.NAME ORDER_TYPE
, H.ORDER_TYPE_ID
, SUBSTRB ( CUST.PARTY_NAME
, 1
, 50 ) /*CUSTOMER_NAME*/
, CUST.ACCOUNT_NUMBER /*CUSTOMER NUMBER*/
, H.SOLD_TO_ORG_ID CUSTOMER_ID
, H.SHIPPING_METHOD_CODE
, H.SHIPMENT_PRIORITY_CODE
FROM ( SELECT PARTY.PARTY_NAME
, CUST_ACCT.ACCOUNT_NUMBER
, CUST_ACCT.CUST_ACCOUNT_ID
FROM HZ_PARTIES PARTY
, HZ_CUST_ACCOUNTS CUST_ACCT
WHERE CUST_ACCT.PARTY_ID = PARTY.PARTY_ID ) CUST
, OE_ORDER_HEADERS_ALL H
, OE_TRXT_TYPES_NOORGS_VL OT
WHERE OT.TRANSACTION_TYPE_ID = H.ORDER_TYPE_ID
AND OT.TRANSACTION_TYPE_CODE = 'ORDER'
AND H.OPEN_FLAG = 'Y'
AND H.SOLD_TO_ORG_ID = CUST.CUST_ACCOUNT_ID(+)
AND EXISTS ( SELECT SOURCE_HEADER_ID
FROM WSH_DELIVERY_DETAILS WDD
WHERE WDD.SOURCE_HEADER_ID = H.HEADER_ID
AND WDD.SOURCE_CODE = 'OE'
AND WDD.RELEASED_STATUS = 'R'
AND WDD.DATE_SCHEDULED IS NOT NULL )