[Home] [Help]
9141: lx_fee_rec okl_fee_pvt.feev_rec_type;
9142: l_ass_adj_tbl okl_lease_quote_asset_pvt.asset_adjustment_tbl_type;
9143: l_cf_source VARCHAR2(30);
9144: l_fee_yn VARCHAR2(1) := 'N';
9145: l_cashflow_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
9146: l_cashflow_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
9147: l_asset_rec OKL_LEASE_QUOTE_ASSET_PVT.asset_rec_type;
9148: l_component_tbl OKL_LEASE_QUOTE_ASSET_PVT.asset_component_tbl_type;
9149: l_cf_hdr_rec OKL_LEASE_QUOTE_ASSET_PVT.cashflow_hdr_rec_type;
9142: l_ass_adj_tbl okl_lease_quote_asset_pvt.asset_adjustment_tbl_type;
9143: l_cf_source VARCHAR2(30);
9144: l_fee_yn VARCHAR2(1) := 'N';
9145: l_cashflow_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
9146: l_cashflow_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
9147: l_asset_rec OKL_LEASE_QUOTE_ASSET_PVT.asset_rec_type;
9148: l_component_tbl OKL_LEASE_QUOTE_ASSET_PVT.asset_component_tbl_type;
9149: l_cf_hdr_rec OKL_LEASE_QUOTE_ASSET_PVT.cashflow_hdr_rec_type;
9150: l_cf_level_tbl OKL_LEASE_QUOTE_ASSET_PVT.cashflow_level_tbl_type;
9949: -- IF cash flows exists delete the existing ones and create afresh ..
9950: IF l_cfo_exists = 'YES'
9951: THEN
9952: -- Delete the Cash Flow Levels which may be already created by Pricing ..
9953: okl_lease_quote_cashflow_pvt.delete_cashflows (
9954: p_api_version => p_api_version,
9955: p_init_msg_list => p_init_msg_list,
9956: p_transaction_control => NULL,
9957: p_source_object_code => l_cashflow_header_rec.parent_object_code,
10073: l_cashflow_level_tbl(i).record_mode := 'CREATE';
10074: END LOOP;
10075: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
10076: 'Before calling create_cash_flow ' );
10077: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
10078: p_api_version => p_api_version,
10079: p_init_msg_list => p_init_msg_list,
10080: p_transaction_control => NULL,
10081: p_cashflow_header_rec => l_cashflow_header_rec,
10832: x_return_status OUT NOCOPY VARCHAR2,
10833: x_msg_count OUT NOCOPY NUMBER,
10834: x_msg_data OUT NOCOPY VARCHAR2,
10835: p_id IN NUMBER,
10836: x_caf_rec OUT NOCOPY OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type,
10837: x_cfl_tbl OUT NOCOPY OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type,
10838: x_solved OUT NOCOPY VARCHAR2)
10839: IS
10840: -- Cursor to fetch all the Assets in a Lease Quote
10833: x_msg_count OUT NOCOPY NUMBER,
10834: x_msg_data OUT NOCOPY VARCHAR2,
10835: p_id IN NUMBER,
10836: x_caf_rec OUT NOCOPY OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type,
10837: x_cfl_tbl OUT NOCOPY OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type,
10838: x_solved OUT NOCOPY VARCHAR2)
10839: IS
10840: -- Cursor to fetch all the Assets in a Lease Quote
10841: CURSOR all_assets_csr( p_qte_id IN okl_lease_quotes_b.id%TYPE)
10889: is_debug_procedure_on BOOLEAN;
10890: is_debug_statement_on BOOLEAN;
10891: i NUMBER;
10892: l_first BOOLEAN;
10893: l_caf_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
10894: l_cfl_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
10895: l_solved VARCHAR2(30);
10896: BEGIN
10897: l_return_status := OKL_API.G_RET_STS_SUCCESS;
10890: is_debug_statement_on BOOLEAN;
10891: i NUMBER;
10892: l_first BOOLEAN;
10893: l_caf_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
10894: l_cfl_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
10895: l_solved VARCHAR2(30);
10896: BEGIN
10897: l_return_status := OKL_API.G_RET_STS_SUCCESS;
10898: l_debug_enabled := OKL_DEBUG_PUB.check_log_enabled;
11761: l_cash_flow_det_tbl so_cash_flow_details_tbl_type;
11762: l_cash_inflows OKL_PRICING_UTILS_PVT.cash_inflows_tbl_type;
11763: l_lease_qte_rec OKL_LEASE_QUOTE_PVT.lease_qte_rec_type;
11764: x_lease_qte_rec OKL_LEASE_QUOTE_PVT.lease_qte_rec_type;
11765: l_lq_payment_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11766: l_lq_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11767: l_cfo_exists_at_lq VARCHAR2(30);
11768: l_cfo_exists_at_noa VARCHAR2(30);
11769: l_tot_noa_oec NUMBER;
11762: l_cash_inflows OKL_PRICING_UTILS_PVT.cash_inflows_tbl_type;
11763: l_lease_qte_rec OKL_LEASE_QUOTE_PVT.lease_qte_rec_type;
11764: x_lease_qte_rec OKL_LEASE_QUOTE_PVT.lease_qte_rec_type;
11765: l_lq_payment_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11766: l_lq_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11767: l_cfo_exists_at_lq VARCHAR2(30);
11768: l_cfo_exists_at_noa VARCHAR2(30);
11769: l_tot_noa_oec NUMBER;
11770: l_noa_cash_flow_rec OKL_PRICING_UTILS_PVT.so_cash_flows_rec_type;
11768: l_cfo_exists_at_noa VARCHAR2(30);
11769: l_tot_noa_oec NUMBER;
11770: l_noa_cash_flow_rec OKL_PRICING_UTILS_PVT.so_cash_flows_rec_type;
11771: l_noa_cash_flow_det_tbl OKL_PRICING_UTILS_PVT.so_cash_flow_details_tbl_type;
11772: l_noa_payment_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11773: l_noa_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11774: l_fee_outflow_caf_rec so_cash_flows_rec_type;
11775: l_fee_outflow_cfl_tbl so_cash_flow_details_tbl_type;
11776: l_fee_inflow_caf_rec so_cash_flows_rec_type;
11769: l_tot_noa_oec NUMBER;
11770: l_noa_cash_flow_rec OKL_PRICING_UTILS_PVT.so_cash_flows_rec_type;
11771: l_noa_cash_flow_det_tbl OKL_PRICING_UTILS_PVT.so_cash_flow_details_tbl_type;
11772: l_noa_payment_header_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11773: l_noa_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11774: l_fee_outflow_caf_rec so_cash_flows_rec_type;
11775: l_fee_outflow_cfl_tbl so_cash_flow_details_tbl_type;
11776: l_fee_inflow_caf_rec so_cash_flows_rec_type;
11777: l_fee_inflow_cfl_tbl so_cash_flow_details_tbl_type;
11780: l_sp_for_assets BOOLEAN;
11781: l_an_ass_follow_lq BOOLEAN;
11782: l_lq_details_prc_rec OKL_PRICING_UTILS_PVT.pricing_parameter_rec_type;
11783: l_rent_sty_id OKL_STRM_TYPE_B.ID%TYPE;
11784: l_asset_caf_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11785: l_asset_cfl_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11786: l_ast_level_fin_amt NUMBER;
11787: l_lq_level_fin_amt NUMBER;
11788: l_quote_type_code OKL_LEASE_QUOTES_B.PARENT_OBJECT_CODE%TYPE;
11781: l_an_ass_follow_lq BOOLEAN;
11782: l_lq_details_prc_rec OKL_PRICING_UTILS_PVT.pricing_parameter_rec_type;
11783: l_rent_sty_id OKL_STRM_TYPE_B.ID%TYPE;
11784: l_asset_caf_rec OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_header_rec_type;
11785: l_asset_cfl_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11786: l_ast_level_fin_amt NUMBER;
11787: l_lq_level_fin_amt NUMBER;
11788: l_quote_type_code OKL_LEASE_QUOTES_B.PARENT_OBJECT_CODE%TYPE;
11789: l_solved VARCHAR2(30);
11790: l_tmp_amount NUMBER;
11791: l_lq_con_cash_inflows cash_inflows_tbl_type;
11792: l_iir NUMBER;
11793: l_miss_payment NUMBER;
11794: l_rnd_sum_assets_pmnts_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11795: l_rnd_lq_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11796: l_sum_of_noa_oec_percent NUMBER;
11797: -- Bug 6622178 : Start
11798: l_disp_sf_msg BOOLEAN;
11791: l_lq_con_cash_inflows cash_inflows_tbl_type;
11792: l_iir NUMBER;
11793: l_miss_payment NUMBER;
11794: l_rnd_sum_assets_pmnts_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11795: l_rnd_lq_payment_level_tbl OKL_LEASE_QUOTE_CASHFLOW_PVT.cashflow_level_tbl_type;
11796: l_sum_of_noa_oec_percent NUMBER;
11797: -- Bug 6622178 : Start
11798: l_disp_sf_msg BOOLEAN;
11799: -- Bug 6622178 : End
12360: l_lq_details_prc_rec := l_lq_pricing_parameter_rec;
12361: IF l_cfo_exists_at_lq = 'YES'
12362: THEN
12363: -- Delete the Cash Flow Levels which may be already created by Pricing ..
12364: okl_lease_quote_cashflow_pvt.delete_cashflows (
12365: p_api_version => p_api_version,
12366: p_init_msg_list => p_init_msg_list,
12367: p_transaction_control => NULL,
12368: p_source_object_code => 'LEASE_QUOTE',
12383: l_lq_payment_level_tbl(cfl_index).record_mode := 'CREATE';
12384: END LOOP;
12385: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
12386: 'Before creating the cash flows call' );
12387: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
12388: p_api_version => p_api_version,
12389: p_init_msg_list => p_init_msg_list,
12390: p_transaction_control => NULL,
12391: p_cashflow_header_rec => l_lq_payment_header_rec,
12989: THEN
12990: IF l_cfo_exists_at_lq = 'YES'
12991: THEN
12992: -- Delete the Cash Flow Levels which may be already created by Pricing ..
12993: okl_lease_quote_cashflow_pvt.delete_cashflows (
12994: p_api_version => p_api_version,
12995: p_init_msg_list => p_init_msg_list,
12996: p_transaction_control => NULL,
12997: p_source_object_code => 'LEASE_QUOTE',
13013: END LOOP;
13014: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
13015: 'Before creating the cash flows call ' || 'Sty_id ' || l_lq_payment_header_rec.stream_type_id
13016: || 'Status_code ' || l_lq_payment_header_rec.status_code );
13017: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
13018: p_api_version => p_api_version,
13019: p_init_msg_list => p_init_msg_list,
13020: p_transaction_control => NULL,
13021: p_cashflow_header_rec => l_lq_payment_header_rec,
13624: THEN
13625: IF l_cfo_exists_at_lq = 'YES'
13626: THEN
13627: -- Delete the Cash Flow Levels which may be already created by Pricing ..
13628: okl_lease_quote_cashflow_pvt.delete_cashflows (
13629: p_api_version => p_api_version,
13630: p_init_msg_list => p_init_msg_list,
13631: p_transaction_control => NULL,
13632: p_source_object_code => 'LEASE_QUOTE',
13648: END LOOP;
13649: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
13650: 'Before creating the cash flows call ' || 'Sty_id ' || l_lq_payment_header_rec.stream_type_id
13651: || 'Status_code ' || l_lq_payment_header_rec.status_code );
13652: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
13653: p_api_version => p_api_version,
13654: p_init_msg_list => p_init_msg_list,
13655: p_transaction_control => NULL,
13656: p_cashflow_header_rec => l_lq_payment_header_rec,
14343: IF l_cfo_exists_at_lq = 'YES'
14344: THEN
14345: -- Update the CFL Table
14346: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14347: 'Before OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow l_lq_payment_header_rec '
14348: || l_lq_payment_header_rec.stream_type_id
14349: || ' status_code ' || l_lq_payment_header_rec.status_code );
14350: OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow (
14351: p_api_version => G_API_VERSION,
14346: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14347: 'Before OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow l_lq_payment_header_rec '
14348: || l_lq_payment_header_rec.stream_type_id
14349: || ' status_code ' || l_lq_payment_header_rec.status_code );
14350: OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow (
14351: p_api_version => G_API_VERSION,
14352: p_init_msg_list => p_init_msg_list,
14353: p_transaction_control => G_FALSE,
14354: p_cashflow_header_rec => l_lq_payment_header_rec,
14356: x_return_status => l_return_status,
14357: x_msg_count => x_msg_count,
14358: x_msg_data => x_msg_data);
14359: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14360: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow ' || l_return_status );
14361: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14362: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow l_lq_payment_header_rec '
14363: || l_lq_payment_header_rec.stream_type_id
14364: || ' status_code ' || l_lq_payment_header_rec.status_code );
14358: x_msg_data => x_msg_data);
14359: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14360: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow ' || l_return_status );
14361: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14362: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.update_cashflow l_lq_payment_header_rec '
14363: || l_lq_payment_header_rec.stream_type_id
14364: || ' status_code ' || l_lq_payment_header_rec.status_code );
14365: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
14366: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
14368: RAISE OKL_API.G_EXCEPTION_ERROR;
14369: END IF;
14370: ELSE
14371: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14372: 'Before OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow l_lq_payment_header_rec '
14373: || l_lq_payment_header_rec.stream_type_id
14374: || ' status_code ' || l_lq_payment_header_rec.status_code );
14375: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow (
14376: p_api_version => p_api_version,
14371: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14372: 'Before OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow l_lq_payment_header_rec '
14373: || l_lq_payment_header_rec.stream_type_id
14374: || ' status_code ' || l_lq_payment_header_rec.status_code );
14375: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow (
14376: p_api_version => p_api_version,
14377: p_init_msg_list => p_init_msg_list,
14378: p_transaction_control => G_FALSE,
14379: p_cashflow_header_rec => l_lq_payment_header_rec,
14381: x_return_status => l_return_status,
14382: x_msg_count => x_msg_count,
14383: x_msg_data => x_msg_data);
14384: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14385: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow ' || l_return_status );
14386: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14387: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow l_lq_payment_header_rec '
14388: || l_lq_payment_header_rec.stream_type_id
14389: || ' status_code ' || l_lq_payment_header_rec.status_code );
14383: x_msg_data => x_msg_data);
14384: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14385: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow ' || l_return_status );
14386: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
14387: 'After OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow l_lq_payment_header_rec '
14388: || l_lq_payment_header_rec.stream_type_id
14389: || ' status_code ' || l_lq_payment_header_rec.status_code );
14390: IF l_return_status = G_RET_STS_UNEXP_ERROR THEN
14391: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
15562: THEN
15563: put_in_log(l_debug_enabled,is_debug_procedure_on,is_debug_statement_on,l_module, 'S',
15564: ' Deleting already existing CFO ' );
15565: -- Delete the Cash Flow Levels which may be already created by Pricing ..
15566: okl_lease_quote_cashflow_pvt.delete_cashflows (
15567: p_api_version => p_api_version,
15568: p_init_msg_list => p_init_msg_list,
15569: p_transaction_control => NULL,
15570: p_source_object_code => 'QUOTED_ASSET',
15636: l_asset_cfl_tbl(i).stub_days || ' | ' || l_asset_cfl_tbl(i).stub_amount|| ' | ' || l_asset_cfl_tbl(i).periods|| ' | ' ||
15637: l_asset_cfl_tbl(i).periodic_amount || ' | ' || l_asset_cfl_tbl(i).start_Date );
15638: END LOOP;
15639: -- Create the Cash flows for the Asset
15640: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
15641: p_api_version => p_api_version,
15642: p_init_msg_list => p_init_msg_list,
15643: p_transaction_control => NULL,
15644: p_cashflow_header_rec => l_asset_caf_rec,
15725: END LOOP;
15726: IF l_cfo_exists_at_lq = 'YES'
15727: THEN
15728: -- Delete the Payment structure already derieved by pricing
15729: okl_lease_quote_cashflow_pvt.delete_cashflows (
15730: p_api_version => p_api_version,
15731: p_init_msg_list => p_init_msg_list,
15732: p_transaction_control => NULL,
15733: p_source_object_code => 'LEASE_QUOTE_CONSOLIDATED',
15794: l_lq_payment_header_rec.frequency_code || ' | ' || l_lq_payment_header_rec.arrears_flag || ' | ' || l_lq_payment_level_tbl(i).rate|| ' | ' ||
15795: l_lq_payment_level_tbl(i).stub_days || ' | ' || l_lq_payment_level_tbl(i).stub_amount|| ' | ' || l_lq_payment_level_tbl(i).periods|| ' | ' ||
15796: l_lq_payment_level_tbl(i).periodic_amount || ' | ' || l_lq_payment_level_tbl(i).start_Date );
15797: END LOOP;
15798: OKL_LEASE_QUOTE_CASHFLOW_PVT.create_cashflow(
15799: p_api_version => p_api_version,
15800: p_init_msg_list => p_init_msg_list,
15801: p_transaction_control => NULL,
15802: p_cashflow_header_rec => l_lq_payment_header_rec,