DBA Data[Home] [Help]

APPS.OKL_AM_CALCULATE_QUOTE_PVT dependencies on DUAL

Line 45: -- SECHAWLA 14-FEB-03 - Bug 2749690 : Added code to store net investment, unbilled rec and residual value on quote lines

41: -- Business Rules :
42: -- Parameters : array of quote lines, data for new record
43: -- Version : 1.0
44: -- History : SECHAWLA 20-NOV-02 - Bug 2680542 : Added 2 optional paramaters : p_asset_qty, p_quote_qty
45: -- SECHAWLA 14-FEB-03 - Bug 2749690 : Added code to store net investment, unbilled rec and residual value on quote lines
46: -- SECHAWLA 20-FEB-03 - Bug 2757368 : Added logic to prorate the quote line amounts based upon the selected quote quantity
47: -- SECHAWLA 24-FEB-03 - Bug 2817025 : Added code to convert the repurchase quote line amount to functional currency
48: -- SECHAWLA 21-APR-03 - Bug 2925120 Modified code to fix the unit proration problem for unbiled rec, Service and Fee Lines
49: -- RMUNJULU 2757312 Added p_split_asset_number to store asset_number entered by user

Line 66: p_residual_value IN NUMBER DEFAULT NULL, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter

62: p_asset_qty IN NUMBER DEFAULT NULL,
63: p_quote_qty IN NUMBER DEFAULT NULL,
64: p_net_investment IN NUMBER DEFAULT NULL, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
65: p_unbilled_rec IN NUMBER DEFAULT NULL, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
66: p_residual_value IN NUMBER DEFAULT NULL, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
67: p_split_asset_number IN VARCHAR2 DEFAULT NULL, -- RMUNJULU 2757312 Added
68: p_rule_information4 IN OKC_RULES_V.RULE_INFORMATION4%TYPE DEFAULT NULL, --SECHAWLA 20-FEB-03 2757368 : Added anothe parameter
69: p_success_yn IN VARCHAR2,
70: p_sty_id IN NUMBER,

Line 136: 'p_residual_value :'||p_residual_value);

132: 'p_net_investment :'||p_net_investment);
133: OKL_DEBUG_PUB.LOG_DEBUG(G_LEVEL_STATEMENT,L_MODULE_NAME,
134: 'p_unbilled_rec :'||p_unbilled_rec);
135: OKL_DEBUG_PUB.LOG_DEBUG(G_LEVEL_STATEMENT,L_MODULE_NAME,
136: 'p_residual_value :'||p_residual_value);
137: OKL_DEBUG_PUB.LOG_DEBUG(G_LEVEL_STATEMENT,L_MODULE_NAME,
138: 'p_split_asset_number :'||p_split_asset_number);
139: OKL_DEBUG_PUB.LOG_DEBUG(G_LEVEL_STATEMENT,L_MODULE_NAME,
140: 'p_rule_information4 :'||p_rule_information4);

Line 373: -- SECHAWLA 14-FEB-03 Bug 2749690 : Added the following code to store net investment, unbileld rec and residual value on quote lines

369: l_tqlv_rec.asset_quantity := p_asset_qty; -- added
370: l_tqlv_rec.quote_quantity := p_quote_qty; --added
371: -- end new code
372:
373: -- SECHAWLA 14-FEB-03 Bug 2749690 : Added the following code to store net investment, unbileld rec and residual value on quote lines
374: l_tqlv_rec.asset_value := p_net_investment;
375: l_tqlv_rec.unbilled_receivables := p_unbilled_rec;
376: l_tqlv_rec.residual_value := p_residual_value;
377: -- end new code

Line 376: l_tqlv_rec.residual_value := p_residual_value;

372:
373: -- SECHAWLA 14-FEB-03 Bug 2749690 : Added the following code to store net investment, unbileld rec and residual value on quote lines
374: l_tqlv_rec.asset_value := p_net_investment;
375: l_tqlv_rec.unbilled_receivables := p_unbilled_rec;
376: l_tqlv_rec.residual_value := p_residual_value;
377: -- end new code
378: l_tqlv_rec.sty_id := p_sty_id;
379: l_tqlv_rec.defaulted_yn := l_defaulted_yn;
380: l_tqlv_rec.modified_yn := 'N';

Line 472: -- Added logic to calculate Net Investment, Unbileld Receivables and Residual Value for all quote lines

