0% found this document useful (0 votes)
70 views

O2 C

The document contains SQL queries that are selecting data from various tables related to orders, deliveries, invoices, and receipts. The queries are joining data from tables with fields like order_number, header_id, delivery_id, invoice_number, receipt_number to retrieve and display information about orders, including details on items ordered, deliveries, invoices, payments and customer and sales representative information. Sample outputs of some of the queries are also shown.

Uploaded by

pankaj
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

O2 C

The document contains SQL queries that are selecting data from various tables related to orders, deliveries, invoices, and receipts. The queries are joining data from tables with fields like order_number, header_id, delivery_id, invoice_number, receipt_number to retrieve and display information about orders, including details on items ordered, deliveries, invoices, payments and customer and sales representative information. Sample outputs of some of the queries are also shown.

Uploaded by

pankaj
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

OE_ORDER_HEADERS_V -- 56752

OE_ORDER_LINES_V --

wsh_deliverables_v -- details

WSH_DLVB_DLVY_V

wsh_new_deliveries_v

RA_CUSTOMER_TRX_PARTIAL_V -- 10020717

RA_CUST_TRX_LINE_GL_DIST_V

RA_CUSTOMER_TRX_FRT_V

AR_CASH_RECEIPTS_V -- 10020717

select * from
oe_order_headers_all--,header_id,order_number,price_list_id,sold_org_id,salesrep_id
,

select * from oe_order_lines_all --, header_id,line_id,Quantity,Shipped,sold-


to_org_id ,inventory_item_id,Selling price,tax,

Select * from wsh_delivery_details --,source_header_id,


item_discription,delivery_id

select * from wsh_delivery_assignments --,delivery_asdsignement_id,

select * from wsh_new_deliveries --, deliverY_id

select * from RA_customer_trx_all --, TRX_number,Customer_trx_id,


Sold_customer_id,CT_reference,Interface_hedaer_attribute1
where customer_trx_id = 208298

select * from Ra_customer_trx_lines_all -- Customer_trx_line_id,Customer_trx_id


where customer_trx_id = 208298

select * from ar_cash_receipts_all -- Cash_receipt_id,Recepit_number,

select * from hz_cust_accounts_all -- cust_account_id,party_id

select * from Hz_parties -- party_id ,party_name

select * from AR.AR_RECEIVABLE_APPLICATIONS_ALL ---, Cash_recepit_id,


where Applied_Customer_trx_id = 208298

select * from RA_SALESREPS_ALL -- Salesrep_id, Nmae

select * from qp_list_headers_tl --List_header_id, Name

Select ooha.order_number
,rsa.Name Sales_person
,qlht.Name Price_list_Name
,oola.Ordered_quantity
,oola.Shipped_quantity
,wdd.RELEASED_STATUS Pick_release_status
,wnd.INITIAL_PICKUP_DATE "Goods Picked date"
,wnd.CONFIRM_DATE "Goods ship conform date"
,wnd.DELIVERY_TYPE
,wnd.DELIVERED_DATE "Goods Delivered Date"
,rcta.trx_number "Invoice number"
,acra.Receipt_number "Recepit Number"
,hp.party_name "Customer Name"
,acra.Amount "invoice Amount"
From oe_order_headers_all ooha
,oe_order_lines_all oola
,wsh_delivery_details wdd
,wsh_new_deliveries wnd
,wsh_delivery_assignments wda
,RA_customer_trx_all rcta
,ar_cash_receipts_all acra
,hz_cust_accounts_all hcaa
,Hz_parties hp
,AR_RECEIVABLE_APPLICATIONS_ALL araa
,RA_SALESREPS_ALL rsa
,qp_list_headers_tl qlht
where ooha.HEADER_ID = oola.HEADER_ID
and wdd.SOURCE_HEADER_ID = ooha.header_id
and wdd.DELIVERY_DETAIL_ID = wda.DELIVERY_DETAIL_ID
and wda.delivery_id = wnd.delivery_id
and rcta.INTERFACE_HEADER_ATTRIBUTE1 = to_char(ooha.ORDER_NUMBER)
and ooha.sold_to_org_id = hcaa.CUST_ACCOUNT_ID
and hcaa.party_id = hp.party_id
and araa.CASH_RECEIPT_ID = acra.CASH_RECEIPT_ID
and araa.APPLIED_CUSTOMER_TRX_ID = rcta.CUSTOMER_TRX_ID
and ooha.SALESREP_ID = Rsa.SalesRep_id
and ooha.PRICE_LIST_ID = qlht.List_header_id
and ooha.order_number = '56752'

