[Home] [Help]
17:
18: /* variables */
19: l_api_name CONSTANT VARCHAR2(40) := 'REVERSE_LOSS_PROVISIONS';
20: l_api_version CONSTANT NUMBER := 1.0;
21: l_source_table CONSTANT OKL_TRNS_ACC_DSTRS.SOURCE_TABLE%TYPE := 'OKL_TXL_CNTRCT_LNS';
22: l_cntrct_id OKL_K_HEADERS_FULL_V.ID%TYPE;
23: l_sysdate DATE := SYSDATE;
24: l_reversal_date DATE;
25: l_COUNT NUMBER :=0;
44:
45: -- Cursor to select transaction lines for reversal
46: CURSOR reverse_txl_csr(p_khr_id NUMBER, p_tcn_id NUMBER, p_tcn_type VARCHAR2) IS
47: SELECT txl.id, txl.amount, txl.currency_code
48: FROM OKL_TXL_CNTRCT_LNS txl, OKL_TRX_CONTRACTS trx
49: WHERE trx.khr_id = p_khr_id
50: AND txl.tcn_id = trx.id
51: AND txl.tcn_id = p_tcn_id --trx.id
52: AND trx.tsu_code = 'PROCESSED'
64:
65: -- Cursor to select all transaction lines for reversal
66: CURSOR reverse_all_txl_csr(p_khr_id NUMBER, p_tcn_id NUMBER) IS
67: SELECT txl.id, txl.amount, txl.currency_code
68: FROM OKL_TXL_CNTRCT_LNS txl, OKL_TRX_CONTRACTS trx
69: WHERE trx.khr_id = p_khr_id
70: AND txl.tcn_id = trx.id
71: AND txl.tcn_id = p_tcn_id --trx.id
72: AND trx.tsu_code = 'PROCESSED'