Thursday, 7 September 2017

Find the query of Receivable (AR) for the Invoice Number (TRX_NUMBER) Wise, Customer wise, Sales Order Wise, Transaction Date and GL Date Wise in Oracle Apps EBS R12

Find the query of Receivable (AR) for the Invoice Number (TRX_NUMBER) Wise,
Customer wise, Sales Order Wise, Transaction Date and
GL Date Wise in Oracle Apps EBS R12

SELECT RCT.TRX_NUMBER INVOICE_NUMBER,
      -- ARPS.AMOUNT_DUE_ORIGINAL BALANCE,
       ARPS.AMOUNT_DUE_REMAINING BALANCE,
       HP.PARTY_NAME BILL_TO_CUSTOMER,
       DECODE (RCTT.TYPE,'CB','Chargeback',
                                  'CM','Credit Memo',
                                  'DM','Debit Memo',
                                  'DEP','Deposit',
                                  'GUAR','Guarantee',
                                  'INV','Invoice',
                                  'PMT','Receipt',
                                  'Invoice') INVOICE_CLASS,                           
       RCT.INVOICE_CURRENCY_CODE CURRENCY,
       RCT.TRX_DATE INV_DATE,
       RCTD.GL_DATE GL_DATE,
       (SELECT NAME FROM APPS.RA_TERMS RAT WHERE RAT.TERM_ID =RCT.TERM_ID ) TERMS,
       RCTT.NAME Order_Type
FROM RA_CUSTOMER_TRX_ALL            RCT,
    -- RA_CUSTOMER_TRX_LINES_ALL      RCTL,
     RA_CUST_TRX_LINE_GL_DIST_ALL   RCTD,
     HZ_PARTIES                     HP,
     HZ_CUST_ACCOUNTS_ALL           HCA,
     RA_CUST_TRX_TYPES_ALL          RCTT,
     HR_OPERATING_UNITS             HOU,
     AR_PAYMENT_SCHEDULES_ALL       ARPS
WHERE RCT.CUSTOMER_TRX_ID       = RCTD.CUSTOMER_TRX_ID
--AND RCT.CUSTOMER_TRX_ID       = RCTL.CUSTOMER_TRX_ID
--AND RCTL.CUSTOMER_TRX_LINE_ID = RCTD.CUSTOMER_TRX_LINE_ID
AND   RCT.BILL_TO_CUSTOMER_ID   = HCA.CUST_ACCOUNT_ID 
AND   HP.PARTY_ID               = HCA.PARTY_ID
AND   RCT.CUST_TRX_TYPE_ID      = RCTT.CUST_TRX_TYPE_ID
AND   RCT.ORG_ID                = RCTT.ORG_ID
AND   RCT.ORG_ID                = HOU.ORGANIZATION_ID
AND   ARPS.CUSTOMER_TRX_ID(+)   = RCT.CUSTOMER_TRX_ID
AND   RCT.ORG_ID                = NVL(:P_ORG_ID,RCT.ORG_ID)
AND   RCT.TRX_NUMBER            = NVL (:TRX_NUMBER,RCT.TRX_NUMBER)  -- KAL/2017/DE/1114
AND   RCT.TRX_DATE              BETWEEN NVL(:P_TRX_DATE_FROM,RCT.TRX_DATE) and NVL(:P_TRX_DATE_TO,RCT.TRX_DATE)
AND   RCTD.GL_DATE              BETWEEN NVL(:P_GL_DATE_FROM,RCTD.GL_DATE) and NVL(:P_GL_DATE_TO,RCTD.GL_DATE)
AND   HP.PARTY_NAME             = NVL(:P_CUST_NAME,HP.PARTY_NAME)
AND   NVL(RCT.CT_REFERENCE,'XX')   = NVL(NVL(:P_SALES_ORDER_NO,RCT.CT_REFERENCE),'XX')
GROUP BY
       RCT.TRX_NUMBER,
      -- ARPS.AMOUNT_DUE_ORIGINAL,
       ARPS.AMOUNT_DUE_REMAINING,
       HP.PARTY_NAME,
       RCTT.TYPE,                     
       RCT.INVOICE_CURRENCY_CODE,
       RCT.TRX_DATE,
       RCTD.GL_DATE,
       RCT.TERM_ID,
       RCTT.NAME;

No comments:

Post a Comment

How to change Employee Number Generation from Manual to Automatic in Oracle HRMS (When attempting to apply for a job in iRecruitment)

When attempting to apply for a job in iRecruitment, the following error occurs: ERROR: You must enter an Application Number. Solution: How t...