OKL Amortization Schedule

Description
Categories: BI Publisher, Financials
Application: Lease and Finance Management
Source:
Short Name: OKLAMORTSCHED
DB package:
  SELECT  CHR.id Id, 
        CHR.CONTRACT_NUMBER CONTRACT_NUMBER, 
        CHR.STS_CODE CONTRACT_STATUS,
        CHR.START_DATE CONTRACT_EFFECTIVE_FROM,
        CHR.END_DATE CONTRACT_EFFECTIVE_TO,
        CHR.CURRENCY_CODE CONTRACT_CURRENCY_CODE, 
        CHR.AUTHORING_ORG_ID ORG_ID,
        CHR.CUST_ACCT_ID CUST_ACCOUNT_ID,
        (SUM(X.AMOUNT) + SUM(Y.AMOUNT)) TOTAL_PAYMENT, 
        SUM(X.AMOUNT) PRINCIPAL_PAYMENT, 
        SUM(Y.AMOUNT) INTEREST_AMOUNT, 
        SUM(Z.AMOUNT) PRINCIPAL_BALANCE, 
        X.KLE_ID KLE_ID, 
        X.STREAM_ELEMENT_DATE STREAM_ELEMENT_DATE 
FROM    OKC_K_HEADERS_ALL_B CHR,
        OKC_K_LINES_V CTR_LN,
        OKL_CS_SCHPRINC_PAYMENTS_UV X,
        OKL_CS_SCHINTR_PAYMENTS_UV Y,
        OKL_CS_SCHPRINC_BALANCE_UV Z 
WHERE   CHR.ID = :P_CONTRACT_ID
        AND CHR.id                = CTR_LN.CHR_ID 
        AND CTR_LN.ID         = X.KLE_ID 
        AND X.KLE_ID          = Y.KLE_ID 
        AND Y.KLE_ID          = Z.KLE_ID 
        AND X.STREAM_ELEMENT_DATE = Y.STREAM_ELEMENT_DATE 
        AND Y.STREAM_ELEMENT_DATE = Z.STREAM_ELEMENT_DATE 
GROUP BY X.STREAM_ELEMENT_DATE,
        CHR.ID,
        CHR.CONTRACT_NUMBER,
        CHR.STS_CODE,
        CHR.START_DATE,
        CHR.END_DATE,
        CHR.CURRENCY_CODE,
        CHR.AUTHORING_ORG_ID,
        CHR.CUST_ACCT_ID,
        X.KLE_ID,
        X.STREAM_ELEMENT_DATE