Showing posts with label sale Order. Show all posts
Showing posts with label sale Order. Show all posts

Monday, 26 January 2015

Query Sales Order Number Against AR Receipt No.

Pupose:
Receipt -->
       Against which Invoice Applied -->
                   Then That Invoice Mapped to Sales Order.

Query:
Select Arc.Receipt_Number, Trx_Number Invoice_Num, Ct_Reference Sales_Order
  From Ar_Receivable_Applications_All App,
       Ra_Customer_Trx_All            Rac,
       Ar_Cash_Receipts_All           Arc
 Where App.Applied_Customer_Trx_Id = Rac.Customer_Trx_Id
   And App.Cash_Receipt_Id = Arc.Cash_Receipt_Id

Friday, 23 January 2015

Query to retrive the Sales order and associate invoice.

SELECT
ooh.order_number,
ooh.ORDERED_DATE,
ooh.FLOW_STATUS_CODE SO_Status,
ool.line_number,
msi.SEGMENT1 Item_Name,
ool.ordered_quantity,
rct.TRX_NUMBER Invoice_Num,
rct.TRX_date Invoice_Date,
rct.STATUS_TRX,
decode(rct.COMPLETE_FLAG,'Y','Completed','In Complete') Inv_Status,
ool.UNIT_SELLING_price*ool.ordered_quantity line_total
from
oe_order_headers_all ooh,
oe_order_lines_all ool,
hz_cust_accounts hca,
ra_customer_trx_lines_all rctl,
ra_customer_trx_all rct,
mtl_system_items msi
where
ooh.header_id=ool.header_id
and ooh.sold_to_org_id=hca.cust_account_id
and msi.INVENTORY_ITEM_ID=ool.INVENTORY_ITEM_ID
and msi.ORGANIZATION_ID=ool.SHIP_FROM_ORG_ID
and rct.CUSTOMER_TRX_ID = rctl.CUSTOMER_TRX_ID
and rctl.LINE_TYPE = 'LINE'
and rctl.interface_line_attribute1 = to_char(ooh.ORDER_NUMBER)
and rctl.QUANTITY_invoiced = ool.ORDERED_QUANTITY
and ooh.order_number= 1195372 --517980
order by ool.line_number;

Query to Find Receipt Class and its GL Combinition Query

SELECT ARC.NAME ReceiptClass,        ARC.CREATION_METHOD_CODE Creation_Mehthod,        DECODE (ARC.REMIT_METHOD_CODE,             ...