Friday, June 2, 2017

Query - Get Sales Order and corresponding AR Invoice Details


SELECT 

       oha.order_number, 
       ola.line_number line_number,
       ola.ordered_item item_name,

       ola.ordered_quantity,       ola.ordered_quantity * ola.unit_selling_price line_amount,
       rcta.trx_number invoice_number, 

       rcta.trx_date invoice_date,
       rctla.line_number trx_line_number
FROM   oe_order_headers_all oha,
       oe_order_lines_all ola              

       ra_customer_trx_all rcta,
       ra_customer_trx_lines_all rctla
 WHERE oha.header_id = ola.header_id
   AND rcta.customer_trx_id = rctla.customer_trx_id

   AND rctla.interface_line_context = ‘ORDER ENTRY’
   AND rctla.interface_line_attribute6 = TO_CHAR (ola.line_id)
   AND rctla.interface_line_attribute1 = TO_CHAR (oha.order_number)
   AND order_number = :p_order_number

1 comments:

Anonymous said...

I will recommend anyone looking for Business loan to Le_Meridian they helped me with Four Million USD loan to startup my Quilting business and it's was fast When obtaining a loan from them it was surprising at how easy they were to work with. They can finance up to the amount of $500,000.000.00 (Five Hundred Million Dollars) in any region of the world as long as there 1.9% ROI can be guaranteed on the projects.The process was fast and secure. It was definitely a positive experience.Avoid scammers on here and contact Le_Meridian Funding Service On. lfdsloans@lemeridianfds.com / lfdsloans@outlook.com. WhatsApp...+ 19893943740. if you looking for business loan.

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Justin Bieber, Gold Price in India