OKL Payment Schedule

Description
Categories: BI Publisher, Financials
Application: Lease and Finance Management
Source:
Short Name: OKLPAYSCHED
DB package:
 SELECT  STM.KHR_ID KHR_ID ,
        CHRB.AUTHORING_ORG_ID ORG_ID,
        CHRB.CUST_ACCT_ID CUST_ACCOUNT_ID,
        CHRB.CONTRACT_NUMBER CONTRACT_NUMBER,
        decode(LSE.LTY_CODE,'FREE_FORM1',KLE.NAME,NULL) ASSET_NUMBER ,
        KLE.ID KLE_ID ,
        LSE.NAME,
        STYT.NAME STREAM_TYPE,
        SELB.STREAM_ELEMENT_DATE STREAM_ELEMENT_DATE ,
        SELB.AMOUNT AMOUNT ,
        CHRB.CURRENCY_CODE CURRENCY_CODE ,
        SELB.DATE_BILLED DATE_BILLED ,
        SELB.SE_LINE_NUMBER SE_LINE_NUMBER ,
        SELB.STM_ID STM_ID ,
        stm.kle_id , 
        stm.sty_id 
FROM    okl_strm_elements selb, 
        okl_streams stm, 
        okl_strm_type_tl styt,
        okl_strm_type_b styb ,
        okc_k_headers_all_b chrb ,
        okc_k_lines_v kle,
        okc_line_styles_v lse
WHERE   STM.KHR_ID = :P_CONTRACT_ID
        AND STM.PURPOSE_CODE IS NULL
        AND STM.STY_ID       = STYB.ID 
        AND STYB.ID          = STYT.ID 
        AND STYB.BILLABLE_YN = 'Y' 
        AND STYT.LANGUAGE    = USERENV('LANG') 
        AND kle.id(+) = stm.kle_id
        AND KLE.LSE_ID = LSE.ID(+)
        AND LSE.LTY_CODE IN ('FREE_FORM1','FEE','SOLD_SERVICE','LINK_SERV_ASSET')
        AND stm.say_code = 'CURR' 
        AND (selb.date_billed is null 
        OR (selb.date_billed is not null 
        AND selb.bill_adj_flag is null)) 
        AND stm.id        = selb.stm_id 
        AND stm.khr_id    = chrb.id 
        AND stm.active_yn = 'Y' 
union          
SELECT  STM.KHR_ID KHR_ID , 
        CHRB.AUTHORING_ORG_ID ORG_ID,
        CHRB.CUST_ACCT_ID CUST_ACCOUNT_ID,
        CHRB.CONTRACT_NUMBER CONTRACT_NUMBER,
        decode(LSE.LTY_CODE,'FREE_FORM1',KLE.NAME,NULL) ASSET_NUMBER ,
        KLE.ID KLE_ID ,
        LSE.NAME,
        STYT.NAME STREAM_TYPE,
        SELB.STREAM_ELEMENT_DATE STREAM_ELEMENT_DATE , 
        SELB.AMOUNT AMOUNT , 
        CHRB.CURRENCY_CODE CURRENCY_CODE , 
        SELB.DATE_BILLED DATE_BILLED , 
        SELB.SE_LINE_NUMBER SE_LINE_NUMBER , 
        SELB.STM_ID STM_ID, 
        stm.kle_id, 
        stm.sty_id 
FROM    okl_strm_elements selb, 
        okl_streams stm, 
        okl_strm_type_tl styt,
        okl_strm_type_b styb ,
        okc_k_headers_all_b chrb,
        okc_k_lines_v kle,
        okc_line_styles_v lse
WHERE   STM.KHR_ID = :P_CONTRACT_ID
     AND STM.PURPOSE_CODE IS NULL
        AND STM.STY_ID       = STYB.ID 
        AND STYB.ID          = STYT.ID 
        AND STYB.BILLABLE_YN = 'Y' 
        AND STYT.LANGUAGE    = USERENV('LANG') 
        AND kle.id(+) = stm.kle_id
        AND KLE.LSE_ID = LSE.ID(+)
        AND LSE.LTY_CODE IN ('FREE_FORM1','FEE','SOLD_SERVICE','LINK_SERV_ASSET')
        AND stm.say_code = 'HIST' 
        AND selb.date_billed is not null 
        AND selb.bill_adj_flag is null 
        AND stm.id     = selb.stm_id 
        AND stm.khr_id = chrb.id
Ask a question