select oos.Name "Source Name"


,otta.Transaction_type_code
,otta.Order_category_code
,qlht.NAME "Price List Name"
,rr.Name "Invoice Rule Name"
,(select rr.name from ra_rules rr, oe_order_headers_all ooha where
ooha.ACCOUNTING_RULE_ID = rr.rule_id and ooha.order_number = 56752) "account rule
Name"
,rtl.Due_days
,hp.Party_name
,Organization_Name
,oola.tax_value "Tax"
,(select sum(invoiced_amount) from OE_PRICE_ADJUSTMENTS
opa,oe_order_headers_all ooha where ooha.header_id = opa.header_id and
ooha.order_number = 56752 and list_line_type_code = 'FREIGHT_CHARGE' ) "Freight
Charge"
,oola.UNIT_SELLING_PRICE "Cost for each item"
,oola.ORDERED_QUANTITY "Quantity"
from oe_order_headers_all ooha
,oe_order_sources oos
,OE_TRANSACTION_TYPES_ALL otta
,qp_list_headers_tl qlht
,ra_rules rr
,RA_TERMS_LINES rtl
,hz_parties hp
,hz_cust_accounts_all hcaa
,oe_order_lines_all oola
,mtl_organizations mo
where oos.ORDER_SOURCE_ID = ooha.ORDER_SOURCE_ID
and otta.Transaction_type_id = ooha.ORDER_TYPE_ID
and qlht.LIST_HEADER_ID = ooha.PRICE_LIST_ID
and rr.RULE_ID = ooha.INVOICING_RULE_ID
and ooha.Payment_term_id = rtl.term_id
and ooha.sold_to_org_id = hcaa.Cust_account_id
and hcaa.party_id = hp.Party_id
and oola.header_id = ooha.header_id
and mo.organization_id = ooha.org_id
and ooha.order_number = 56840

Select ooha.order_number
,rsa.Name Sales_person
,qlht.Name Price_list_Name
,oola.Ordered_quantity
,oola.Shipped_quantity
,wdd.RELEASED_STATUS Pick_release_status
,wnd.INITIAL_PICKUP_DATE "Goods Picked date"
,wnd.CONFIRM_DATE "Goods ship conform date"
,wnd.DELIVERY_TYPE
,wnd.DELIVERED_DATE "Goods Delivered Date"
,rcta.trx_number "Invoice number"
,acra.Receipt_number "Recepit Number"
,hp.party_name "Customer Name"
,acra.Amount "invoice Amount"
From oe_order_headers_all ooha
,oe_order_lines_all oola
,wsh_delivery_details wdd
,wsh_new_deliveries wnd
,wsh_delivery_assignments wda
,RA_customer_trx_all rcta
,ar_cash_receipts_all acra
,hz_cust_accounts_all hcaa
,Hz_parties hp
,AR_RECEIVABLE_APPLICATIONS_ALL araa
,RA_SALESREPS_ALL rsa
,qp_list_headers_tl qlht
where ooha.HEADER_ID = oola.HEADER_ID
and wdd.SOURCE_HEADER_ID = ooha.header_id
and wdd.DELIVERY_DETAIL_ID = wda.DELIVERY_DETAIL_ID
and wda.delivery_id = wnd.delivery_id
and rcta.INTERFACE_HEADER_ATTRIBUTE1 = to_char(ooha.ORDER_NUMBER)
and ooha.sold_to_org_id = hcaa.CUST_ACCOUNT_ID
and hcaa.party_id = hp.party_id
and araa.CASH_RECEIPT_ID = acra.CASH_RECEIPT_ID
and araa.APPLIED_CUSTOMER_TRX_ID = rcta.CUSTOMER_TRX_ID
and ooha.SALESREP_ID = Rsa.SalesRep_id
and ooha.PRICE_LIST_ID = qlht.List_header_id
AND OOHA.ORG_ID = RSA.ORG_ID
and ooha.order_number = '56752'

You might also like