468: -- History : SECHAWLA - 20-NOV-02 - Bug 2468222
469: -- Added p_asset_qty and p_quote_qty parameters in call to append_quote_lines procedure.
470: -- Changed reference p_asset_tbl(l_asset_tbl_index) to p_asset_tbl(l_asset_tbl_index).p_asset_id
471: -- SECHAWLA - 14-FEB-03 - Bug 2749690
472: -- Added logic to calculate Net Investment, Unbileld Receivables and Residual Value for all quote lines
473: -- SECHAWLA - 21-APR-03 Bug 2925120
474: -- Modified code to get the Unbilled Rec using calc quote strm API, instead of using LINE_UNBILLED_STREAMS formula
475: -- RMUNJULU 2757312 Added to store p_split_asset_number
476: -- SECHAWLA 09-AUG-05 4304230 Modified to return 0 residual value if asset status is Evergreen

Line 476: -- SECHAWLA 09-AUG-05 4304230 Modified to return 0 residual value if asset status is Evergreen

472: -- Added logic to calculate Net Investment, Unbileld Receivables and Residual Value for all quote lines
473: -- SECHAWLA - 21-APR-03 Bug 2925120
474: -- Modified code to get the Unbilled Rec using calc quote strm API, instead of using LINE_UNBILLED_STREAMS formula
475: -- RMUNJULU 2757312 Added to store p_split_asset_number
476: -- SECHAWLA 09-AUG-05 4304230 Modified to return 0 residual value if asset status is Evergreen
477: -- PRASJAIN Bug 6030917 Modified the signature of
478: -- okl_am_util_pvt.get_net_investment() and Removed the proration
479: -- after the call
480: -- End of comments

Line 499: l_residual_value NUMBER;

495:
496: --SECHAWLA 14-FEB-03 2749690 : New declarations
497: l_net_investment NUMBER;
498: --l_unbilled_rec NUMBER; --SECHAWLA 21-APR-03 Bug 2925120
499: l_residual_value NUMBER;
500: l_asset_value ak_attributes_vl.attribute_label_long%TYPE;
501:
502: -- SECHAWLA 09-AUG-05 4304230 : Modified to get line status
503: -- This cursor is used to get the residual value for an asset

Line 503: -- This cursor is used to get the residual value for an asset

499: l_residual_value NUMBER;
500: l_asset_value ak_attributes_vl.attribute_label_long%TYPE;
501:
502: -- SECHAWLA 09-AUG-05 4304230 : Modified to get line status
503: -- This cursor is used to get the residual value for an asset
504: CURSOR l_okllines_csr(p_kle_id IN NUMBER) IS
505: SELECT nvl(kle.residual_value,0), cle.sts_code
506: FROM okl_k_lines kle, okc_k_lines_b cle
507: WHERE kle.id = p_kle_id

Line 505: SELECT nvl(kle.residual_value,0), cle.sts_code

501:
502: -- SECHAWLA 09-AUG-05 4304230 : Modified to get line status
503: -- This cursor is used to get the residual value for an asset
504: CURSOR l_okllines_csr(p_kle_id IN NUMBER) IS
505: SELECT nvl(kle.residual_value,0), cle.sts_code
506: FROM okl_k_lines kle, okc_k_lines_b cle
507: WHERE kle.id = p_kle_id
508: AND kle.id = cle.id;
509:

Line 542: --SECHAWLA 14-FEB-03 2749690 : Calculate Asset Value, Unbilled Receivables and Residual Value for each

538: l_asset_tbl_index := p_asset_tbl.FIRST;
539:
540: LOOP
541:
542: --SECHAWLA 14-FEB-03 2749690 : Calculate Asset Value, Unbilled Receivables and Residual Value for each
543: --quote line
544:
545: -- Start : Bug 6030917 : prasjain
546: l_proration_factor := p_asset_tbl(l_asset_tbl_index).p_quote_qty/p_asset_tbl(l_asset_tbl_index).p_asset_qty;

Line 634: --Get the Residual value

