Monday, December 30, 2024

Query to get Sales Invoice(Receivables) Details in R12

SELECT RA_CUST_TRX_TYPES_ALL.TYPE,
       RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_LINE_ID,
       RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATE_DATE,
       RA_CUSTOMER_TRX_LINES_ALL.LAST_UPDATED_BY,
       RA_CUSTOMER_TRX_LINES_ALL.CREATION_DATE,
       RA_CUSTOMER_TRX_LINES_ALL.CREATED_BY,
       RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_ID,
       RA_CUSTOMER_TRX_LINES_ALL.LINE_NUMBER,
       RA_CUSTOMER_TRX_LINES_ALL.SET_OF_BOOKS_ID,
       RA_CUSTOMER_TRX_LINES_ALL.INVENTORY_ITEM_ID,
       RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_INVOICED,
       RA_CUSTOMER_TRX_LINES_ALL.QUANTITY_CREDITED,
       RA_CUSTOMER_TRX_LINES_ALL.UNIT_STANDARD_PRICE,
       RA_CUSTOMER_TRX_LINES_ALL.UNIT_SELLING_PRICE,
       RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER,
       RA_CUSTOMER_TRX_LINES_ALL.SALES_ORDER_LINE,
       RA_CUSTOMER_TRX_LINES_ALL.LINE_TYPE,
       RA_CUSTOMER_TRX_LINES_ALL.EXTENDED_AMOUNT,
       RA_CUSTOMER_TRX_LINES_ALL.TAX_RATE,
       RA_CUSTOMER_TRX_LINES_ALL.UOM_CODE,
       RA_CUSTOMER_TRX_LINES_ALL.ORG_ID,
       RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_CONTEXT,
       RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6,
       RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE7,
       RA_CUSTOMER_TRX_LINES_ALL.LINK_TO_CUST_TRX_LINE_ID,
       RA_CUSTOMER_TRX_LINES_ALL.WAREHOUSE_ID,
       RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID,
       RA_CUSTOMER_TRX_ALL.TRX_NUMBER,
       RA_CUSTOMER_TRX_ALL.CUST_TRX_TYPE_ID,
       RA_CUSTOMER_TRX_ALL.TRX_DATE,
       RA_CUSTOMER_TRX_ALL.SOLD_TO_CUSTOMER_ID,
       OE_ORDER_HEADERS_ALL.SOLD_TO_CONTACT_ID,
       RA_CUSTOMER_TRX_ALL.SOLD_TO_SITE_USE_ID,
       RA_CUSTOMER_TRX_ALL.BILL_TO_CUSTOMER_ID,
       RA_CUSTOMER_TRX_ALL.BILL_TO_SITE_USE_ID,
       RA_CUSTOMER_TRX_ALL.SHIP_TO_CUSTOMER_ID,
       RA_CUSTOMER_TRX_ALL.SHIP_TO_SITE_USE_ID,
       RA_CUSTOMER_TRX_ALL.TERM_ID,
       RA_CUSTOMER_TRX_ALL.TERM_DUE_DATE,
       RA_CUSTOMER_TRX_ALL.PRIMARY_SALESREP_ID,
       RA_CUSTOMER_TRX_ALL.PRINTING_ORIGINAL_DATE,
       RA_CUSTOMER_TRX_ALL.PURCHASE_ORDER,
       RA_CUSTOMER_TRX_ALL.EXCHANGE_DATE,
       RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE,
       RA_CUSTOMER_TRX_ALL.TERRITORY_ID,
       RA_CUSTOMER_TRX_ALL.INVOICE_CURRENCY_CODE,
       RA_CUSTOMER_TRX_ALL.COMPLETE_FLAG,
       RA_CUSTOMER_TRX_ALL.PAYING_SITE_USE_ID,
       RA_CUSTOMER_TRX_LINES_ALL1.CUSTOMER_TRX_LINE_ID,
       RA_CUSTOMER_TRX_LINES_ALL1.INVENTORY_ITEM_ID,
       RA_CUSTOMER_TRX_LINES_ALL1.SALES_ORDER,
       RA_CUSTOMER_TRX_LINES_ALL1.SALES_ORDER_LINE,
       RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_CONTEXT,
       RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_ATTRIBUTE6,
       RA_CUSTOMER_TRX_LINES_ALL1.INTERFACE_LINE_ATTRIBUTE7,
       RA_CUSTOMER_TRX_LINES_ALL1.WAREHOUSE_ID,
       RA_CUSTOMER_TRX_ALL.STATUS_TRX,
       RA_CUSTOMER_TRX_ALL.EXCHANGE_RATE_TYPE,
       RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE,
       RA_CUST_TRX_TYPES_ALL.LAST_UPDATE_DATE,
       OE_ORDER_HEADERS_ALL.LAST_UPDATE_DATE,
       OE_ORDER_HEADERS_ALL.SALES_CHANNEL_CODE,
       OE_ORDER_HEADERS_ALL.ORDER_TYPE_ID,
       OE_ORDER_HEADERS_ALL.PAYMENT_TYPE_CODE,
       OE_ORDER_HEADERS_ALL.FREIGHT_TERMS_CODE,
       OE_ORDER_LINES_ALL.LINE_CATEGORY_CODE,
       OE_ORDER_LINES_ALL.ITEM_TYPE_CODE,
       OE_ORDER_LINES_ALL.SHIPMENT_NUMBER,
       OE_ORDER_LINES_ALL.SHIP_FROM_ORG_ID,
       OE_ORDER_LINES_ALL.PROJECT_ID,
       OE_ORDER_LINES_ALL.TASK_ID,
       OE_ORDER_LINES_ALL.OPTION_NUMBER,
       OE_ORDER_LINES_ALL.COMPONENT_NUMBER,
       OE_ORDER_LINES_ALL.SOURCE_TYPE_CODE,
       OE_ORDER_HEADERS_ALL.ORDER_SOURCE_ID,
       RA_CUSTOMER_TRX_ALL.LEGAL_ENTITY_ID,
       RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE11
  FROM RA_CUSTOMER_TRX_LINES_ALL  RA_CUSTOMER_TRX_LINES_ALL1,
       RA_CUSTOMER_TRX_LINES_ALL,
       RA_CUSTOMER_TRX_ALL,
       RA_CUST_TRX_TYPES_ALL,
       OE_ORDER_HEADERS_ALL,
       OE_ORDER_LINES_ALL
 WHERE     RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID =
           RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_ID
       AND RA_CUSTOMER_TRX_ALL.COMPLETE_FLAG = 'Y'
       AND RA_CUSTOMER_TRX_ALL.CUST_TRX_TYPE_ID =
           RA_CUST_TRX_TYPES_ALL.CUST_TRX_TYPE_ID
       AND RA_CUSTOMER_TRX_ALL.ORG_ID = RA_CUST_TRX_TYPES_ALL.ORG_ID
       AND RA_CUSTOMER_TRX_LINES_ALL.LINK_TO_CUST_TRX_LINE_ID =
           RA_CUSTOMER_TRX_LINES_ALL1.CUSTOMER_TRX_LINE_ID(+)
       AND RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_CONTEXT IN
               ('ORDER ENTRY', 'INTERCOMPANY')
       AND TO_NUMBER (RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6) =
           OE_ORDER_LINES_ALL.LINE_ID(+)
       AND OE_ORDER_LINES_ALL.HEADER_ID = OE_ORDER_HEADERS_ALL.HEADER_ID(+)
       AND RA_CUSTOMER_TRX_ALL.LAST_UPDATE_DATE >=
           TO_DATE (:P_LAST_EXTRACT_DATE, 'MM/D D/YYYY HH24:MI:SS')

No comments:

Post a Comment

Query to get Parent and Child Accounts in Oracle APPS R12

SELECT ffv1.flex_value parent_account       ,ffvt1.description parent_account_desc   ,ffv2.flex_value child_account   ,ffvt2.description...