1848: -- Parameters : out yield pl/sql table of recors
1849: -- Version :
1850: -- End of Commnets
1851: -------------------------------------------------------------------------------------------------
1852: FUNCTION yield_request(x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type)
1853: RETURN VARCHAR2 IS
1854: l_prog_name VARCHAR2(100) := 'YIELD_REQUEST';
1855: x_return_status VARCHAR2(3) := okl_api.g_ret_sts_success;
1856: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
1852: FUNCTION yield_request(x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type)
1853: RETURN VARCHAR2 IS
1854: l_prog_name VARCHAR2(100) := 'YIELD_REQUEST';
1855: x_return_status VARCHAR2(3) := okl_api.g_ret_sts_success;
1856: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
1857: BEGIN
1858: -- Pre tax IRR with subsidy
1859: l_csm_yields_tbl(1).yield_name := 'PTIRR';
1860: l_csm_yields_tbl(1).method := 'Internal rate-of-return';
2335: -- Version :
2336: -- End of Commnets
2337: -------------------------------------------------------------------------------------------------
2338: FUNCTION append_perd_exp_tbl(p_khr_id IN OKC_K_HEADERS_B.ID%TYPE,
2339: p_csm_perd_exp_tbl IN OUT NOCOPY OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type)
2340: RETURN VARCHAR2 IS
2341: l_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type := p_csm_perd_exp_tbl;
2342: m_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2343: mx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2337: -------------------------------------------------------------------------------------------------
2338: FUNCTION append_perd_exp_tbl(p_khr_id IN OKC_K_HEADERS_B.ID%TYPE,
2339: p_csm_perd_exp_tbl IN OUT NOCOPY OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type)
2340: RETURN VARCHAR2 IS
2341: l_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type := p_csm_perd_exp_tbl;
2342: m_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2343: mx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2344: lx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2345: i NUMBER := 0;
2338: FUNCTION append_perd_exp_tbl(p_khr_id IN OKC_K_HEADERS_B.ID%TYPE,
2339: p_csm_perd_exp_tbl IN OUT NOCOPY OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type)
2340: RETURN VARCHAR2 IS
2341: l_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type := p_csm_perd_exp_tbl;
2342: m_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2343: mx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2344: lx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2345: i NUMBER := 0;
2346: m NUMBER := 0;
2339: p_csm_perd_exp_tbl IN OUT NOCOPY OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type)
2340: RETURN VARCHAR2 IS
2341: l_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type := p_csm_perd_exp_tbl;
2342: m_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2343: mx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2344: lx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2345: i NUMBER := 0;
2346: m NUMBER := 0;
2347: n NUMBER := 0;
2340: RETURN VARCHAR2 IS
2341: l_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type := p_csm_perd_exp_tbl;
2342: m_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2343: mx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2344: lx_csm_perd_exp_tbl OKL_CREATE_STREAMS_PUB.csm_periodic_expenses_tbl_type;
2345: i NUMBER := 0;
2346: m NUMBER := 0;
2347: n NUMBER := 0;
2348: ld_start_date OKC_K_HEADERS_B.START_DATE%TYPE;
2409: l_csm_perd_exp_tbl(j).level_index_number := 0;
2410: l_csm_perd_exp_tbl(j).number_of_periods := 1;
2411: l_csm_perd_exp_tbl(j).lock_level_step := NULL;
2412: -- Start modification bug#3145540,3145597
2413: l_csm_perd_exp_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
2414: -- End modification bug#3145540,3145597
2415: l_csm_perd_exp_tbl(j).query_level_yn := NULL;
2416: l_csm_perd_exp_tbl(j).structure := NULL;
2417: l_csm_perd_exp_tbl(j).amount := 0;
8041: x_msg_count OUT NOCOPY NUMBER,
8042: x_msg_data OUT NOCOPY VARCHAR2,
8043: p_chr_id IN OKC_K_HEADERS_B.ID%TYPE,
8044: p_deal_type IN VARCHAR2,
8045: p_stream_types_tbl IN okl_create_streams_pub.csm_stream_types_tbl_type,
8046: x_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8047: l_api_name VARCHAR2(256) := 'CHECK_FOR_MD_STRMS';
8048: i NUMBER;
8049: styid NUMBER;
8042: x_msg_data OUT NOCOPY VARCHAR2,
8043: p_chr_id IN OKC_K_HEADERS_B.ID%TYPE,
8044: p_deal_type IN VARCHAR2,
8045: p_stream_types_tbl IN okl_create_streams_pub.csm_stream_types_tbl_type,
8046: x_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8047: l_api_name VARCHAR2(256) := 'CHECK_FOR_MD_STRMS';
8048: i NUMBER;
8049: styid NUMBER;
8050: l_return_status VARCHAR2(1);
8621: p_init_msg_list IN VARCHAR2 DEFAULT OKL_API.G_FALSE,
8622: x_msg_count OUT NOCOPY NUMBER,
8623: x_msg_data OUT NOCOPY VARCHAR2,
8624: x_return_status OUT NOCOPY VARCHAR2,
8625: px_csm_lease_header IN OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
8626: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
8627: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
8628: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8629:
8622: x_msg_count OUT NOCOPY NUMBER,
8623: x_msg_data OUT NOCOPY VARCHAR2,
8624: x_return_status OUT NOCOPY VARCHAR2,
8625: px_csm_lease_header IN OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
8626: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
8627: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
8628: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8629:
8630: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_SECURITY_DEPOSIT';
8623: x_msg_data OUT NOCOPY VARCHAR2,
8624: x_return_status OUT NOCOPY VARCHAR2,
8625: px_csm_lease_header IN OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
8626: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
8627: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
8628: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8629:
8630: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_SECURITY_DEPOSIT';
8631: l_api_version CONSTANT NUMBER := 1;
8624: x_return_status OUT NOCOPY VARCHAR2,
8625: px_csm_lease_header IN OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
8626: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
8627: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
8628: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
8629:
8630: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_SECURITY_DEPOSIT';
8631: l_api_version CONSTANT NUMBER := 1;
8632:
8770: --end
8771: l := l + 1;
8772: px_csm_one_off_fee_tbl(l).description := l_strm_name;
8773: px_csm_one_off_fee_tbl(l).fee_type := 'SECDEPOSIT';
8774: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
8775: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec1.id;
8776:
8777: OPEN l_rl_csr1 ( 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_lne_rec1.id );
8778: FETCH l_rl_csr1 INTO l_rl_rec1;
8875: x_return_status OUT NOCOPY VARCHAR2,
8876: x_msg_count OUT NOCOPY NUMBER,
8877: x_msg_data OUT NOCOPY VARCHAR2,
8878: p_chr_id IN NUMBER,
8879: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type)
8880:
8881: AS
8882: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_SUBSIDIZED_LINES';
8883: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type := px_csm_one_off_fee_tbl;
8879: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type)
8880:
8881: AS
8882: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_SUBSIDIZED_LINES';
8883: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type := px_csm_one_off_fee_tbl;
8884: i BINARY_INTEGER := 0;
8885: lv_acc_mtd_code okl_subsidies_b.accounting_method_code%TYPE := NULL;
8886: lv_strm_desc VARCHAR2(200);
8887: ln_sub_id okc_k_lines_b.id%TYPE := NULL;
9096: p_token1_value => 'Subsidy Records');
9097: x_return_status := OKL_API.G_RET_STS_ERROR;
9098: EXIT WHEN (x_return_status = OKL_API.G_RET_STS_ERROR);
9099: END IF;
9100: l_csm_one_off_fee_tbl(i).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9101: l_csm_one_off_fee_tbl(i).date_paid := get_asset_lines_rec.date_funding;
9102: l_csm_one_off_fee_tbl(i).kle_asset_id := get_asset_lines_rec.id;
9103: l_csm_one_off_fee_tbl(i).other_type_id := get_acc_mth_code_rec.id;
9104: l_csm_one_off_fee_tbl(i).other_type := G_SFE_TYPE_SUBSIDY;
9241: p_token1_value => 'Subsidy Records');
9242: x_return_status := OKL_API.G_RET_STS_ERROR;
9243: EXIT WHEN (x_return_status = OKL_API.G_RET_STS_ERROR);
9244: END IF;
9245: l_csm_one_off_fee_tbl(i).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9246: l_csm_one_off_fee_tbl(i).date_paid := get_asset_lines_rec.date_funding;
9247: l_csm_one_off_fee_tbl(i).kle_asset_id := get_asset_lines_rec.id;
9248: l_csm_one_off_fee_tbl(i).other_type_id := get_acc_mth_code_rec.id;
9249: l_csm_one_off_fee_tbl(i).other_type := G_SFE_TYPE_SUBSIDY;
9375: p_init_msg_list IN VARCHAR2 DEFAULT OKL_API.G_FALSE,
9376: x_msg_count OUT NOCOPY NUMBER,
9377: x_msg_data OUT NOCOPY VARCHAR2,
9378: x_return_status OUT NOCOPY VARCHAR2,
9379: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
9380: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
9381: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
9382:
9383: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_FEE_LINES';
9376: x_msg_count OUT NOCOPY NUMBER,
9377: x_msg_data OUT NOCOPY VARCHAR2,
9378: x_return_status OUT NOCOPY VARCHAR2,
9379: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
9380: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
9381: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
9382:
9383: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_FEE_LINES';
9384: l_api_version CONSTANT NUMBER := 1;
9377: x_msg_data OUT NOCOPY VARCHAR2,
9378: x_return_status OUT NOCOPY VARCHAR2,
9379: px_csm_one_off_fee_tbl IN OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
9380: px_csm_periodic_expenses_tbl IN OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
9381: px_csm_stream_types_tbl IN OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
9382:
9383: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_FEE_LINES';
9384: l_api_version CONSTANT NUMBER := 1;
9385: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
9416: --INDEX BY BINARY_INTEGER;
9417: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
9418:
9419:
9420: px_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
9421:
9422: /* ER# 5150038 */
9423: /* This cursor is used to fetch the linked asset lines when fees are associated to assets */
9424: CURSOR l_linked_asset_line_csr (p_chr_d NUMBER,
9795: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
9796: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
9797: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
9798: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9799: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9800: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9801: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
9802: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9803: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9796: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
9797: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
9798: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9799: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9800: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9801: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
9802: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9803: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9804:
9810: -- Added by kthiruva on 29-Dec-2005.
9811: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
9812: -- Bug 4915938 - Start of Changes
9813: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9814: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9815: ELSE
9816: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9817: END IF;
9818: -- Bug 4915938 - End of Changes
9812: -- Bug 4915938 - Start of Changes
9813: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9814: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9815: ELSE
9816: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9817: END IF;
9818: -- Bug 4915938 - End of Changes
9819:
9820: ELSIF (l_rl_rec.rule_information7 IS NULL OR
9831: -- gboomina Bug 4746368 - Modified amount calculation - Start
9832: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount - l_pass_thru_amount;
9833: -- gboomina Bug 4746368 - Modified amount calculation - End
9834: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
9835: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9836: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9837: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9838: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9839: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9833: -- gboomina Bug 4746368 - Modified amount calculation - End
9834: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
9835: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9836: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9837: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9838: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9839: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9840:
9841: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
9841: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
9842: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
9843: END IF;
9844: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9845: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9846: ELSE
9847: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9848: END IF;
9849: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
9843: END IF;
9844: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9845: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9846: ELSE
9847: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9848: END IF;
9849: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
9850: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
9851: ELSE
9863: -- gboomina Bug 4746368 - Modified amount calculation - Start
9864: px_csm_periodic_expenses_tbl(k).amount := l_linked_asset_line_rec.amount - l_pass_thru_amount;
9865: -- gboomina Bug 4746368 - Modified amount calculation - End
9866: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
9867: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9868: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9869: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9870: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
9871: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9864: px_csm_periodic_expenses_tbl(k).amount := l_linked_asset_line_rec.amount - l_pass_thru_amount;
9865: -- gboomina Bug 4746368 - Modified amount calculation - End
9866: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
9867: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9868: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9869: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9870: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
9871: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9872: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9867: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9868: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9869: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
9870: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
9871: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9872: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9873: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9874:
9875: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
9920: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
9921: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
9922: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
9923: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9924: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9925: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9926: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
9927: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9928: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9921: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
9922: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
9923: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9924: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9925: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9926: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
9927: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9928: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9929:
9935: -- Added by kthiruva on 29-Dec-2005.
9936: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
9937: -- Bug 4915938 - Start of Changes
9938: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9939: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9940: ELSE
9941: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9942: END IF;
9943: -- Bug 4915938 - End of Changes
9937: -- Bug 4915938 - Start of Changes
9938: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9939: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9940: ELSE
9941: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9942: END IF;
9943: -- Bug 4915938 - End of Changes
9944:
9945: ELSIF (l_rl_rec.rule_information7 IS NULL OR
9956: -- gboomina Bug 4746368 - Modified amount calculation - Start
9957: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount - l_pass_thru_amount;
9958: -- gboomina Bug 4746368 - Modified amount calculation - End
9959: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
9960: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9961: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9962: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9963: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9964: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9958: -- gboomina Bug 4746368 - Modified amount calculation - End
9959: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
9960: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9961: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9962: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9963: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9964: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9965:
9966: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
9966: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
9967: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
9968: END IF;
9969: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9970: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9971: ELSE
9972: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9973: END IF;
9974: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
9968: END IF;
9969: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
9970: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
9971: ELSE
9972: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9973: END IF;
9974: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
9975: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
9976: ELSE
9988: -- gboomina Bug 4746368 - Modified amount calculation - Start
9989: px_csm_periodic_expenses_tbl(k).amount := l_lne_rec.amount - l_pass_thru_amount;
9990: -- gboomina Bug 4746368 - Modified amount calculation - End
9991: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
9992: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9993: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9994: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9995: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
9996: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9989: px_csm_periodic_expenses_tbl(k).amount := l_lne_rec.amount - l_pass_thru_amount;
9990: -- gboomina Bug 4746368 - Modified amount calculation - End
9991: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
9992: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9993: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9994: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9995: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
9996: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9997: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9992: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
9993: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
9994: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
9995: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
9996: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
9997: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
9998: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
9999:
10000: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
10056: If ( nvl(l_lne_rec.initial_direct_cost,0) > 0.0 ) Then
10057: l := l + 1;
10058: px_csm_one_off_fee_tbl(l).description := l_fee_strm_type_rec.strm_name;
10059: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
10060: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10061: px_csm_one_off_fee_tbl(l).amount := l_lne_rec.initial_direct_cost * l_ratio;
10062: px_csm_one_off_fee_tbl(l).date_paid := l_linked_asset_line_rec.start_date;
10063: px_csm_one_off_fee_tbl(l).kle_fee_id := l_linked_asset_line_rec.id; -- Assign linked fee asset line id
10064: -- gboomina BUG#4508077 IDC changes start
10061: px_csm_one_off_fee_tbl(l).amount := l_lne_rec.initial_direct_cost * l_ratio;
10062: px_csm_one_off_fee_tbl(l).date_paid := l_linked_asset_line_rec.start_date;
10063: px_csm_one_off_fee_tbl(l).kle_fee_id := l_linked_asset_line_rec.id; -- Assign linked fee asset line id
10064: -- gboomina BUG#4508077 IDC changes start
10065: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
10066: -- gboomina BUG#4508077 IDC changes end
10067: End If;
10068: --Added by kthiruva on 15-Feb-2006
10069: -- Streams for the fee need to be retrieved if Pricing Name is setup for the same
10141: IF NVL(l_lne_rec.amount,-1) <> NVL(l_lne_rec.initial_direct_cost,-1) THEN
10142: -- sjalasut, bug 4872258. assumption is now -1 instead of zero. END
10143: k := k + 1;
10144: px_csm_periodic_expenses_tbl(k).level_index_number := 1;
10145: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10146: px_csm_periodic_expenses_tbl(k).description := l_fee_strm_type_rec.strm_name;
10147: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10148: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION2,'0'));
10149: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION1, l_hdr_rec.term));
10149: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION1, l_hdr_rec.term));
10150: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount - (NVL(l_lne_rec.initial_direct_cost,0)/px_csm_periodic_expenses_tbl(k).number_of_periods);
10151: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount * l_ratio;
10152: px_csm_periodic_expenses_tbl(k).period := l_rl_rec1.object1_id1;
10153: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10154: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10155: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10156: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10157: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10152: px_csm_periodic_expenses_tbl(k).period := l_rl_rec1.object1_id1;
10153: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10154: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10155: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10156: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10157: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10158: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10159: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10160: END IF;
10153: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10154: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10155: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10156: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10157: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10158: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10159: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10160: END IF;
10161: Elsif ( l_fee_type <> 'MISCELLANEOUS' ) Then
10163: --px_csm_stream_types_tbl(m).stream_type_id := l_fee_strm_type_rec.styp_id;
10164: --px_csm_stream_types_tbl(m).kle_fee_id := l_linked_asset_line_rec.id;
10165: k := k + 1;
10166: px_csm_periodic_expenses_tbl(k).level_index_number := 1;
10167: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10168: px_csm_periodic_expenses_tbl(k).description := l_fee_strm_type_rec.strm_name;
10169: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10170: px_csm_periodic_expenses_tbl(k).amount := nvl(l_lne_rec.amount,0)-nvl(l_lne_rec.initial_direct_cost,0);
10171: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount * l_ratio;
10170: px_csm_periodic_expenses_tbl(k).amount := nvl(l_lne_rec.amount,0)-nvl(l_lne_rec.initial_direct_cost,0);
10171: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount * l_ratio;
10172: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10173: px_csm_periodic_expenses_tbl(k).period := 'M';
10174: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10175: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10176: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10177: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10178: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10173: px_csm_periodic_expenses_tbl(k).period := 'M';
10174: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10175: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10176: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10177: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10178: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10179: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10180: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10181:
10174: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10175: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10176: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10177: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10178: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10179: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10180: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10181:
10182: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
10291: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
10292: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10293: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10294: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10295: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10296: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10297: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10298: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10299: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10292: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10293: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10294: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10295: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10296: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10297: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10298: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10299: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10300: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10307: -- Added by kthiruva on 29-Dec-2005.
10308: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
10309: -- Bug 4915938 - Start of Changes
10310: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10311: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10312: ELSE
10313: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10314: END IF;
10315: -- Bug 4915938 - End of Changes
10309: -- Bug 4915938 - Start of Changes
10310: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10311: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10312: ELSE
10313: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10314: END IF;
10315: -- Bug 4915938 - End of Changes
10316: ELSIF (l_rl_rec.rule_information7 IS NULL OR
10317: l_rl_rec.rule_information7 = OKL_API.G_MISS_CHAR) AND
10325: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10326: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
10327: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
10328: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
10329: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10330: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10331: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10332: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10333: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10326: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
10327: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
10328: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
10329: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10330: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10331: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10332: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10333: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10334:
10335: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
10336: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
10337: END IF;
10338: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10339: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10340: ELSE
10341: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10342: END IF;
10343: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
10337: END IF;
10338: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10339: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10340: ELSE
10341: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10342: END IF;
10343: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
10344: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
10345: ELSE
10377: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10378: px_csm_periodic_expenses_tbl(k).period := 'M';
10379: px_csm_periodic_expenses_tbl(k).amount := l_linked_asset_line_rec.amount;
10380: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10381: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10382: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10383: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10384: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10385: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10378: px_csm_periodic_expenses_tbl(k).period := 'M';
10379: px_csm_periodic_expenses_tbl(k).amount := l_linked_asset_line_rec.amount;
10380: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10381: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10382: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10383: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10384: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10385: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10386: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10381: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10382: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10383: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10384: px_csm_periodic_expenses_tbl(k).date_start := l_linked_asset_line_rec.start_date;
10385: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10386: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10387: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10388:
10389: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
10399: If ( nvl(l_lne_rec.initial_direct_cost,0) > 0.0 ) Then
10400: l := l + 1;
10401: px_csm_one_off_fee_tbl(l).description := l_strm_name;
10402: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
10403: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10404: px_csm_one_off_fee_tbl(l).amount := l_lne_rec.initial_direct_cost;
10405: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
10406: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
10407: -- gboomina BUG#4508077 IDC changes start
10404: px_csm_one_off_fee_tbl(l).amount := l_lne_rec.initial_direct_cost;
10405: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
10406: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
10407: -- gboomina BUG#4508077 IDC changes start
10408: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
10409: -- gboomina BUG#4508077 IDC changes end
10410: End If;
10411: --Added by kthiruva on 15-Feb-2006
10412: -- Streams for the fee need to be retrieved if Pricing Name is setup for the same
10482: IF NVL(l_lne_rec.amount,-1) <> NVL(l_lne_rec.initial_direct_cost,-1) THEN
10483: -- sjalasut, bug 4872258. assumption is now -1 instead of zero. END
10484: k := k + 1;
10485: px_csm_periodic_expenses_tbl(k).level_index_number := 1;
10486: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10487: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10488: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10489: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION2,'0'));
10490: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION1, l_hdr_rec.term));
10489: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION2,'0'));
10490: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec2_exp.RULE_INFORMATION1, l_hdr_rec.term));
10491: px_csm_periodic_expenses_tbl(k).amount := px_csm_periodic_expenses_tbl(k).amount - (NVL(l_lne_rec.initial_direct_cost,0)/px_csm_periodic_expenses_tbl(k).number_of_periods);
10492: px_csm_periodic_expenses_tbl(k).period := l_rl_rec1.object1_id1;
10493: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10494: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10495: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10496: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10497: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10492: px_csm_periodic_expenses_tbl(k).period := l_rl_rec1.object1_id1;
10493: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10494: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10495: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10496: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10497: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10498: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10499: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10500: END IF;
10493: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10494: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10495: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10496: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10497: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10498: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10499: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10500: END IF;
10501: Elsif ( l_fee_type <> 'MISCELLANEOUS' ) Then
10521: --srsreeni Bug6149951 ends
10522: --px_csm_stream_types_tbl(m).kle_fee_id := l_lne_rec.id;
10523: k := k + 1;
10524: px_csm_periodic_expenses_tbl(k).level_index_number := 1;
10525: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10526: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10527: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10528: px_csm_periodic_expenses_tbl(k).amount := nvl(l_lne_rec.amount,0)-nvl(l_lne_rec.initial_direct_cost,0);
10529: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10527: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10528: px_csm_periodic_expenses_tbl(k).amount := nvl(l_lne_rec.amount,0)-nvl(l_lne_rec.initial_direct_cost,0);
10529: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10530: px_csm_periodic_expenses_tbl(k).period := 'M';
10531: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10532: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10533: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10534: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10535: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10530: px_csm_periodic_expenses_tbl(k).period := 'M';
10531: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10532: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10533: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10534: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10535: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10536: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10537: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10538:
10531: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10532: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10533: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10534: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10535: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10536: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10537: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10538:
10539: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
10631: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
10632: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10633: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10634: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10635: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10636: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10637: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10638: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10639: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10632: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10633: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10634: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10635: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10636: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10637: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10638: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10639: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10640: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10647: -- Added by kthiruva on 29-Dec-2005.
10648: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
10649: -- Bug 4915938 - Start of Changes
10650: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10651: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10652: ELSE
10653: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10654: END IF;
10655: -- Bug 4915938 - End of Changes
10649: -- Bug 4915938 - Start of Changes
10650: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10651: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10652: ELSE
10653: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10654: END IF;
10655: -- Bug 4915938 - End of Changes
10656: ELSIF (l_rl_rec.rule_information7 IS NULL OR
10657: l_rl_rec.rule_information7 = OKL_API.G_MISS_CHAR) AND
10665: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10666: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
10667: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
10668: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
10669: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10670: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10671: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10672: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10673: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10666: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
10667: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
10668: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
10669: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10670: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10671: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10672: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10673: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10674:
10675: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
10676: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
10677: END IF;
10678: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10679: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10680: ELSE
10681: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10682: END IF;
10683: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
10677: END IF;
10678: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10679: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10680: ELSE
10681: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10682: END IF;
10683: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
10684: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
10685: ELSE
10715: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10716: px_csm_periodic_expenses_tbl(k).period := 'M';
10717: px_csm_periodic_expenses_tbl(k).amount := l_lne_rec.amount;
10718: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10719: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10720: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10721: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10722: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10723: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10716: px_csm_periodic_expenses_tbl(k).period := 'M';
10717: px_csm_periodic_expenses_tbl(k).amount := l_lne_rec.amount;
10718: px_csm_periodic_expenses_tbl(k).number_of_periods := 1;
10719: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10720: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10721: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10722: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10723: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10724: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10719: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10720: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10721: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10722: px_csm_periodic_expenses_tbl(k).date_start := l_lne_rec.start_date;
10723: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10724: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10725: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10726:
10727: print( l_api_name, 'amnt='||to_char(px_csm_periodic_expenses_tbl(k).amount)||
10767: FOR l_linked_asset_line_rec IN l_linked_asset_line_csr(p_chr_id, l_lne_rec.id) LOOP
10768: l := l + 1;
10769: px_csm_one_off_fee_tbl(l).description := l_strm_name_fin_rec.strm_name;
10770: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
10771: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10772: px_csm_one_off_fee_tbl(l).amount := l_linked_asset_line_rec.amount;
10773: px_csm_one_off_fee_tbl(l).date_paid := l_linked_asset_line_rec.start_date;
10774: px_csm_one_off_fee_tbl(l).kle_fee_id := l_linked_asset_line_rec.id;
10775:
10840: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
10841: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10842: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10843: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10844: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10845: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10846: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10847: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10848: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10841: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10842: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10843: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10844: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10845: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10846: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10847: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10848: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10849: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10857: -- Added by kthiruva on 29-Dec-2005.
10858: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
10859: -- Bug 4915938 - Start of Changes
10860: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10861: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10862: ELSE
10863: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10864: END IF;
10865: -- Bug 4915938 - End of Changes
10859: -- Bug 4915938 - Start of Changes
10860: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10861: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10862: ELSE
10863: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10864: END IF;
10865: -- Bug 4915938 - End of Changes
10866:
10867: ELSIF (l_rl_rec.rule_information7 IS NULL OR
10875: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10876: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
10877: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
10878: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
10879: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10880: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10881: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10882: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10883: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10877: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
10878: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
10879: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10880: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_linked_asset_line_rec.id;
10881: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10882: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10883: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
10884:
10885: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
10885: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
10886: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.rule_information5);
10887: END IF;
10888: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10889: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10890: ELSE
10891: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10892: END IF;
10893: IF(l_rl_rec.rule_information2 IS NULL OR
10887: END IF;
10888: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10889: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10890: ELSE
10891: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
10892: END IF;
10893: IF(l_rl_rec.rule_information2 IS NULL OR
10894: l_rl_rec.rule_information2 = OKL_API.G_MISS_CHAR) THEN
10895: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
10905: ELSE
10906: l := l + 1;
10907: px_csm_one_off_fee_tbl(l).description := l_strm_name_fin_rec.strm_name;
10908: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
10909: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
10910: px_csm_one_off_fee_tbl(l).amount := l_strm_name_fin_rec.amount;
10911: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
10912: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
10913:
10976: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
10977: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10978: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10979: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10980: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10981: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10982: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10983: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10984: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10977: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
10978: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
10979: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
10980: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
10981: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
10982: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
10983: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
10984: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
10985: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
10993: -- Added by kthiruva on 29-Dec-2005.
10994: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
10995: -- Bug 4915938 - Start of Changes
10996: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10997: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10998: ELSE
10999: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11000: END IF;
11001: -- Bug 4915938 - End of Changes
10995: -- Bug 4915938 - Start of Changes
10996: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
10997: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
10998: ELSE
10999: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11000: END IF;
11001: -- Bug 4915938 - End of Changes
11002:
11003: ELSIF (l_rl_rec.rule_information7 IS NULL OR
11011: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11012: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
11013: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11014: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11015: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11016: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11017: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11018: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11019: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11013: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11014: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11015: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11016: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11017: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11018: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11019: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11020:
11021: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11021: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11022: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.rule_information5);
11023: END IF;
11024: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11025: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11026: ELSE
11027: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11028: END IF;
11029: IF(l_rl_rec.rule_information2 IS NULL OR
11023: END IF;
11024: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11025: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11026: ELSE
11027: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11028: END IF;
11029: IF(l_rl_rec.rule_information2 IS NULL OR
11030: l_rl_rec.rule_information2 = OKL_API.G_MISS_CHAR) THEN
11031: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
11069:
11070: l := l + 1;
11071: px_csm_one_off_fee_tbl(l).description := l_strm_name_abs_rec.strm_name;
11072: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
11073: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
11074: px_csm_one_off_fee_tbl(l).amount := link_rollover_rec.amount;
11075: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
11076: px_csm_one_off_fee_tbl(l).kle_fee_id := link_rollover_rec.id;
11077:
11148: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
11149: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11150: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11151: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11152: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11153: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11154: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11155: px_csm_periodic_expenses_tbl(k).kle_fee_id := link_rollover_rec.id;
11156: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11149: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11150: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11151: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11152: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11153: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11154: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11155: px_csm_periodic_expenses_tbl(k).kle_fee_id := link_rollover_rec.id;
11156: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11157: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11165: -- Added by kthiruva on 29-Dec-2005.
11166: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
11167: -- Bug 4915938 - Start of Changes
11168: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11169: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11170: ELSE
11171: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11172: END IF;
11173: -- Bug 4915938 - End of Changes
11167: -- Bug 4915938 - Start of Changes
11168: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11169: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11170: ELSE
11171: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11172: END IF;
11173: -- Bug 4915938 - End of Changes
11174:
11175: ELSIF (l_rl_rec.rule_information7 IS NULL OR
11183: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11184: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
11185: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11186: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11187: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11188: px_csm_periodic_expenses_tbl(k).kle_fee_id := link_rollover_rec.id;
11189: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11190: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11191: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11185: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11186: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11187: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11188: px_csm_periodic_expenses_tbl(k).kle_fee_id := link_rollover_rec.id;
11189: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11190: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11191: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11192:
11193: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11193: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11194: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.rule_information5);
11195: END IF;
11196: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11197: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11198: ELSE
11199: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11200: END IF;
11201: IF(l_rl_rec.rule_information2 IS NULL OR
11195: END IF;
11196: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11197: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11198: ELSE
11199: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11200: END IF;
11201: IF(l_rl_rec.rule_information2 IS NULL OR
11202: l_rl_rec.rule_information2 = OKL_API.G_MISS_CHAR) THEN
11203: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
11215: IF l_link_fee_asset_yn = 'FALSE' THEN
11216: l := l + 1;
11217: px_csm_one_off_fee_tbl(l).description := l_strm_name_abs_rec.strm_name;
11218: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
11219: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
11220: px_csm_one_off_fee_tbl(l).amount := l_strm_name_abs_rec.amount;
11221: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
11222: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
11223: OPEN l_rl_csr2 ( 'LALEVL', 'LASLH', TO_NUMBER(p_chr_id), l_lne_rec.id );
11283: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
11284: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11285: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11286: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11287: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11288: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11289: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11290: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11291: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11284: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11285: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11286: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11287: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11288: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11289: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11290: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11291: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11292: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11300: -- Added by kthiruva on 29-Dec-2005.
11301: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
11302: -- Bug 4915938 - Start of Changes
11303: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11304: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11305: ELSE
11306: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11307: END IF;
11308: -- Bug 4915938 - End of Changes
11302: -- Bug 4915938 - Start of Changes
11303: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11304: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11305: ELSE
11306: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11307: END IF;
11308: -- Bug 4915938 - End of Changes
11309:
11310: ELSIF (l_rl_rec.rule_information7 IS NULL OR
11318: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11319: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
11320: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11321: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11322: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11323: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11324: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11325: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11326: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11320: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11321: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11322: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11323: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11324: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11325: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11326: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11327:
11328: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11328: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11329: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.rule_information5);
11330: END IF;
11331: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11332: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11333: ELSE
11334: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11335: END IF;
11336: IF(l_rl_rec.rule_information2 IS NULL OR
11330: END IF;
11331: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11332: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11333: ELSE
11334: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11335: END IF;
11336: IF(l_rl_rec.rule_information2 IS NULL OR
11337: l_rl_rec.rule_information2 = OKL_API.G_MISS_CHAR) THEN
11338: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
11377: FOR l_linked_asset_line_rec IN l_linked_asset_line_csr(p_chr_id, l_lne_rec.id) LOOP
11378: l := l + 1;
11379: px_csm_one_off_fee_tbl(l).description := l_strm_name_abs_rec.strm_name;
11380: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
11381: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
11382: px_csm_one_off_fee_tbl(l).amount := l_linked_asset_line_rec.amount;
11383: px_csm_one_off_fee_tbl(l).date_paid := l_linked_asset_line_rec.start_date;
11384: px_csm_one_off_fee_tbl(l).kle_fee_id := l_linked_asset_line_rec.id;
11385:
11384: px_csm_one_off_fee_tbl(l).kle_fee_id := l_linked_asset_line_rec.id;
11385:
11386: -- gboomina BUG#4508077 changes start
11387: IF('RVI' = l_strm_name_abs_rec.fee_purpose_code) THEN
11388: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
11389: -- populating the interface table records if pricing name is not null
11390: -- vdamerla Bug6149951
11391: --vdamerla Bug6149951 start
11392: IF l_linked_asset_line_rec.STE_CODE <> 'TERMINATED' THEN
11447:
11448: --End of modification for Bug#3320656 BAKUCHIB Modified
11449: -- gboomina BUG#4598620 changes start
11450: -- requesting all ABSORBED fees as IDC fees
11451: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
11452: -- gboomina BUG#4598620 changes end
11453: END LOOP; -- l_linked_asset_line_csr
11454: ELSE
11455: l := l + 1;
11454: ELSE
11455: l := l + 1;
11456: px_csm_one_off_fee_tbl(l).description := l_strm_name_abs_rec.strm_name;
11457: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
11458: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
11459: px_csm_one_off_fee_tbl(l).amount := l_strm_name_abs_rec.amount;
11460: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
11461: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
11462:
11461: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
11462:
11463: -- gboomina BUG#4508077 changes start
11464: IF('RVI' = l_strm_name_abs_rec.fee_purpose_code) THEN
11465: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
11466: -- populating the interface table records if pricing name is not null
11467: get_primary_pricing_name
11468: (
11469: p_khr_id =>p_chr_id,
11515:
11516: --End of modification for Bug#3320656 BAKUCHIB Modified
11517: -- gboomina BUG#4598620 changes start
11518: -- requesting all ABSORBED fees as IDC fees
11519: px_csm_one_off_fee_tbl(l).idc_accounting_flag := OKL_CREATE_STREAMS_PUB.G_FND_YES;
11520: -- gboomina BUG#4598620 changes end
11521: END IF; -- l_asset_association
11522:
11523: ELSIF l_fee_type = 'INCOME' THEN
11617: FETCH l_rl_csr INTO r_rl_rec;
11618: CLOSE l_rl_csr;
11619: px_csm_one_off_fee_tbl(l).description := l_strm_name;
11620: px_csm_one_off_fee_tbl(l).fee_type := l_fee_type;
11621: px_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11622: px_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(r_rl_rec.rule_information6);
11623: px_csm_one_off_fee_tbl(l).date_paid := l_lne_rec.start_date;
11624: px_csm_one_off_fee_tbl(l).kle_fee_id := l_lne_rec.id;
11625:
11690: px_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
11691: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11692: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11693: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11694: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11695: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11696: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11697: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11698: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11691: px_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
11692: px_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
11693: px_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
11694: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11695: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11696: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11697: px_csm_periodic_expenses_tbl(k).description := l_strm_name;
11698: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11699: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11707: -- Added by kthiruva on 29-Dec-2005.
11708: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
11709: -- Bug 4915938 - Start of Changes
11710: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11711: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11712: ELSE
11713: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11714: END IF;
11715: -- Bug 4915938 - End of Changes
11709: -- Bug 4915938 - Start of Changes
11710: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11711: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11712: ELSE
11713: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11714: END IF;
11715: -- Bug 4915938 - End of Changes
11716:
11717: ELSIF (l_rl_rec.rule_information7 IS NULL OR
11725: px_csm_periodic_expenses_tbl(k).fee_type := l_fee_type;
11726: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
11727: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11728: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11729: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11730: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11731: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11732: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11733: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11726: px_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
11727: px_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.rule_information6,'0'));
11728: px_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.rule_information3, l_hdr_rec.term));
11729: px_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
11730: px_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
11731: px_csm_periodic_expenses_tbl(k).kle_fee_id := l_lne_rec.id;
11732: px_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
11733: px_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
11734:
11735: IF(l_rl_rec.rule_information5 IS NOT NULL) THEN
11736: px_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.rule_information5);
11737: END IF;
11738: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11739: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11740: ELSE
11741: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11742: END IF;
11743: IF(l_rl_rec.rule_information2 IS NULL OR
11737: END IF;
11738: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
11739: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
11740: ELSE
11741: px_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
11742: END IF;
11743: IF(l_rl_rec.rule_information2 IS NULL OR
11744: l_rl_rec.rule_information2 = OKL_API.G_MISS_CHAR) THEN
11745: px_csm_periodic_expenses_tbl(k).date_start:=l_hdr_rec.start_date;
11858: x_msg_data OUT NOCOPY VARCHAR2,
11859: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
11860: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
11861: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
11862: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
11863: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
11864: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
11865: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
11866:
11859: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
11860: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
11861: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
11862: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
11863: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
11864: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
11865: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
11866:
11867: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_DEAL';
11860: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
11861: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
11862: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
11863: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
11864: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
11865: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
11866:
11867: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_DEAL';
11868: l_api_version CONSTANT NUMBER := 1;
11861: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
11862: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
11863: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
11864: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
11865: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
11866:
11867: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_DEAL';
11868: l_api_version CONSTANT NUMBER := 1;
11869: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
11928: l_struct_rec l_struct_csr%ROWTYPE;
11929: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
11930: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
11931: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
11932: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
11933: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11929: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
11930: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
11931: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
11932: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
11933: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11937: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
11930: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
11931: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
11932: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
11933: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11937: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
11938: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11931: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
11932: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
11933: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11937: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
11938: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11939: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
11932: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
11933: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11937: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
11938: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11939: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
11940:
11934: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
11935: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11936: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
11937: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
11938: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
11939: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
11940:
11941: --mansrini : Code for VR build
11942: CURSOR get_day_conv_on_contrct
12079: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
12080: END IF;
12081: CLOSE ib_csr;
12082: l_csm_loan_header.country := l_ib_rec.country;
12083: l_csm_loan_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
12084: -- Callling the formual ccontract cap amount
12085: --Modified by kthiruva on 24-Nov-2005 for the Down payment CR
12086: --The Capital Reduction should not be removed from the Funding amount
12087: --Bug 4738011 - Start of Changes
12107: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
12108: RAISE OKL_API.G_EXCEPTION_ERROR;
12109: END IF;
12110: l_csm_loan_header.total_lending := l_total_lending;
12111: l_csm_loan_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LENDER;
12112: -- asset infor
12113: FOR l_line_rec IN l_line_rec_csr ( p_chr_id , 'FREE_FORM1') LOOP
12114: i := i + 1;
12115: idx := 0;
12268: --When funding date is not specified, we use the contract start date
12269: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
12270: --Bug 4576794 - End of Changes
12271: l_csm_line_details_tbl(j).level_index_number := idx;
12272: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
12273: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12274: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12275:
12276: --Added by kthiruva on 15-Nov-2005 for the Down Payment CR
12285: l_csm_line_details_tbl(j).description := 'Funding';
12286: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
12287: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
12288: l_csm_line_details_tbl(j).level_index_number := idx;
12289: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
12290: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12291: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12292: -- srsreeni - Bug#5699923 - Added - Start
12293: -- DONOT request SuperTrump to generate streams
12330: l_csm_line_details_tbl(j).amount := TO_NUMBER(l_rl_rec.rule_information8);
12331: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
12332: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
12333: l_csm_line_details_tbl(j).period := g_stub_rec.period;
12334: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12335: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
12336: l_csm_line_details_tbl(j).description := l_strm_name;
12337: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12338: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12343: l_csm_line_details_tbl(j).rate := l_rl_rec.rule_information13;
12344: --Bug 4766555 - End of Changes
12345:
12346: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12347: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12348: ELSE
12349: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12350: END IF;
12351: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12345:
12346: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12347: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12348: ELSE
12349: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12350: END IF;
12351: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12352: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12353: END IF;
12356: -- Added by kthiruva on 29-Dec-2005.
12357: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
12358: -- Bug 4915938 - Start of Changes
12359: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12360: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12361: ELSE
12362: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12363: END IF;
12364: -- Bug 4915938 - End of Changes
12358: -- Bug 4915938 - Start of Changes
12359: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12360: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12361: ELSE
12362: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12363: END IF;
12364: -- Bug 4915938 - End of Changes
12365:
12366: ELSIF (l_rl_rec.rule_information7 IS NULL OR
12376: --Bug 4766555 - Start of Changes
12377: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.RULE_INFORMATION2);
12378: --Bug 4766555 - End of Changes
12379: l_csm_line_details_tbl(j).level_index_number := idx;
12380: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12381: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
12382: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
12383: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12384: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12392: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12393: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12394: END IF;
12395: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12396: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12397: ELSE
12398: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12399: END IF;
12400: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12394: END IF;
12395: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12396: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12397: ELSE
12398: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12399: END IF;
12400: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12401: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12402: ELSE
12397: ELSE
12398: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12399: END IF;
12400: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12401: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12402: ELSE
12403: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12404: END IF;
12405: END IF;
12399: END IF;
12400: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12401: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12402: ELSE
12403: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12404: END IF;
12405: END IF;
12406: END LOOP;
12407: --Code for the new payment type 'PRINCIPAL_PAYMENT' that is allowed for Loan Contracts
12510: --When funding date is not specified, we use the contract start date
12511: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
12512: --Bug 4576794 - End of Changes
12513: l_csm_line_details_tbl(j).level_index_number := idx;
12514: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
12515: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12516: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12517:
12518: --Added by kthiruva on 15-Nov-2005 for the Down Payment CR
12527: l_csm_line_details_tbl(j).description := 'Funding';
12528: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
12529: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
12530: l_csm_line_details_tbl(j).level_index_number := idx;
12531: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
12532: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12533: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12534: -- srsreeni - Bug#5699923 - Added - Start
12535: -- DONOT request SuperTrump to generate streams
12572: l_csm_line_details_tbl(j).amount := TO_NUMBER(l_rl_rec.rule_information8);
12573: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
12574: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
12575: l_csm_line_details_tbl(j).period := g_stub_rec.period;
12576: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12577: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
12578: l_csm_line_details_tbl(j).description := l_strm_name;
12579: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12580: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
12587: l_csm_line_details_tbl(j).rate := nvl(l_rl_rec.rule_information13,l_base_rate);
12588: --Bug 4766555 - End of Changes
12589:
12590: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12591: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12592: ELSE
12593: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12594: END IF;
12595:
12589:
12590: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12591: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12592: ELSE
12593: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12594: END IF;
12595:
12596: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12597: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12602: -- Added by kthiruva on 29-Dec-2005.
12603: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
12604: -- Bug 4915938 - Start of Changes
12605: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12606: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12607: ELSE
12608: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12609: END IF;
12610: -- Bug 4915938 - End of Changes
12604: -- Bug 4915938 - Start of Changes
12605: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12606: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12607: ELSE
12608: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12609: END IF;
12610: -- Bug 4915938 - End of Changes
12611:
12612: ELSIF (l_rl_rec.rule_information7 IS NULL OR
12625: l_csm_line_details_tbl(j).level_index_number := idx;
12626: --Modified by kthiruva on 09-Nov-2005.The level type should be
12627: --set as PRINCIPAL as the payment type is PRINCIPAL_PAYMENT
12628: --Bug 4726209 - Start of Changes
12629: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12630: --Bug 4726209 - End of Changes
12631: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
12632: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
12633: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
12644: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12645: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12646: END IF;
12647: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12648: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12649: ELSE
12650: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12651: END IF;
12652: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12646: END IF;
12647: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12648: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12649: ELSE
12650: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12651: END IF;
12652: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12653: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12654: ELSE
12649: ELSE
12650: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12651: END IF;
12652: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12653: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12654: ELSE
12655: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12656: END IF;
12657: END IF;
12651: END IF;
12652: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12653: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12654: ELSE
12655: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12656: END IF;
12657: END IF;
12658: END LOOP;
12659:
12724: l_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
12725: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
12726: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
12727: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
12728: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12729: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12730: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
12731: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
12732: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
12725: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
12726: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
12727: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
12728: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12729: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12730: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
12731: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
12732: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
12733: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
12741: -- Added by kthiruva on 29-Dec-2005.
12742: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
12743: -- Bug 4915938 - Start of Changes
12744: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12745: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12746: ELSE
12747: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12748: END IF;
12749: -- Bug 4915938 - End of Changes
12743: -- Bug 4915938 - Start of Changes
12744: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12745: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12746: ELSE
12747: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12748: END IF;
12749: -- Bug 4915938 - End of Changes
12750:
12751: ELSIF (l_rl_rec.rule_information7 IS NULL OR
12755: k := k + 1;
12756: -- idx := idx + 1; bug6245602
12757: idx_exp := idx_exp + 1; -- bug6245602
12758: l_csm_periodic_expenses_tbl(k).level_index_number := idx_exp; -- bug6245602
12759: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12760: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
12761: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
12762: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
12763: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
12761: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
12762: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
12763: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
12764: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
12765: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12766: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
12767: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
12768: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
12769: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
12771: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12772: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12773: END If;
12774: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12775: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12776: ELSE
12777: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12778: END IF;
12779: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
12773: END If;
12774: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12775: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12776: ELSE
12777: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12778: END IF;
12779: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
12780: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
12781: ELSE
12822: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12823: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12824: END IF;
12825: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12826: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12827: ELSE
12828: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12829: END IF;
12830: -- Code for user defined streams
12824: END IF;
12825: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12826: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12827: ELSE
12828: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12829: END IF;
12830: -- Code for user defined streams
12831: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
12832: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
12830: -- Code for user defined streams
12831: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
12832: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
12833: -- code ends here
12834: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
12835: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
12836: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
12837: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12838: ELSE
12833: -- code ends here
12834: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
12835: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
12836: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
12837: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12838: ELSE
12839: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12840: END If;
12841: -- End of Bug#2757289 modification
12835: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
12836: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
12837: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12838: ELSE
12839: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12840: END If;
12841: -- End of Bug#2757289 modification
12842:
12843: -- Added by kthiruva on 29-Dec-2005.
12843: -- Added by kthiruva on 29-Dec-2005.
12844: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
12845: -- Bug 4915938 - Start of Changes
12846: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12847: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12848: ELSE
12849: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12850: END IF;
12851: -- Bug 4915938 - End of Changes
12845: -- Bug 4915938 - Start of Changes
12846: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12847: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12848: ELSE
12849: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12850: END IF;
12851: -- Bug 4915938 - End of Changes
12852:
12853: ELSIF (l_rl_rec.rule_information7 IS NULL OR
12869: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
12870: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
12871: END IF;
12872: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12873: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12874: ELSE
12875: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12876: END IF;
12877: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
12871: END IF;
12872: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
12873: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
12874: ELSE
12875: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
12876: END IF;
12877: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
12878: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
12879: ELSE
12879: ELSE
12880: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.RULE_INFORMATION2);
12881: END IF;
12882: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12883: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12884: ELSE
12885: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12886: END IF;
12887: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
12881: END IF;
12882: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
12883: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
12884: ELSE
12885: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12886: END IF;
12887: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
12888: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
12889: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
12885: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12886: END IF;
12887: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
12888: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
12889: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
12890: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
12891: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
12892: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12893: ELSE
12888: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
12889: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
12890: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
12891: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
12892: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12893: ELSE
12894: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12895: END If;
12896: END IF;
12890: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
12891: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
12892: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
12893: ELSE
12894: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
12895: END If;
12896: END IF;
12897: END LOOP;
12898: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
12898: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
12899: FOR l_rl_rec in l_rl_csr (l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_line_rec.id ) LOOP
12900: l := l + 1;
12901: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
12902: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
12903: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
12904: If(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
12905: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;
12906: Else
13088: x_msg_data OUT NOCOPY VARCHAR2,
13089: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
13090: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
13091: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
13092: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
13093: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
13094: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
13095: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
13096:
13089: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
13090: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
13091: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
13092: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
13093: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
13094: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
13095: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
13096:
13097: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_PPD';
13090: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
13091: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
13092: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
13093: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
13094: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
13095: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
13096:
13097: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_PPD';
13098: l_api_version CONSTANT NUMBER := 1;
13091: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
13092: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
13093: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
13094: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
13095: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
13096:
13097: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LOAN_PPD';
13098: l_api_version CONSTANT NUMBER := 1;
13099: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
13182: l_struct_rec l_struct_csr%ROWTYPE;
13183: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
13184: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
13185: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
13186: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
13187: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13183: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
13184: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
13185: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
13186: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
13187: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13191: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
13184: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
13185: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
13186: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
13187: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13191: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
13192: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13185: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
13186: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
13187: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13191: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
13192: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13193: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
13186: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
13187: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13191: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
13192: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13193: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
13194: --p_deal_type okl_st_gen_tmpt_sets.deal_type%TYPE;
13188: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
13189: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13190: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
13191: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
13192: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
13193: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
13194: --p_deal_type okl_st_gen_tmpt_sets.deal_type%TYPE;
13195:
13196: --mansrini : Code for VR build
13381: END IF;
13382: CLOSE ib_csr;
13383: l_csm_loan_header.country := l_ib_rec.country;
13384: --The orp code for the Principal Paydown process is used here.
13385: l_csm_loan_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_RENEWAL;
13386: -- Callling the formual ccontract cap amount
13387: --Modified by kthiruva on 24-Nov-2005 for the Down payment CR
13388: --The Capital Reduction should not be removed from the Funding amount
13389: --Bug 4738011 - Start of Changes
13402: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
13403: RAISE OKL_API.G_EXCEPTION_ERROR;
13404: END IF;
13405: l_csm_loan_header.total_lending := l_total_lending;
13406: l_csm_loan_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LENDER;
13407:
13408: --kthiruva : for PR proj
13409: --Fetch the total OEC for this contract so that it can be prorated for each asset in
13410: --the following loop
13622: --When funding date is not specified, we use the contract start date
13623: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
13624: --Bug 4576794 - End of Changes
13625: l_csm_line_details_tbl(j).level_index_number := idx;
13626: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
13627: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
13628: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
13629: l_csm_line_details_tbl(j).rate := l_variable_rate;
13630:
13640: l_csm_line_details_tbl(j).description := 'Funding';
13641: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
13642: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
13643: l_csm_line_details_tbl(j).level_index_number := idx;
13644: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
13645: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
13646: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
13647: END IF;
13648: --Bug 4738011 - End of Changes
13671: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
13672: AND (l_rl_rec.RULE_INFORMATION10 IS NOT NULL) THEN
13673: j := j + 1;
13674: idx := idx + 1;
13675: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
13676: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
13677: l_csm_line_details_tbl(j).period := g_stub_rec.period;
13678: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
13679: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
13694: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
13695: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
13696: l_csm_line_details_tbl(j).rate := l_variable_rate;
13697: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13698: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13699: ELSE
13700: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13701: END IF;
13702:
13696: l_csm_line_details_tbl(j).rate := l_variable_rate;
13697: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13698: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13699: ELSE
13700: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13701: END IF;
13702:
13703: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
13704: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13704: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13705: END IF;
13706:
13707: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13708: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13709: ELSE
13710: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13711: END IF;
13712:
13706:
13707: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13708: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13709: ELSE
13710: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13711: END IF;
13712:
13713: END IF;
13714: END LOOP;
13728: END IF;
13729: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
13730: l_csm_line_details_tbl(j).period := g_stub_rec.period;
13731: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
13732: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
13733: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
13734: l_csm_line_details_tbl(j).description := l_strm_name;
13735: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
13736: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
13747: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
13748: END IF;
13749:
13750: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13751: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13752: ELSE
13753: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13754: END IF;
13755:
13749:
13750: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13751: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13752: ELSE
13753: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13754: END IF;
13755:
13756: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
13757: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13757: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13758: END IF;
13759:
13760: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13761: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13762: ELSE
13763: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13764: END IF;
13765: --=======================================================================================
13759:
13760: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13761: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13762: ELSE
13763: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13764: END IF;
13765: --=======================================================================================
13766: --Step 3 : IF the Payment is Advance then the PPD stub is created after the existing stub
13767: --=======================================================================================
13771: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
13772: AND (l_rl_rec.RULE_INFORMATION10 IS NULL) THEN
13773: j := j + 1;
13774: idx := idx + 1;
13775: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
13776: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
13777: l_csm_line_details_tbl(j).period := g_stub_rec.period;
13778: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
13779: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
13794: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
13795: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
13796: l_csm_line_details_tbl(j).rate := l_variable_rate;
13797: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13798: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13799: ELSE
13800: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13801: END IF;
13802:
13796: l_csm_line_details_tbl(j).rate := l_variable_rate;
13797: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13798: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13799: ELSE
13800: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13801: END IF;
13802:
13803: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
13804: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13804: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13805: END IF;
13806:
13807: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13808: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13809: ELSE
13810: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13811: END IF;
13812:
13806:
13807: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13808: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13809: ELSE
13810: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13811: END IF;
13812:
13813: END IF;
13814: END LOOP;
13834: l_csm_line_details_tbl(j).description := l_strm_name;
13835: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
13836: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
13837: l_csm_line_details_tbl(j).level_index_number := idx;
13838: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
13839: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
13840:
13841: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
13842: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
13858: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13859: END IF;
13860:
13861: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13862: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13863: ELSE
13864: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13865: END IF;
13866:
13860:
13861: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13862: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13863: ELSE
13864: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13865: END IF;
13866:
13867: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13868: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13864: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13865: END IF;
13866:
13867: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13868: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13869: ELSE
13870: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13871: END IF;
13872:
13866:
13867: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13868: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13869: ELSE
13870: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13871: END IF;
13872:
13873: ELSE
13874:
13905: l_csm_line_details_tbl(j).description := l_strm_name;
13906: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
13907: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
13908: l_csm_line_details_tbl(j).level_index_number := idx;
13909: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
13910:
13911: IF l_number_periods_completed_cpy = 0 THEN
13912: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
13913: ELSE
13934: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13935: END IF;
13936:
13937: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13938: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13939: ELSE
13940: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13941: END IF;
13942:
13936:
13937: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
13938: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
13939: ELSE
13940: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13941: END IF;
13942:
13943: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13944: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13940: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
13941: END IF;
13942:
13943: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13944: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13945: ELSE
13946: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13947: END IF;
13948: l_first_batch := 'Y';
13942:
13943: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
13944: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
13945: ELSE
13946: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
13947: END IF;
13948: l_first_batch := 'Y';
13949: END IF;
13950: --=====================================================================
13968: --of the period and one payment line for the remaining periods until the next paydown date
13969: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
13970: j := j + 1;
13971: idx := idx + 1;
13972: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
13973: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
13974: l_csm_line_details_tbl(j).period := g_stub_rec.period;
13975: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
13976: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
13998: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
13999: END IF;
14000:
14001: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14002: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14003: ELSE
14004: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14005: END IF;
14006:
14000:
14001: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14002: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14003: ELSE
14004: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14005: END IF;
14006:
14007: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14008: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14004: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14005: END IF;
14006:
14007: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14008: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14009: ELSE
14010: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14011: END IF;
14012: END IF;
14006:
14007: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14008: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14009: ELSE
14010: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14011: END IF;
14012: END IF;
14013: END IF;
14014: --Bug 4964710 - End of Changes
14020: IF p_paydown_type = OKL_CREATE_STREAMS_PVT.G_PAYDOWN_TYPE_PPD THEN
14021: /*PPD stub*/
14022: j := j + 1;
14023: idx := idx + 1;
14024: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14025: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14026: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14027: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14028: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14054: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14055: END IF;
14056:
14057: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14058: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14059: ELSE
14060: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14061: END IF;
14062:
14056:
14057: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14058: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14059: ELSE
14060: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14061: END IF;
14062:
14063: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14064: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14060: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14061: END IF;
14062:
14063: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14064: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14065: ELSE
14066: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14067: END IF;
14068: --===============================================================================
14062:
14063: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14064: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14065: ELSE
14066: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14067: END IF;
14068: --===============================================================================
14069: --Step 5: Check whether Ajusting stub needs to be created and create if necessary
14070: --================================================================================
14083: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
14084: /*Adjusting stub*/
14085: j := j + 1;
14086: idx := idx + 1;
14087: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
14088: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14089: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14090: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14091: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14112: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14113: END IF;
14114:
14115: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14116: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14117: ELSE
14118: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14119: END IF;
14120:
14114:
14115: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14116: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14117: ELSE
14118: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14119: END IF;
14120:
14121: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14122: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14118: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14119: END IF;
14120:
14121: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14122: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14123: ELSE
14124: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14125: END IF;
14126: END IF;
14120:
14121: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14122: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14123: ELSE
14124: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14125: END IF;
14126: END IF;
14127: END IF;
14128: --Bug 4964710 - Start of Changes
14147: IF (l_periods_after_ppd > 0) THEN
14148: /*Remaining amts*/
14149: j := j + 1;
14150: idx := idx + 1;
14151: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
14152: l_csm_line_details_tbl(j).number_of_periods := l_periods_after_ppd;
14153: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
14154: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14155: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14176: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14177: END IF;
14178:
14179: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14180: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14181: ELSE
14182: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14183: END IF;
14184:
14178:
14179: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14180: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14181: ELSE
14182: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14183: END IF;
14184:
14185: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14186: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14182: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14183: END IF;
14184:
14185: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14186: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14187: ELSE
14188: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14189: END IF;
14190: END IF;--End of condition l_periods_after_ppd >0
14184:
14185: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14186: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14187: ELSE
14188: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14189: END IF;
14190: END IF;--End of condition l_periods_after_ppd >0
14191: END IF;--The condition that checks the paydown type
14192: END IF;--The condition check for the date of every PPD in the ppd_tbl
14337: --When funding date is not specified, we use the contract start date
14338: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
14339: --Bug 4576794 - End of Changes
14340: l_csm_line_details_tbl(j).level_index_number := idx;
14341: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
14342: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
14343: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
14344: l_csm_line_details_tbl(j).rate := l_variable_rate;
14345:
14355: l_csm_line_details_tbl(j).description := 'Funding';
14356: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
14357: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
14358: l_csm_line_details_tbl(j).level_index_number := idx;
14359: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
14360: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
14361: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
14362: END IF;
14363: --Bug 4738011 - End of Changes
14385: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
14386: AND (l_rl_rec.RULE_INFORMATION10 IS NOT NULL) THEN
14387: j := j + 1;
14388: idx := idx + 1;
14389: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14390: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14391: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14392: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14393: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14408: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
14409: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
14410: l_csm_line_details_tbl(j).rate := l_variable_rate;
14411: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14412: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14413: ELSE
14414: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14415: END IF;
14416:
14410: l_csm_line_details_tbl(j).rate := l_variable_rate;
14411: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14412: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14413: ELSE
14414: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14415: END IF;
14416:
14417: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
14418: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14418: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14419: END IF;
14420:
14421: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14422: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14423: ELSE
14424: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14425: END IF;
14426:
14420:
14421: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14422: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14423: ELSE
14424: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14425: END IF;
14426:
14427: END IF;
14428: END LOOP;
14442: END IF;
14443: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14444: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14445: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14446: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14447: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14448: l_csm_line_details_tbl(j).description := l_strm_name;
14449: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
14450: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
14461: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
14462: END IF;
14463:
14464: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14465: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14466: ELSE
14467: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14468: END IF;
14469:
14463:
14464: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14465: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14466: ELSE
14467: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14468: END IF;
14469:
14470: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
14471: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14471: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14472: END IF;
14473:
14474: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14475: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14476: ELSE
14477: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14478: END IF;
14479: --=======================================================================================
14473:
14474: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14475: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14476: ELSE
14477: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14478: END IF;
14479: --=======================================================================================
14480: --Step 3 : IF the Payment is Advance then the PPD stub is created after the existing stub
14481: --=======================================================================================
14485: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
14486: AND (l_rl_rec.RULE_INFORMATION10 IS NULL) THEN
14487: j := j + 1;
14488: idx := idx + 1;
14489: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14490: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14491: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14492: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14493: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14508: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
14509: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_BOTH;
14510: l_csm_line_details_tbl(j).rate := l_variable_rate;
14511: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14512: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14513: ELSE
14514: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14515: END IF;
14516:
14510: l_csm_line_details_tbl(j).rate := l_variable_rate;
14511: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14512: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14513: ELSE
14514: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14515: END IF;
14516:
14517: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
14518: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14518: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14519: END IF;
14520:
14521: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14522: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14523: ELSE
14524: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14525: END IF;
14526:
14520:
14521: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14522: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14523: ELSE
14524: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14525: END IF;
14526:
14527: END IF;
14528: END LOOP;
14547: l_csm_line_details_tbl(j).description := l_strm_name;
14548: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
14549: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
14550: l_csm_line_details_tbl(j).level_index_number := idx;
14551: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14552: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
14553:
14554: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
14555: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
14571: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14572: END IF;
14573:
14574: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14575: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14576: ELSE
14577: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14578: END IF;
14579:
14573:
14574: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14575: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14576: ELSE
14577: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14578: END IF;
14579:
14580: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14581: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14577: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14578: END IF;
14579:
14580: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14581: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14582: ELSE
14583: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14584: END IF;
14585:
14579:
14580: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14581: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14582: ELSE
14583: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14584: END IF;
14585:
14586: ELSE
14587:
14618: l_csm_line_details_tbl(j).description := l_strm_name;
14619: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
14620: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
14621: l_csm_line_details_tbl(j).level_index_number := idx;
14622: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14623:
14624: IF l_number_periods_completed_cpy = 0 THEN
14625: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
14626: ELSE
14647: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14648: END IF;
14649:
14650: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14651: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14652: ELSE
14653: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14654: END IF;
14655:
14649:
14650: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14651: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14652: ELSE
14653: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14654: END IF;
14655:
14656: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14657: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14653: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14654: END IF;
14655:
14656: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14657: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14658: ELSE
14659: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14660: END IF;
14661: l_first_batch := 'Y';
14655:
14656: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14657: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14658: ELSE
14659: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14660: END IF;
14661: l_first_batch := 'Y';
14662: END IF;
14663: --=====================================================================
14681: --of the period and one payment line for the remaining periods until the next paydown date
14682: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
14683: j := j + 1;
14684: idx := idx + 1;
14685: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
14686: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14687: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14688: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14689: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14711: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14712: END IF;
14713:
14714: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14715: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14716: ELSE
14717: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14718: END IF;
14719:
14713:
14714: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14715: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14716: ELSE
14717: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14718: END IF;
14719:
14720: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14721: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14717: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14718: END IF;
14719:
14720: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14721: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14722: ELSE
14723: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14724: END IF;
14725: END IF;
14719:
14720: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14721: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14722: ELSE
14723: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14724: END IF;
14725: END IF;
14726: END IF;
14727: --Bug 4964710 - End of Changes
14733: IF p_paydown_type = OKL_CREATE_STREAMS_PVT.G_PAYDOWN_TYPE_PPD THEN
14734: /*PPD stub*/
14735: j := j + 1;
14736: idx := idx + 1;
14737: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14738: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14739: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14740: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14741: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14769: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14770: END IF;
14771:
14772: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14773: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14774: ELSE
14775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14776: END IF;
14777:
14771:
14772: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14773: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14774: ELSE
14775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14776: END IF;
14777:
14778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14776: END IF;
14777:
14778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14780: ELSE
14781: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14782: END IF;
14783: --===============================================================================
14777:
14778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14780: ELSE
14781: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14782: END IF;
14783: --===============================================================================
14784: --Step 5: Check whether Ajusting stub needs to be created and create if necessary
14785: --================================================================================
14798: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
14799: /*Adjusting stub*/
14800: j := j + 1;
14801: idx := idx + 1;
14802: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14803: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
14804: l_csm_line_details_tbl(j).period := g_stub_rec.period;
14805: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14806: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14827: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14828: END IF;
14829:
14830: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14831: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14832: ELSE
14833: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14834: END IF;
14835:
14829:
14830: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14831: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14832: ELSE
14833: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14834: END IF;
14835:
14836: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14833: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14834: END IF;
14835:
14836: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14838: ELSE
14839: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14840: END IF;
14841: END IF;
14835:
14836: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14838: ELSE
14839: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14840: END IF;
14841: END IF;
14842: END IF;
14843: --===================================================================================
14860: IF (l_periods_after_ppd > 0) THEN
14861: /*Remaining amts*/
14862: j := j + 1;
14863: idx := idx + 1;
14864: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14865: l_csm_line_details_tbl(j).number_of_periods := l_periods_after_ppd;
14866: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
14867: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
14868: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
14889: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14890: END IF;
14891:
14892: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14893: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14894: ELSE
14895: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14896: END IF;
14897:
14891:
14892: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14893: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14894: ELSE
14895: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14896: END IF;
14897:
14898: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14899: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14895: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14896: END IF;
14897:
14898: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14899: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14900: ELSE
14901: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14902: END IF;
14903: END IF;--End of condition l_periods_after_ppd >0
14897:
14898: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14899: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14900: ELSE
14901: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14902: END IF;
14903: END IF;--End of condition l_periods_after_ppd >0
14904:
14905: END IF;--The condition that checks the paydown type
14938: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
14939: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14940: END IF;
14941: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14942: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14943: ELSE
14944: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14945: END IF;
14946: -- Code for user defined streams
14940: END IF;
14941: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14942: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14943: ELSE
14944: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
14945: END IF;
14946: -- Code for user defined streams
14947: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
14948: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
14946: -- Code for user defined streams
14947: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
14948: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
14949: -- code ends here
14950: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
14951: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
14952: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
14953: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14954: ELSE
14949: -- code ends here
14950: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
14951: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
14952: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
14953: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14954: ELSE
14955: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
14956: END If;
14957: -- End of Bug#2757289 modification
14951: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
14952: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
14953: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
14954: ELSE
14955: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
14956: END If;
14957: -- End of Bug#2757289 modification
14958:
14959: -- Added by kthiruva on 29-Dec-2005.
14959: -- Added by kthiruva on 29-Dec-2005.
14960: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
14961: -- Bug 4915938 - Start of Changes
14962: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14963: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14964: ELSE
14965: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14966: END IF;
14967: -- Bug 4915938 - End of Changes
14961: -- Bug 4915938 - Start of Changes
14962: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14963: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14964: ELSE
14965: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14966: END IF;
14967: -- Bug 4915938 - End of Changes
14968:
14969: ELSIF (l_rl_rec.rule_information7 IS NULL OR
14984: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
14985: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
14986: END IF;
14987: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14988: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14989: ELSE
14990: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14991: END IF;
14992: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
14986: END IF;
14987: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
14988: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
14989: ELSE
14990: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
14991: END IF;
14992: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
14993: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
14994: ELSE
14994: ELSE
14995: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.RULE_INFORMATION2);
14996: END IF;
14997: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14998: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14999: ELSE
15000: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15001: END IF;
15002: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
14996: END IF;
14997: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
14998: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
14999: ELSE
15000: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15001: END IF;
15002: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
15003: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
15004: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
15000: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15001: END IF;
15002: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
15003: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
15004: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
15005: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
15006: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
15007: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
15008: ELSE
15003: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
15004: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
15005: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
15006: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
15007: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
15008: ELSE
15009: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
15010: END If;
15011: END IF;
15005: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
15006: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
15007: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
15008: ELSE
15009: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
15010: END If;
15011: END IF;
15012: END LOOP;
15013: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
15013: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
15014: FOR l_rl_rec in l_rl_csr (l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_line_rec.id ) LOOP
15015: l := l + 1;
15016: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
15017: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15018: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
15019: If(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
15020: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;
15021: Else
15188: x_msg_data OUT NOCOPY VARCHAR2,
15189: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
15190: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
15191: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
15192: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
15193: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
15194: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
15195: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
15196:
15189: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
15190: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
15191: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
15192: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
15193: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
15194: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
15195: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
15196:
15197: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_PPD_REBOOK';
15190: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
15191: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
15192: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
15193: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
15194: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
15195: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
15196:
15197: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_PPD_REBOOK';
15198: l_api_version CONSTANT NUMBER := 1;
15191: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
15192: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
15193: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
15194: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
15195: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
15196:
15197: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_PPD_REBOOK';
15198: l_api_version CONSTANT NUMBER := 1;
15199: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
15257: l_struct_rec l_struct_csr%ROWTYPE;
15258: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
15259: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
15260: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
15261: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
15262: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15258: l_pdt_id_rec l_hdr_pdt_csr%ROWTYPE;
15259: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
15260: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
15261: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
15262: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15266: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
15259: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
15260: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
15261: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
15262: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15266: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
15267: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15260: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
15261: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
15262: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15266: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
15267: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15268: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
15261: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
15262: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15266: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
15267: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15268: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
15269: --p_deal_type okl_st_gen_tmpt_sets.deal_type%TYPE;
15263: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
15264: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15265: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
15266: l_csm_line_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
15267: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
15268: l_strm_type_id_tbl okl_strm_type_id_tbl_type;
15269: --p_deal_type okl_st_gen_tmpt_sets.deal_type%TYPE;
15270:
15271: --mansrini : Code for VR build
15463: END IF;
15464: CLOSE ib_csr;
15465: l_csm_loan_header.country := l_ib_rec.country;
15466: --The orp code for the Principal Paydown process is used here.
15467: l_csm_loan_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
15468: -- Callling the formual ccontract cap amount
15469: --Modified by kthiruva on 24-Nov-2005 for the Down payment CR
15470: --The Capital Reduction should not be removed from the Funding amount
15471: --Bug 4738011 - Start of Changes
15484: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
15485: RAISE OKL_API.G_EXCEPTION_ERROR;
15486: END IF;
15487: l_csm_loan_header.total_lending := l_total_lending;
15488: l_csm_loan_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LENDER;
15489:
15490: --kthiruva : for PR proj
15491: --Fetch the total OEC for this contract so that it can be prorated for each asset in
15492: --the following loop
15673: --When funding date is not specified, we use the contract start date
15674: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
15675: --Bug 4576794 - End of Changes
15676: l_csm_line_details_tbl(j).level_index_number := idx;
15677: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
15678: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
15679: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
15680:
15681: --Added by kthiruva on 15-Nov-2005 for the Down Payment CR
15690: l_csm_line_details_tbl(j).description := 'Funding';
15691: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
15692: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
15693: l_csm_line_details_tbl(j).level_index_number := idx;
15694: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
15695: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
15696: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
15697: END IF;
15698: --Bug 4738011 - End of Changes
15720: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
15721: AND (l_rl_rec.RULE_INFORMATION10 IS NOT NULL) THEN
15722: j := j + 1;
15723: idx := idx + 1;
15724: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
15725: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
15726: l_csm_line_details_tbl(j).period := g_stub_rec.period;
15727: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
15728: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
15740: -- For the PPD stub, the amount should be locked , but rate should be unlocked, as
15741: -- we are solving for rate.
15742: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
15743: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15744: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15745: ELSE
15746: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15747: END IF;
15748:
15742: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
15743: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15744: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15745: ELSE
15746: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15747: END IF;
15748:
15749: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
15750: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15750: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15751: END IF;
15752:
15753: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15754: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15755: ELSE
15756: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15757: END IF;
15758:
15752:
15753: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15754: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15755: ELSE
15756: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15757: END IF;
15758:
15759: END IF;
15760: END LOOP;
15774: END IF;
15775: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
15776: l_csm_line_details_tbl(j).period := g_stub_rec.period;
15777: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
15778: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
15779: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
15780: l_csm_line_details_tbl(j).description := l_strm_name;
15781: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
15782: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
15789: -- we are solving for rate.
15790: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := G_FALSE;
15791:
15792: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15793: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15794: ELSE
15795: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15796: END IF;
15797:
15791:
15792: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15793: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15794: ELSE
15795: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15796: END IF;
15797:
15798: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
15799: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15799: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15800: END IF;
15801:
15802: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15803: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15804: ELSE
15805: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15806: END IF;
15807: --=======================================================================================
15801:
15802: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15803: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15804: ELSE
15805: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15806: END IF;
15807: --=======================================================================================
15808: --Step 3 : IF the Payment is Advance then the PPD stub is created after the existing stub
15809: --=======================================================================================
15813: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
15814: AND (l_rl_rec.RULE_INFORMATION10 IS NULL) THEN
15815: j := j + 1;
15816: idx := idx + 1;
15817: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
15818: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
15819: l_csm_line_details_tbl(j).period := g_stub_rec.period;
15820: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
15821: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
15833: -- For the PPD stub, the amount should be locked , but rate should be unlocked, as
15834: -- we are solving for rate.
15835: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
15836: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15838: ELSE
15839: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15840: END IF;
15841:
15835: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
15836: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15838: ELSE
15839: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15840: END IF;
15841:
15842: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
15843: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15843: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15844: END IF;
15845:
15846: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15847: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15848: ELSE
15849: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15850: END IF;
15851:
15845:
15846: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15847: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15848: ELSE
15849: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15850: END IF;
15851:
15852: END IF;
15853: END LOOP;
15871: l_csm_line_details_tbl(j).description := l_strm_name;
15872: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
15873: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
15874: l_csm_line_details_tbl(j).level_index_number := idx;
15875: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
15876: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
15877:
15878: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
15879: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
15891: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15892: END IF;
15893:
15894: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15895: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15896: ELSE
15897: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15898: END IF;
15899:
15893:
15894: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15895: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15896: ELSE
15897: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15898: END IF;
15899:
15900: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15901: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15897: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15898: END IF;
15899:
15900: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15901: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15902: ELSE
15903: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15904: END IF;
15905:
15899:
15900: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15901: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15902: ELSE
15903: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15904: END IF;
15905:
15906: ELSE
15907:
15938: l_csm_line_details_tbl(j).description := l_strm_name;
15939: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
15940: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
15941: l_csm_line_details_tbl(j).level_index_number := idx;
15942: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
15943:
15944: IF l_number_periods_completed_cpy = 0 THEN
15945: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
15946: ELSE
15963: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
15964: END IF;
15965:
15966: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15967: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15968: ELSE
15969: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15970: END IF;
15971:
15965:
15966: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
15967: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
15968: ELSE
15969: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15970: END IF;
15971:
15972: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15973: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15969: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
15970: END IF;
15971:
15972: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15973: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15974: ELSE
15975: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15976: END IF;
15977: l_first_batch := 'Y';
15971:
15972: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
15973: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
15974: ELSE
15975: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
15976: END IF;
15977: l_first_batch := 'Y';
15978: END IF;
15979: --=====================================================================
15997: --of the period and one payment line for the remaining periods until the next paydown date
15998: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
15999: j := j + 1;
16000: idx := idx + 1;
16001: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16002: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16003: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16004: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16005: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16023: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16024: END IF;
16025:
16026: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16027: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16028: ELSE
16029: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16030: END IF;
16031:
16025:
16026: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16027: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16028: ELSE
16029: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16030: END IF;
16031:
16032: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16033: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16029: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16030: END IF;
16031:
16032: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16033: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16034: ELSE
16035: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16036: END IF;
16037: END IF;
16031:
16032: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16033: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16034: ELSE
16035: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16036: END IF;
16037: END IF;
16038: END IF;
16039: --Bug 4964710 - End of Changes
16044:
16045: /*PPD stub*/
16046: j := j + 1;
16047: idx := idx + 1;
16048: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16049: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16050: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16051: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16052: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16074: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16075: END IF;
16076:
16077: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16078: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16079: ELSE
16080: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16081: END IF;
16082:
16076:
16077: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16078: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16079: ELSE
16080: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16081: END IF;
16082:
16083: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16084: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16080: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16081: END IF;
16082:
16083: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16084: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16085: ELSE
16086: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16087: END IF;
16088: --===============================================================================
16082:
16083: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16084: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16085: ELSE
16086: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16087: END IF;
16088: --===============================================================================
16089: --Step 5: Check whether Ajusting stub needs to be created and create if necessary
16090: --================================================================================
16103: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
16104: /*Adjusting stub*/
16105: j := j + 1;
16106: idx := idx + 1;
16107: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16108: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16109: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16110: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16111: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16128: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16129: END IF;
16130:
16131: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16132: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16133: ELSE
16134: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16135: END IF;
16136:
16130:
16131: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16132: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16133: ELSE
16134: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16135: END IF;
16136:
16137: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16138: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16134: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16135: END IF;
16136:
16137: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16138: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16139: ELSE
16140: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16141: END IF;
16142: END IF;
16136:
16137: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16138: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16139: ELSE
16140: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16141: END IF;
16142: END IF;
16143: END IF;
16144: --Bug 4964710 - Start of Changes
16163: IF (l_periods_after_ppd > 0) THEN
16164: /*Remaining amts*/
16165: j := j + 1;
16166: idx := idx + 1;
16167: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16168: l_csm_line_details_tbl(j).number_of_periods := l_periods_after_ppd;
16169: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
16170: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16171: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16188: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16189: END IF;
16190:
16191: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16192: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16193: ELSE
16194: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16195: END IF;
16196:
16190:
16191: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16192: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16193: ELSE
16194: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16195: END IF;
16196:
16197: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16198: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16194: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16195: END IF;
16196:
16197: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16198: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16199: ELSE
16200: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16201: END IF;
16202: END IF;--End of condition l_periods_after_ppd >0
16196:
16197: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16198: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16199: ELSE
16200: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16201: END IF;
16202: END IF;--End of condition l_periods_after_ppd >0
16203: END IF;--The condition check for the date of every PPD in the ppd_tbl
16204: END LOOP;--loop for l_ppd_tbl
16352: --When funding date is not specified, we use the contract start date
16353: l_csm_line_details_tbl(j).date_start := nvl(l_line_rec.date_funding_expected,l_hdr_rec.start_date);
16354: --Bug 4576794 - End of Changes
16355: l_csm_line_details_tbl(j).level_index_number := idx;
16356: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
16357: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
16358: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
16359:
16360: --Added by kthiruva on 15-Nov-2005 for the Down Payment CR
16369: l_csm_line_details_tbl(j).description := 'Funding';
16370: l_csm_line_details_tbl(j).amount := l_line_rec.capital_reduction * (-1);
16371: l_csm_line_details_tbl(j).date_start := l_hdr_rec.start_date;
16372: l_csm_line_details_tbl(j).level_index_number := idx;
16373: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
16374: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
16375: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
16376: END IF;
16377: --Bug 4738011 - End of Changes
16398: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
16399: AND (l_rl_rec.RULE_INFORMATION10 IS NOT NULL) THEN
16400: j := j + 1;
16401: idx := idx + 1;
16402: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16403: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16404: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16405: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16406: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16420: -- For the PPD stub, the amount should be locked , but rate should be unlocked, as
16421: -- we are solving for rate.
16422: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
16423: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16424: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16425: ELSE
16426: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16427: END IF;
16428:
16422: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
16423: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16424: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16425: ELSE
16426: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16427: END IF;
16428:
16429: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
16430: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16430: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16431: END IF;
16432:
16433: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16434: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16435: ELSE
16436: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16437: END IF;
16438:
16432:
16433: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16434: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16435: ELSE
16436: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16437: END IF;
16438:
16439: END IF;
16440: END LOOP;
16454: END IF;
16455: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16456: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16457: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16458: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16459: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16460: l_csm_line_details_tbl(j).description := l_strm_name;
16461: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
16462: l_csm_line_details_tbl(j).days_in_year := l_days_in_yr_code;
16471: -- we are solving for rate.
16472: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := G_FALSE;
16473:
16474: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16475: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16476: ELSE
16477: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16478: END IF;
16479:
16473:
16474: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16475: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16476: ELSE
16477: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16478: END IF;
16479:
16480: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
16481: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16481: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16482: END IF;
16483:
16484: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16485: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16486: ELSE
16487: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16488: END IF;
16489: --=======================================================================================
16483:
16484: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16485: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16486: ELSE
16487: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16488: END IF;
16489: --=======================================================================================
16490: --Step 3 : IF the Payment is Advance then the PPD stub is created after the existing stub
16491: --=======================================================================================
16495: AND l_ppd_tbl(k).paydown_date < FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7)
16496: AND (l_rl_rec.RULE_INFORMATION10 IS NULL) THEN
16497: j := j + 1;
16498: idx := idx + 1;
16499: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16500: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16501: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16502: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16503: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16517: -- For the PPD stub, the amount should be locked , but rate should be unlocked, as
16518: -- we are solving for rate.
16519: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
16520: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16521: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16522: ELSE
16523: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16524: END IF;
16525:
16519: l_csm_line_details_tbl(j).LOCK_LEVEL_STEP := OKL_CREATE_STREAMS_PVT.G_LOCK_AMOUNT;
16520: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16521: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16522: ELSE
16523: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16524: END IF;
16525:
16526: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
16527: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16527: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16528: END IF;
16529:
16530: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16531: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16532: ELSE
16533: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16534: END IF;
16535:
16529:
16530: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16531: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16532: ELSE
16533: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16534: END IF;
16535:
16536: END IF;
16537: END LOOP;
16555: l_csm_line_details_tbl(j).description := l_strm_name;
16556: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
16557: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
16558: l_csm_line_details_tbl(j).level_index_number := idx;
16559: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16560: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
16561:
16562: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
16563: l_csm_line_details_tbl(j).days_in_month := l_days_in_month_code;
16577: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16578: END IF;
16579:
16580: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16581: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16582: ELSE
16583: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16584: END IF;
16585:
16579:
16580: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16581: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16582: ELSE
16583: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16584: END IF;
16585:
16586: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16587: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16583: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16584: END IF;
16585:
16586: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16587: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16588: ELSE
16589: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16590: END IF;
16591:
16585:
16586: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16587: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16588: ELSE
16589: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16590: END IF;
16591:
16592: ELSE
16593:
16624: l_csm_line_details_tbl(j).description := l_strm_name;
16625: l_csm_line_details_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
16626: l_csm_line_details_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2) ;
16627: l_csm_line_details_tbl(j).level_index_number := idx;
16628: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16629:
16630: IF l_number_periods_completed_cpy = 0 THEN
16631: l_csm_line_details_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
16632: ELSE
16651: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16652: END IF;
16653:
16654: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16655: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16656: ELSE
16657: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16658: END IF;
16659:
16653:
16654: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16655: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16656: ELSE
16657: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16658: END IF;
16659:
16660: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16661: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16657: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16658: END IF;
16659:
16660: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16661: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16662: ELSE
16663: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16664: END IF;
16665: l_first_batch := 'Y';
16659:
16660: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16661: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16662: ELSE
16663: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16664: END IF;
16665: l_first_batch := 'Y';
16666: END IF;
16667: --=====================================================================
16685: --of the period and one payment line for the remaining periods until the next paydown date
16686: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
16687: j := j + 1;
16688: idx := idx + 1;
16689: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16690: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16691: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16692: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16693: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16713: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16714: END IF;
16715:
16716: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16717: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16718: ELSE
16719: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16720: END IF;
16721:
16715:
16716: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16717: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16718: ELSE
16719: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16720: END IF;
16721:
16722: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16723: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16719: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16720: END IF;
16721:
16722: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16723: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16724: ELSE
16725: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16726: END IF;
16727: END IF;
16721:
16722: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16723: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16724: ELSE
16725: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16726: END IF;
16727: END IF;
16728: END IF;
16729: --Bug 4964710 - End of Changes
16734:
16735: /*PPD stub*/
16736: j := j + 1;
16737: idx := idx + 1;
16738: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16739: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16740: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16741: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16742: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16769: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16770: END IF;
16771:
16772: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16773: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16774: ELSE
16775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16776: END IF;
16777:
16771:
16772: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16773: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16774: ELSE
16775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16776: END IF;
16777:
16778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16775: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16776: END IF;
16777:
16778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16780: ELSE
16781: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16782: END IF;
16783: --===============================================================================
16777:
16778: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16779: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16780: ELSE
16781: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16782: END IF;
16783: --===============================================================================
16784: --Step 5: Check whether Ajusting stub needs to be created and create if necessary
16785: --================================================================================
16798: IF (l_ppd_tbl(k).diff_to_next = 0 OR (l_ppd_tbl(k).diff_to_next > l_days_between)) THEN
16799: /*Adjusting stub*/
16800: j := j + 1;
16801: idx := idx + 1;
16802: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16803: l_csm_line_details_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
16804: l_csm_line_details_tbl(j).period := g_stub_rec.period;
16805: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16806: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16825: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16826: END IF;
16827:
16828: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16829: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16830: ELSE
16831: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16832: END IF;
16833:
16827:
16828: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16829: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16830: ELSE
16831: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16832: END IF;
16833:
16834: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16835: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16831: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16832: END IF;
16833:
16834: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16835: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16836: ELSE
16837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16838: END IF;
16839: END IF;
16833:
16834: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16835: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16836: ELSE
16837: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16838: END IF;
16839: END IF;
16840: END IF;
16841: --===================================================================================
16858: IF (l_periods_after_ppd > 0) THEN
16859: /*Remaining amts*/
16860: j := j + 1;
16861: idx := idx + 1;
16862: l_csm_line_details_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16863: l_csm_line_details_tbl(j).number_of_periods := l_periods_after_ppd;
16864: l_csm_line_details_tbl(j).period := l_rl_rec.object1_id1;
16865: l_csm_line_details_tbl(j).advance_or_arrears := g_stub_rec.advance_or_arrears;
16866: l_csm_line_details_tbl(j).kle_loan_id := l_line_rec.id;
16885: l_csm_line_details_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16886: END IF;
16887:
16888: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16889: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16890: ELSE
16891: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16892: END IF;
16893:
16887:
16888: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16889: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16890: ELSE
16891: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16892: END IF;
16893:
16894: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16895: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16891: l_csm_line_details_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16892: END IF;
16893:
16894: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16895: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16896: ELSE
16897: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16898: END IF;
16899: END IF;--End of condition l_periods_after_ppd >0
16893:
16894: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16895: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16896: ELSE
16897: l_csm_line_details_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16898: END IF;
16899: END IF;--End of condition l_periods_after_ppd >0
16900:
16901: END IF;--The condition check for the date of every PPD in the ppd_tbl
16933: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
16934: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16935: END IF;
16936: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16937: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16938: ELSE
16939: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16940: END IF;
16941: -- Code for user defined streams
16935: END IF;
16936: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16937: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16938: ELSE
16939: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16940: END IF;
16941: -- Code for user defined streams
16942: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
16943: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
16941: -- Code for user defined streams
16942: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
16943: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
16944: -- code ends here
16945: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
16946: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
16947: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
16948: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16949: ELSE
16944: -- code ends here
16945: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
16946: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
16947: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
16948: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16949: ELSE
16950: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16951: END If;
16952: -- End of Bug#2757289 modification
16946: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) THEN
16947: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) THEN
16948: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
16949: ELSE
16950: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
16951: END If;
16952: -- End of Bug#2757289 modification
16953:
16954: -- Added by kthiruva on 29-Dec-2005.
16954: -- Added by kthiruva on 29-Dec-2005.
16955: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
16956: -- Bug 4915938 - Start of Changes
16957: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16958: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16959: ELSE
16960: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16961: END IF;
16962: -- Bug 4915938 - End of Changes
16956: -- Bug 4915938 - Start of Changes
16957: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16958: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16959: ELSE
16960: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16961: END IF;
16962: -- Bug 4915938 - End of Changes
16963:
16964: ELSIF (l_rl_rec.rule_information7 IS NULL OR
16979: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
16980: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
16981: END IF;
16982: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16983: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16984: ELSE
16985: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16986: END IF;
16987: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
16981: END IF;
16982: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
16983: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
16984: ELSE
16985: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
16986: END IF;
16987: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
16988: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
16989: ELSE
16989: ELSE
16990: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.RULE_INFORMATION2);
16991: END IF;
16992: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16993: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16994: ELSE
16995: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16996: END IF;
16997: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
16991: END IF;
16992: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
16993: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
16994: ELSE
16995: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16996: END IF;
16997: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
16998: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
16999: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
16995: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
16996: END IF;
16997: --IF ( UPPER(l_strm_name_rec.name) = 'INTEREST PAYMENT' ) THEN
16998: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
16999: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
17000: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
17001: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
17002: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
17003: ELSE
16998: IF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'INTEREST_PAYMENT' ) THEN
16999: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
17000: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
17001: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
17002: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
17003: ELSE
17004: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
17005: END If;
17006: END IF;
17000: --ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL PAYMENT' ) Then
17001: ELSIF ( UPPER(l_strm_name_rec.stream_type_purpose) = 'PRINCIPAL_PAYMENT' ) Then
17002: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
17003: ELSE
17004: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
17005: END If;
17006: END IF;
17007: END LOOP;
17008: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
17008: ELSIf ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) Then
17009: FOR l_rl_rec in l_rl_csr (l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_line_rec.id ) LOOP
17010: l := l + 1;
17011: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
17012: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
17013: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
17014: If(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
17015: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;
17016: Else
17184: x_msg_data OUT NOCOPY VARCHAR2,
17185: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
17186: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17187: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17188: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17189: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17190: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17191: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17192:
17185: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
17186: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17187: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17188: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17189: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17190: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17191: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17192:
17193: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17186: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17187: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17188: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17189: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17190: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17191: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17192:
17193: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17194: --This cursor determines whether there have been any Paydowns on this Contract
17187: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17188: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17189: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17190: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17191: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17192:
17193: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17194: --This cursor determines whether there have been any Paydowns on this Contract
17195: CURSOR is_ppd_available_csr(chrId NUMBER)
17289: x_msg_data OUT NOCOPY VARCHAR2,
17290: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
17291: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17292: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17293: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17294: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17295: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17296: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17297:
17290: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
17291: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17292: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17293: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17294: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17295: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17296: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17297:
17298: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17291: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
17292: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17293: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17294: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17295: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17296: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17297:
17298: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17299: --This cursor determines whether there have been any Paydowns on this Contract
17292: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type,
17293: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17294: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17295: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17296: x_csm_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type) AS
17297:
17298: --Added by kthiruva on 18-Apr-2006 for Bug 5161075
17299: --This cursor determines whether there have been any Paydowns on this Contract
17300: CURSOR is_payment_available_csr(chrId NUMBER,
17435: p_deal_type IN VARCHAR2,
17436: x_return_status OUT NOCOPY VARCHAR2,
17437: x_msg_count OUT NOCOPY NUMBER,
17438: x_msg_data OUT NOCOPY VARCHAR2,
17439: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17436: x_return_status OUT NOCOPY VARCHAR2,
17437: x_msg_count OUT NOCOPY NUMBER,
17438: x_msg_data OUT NOCOPY VARCHAR2,
17439: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17437: x_msg_count OUT NOCOPY NUMBER,
17438: x_msg_data OUT NOCOPY VARCHAR2,
17439: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17445: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
17438: x_msg_data OUT NOCOPY VARCHAR2,
17439: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17445: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
17446:
17439: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17445: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
17446:
17447: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE_DEAL';
17440: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17445: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
17446:
17447: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE_DEAL';
17448: l_api_version CONSTANT NUMBER := 1;
17441: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
17442: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
17443: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
17444: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
17445: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
17446:
17447: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE_DEAL';
17448: l_api_version CONSTANT NUMBER := 1;
17449: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
17805:
17806: l_pdtv_rec pdtv_rec_type;
17807: lx_pdt_param_rec pdt_param_rec_type;
17808: l_ast_dtl_tbl ast_dtl_tbl_type;
17809: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17806: l_pdtv_rec pdtv_rec_type;
17807: lx_pdt_param_rec pdt_param_rec_type;
17808: l_ast_dtl_tbl ast_dtl_tbl_type;
17809: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17807: lx_pdt_param_rec pdt_param_rec_type;
17808: l_ast_dtl_tbl ast_dtl_tbl_type;
17809: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17808: l_ast_dtl_tbl ast_dtl_tbl_type;
17809: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17816: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17809: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17816: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17817: l_line_rec l_line_rec_csr_lease%ROWTYPE;
17810: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17816: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17817: l_line_rec l_line_rec_csr_lease%ROWTYPE;
17818: l_hdr_rec l_hdr_csr_lease%ROWTYPE;
17811: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17816: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17817: l_line_rec l_line_rec_csr_lease%ROWTYPE;
17818: l_hdr_rec l_hdr_csr_lease%ROWTYPE;
17819: l_rl_rec l_sll_csr_lease%ROWTYPE;
17812: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
17813: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17814: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
17815: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
17816: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
17817: l_line_rec l_line_rec_csr_lease%ROWTYPE;
17818: l_hdr_rec l_hdr_csr_lease%ROWTYPE;
17819: l_rl_rec l_sll_csr_lease%ROWTYPE;
17820: l_hdrrl_rec l_hdrrl_csr_lease%ROWTYPE;
17950: OPEN l_financed_type_csr (chrId => p_chr_id);
17951: FETCH l_financed_type_csr INTO ln_fin_yn;
17952: CLOSE l_financed_type_csr;
17953: IF ln_fin_yn = 1 THEN
17954: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_BOTH;
17955: ELSIF ln_fin_yn = 0 THEN
17956: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LESSOR;
17957: END IF;
17958: -- to get the locatin of the asset
17952: CLOSE l_financed_type_csr;
17953: IF ln_fin_yn = 1 THEN
17954: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_BOTH;
17955: ELSIF ln_fin_yn = 0 THEN
17956: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LESSOR;
17957: END IF;
17958: -- to get the locatin of the asset
17959: OPEN ib_csr_lease(TO_NUMBER(p_chr_id));
17960: FETCH ib_csr_lease into l_ib_rec;
17968: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
17969: END IF;
17970: CLOSE ib_csr_lease;
17971: l_csm_lease_header.country := l_ib_rec.country;
17972: l_csm_lease_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
17973: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_NO;
17974: -- get header rule info
17975: OPEN l_hdrrl_csr_lease('LARVIN', 'LARVAU', TO_NUMBER(p_chr_id));
17976: FETCH l_hdrrl_csr_lease into l_hdrrl_rec;
17969: END IF;
17970: CLOSE ib_csr_lease;
17971: l_csm_lease_header.country := l_ib_rec.country;
17972: l_csm_lease_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
17973: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_NO;
17974: -- get header rule info
17975: OPEN l_hdrrl_csr_lease('LARVIN', 'LARVAU', TO_NUMBER(p_chr_id));
17976: FETCH l_hdrrl_csr_lease into l_hdrrl_rec;
17977: CLOSE l_hdrrl_csr_lease;
18002: --l_csm_stream_types_tbl(m).stream_type_id := l_strmid_rec.styid;
18003: l_csm_stream_types_tbl(m).stream_type_id := l_sty_id.id;
18004: l_csm_stream_types_tbl(m).pricing_name := l_sty_id.pricing_name;
18005: END IF;
18006: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_YES;
18007: -- get header rule info
18008: OPEN l_hdrrl_csr_lease('LARVIN', 'LARVAM', TO_NUMBER(p_chr_id));
18009: FETCH l_hdrrl_csr_lease into l_hdrrl_rec;
18010: CLOSE l_hdrrl_csr_lease;
18723: l_rents_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
18724: l_rents_tbl(j).period := g_stub_rec.period;
18725: l_rents_tbl(j).description := l_strm_name;
18726: l_rents_tbl(j).kle_asset_id := l_line_rec.id;
18727: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18728: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18729: l_rents_tbl(j).days_in_month := l_days_in_month_code;
18730: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
18731: -- Added by RGOOTY : ESG Down Payment Enhancements. Bug 4629365: Start
18724: l_rents_tbl(j).period := g_stub_rec.period;
18725: l_rents_tbl(j).description := l_strm_name;
18726: l_rents_tbl(j).kle_asset_id := l_line_rec.id;
18727: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18728: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18729: l_rents_tbl(j).days_in_month := l_days_in_month_code;
18730: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
18731: -- Added by RGOOTY : ESG Down Payment Enhancements. Bug 4629365: Start
18732: IF l_line_rec.capitalize_down_payment_yn = 'N' AND
18744: -- Added by kthiruva on 29-Dec-2005.
18745: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
18746: -- Bug 4915938 - Start of Changes
18747: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18748: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18749: ELSE
18750: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18751: END IF;
18752: -- Bug 4915938 - End of Changes
18746: -- Bug 4915938 - Start of Changes
18747: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18748: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18749: ELSE
18750: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18751: END IF;
18752: -- Bug 4915938 - End of Changes
18753:
18754: END IF;
18766: l_rents_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
18767: l_rents_tbl(j).period := g_stub_rec.period;
18768: l_rents_tbl(j).description := l_strm_name;
18769: l_rents_tbl(j).kle_asset_id := l_line_rec.id;
18770: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18771: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18772: l_rents_tbl(j).days_in_month := l_days_in_month_code;
18773: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
18774: -- Added by RGOOTY : ESG Down Payment Enhancements. Bug 4629365: Start
18767: l_rents_tbl(j).period := g_stub_rec.period;
18768: l_rents_tbl(j).description := l_strm_name;
18769: l_rents_tbl(j).kle_asset_id := l_line_rec.id;
18770: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18771: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18772: l_rents_tbl(j).days_in_month := l_days_in_month_code;
18773: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
18774: -- Added by RGOOTY : ESG Down Payment Enhancements. Bug 4629365: Start
18775: IF l_line_rec.capitalize_down_payment_yn = 'N' AND
18787: -- Added by kthiruva on 29-Dec-2005.
18788: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
18789: -- Bug 4915938 - Start of Changes
18790: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18791: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18792: ELSE
18793: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18794: END IF;
18795: -- Bug 4915938 - End of Changes
18789: -- Bug 4915938 - Start of Changes
18790: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18791: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18792: ELSE
18793: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18794: END IF;
18795: -- Bug 4915938 - End of Changes
18796:
18797: ELSIF (l_rl_rec.rule_information7 IS NULL OR
18800: l_rl_rec.rule_information8 = OKL_API.G_MISS_CHAR) THEN
18801: j := j + 1;
18802: idx := idx + 1;
18803: l_rents_tbl(j).level_index_number := idx;
18804: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18805: l_rents_tbl(j).description := l_strm_name;
18806: l_rents_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
18807: l_rents_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
18808: l_rents_tbl(j).period := l_rl_rec.object1_id1;
18805: l_rents_tbl(j).description := l_strm_name;
18806: l_rents_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
18807: l_rents_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
18808: l_rents_tbl(j).period := l_rl_rec.object1_id1;
18809: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18810: l_rents_tbl(j).kle_asset_id := l_line_rec.id;
18811: l_rents_tbl(j).days_in_month := l_days_in_month_code;
18812: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
18813: -- Added by RGOOTY : ESG Down Payment Enhancements. Bug 4629365: Start
18820: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
18821: l_rents_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
18822: END If;
18823: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18824: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18825: ELSE
18826: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18827: END IF;
18828: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
18822: END If;
18823: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18824: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18825: ELSE
18826: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18827: END IF;
18828: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
18829: l_rents_tbl(j).date_start := l_hdr_rec.start_date;
18830: ELSE
18853: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
18854: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18855: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18856: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18857: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18858: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18859: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
18860: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
18861: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
18854: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18855: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18856: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18857: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18858: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18859: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
18860: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
18861: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
18862: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
18869: -- Added by kthiruva on 29-Dec-2005.
18870: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
18871: -- Bug 4915938 - Start of Changes
18872: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18873: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18874: ELSE
18875: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18876: END IF;
18877: -- Bug 4915938 - End of Changes
18871: -- Bug 4915938 - Start of Changes
18872: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18873: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18874: ELSE
18875: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18876: END IF;
18877: -- Bug 4915938 - End of Changes
18878: END IF;
18879:
18888: l_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
18889: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
18890: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
18891: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18892: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18893: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18894: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18895: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18896: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
18889: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
18890: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
18891: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18892: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18893: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18894: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18895: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18896: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
18897: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
18905: -- Added by kthiruva on 29-Dec-2005.
18906: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
18907: -- Bug 4915938 - Start of Changes
18908: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18909: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18910: ELSE
18911: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18912: END IF;
18913: -- Bug 4915938 - End of Changes
18907: -- Bug 4915938 - Start of Changes
18908: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18909: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18910: ELSE
18911: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18912: END IF;
18913: -- Bug 4915938 - End of Changes
18914:
18915: ELSIF (l_rl_rec.rule_information7 IS NULL OR
18918: l_rl_rec.rule_information8 = OKL_API.G_MISS_CHAR) THEN
18919: k := k + 1;
18920: idx := idx + 1;
18921: l_csm_periodic_expenses_tbl(k).level_index_number := idx;
18922: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18923: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18924: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
18925: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
18926: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
18924: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
18925: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
18926: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
18927: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18928: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18929: l_csm_periodic_expenses_tbl(k).cash_effect_yn := 'N';
18930: l_csm_periodic_expenses_tbl(k).tax_effect_yn := 'N';
18931: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
18932: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
18934: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
18935: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
18936: END If;
18937: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18938: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18939: ELSE
18940: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18941: END IF;
18942: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
18936: END If;
18937: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18938: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18939: ELSE
18940: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18941: END IF;
18942: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
18943: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
18944: ELSE
18970: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
18971: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18972: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18973: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18974: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18975: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18976: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
18977: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
18978:
18971: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
18972: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
18973: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
18974: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
18975: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
18976: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
18977: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
18978:
18979: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
18984: -- Added by kthiruva on 29-Dec-2005.
18985: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
18986: -- Bug 4915938 - Start of Changes
18987: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18988: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18989: ELSE
18990: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18991: END IF;
18992: -- Bug 4915938 - End of Changes
18986: -- Bug 4915938 - Start of Changes
18987: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
18988: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
18989: ELSE
18990: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
18991: END IF;
18992: -- Bug 4915938 - End of Changes
18993:
18994: END IF;
19004: l_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
19005: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
19006: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
19007: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
19008: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
19009: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
19010: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
19011: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
19012: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
19005: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
19006: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
19007: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
19008: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
19009: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
19010: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
19011: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
19012: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
19013: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
19020: -- Added by kthiruva on 29-Dec-2005.
19021: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
19022: -- Bug 4915938 - Start of Changes
19023: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
19024: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
19025: ELSE
19026: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
19027: END IF;
19028: -- Bug 4915938 - End of Changes
19022: -- Bug 4915938 - Start of Changes
19023: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
19024: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
19025: ELSE
19026: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
19027: END IF;
19028: -- Bug 4915938 - End of Changes
19029:
19030: ELSIF (l_rl_rec.rule_information7 IS NULL OR
19033: l_rl_rec.rule_information8 = OKL_API.G_MISS_CHAR) THEN
19034: k := k + 1;
19035: idx := idx + 1;
19036: l_csm_periodic_expenses_tbl(k).level_index_number := idx;
19037: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
19038: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
19039: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
19040: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
19041: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
19039: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
19040: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
19041: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
19042: l_csm_periodic_expenses_tbl(k).kle_asset_id := l_line_rec.id;
19043: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
19044: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
19045: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
19046:
19047: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
19047: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
19048: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
19049: END If;
19050: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
19051: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
19052: ELSE
19053: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
19054: END IF;
19055: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
19049: END If;
19050: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
19051: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
19052: ELSE
19053: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
19054: END IF;
19055: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
19056: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
19057: ELSE
19068: (UPPER(TRIM(l_strm_name)) <> 'DOWN_PAYMENT') ) THEN
19069: FOR l_rl_rec in l_sll_csr_lease (l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_line_rec.id ) LOOP
19070: l := l + 1;
19071: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
19072: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
19073: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
19074: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
19075: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;
19076: ELSE
19313: p_chr_id IN VARCHAR2,
19314: x_return_status OUT NOCOPY VARCHAR2,
19315: x_msg_count OUT NOCOPY NUMBER,
19316: x_msg_data OUT NOCOPY VARCHAR2,
19317: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19314: x_return_status OUT NOCOPY VARCHAR2,
19315: x_msg_count OUT NOCOPY NUMBER,
19316: x_msg_data OUT NOCOPY VARCHAR2,
19317: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19315: x_msg_count OUT NOCOPY NUMBER,
19316: x_msg_data OUT NOCOPY VARCHAR2,
19317: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19323: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
19316: x_msg_data OUT NOCOPY VARCHAR2,
19317: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19323: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
19324:
19317: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19323: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
19324:
19325: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE';
19318: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19323: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
19324:
19325: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE';
19326: l_api_version CONSTANT NUMBER := 1;
19319: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
19320: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
19321: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
19322: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
19323: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type) AS
19324:
19325: l_api_name CONSTANT VARCHAR2(30) := 'EXTRACT_PARAMS_LEASE';
19326: l_api_version CONSTANT NUMBER := 1;
19327: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
19396:
19397: l_Trx_Type_rec Transaction_Type_csr%ROWTYPE;
19398: l_hdr_rec l_hdr_csr%ROWTYPE;
19399:
19400: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19397: l_Trx_Type_rec Transaction_Type_csr%ROWTYPE;
19398: l_hdr_rec l_hdr_csr%ROWTYPE;
19399:
19400: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19398: l_hdr_rec l_hdr_csr%ROWTYPE;
19399:
19400: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19399:
19400: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19407: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19400: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19407: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19408:
19401: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19407: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19408:
19409: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19402: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19407: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19408:
19409: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19410: x_csm_lines_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
19403: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19404: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19405: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19406: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19407: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19408:
19409: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19410: x_csm_lines_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
19411: x_csm_loan_lines_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
19464:
19465: x_csm_lease_header.purpose_code := 'REPORT';
19466: x_csm_lease_header.sif_id := x_request_id;
19467:
19468: okl_create_streams_pub.create_streams_lease_book(
19469: p_api_version,
19470: p_init_msg_list,
19471: p_skip_prc_engine,
19472: x_csm_lease_header,
19521:
19522: x_csm_loan_header.purpose_code := 'REPORT';
19523: x_csm_loan_header.sif_id := x_request_id;
19524:
19525: okl_create_streams_pub.create_streams_loan_book(
19526: p_api_version => p_api_version,
19527: p_init_msg_list => p_init_msg_list,
19528: p_skip_prc_engine => p_skip_prc_engine,
19529: p_csm_loan_header => x_csm_loan_header,
19648: l_hdr_rec l_hdr_csr%ROWTYPE;
19649: l_strms_orig_rec strms_csr%ROWTYPE;
19650: l_strms_rep_rec strms_csr%ROWTYPE;
19651:
19652: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19649: l_strms_orig_rec strms_csr%ROWTYPE;
19650: l_strms_rep_rec strms_csr%ROWTYPE;
19651:
19652: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19650: l_strms_rep_rec strms_csr%ROWTYPE;
19651:
19652: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19651:
19652: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19659: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19652: x_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19659: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19660:
19653: x_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19659: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19660:
19661: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19654: x_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19659: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19660:
19661: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19662: x_csm_lines_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
19655: x_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
19656: x_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19657: x_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
19658: x_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
19659: x_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
19660:
19661: x_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
19662: x_csm_lines_details_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
19663: x_csm_loan_lines_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
19799: -- ' for fee ' || to_char(nvl( x_req_stream_types_tbl(i).kle_fee_id,-1)) );
19800: -- END LOOP;
19801:
19802:
19803: okl_create_streams_pub.create_streams_lease_book(
19804: p_api_version,
19805: p_init_msg_list,
19806: p_skip_prc_engine,
19807: x_csm_lease_header,
19855: p_msg_name => 'OKL_LLA_GENSTRMS_EXTR_FAILED');
19856: raise OKL_API.G_EXCEPTION_ERROR;
19857: End If;
19858:
19859: okl_create_streams_pub.create_streams_loan_book(
19860: p_api_version => p_api_version,
19861: p_init_msg_list => p_init_msg_list,
19862: p_skip_prc_engine => p_skip_prc_engine,
19863: p_csm_loan_header => x_csm_loan_header,
21810: p_cle_id IN OKC_K_LINES_B.ID%TYPE,
21811: x_return_status OUT NOCOPY VARCHAR2,
21812: x_msg_count OUT NOCOPY NUMBER,
21813: x_msg_data OUT NOCOPY VARCHAR2,
21814: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21811: x_return_status OUT NOCOPY VARCHAR2,
21812: x_msg_count OUT NOCOPY NUMBER,
21813: x_msg_data OUT NOCOPY VARCHAR2,
21814: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21812: x_msg_count OUT NOCOPY NUMBER,
21813: x_msg_data OUT NOCOPY VARCHAR2,
21814: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21820: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21813: x_msg_data OUT NOCOPY VARCHAR2,
21814: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21820: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21821: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
21814: x_csm_lease_header OUT NOCOPY okl_create_streams_pub.csm_lease_rec_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21820: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21821: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
21822: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
21815: x_csm_one_off_fee_tbl OUT NOCOPY okl_create_streams_pub.csm_one_off_fee_tbl_type,
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21820: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21821: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
21822: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
21823: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type)
21816: x_csm_periodic_expenses_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21817: x_csm_yields_tbl OUT NOCOPY okl_create_streams_pub.csm_yields_tbl_type,
21818: x_req_stream_types_tbl OUT NOCOPY okl_create_streams_pub.csm_stream_types_tbl_type,
21819: x_csm_line_details_tbl OUT NOCOPY okl_create_streams_pub.csm_line_details_tbl_type,
21820: x_rents_tbl OUT NOCOPY okl_create_streams_pub.csm_periodic_expenses_tbl_type,
21821: x_csm_loan_header OUT NOCOPY okl_create_streams_pvt.csm_loan_rec_type,
21822: x_csm_loan_lines_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_line_tbl_type,
21823: x_csm_loan_levels_tbl OUT NOCOPY okl_create_streams_pvt.csm_loan_level_tbl_type)
21824: IS
22207: l_txtrans_rec l_txtrans_csr%ROWTYPE;
22208: l_strm_name_rec strm_name_csr%ROWTYPE;
22209: l_ib_rec ib_csr%ROWTYPE;
22210: l_strmid_rec l_strmid_csr%ROWTYPE;
22211: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22208: l_strm_name_rec strm_name_csr%ROWTYPE;
22209: l_ib_rec ib_csr%ROWTYPE;
22210: l_strmid_rec l_strmid_csr%ROWTYPE;
22211: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22209: l_ib_rec ib_csr%ROWTYPE;
22210: l_strmid_rec l_strmid_csr%ROWTYPE;
22211: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22210: l_strmid_rec l_strmid_csr%ROWTYPE;
22211: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22218: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
22211: l_csm_lease_header okl_create_streams_pub.csm_lease_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22218: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
22219: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
22212: l_csm_line_details_tbl okl_create_streams_pub.csm_line_details_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22218: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
22219: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
22220: l_csm_loan_details_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
22213: l_rents_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22218: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
22219: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
22220: l_csm_loan_details_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
22221: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
22214: l_csm_periodic_expenses_tbl okl_create_streams_pub.csm_periodic_expenses_tbl_type;
22215: l_csm_one_off_fee_tbl okl_create_streams_pub.csm_one_off_fee_tbl_type;
22216: l_csm_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22217: l_req_stream_types_tbl okl_create_streams_pub.csm_stream_types_tbl_type;
22218: l_csm_yields_tbl okl_create_streams_pub.csm_yields_tbl_type;
22219: l_csm_loan_header okl_create_streams_pvt.csm_loan_rec_type;
22220: l_csm_loan_details_tbl okl_create_streams_pvt.csm_loan_line_tbl_type;
22221: l_csm_loan_levels_tbl okl_create_streams_pvt.csm_loan_level_tbl_type;
22222:
22346: OPEN l_financed_type_csr (chrId => p_chr_id);
22347: FETCH l_financed_type_csr INTO ln_fin_yn;
22348: CLOSE l_financed_type_csr;
22349: IF ln_fin_yn = 1 THEN
22350: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_BOTH;
22351: ELSIF ln_fin_yn = 0 THEN
22352: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LESSOR;
22353: END IF;
22354: -- Getting the install base location
22348: CLOSE l_financed_type_csr;
22349: IF ln_fin_yn = 1 THEN
22350: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_BOTH;
22351: ELSIF ln_fin_yn = 0 THEN
22352: l_csm_lease_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LESSOR;
22353: END IF;
22354: -- Getting the install base location
22355: OPEN ib_csr(p_chr_id);
22356: FETCH ib_csr INTO l_ib_rec;
22362: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
22363: END IF;
22364: CLOSE ib_csr;
22365: l_csm_lease_header.country := l_ib_rec.country;
22366: l_csm_lease_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
22367: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_NO;
22368: -- Fetching the Header rule for Residual value insurance premium
22369: OPEN l_hdrrl_csr('LARVIN', 'LARVAU', TO_NUMBER(p_chr_id));
22370: FETCH l_hdrrl_csr INTO l_hdrrl_rec;
22363: END IF;
22364: CLOSE ib_csr;
22365: l_csm_lease_header.country := l_ib_rec.country;
22366: l_csm_lease_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
22367: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_NO;
22368: -- Fetching the Header rule for Residual value insurance premium
22369: OPEN l_hdrrl_csr('LARVIN', 'LARVAU', TO_NUMBER(p_chr_id));
22370: FETCH l_hdrrl_csr INTO l_hdrrl_rec;
22371: CLOSE l_hdrrl_csr;
22405: */
22406: m := m + 1;
22407: l_csm_stream_types_tbl(m).stream_type_id := l_sty_id.id;
22408: l_csm_stream_types_tbl(m).pricing_name := l_sty_id.pricing_name;
22409: l_csm_lease_header.rvi_yn := OKL_CREATE_STREAMS_PUB.G_FND_YES;
22410: OPEN l_hdrrl_csr('LARVIN', 'LARVAM', p_chr_id);
22411: FETCH l_hdrrl_csr INTO l_hdrrl_rec;
22412: CLOSE l_hdrrl_csr;
22413: l_csm_lease_header.rvi_rate := TO_NUMBER(nvl(l_hdrrl_rec.RULE_INFORMATION4,'0'));
22865: l_rents_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
22866: l_rents_tbl(j).period := g_stub_rec.period;
22867: l_rents_tbl(j).description := l_strm_name;
22868: -- l_rents_tbl(j).kle_asset_id := l_so_line_rec.id;
22869: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22870: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22871: l_rents_tbl(j).days_in_month := l_days_in_month_code;
22872: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
22873: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
22866: l_rents_tbl(j).period := g_stub_rec.period;
22867: l_rents_tbl(j).description := l_strm_name;
22868: -- l_rents_tbl(j).kle_asset_id := l_so_line_rec.id;
22869: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22870: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22871: l_rents_tbl(j).days_in_month := l_days_in_month_code;
22872: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
22873: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
22874: l_rents_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
22878: -- Added by kthiruva on 29-Dec-2005.
22879: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
22880: -- Bug 4915938 - Start of Changes
22881: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22882: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22883: ELSE
22884: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22885: END IF;
22886: -- Bug 4915938 - End of Changes
22880: -- Bug 4915938 - Start of Changes
22881: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22882: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22883: ELSE
22884: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22885: END IF;
22886: -- Bug 4915938 - End of Changes
22887:
22888: ELSIF (l_rl_rec.rule_information7 IS NULL OR
22891: l_rl_rec.rule_information8 = OKL_API.G_MISS_CHAR) THEN
22892: j := j + 1;
22893: idx := idx + 1;
22894: l_rents_tbl(j).level_index_number := idx;
22895: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22896: l_rents_tbl(j).description := l_strm_name;
22897: l_rents_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
22898: l_rents_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
22899: l_rents_tbl(j).period := l_rl_rec.object1_id1;
22896: l_rents_tbl(j).description := l_strm_name;
22897: l_rents_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
22898: l_rents_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
22899: l_rents_tbl(j).period := l_rl_rec.object1_id1;
22900: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22901: -- l_rents_tbl(j).kle_asset_id := l_so_line_rec.id;
22902: l_rents_tbl(j).days_in_month := l_days_in_month_code;
22903: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
22904: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
22904: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
22905: l_rents_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
22906: END If;
22907: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22908: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22909: ELSE
22910: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22911: END IF;
22912: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
22906: END If;
22907: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22908: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22909: ELSE
22910: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22911: END IF;
22912: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) Then
22913: l_rents_tbl(j).date_start := l_hdr_rec.start_date;
22914: ELSE
22946: l_rents_tbl(j).date_start := (ld_last_end_date + 1) + ln_diff_days;
22947: l_rents_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
22948: l_rents_tbl(j).period := g_stub_rec.period;
22949: l_rents_tbl(j).description := l_strm_name;
22950: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22951: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22952: l_rents_tbl(j).days_in_month := l_days_in_month_code;
22953: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
22954:
22947: l_rents_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
22948: l_rents_tbl(j).period := g_stub_rec.period;
22949: l_rents_tbl(j).description := l_strm_name;
22950: l_rents_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22951: l_rents_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22952: l_rents_tbl(j).days_in_month := l_days_in_month_code;
22953: l_rents_tbl(j).days_in_year := l_days_in_yr_code;
22954:
22955: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) Then
22959: -- Added by kthiruva on 29-Dec-2005.
22960: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
22961: -- Bug 4915938 - Start of Changes
22962: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22963: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22964: ELSE
22965: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22966: END IF;
22967: -- Bug 4915938 - End of Changes
22961: -- Bug 4915938 - Start of Changes
22962: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
22963: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
22964: ELSE
22965: l_rents_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
22966: END IF;
22967: -- Bug 4915938 - End of Changes
22968: END IF;
22969: -- End of BAKUCHIB modification bug#3121708
22984: l_csm_periodic_expenses_tbl(k).amount := TO_NUMBER(l_rl_rec.rule_information8);
22985: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
22986: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
22987: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
22988: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22989: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22990: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
22991: -- l_csm_periodic_expenses_tbl(k).kle_asset_id := l_so_line_rec.id;
22992: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
22985: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
22986: l_csm_periodic_expenses_tbl(k).number_of_periods := g_stub_rec.number_of_periods;
22987: l_csm_periodic_expenses_tbl(k).period := g_stub_rec.period;
22988: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
22989: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
22990: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
22991: -- l_csm_periodic_expenses_tbl(k).kle_asset_id := l_so_line_rec.id;
22992: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
22993: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
22999: -- Added by kthiruva on 29-Dec-2005.
23000: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
23001: -- Bug 4915938 - Start of Changes
23002: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23003: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23004: ELSE
23005: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23006: END IF;
23007: -- Bug 4915938 - End of Changes
23001: -- Bug 4915938 - Start of Changes
23002: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23003: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23004: ELSE
23005: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23006: END IF;
23007: -- Bug 4915938 - End of Changes
23008:
23009: ELSIF (l_rl_rec.rule_information7 IS NULL OR
23012: l_rl_rec.rule_information8 = OKL_API.G_MISS_CHAR) THEN
23013: k := k + 1;
23014: idx := idx + 1;
23015: l_csm_periodic_expenses_tbl(k).level_index_number := idx;
23016: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23017: l_csm_periodic_expenses_tbl(k).description := l_strm_name;
23018: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
23019: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
23020: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
23018: l_csm_periodic_expenses_tbl(k).period := l_rl_rec.object1_id1;
23019: l_csm_periodic_expenses_tbl(k).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
23020: l_csm_periodic_expenses_tbl(k).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
23021: -- l_csm_periodic_expenses_tbl(k).kle_asset_id := l_so_line_rec.id;
23022: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23023: l_csm_periodic_expenses_tbl(k).days_in_month := l_days_in_month_code;
23024: l_csm_periodic_expenses_tbl(k).days_in_year := l_days_in_yr_code;
23025:
23026: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23026: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23027: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23028: END If;
23029: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23030: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23031: ELSE
23032: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23033: END IF;
23034: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23028: END If;
23029: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23030: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23031: ELSE
23032: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23033: END IF;
23034: IF(l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23035: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
23036: ELSE
23041: ELSIF ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) THEN
23042: FOR l_rl_rec in l_rl_csr (l_rl_rec1.slh_id, 'LALEVL', 'LASLL',p_chr_id, l_so_line_rec.id ) LOOP
23043: l := l + 1;
23044: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
23045: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23046: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
23047: IF (l_rl_rec.RULE_INFORMATION2 IS NULL OR l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23048: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;
23049: ELSE
23152: l_csm_loan_header.date_payments_commencement := l_hdr_rec.start_date;
23153: l_csm_loan_header.date_start := l_hdr_rec.start_date;
23154: l_csm_loan_header.pdt_id := l_hdr_rec.pid;
23155: l_csm_loan_header.country := l_ib_rec.country;
23156: l_csm_loan_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
23157: l_csm_loan_header.total_lending := l_total_lending;
23158: l_csm_loan_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LENDER;
23159: FOR l_line_rec in l_line_rec_csr ( p_chr_id , 'FREE_FORM1') LOOP
23160: i := i + 1;
23154: l_csm_loan_header.pdt_id := l_hdr_rec.pid;
23155: l_csm_loan_header.country := l_ib_rec.country;
23156: l_csm_loan_header.orp_code := OKL_CREATE_STREAMS_PUB.G_ORP_CODE_BOOKING;
23157: l_csm_loan_header.total_lending := l_total_lending;
23158: l_csm_loan_header.sif_mode := OKL_CREATE_STREAMS_PUB.G_MODE_LENDER;
23159: FOR l_line_rec in l_line_rec_csr ( p_chr_id , 'FREE_FORM1') LOOP
23160: i := i + 1;
23161: l_csm_loan_details_tbl(i).kle_loan_id := l_line_rec.id;
23162: END LOOP;
23188: l_csm_loan_levels_tbl(j).description := 'Funding';
23189: l_csm_loan_levels_tbl(j).amount := l_total_lending;
23190: l_csm_loan_levels_tbl(j).date_start := l_hdr_rec.start_date;
23191: l_csm_loan_levels_tbl(j).level_index_number := idx;
23192: l_csm_loan_levels_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_FUNDING;
23193: l_csm_loan_levels_tbl(j).days_in_month := l_days_in_month_code;
23194: l_csm_loan_levels_tbl(j).days_in_year := l_days_in_yr_code;
23195:
23196: FOR l_rl_rec in l_rl_csr ( l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_so_line_rec.id ) LOOP
23204: l_csm_loan_levels_tbl(j).amount := TO_NUMBER(l_rl_rec.rule_information8);
23205: l_csm_loan_levels_tbl(j).date_start := FND_DATE.canonical_to_date(l_rl_rec.rule_information2)+TO_NUMBER(l_rl_rec.rule_information7);
23206: l_csm_loan_levels_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
23207: l_csm_loan_levels_tbl(j).period := g_stub_rec.period;
23208: l_csm_loan_levels_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23209: l_csm_loan_levels_tbl(j).days_in_month := l_days_in_month_code;
23210: l_csm_loan_levels_tbl(j).days_in_year := l_days_in_yr_code;
23211:
23212: --smahapat l_csm_loan_levels_tbl(j).kle_loan_id := l_so_line_rec.id;
23211:
23212: --smahapat l_csm_loan_levels_tbl(j).kle_loan_id := l_so_line_rec.id;
23213: l_csm_loan_levels_tbl(j).description := l_strm_name;
23214: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23215: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23216: ELSE
23217: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23218: END IF;
23219: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23213: l_csm_loan_levels_tbl(j).description := l_strm_name;
23214: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23215: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23216: ELSE
23217: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23218: END IF;
23219: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23220: l_csm_loan_levels_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23221: END IF;
23223: -- Added by kthiruva on 29-Dec-2005.
23224: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
23225: -- Bug 4915938 - Start of Changes
23226: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23227: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23228: ELSE
23229: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23230: END IF;
23231: -- Bug 4915938 - End of Changes
23225: -- Bug 4915938 - Start of Changes
23226: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23227: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23228: ELSE
23229: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23230: END IF;
23231: -- Bug 4915938 - End of Changes
23232:
23233: ELSIF (l_rl_rec.rule_information7 IS NULL OR
23240: l_csm_loan_levels_tbl(j).description := l_strm_name;
23241: l_csm_loan_levels_tbl(j).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
23242: l_csm_loan_levels_tbl(j).date_start := l_hdr_rec.start_date;
23243: l_csm_loan_levels_tbl(j).level_index_number := idx;
23244: l_csm_loan_levels_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23245: l_csm_loan_levels_tbl(j).number_of_periods := TO_NUMBER(nvl(l_rl_rec.RULE_INFORMATION3, l_hdr_rec.term));
23246: l_csm_loan_levels_tbl(j).period := l_rl_rec.object1_id1;
23247: l_csm_loan_levels_tbl(j).days_in_month := l_days_in_month_code;
23248: l_csm_loan_levels_tbl(j).days_in_year := l_days_in_yr_code;
23250: IF(l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23251: l_csm_loan_levels_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23252: END IF;
23253: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23254: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23255: ELSE
23256: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23257: END IF;
23258: IF(l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23252: END IF;
23253: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23254: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23255: ELSE
23256: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23257: END IF;
23258: IF(l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23259: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23260: ELSE
23255: ELSE
23256: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23257: END IF;
23258: IF(l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23259: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23260: ELSE
23261: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23262: END IF;
23263: END IF;
23257: END IF;
23258: IF(l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23259: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23260: ELSE
23261: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23262: END IF;
23263: END IF;
23264: -- Now we get difference in days between contract end_date and last payment end_date
23265: -- Start of BAKUCHIB modification bug#3121708
23291: l_csm_loan_levels_tbl(j).date_start := (ld_last_end_date + 1) + ln_diff_days;
23292: l_csm_loan_levels_tbl(j).number_of_periods := g_stub_rec.number_of_periods;
23293: l_csm_loan_levels_tbl(j).period := g_stub_rec.period;
23294: l_csm_loan_levels_tbl(j).description := l_strm_name;
23295: l_csm_loan_levels_tbl(j).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23296: l_csm_loan_levels_tbl(j).days_in_month := l_days_in_month_code;
23297: l_csm_loan_levels_tbl(j).days_in_year := l_days_in_yr_code;
23298:
23299: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23296: l_csm_loan_levels_tbl(j).days_in_month := l_days_in_month_code;
23297: l_csm_loan_levels_tbl(j).days_in_year := l_days_in_yr_code;
23298:
23299: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23300: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23301: ELSE
23302: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23303: END IF;
23304: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23298:
23299: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23300: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23301: ELSE
23302: l_csm_loan_levels_tbl(j).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23303: END IF;
23304: IF( l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23305: l_csm_loan_levels_tbl(j).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23306: END IF;
23308: -- Added by kthiruva on 29-Dec-2005.
23309: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
23310: -- Bug 4915938 - Start of Changes
23311: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23312: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23313: ELSE
23314: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23315: END IF;
23316: -- Bug 4915938 - End of Changes
23310: -- Bug 4915938 - Start of Changes
23311: IF ((l_rl_rec.rule_information10 IS NOT NULL) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23312: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23313: ELSE
23314: l_csm_loan_levels_tbl(j).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23315: END IF;
23316: -- Bug 4915938 - End of Changes
23317:
23318: END IF;
23343: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23344: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23345: END IF;
23346: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23347: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23348: ELSE
23349: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23350: END IF;
23351: IF (UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT') THEN
23345: END IF;
23346: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23347: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23348: ELSE
23349: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23350: END IF;
23351: IF (UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT') THEN
23352: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23353: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) THEN
23348: ELSE
23349: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23350: END IF;
23351: IF (UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT') THEN
23352: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23353: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) THEN
23354: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23355: ELSE
23356: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23350: END IF;
23351: IF (UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT') THEN
23352: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23353: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) THEN
23354: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23355: ELSE
23356: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23357: END If;
23358:
23352: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23353: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) THEN
23354: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23355: ELSE
23356: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23357: END If;
23358:
23359: --Added by kthiruva on 29-Dec-2005.
23360: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
23359: --Added by kthiruva on 29-Dec-2005.
23360: -- The value of the Advance and Arrears flag needs to be obtained from the rule information
23361: -- Bug 4915938 - Start of Changes
23362: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23363: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23364: ELSE
23365: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23366: END IF;
23367: -- Bug 4915938 - End of Changes
23361: -- Bug 4915938 - Start of Changes
23362: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23363: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23364: ELSE
23365: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23366: END IF;
23367: -- Bug 4915938 - End of Changes
23368:
23369: ELSIF (l_rl_rec.rule_information7 IS NULL OR
23384: IF (l_rl_rec.RULE_INFORMATION5 IS NOT NULL) THEN
23385: l_csm_periodic_expenses_tbl(k).structure := TO_NUMBER(l_rl_rec.RULE_INFORMATION5);
23386: END IF;
23387: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23388: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23389: ELSE
23390: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23391: END IF;
23392: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23386: END IF;
23387: IF (( l_rl_rec.RULE_INFORMATION10 IS NOT NULL ) AND (l_rl_rec.RULE_INFORMATION10 = 'Y')) THEN
23388: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ARREARS;
23389: ELSE
23390: l_csm_periodic_expenses_tbl(k).advance_or_arrears := OKL_CREATE_STREAMS_PUB.G_ADVANCE;
23391: END IF;
23392: IF (l_rl_rec.RULE_INFORMATION2 IS NULL or l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23393: l_csm_periodic_expenses_tbl(k).date_start := l_hdr_rec.start_date;
23394: ELSE
23394: ELSE
23395: l_csm_periodic_expenses_tbl(k).date_start := FND_DATE.canonical_to_date(l_rl_rec.RULE_INFORMATION2);
23396: END IF;
23397: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23398: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23399: ELSE
23400: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23401: END IF;
23402: IF ( UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT' ) THEN
23396: END IF;
23397: IF( l_strm_name_rec.stream_type_class = 'EXPENSE') THEN
23398: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_EXPENSE;
23399: ELSE
23400: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23401: END IF;
23402: IF ( UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT' ) THEN
23403: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23404: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) Then
23399: ELSE
23400: l_csm_periodic_expenses_tbl(k).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23401: END IF;
23402: IF ( UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT' ) THEN
23403: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23404: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) Then
23405: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23406: ELSE
23407: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23401: END IF;
23402: IF ( UPPER(l_strm_name_rec.name) = 'INTEREST_PAYMENT' ) THEN
23403: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23404: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) Then
23405: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23406: ELSE
23407: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23408: END If;
23409: END IF;
23403: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_INTEREST;
23404: ELSIF ( UPPER(l_strm_name_rec.name) = 'PRINCIPAL_PAYMENT' ) Then
23405: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PRINCIPAL;
23406: ELSE
23407: l_csm_periodic_expenses_tbl(k).level_type := OKL_CREATE_STREAMS_PUB.G_SFE_LEVEL_PAYMENT;
23408: END If;
23409: END IF;
23410: END LOOP;
23411: ELSIF ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) THEN
23411: ELSIF ((UPPER(TRIM(l_strm_name_rec.periodic_yn)) = 'N' )) THEN
23412: FOR l_rl_rec in l_rl_csr (l_rl_rec1.slh_id, 'LALEVL', 'LASLL', TO_NUMBER(p_chr_id), l_so_line_rec.id ) LOOP
23413: l := l + 1;
23414: l_csm_one_off_fee_tbl(l).description := l_strm_name_rec.name;
23415: l_csm_one_off_fee_tbl(l).income_or_expense := OKL_CREATE_STREAMS_PUB.G_INCOME;
23416: l_csm_one_off_fee_tbl(l).amount := FND_NUMBER.canonical_to_number(nvl(l_rl_rec.RULE_INFORMATION6,'0'));
23417: IF (l_rl_rec.RULE_INFORMATION2 IS NULL OR
23418: l_rl_rec.RULE_INFORMATION2 = OKL_API.G_MISS_CHAR) THEN
23419: l_csm_one_off_fee_tbl(l).date_paid := l_hdr_rec.start_date;