630: IF l_total_line_unbilled_rec <> 0 THEN
631: l_total_line_unbilled_rec := (l_total_line_unbilled_rec/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);
632: END IF;
633:
634: --Get the Residual value
635: OPEN l_okllines_csr( p_asset_tbl(l_asset_tbl_index).p_asset_id);
636: FETCH l_okllines_csr INTO l_residual_value, l_asset_status; -- SECHAWLA 09-AUG-05 4304230 : added asset status
637: IF l_okllines_csr%NOTFOUND THEN
638: OKC_API.set_message( p_app_name => 'OKC',

Line 636: FETCH l_okllines_csr INTO l_residual_value, l_asset_status; -- SECHAWLA 09-AUG-05 4304230 : added asset status

632: END IF;
633:
634: --Get the Residual value
635: OPEN l_okllines_csr( p_asset_tbl(l_asset_tbl_index).p_asset_id);
636: FETCH l_okllines_csr INTO l_residual_value, l_asset_status; -- SECHAWLA 09-AUG-05 4304230 : added asset status
637: IF l_okllines_csr%NOTFOUND THEN
638: OKC_API.set_message( p_app_name => 'OKC',
639: p_msg_name => G_INVALID_VALUE,
640: p_token1 => G_COL_NAME_TOKEN,

Line 642: l_residual_value := 0;

638: OKC_API.set_message( p_app_name => 'OKC',
639: p_msg_name => G_INVALID_VALUE,
640: p_token1 => G_COL_NAME_TOKEN,
641: p_token1_value => 'KLE_ID');
642: l_residual_value := 0;
643: END IF;
644: CLOSE l_okllines_csr;
645:
646: --Prorate Residual Value

Line 646: --Prorate Residual Value

642: l_residual_value := 0;
643: END IF;
644: CLOSE l_okllines_csr;
645:
646: --Prorate Residual Value
647: IF l_residual_value <> 0 THEN
648: IF l_asset_status <> 'EVERGREEN' THEN -- SECHAWLA 09-AUG-05 4304230 : added this condition
649: l_residual_value := (l_residual_value/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);
650: ELSE

Line 647: IF l_residual_value <> 0 THEN

643: END IF;
644: CLOSE l_okllines_csr;
645:
646: --Prorate Residual Value
647: IF l_residual_value <> 0 THEN
648: IF l_asset_status <> 'EVERGREEN' THEN -- SECHAWLA 09-AUG-05 4304230 : added this condition
649: l_residual_value := (l_residual_value/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);
650: ELSE
651: l_residual_value := 0; -- SECHAWLA 09-AUG-05 4304230 : added

Line 649: l_residual_value := (l_residual_value/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);

645:
646: --Prorate Residual Value
647: IF l_residual_value <> 0 THEN
648: IF l_asset_status <> 'EVERGREEN' THEN -- SECHAWLA 09-AUG-05 4304230 : added this condition
649: l_residual_value := (l_residual_value/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);
650: ELSE
651: l_residual_value := 0; -- SECHAWLA 09-AUG-05 4304230 : added
652: END IF;
653: END IF;

Line 651: l_residual_value := 0; -- SECHAWLA 09-AUG-05 4304230 : added

647: IF l_residual_value <> 0 THEN
648: IF l_asset_status <> 'EVERGREEN' THEN -- SECHAWLA 09-AUG-05 4304230 : added this condition
649: l_residual_value := (l_residual_value/p_asset_tbl(l_asset_tbl_index).p_asset_qty)*(p_asset_tbl(l_asset_tbl_index).p_quote_qty);
650: ELSE
651: l_residual_value := 0; -- SECHAWLA 09-AUG-05 4304230 : added
652: END IF;
653: END IF;
654: --SECHAWLA 14-FEB-03 2749690 : End new code
655:

Line 676: p_residual_value => l_residual_value, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter

672: p_quote_qty => p_asset_tbl(l_asset_tbl_index).p_quote_qty, -- added
673: p_net_investment => l_net_investment, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
674: p_split_asset_number => p_asset_tbl(l_asset_tbl_index).p_split_asset_number, -- RMUNJULU 2757312 Added to store p_split_asset_number
675: p_unbilled_rec => l_total_line_unbilled_rec, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
676: p_residual_value => l_residual_value, -- SECHAWLA 14-FEB-03 2749690 :Added another parameter
677: p_success_yn => OKL_API.G_RET_STS_SUCCESS,
678: p_sty_id => NULL,
679: p_formula_name => NULL,
680: p_sub_tqlv_tbl => G_EMPTY_TQLV_TBL,

Line 6184: SELECT sysdate INTO G_SYSDATE from dual;

6180: RAISE OKL_API.G_EXCEPTION_ERROR;
6181: END IF;
6182:
6183: -- SECHAWLA 24-FEB-03 Bug # 2817025 : Get sysdate
6184: SELECT sysdate INTO G_SYSDATE from dual;
6185:
6186: --SECHAWLA 21-APR-03 Bug 2925120 : Store the asset table in a global variable
6187: G_ASSET_TBL := p_asset_tbl;
6188: