3:
4: G_DEBUG CONSTANT VARCHAR2(10) := OKL_DEBUG_PUB.CHECK_LOG_ENABLED;
5: G_INIT_NUMBER CONSTANT NUMBER := -9999;
6: G_API_TYPE CONSTANT VARCHAR2(4) := '_PVT';
7: G_REQUIRED_VALUE CONSTANT VARCHAR2(200) := OKL_API.G_REQUIRED_VALUE;
8: G_COL_NAME_TOKEN CONSTANT VARCHAR2(200) := OKL_API.G_COL_NAME_TOKEN;
9:
10: -- varangan - Billing-Inline changes - Bug#5898792 - New constant added -Begin
11: -- sosharma changed the the value from STREAMS to VARIABLE_RATE
4: G_DEBUG CONSTANT VARCHAR2(10) := OKL_DEBUG_PUB.CHECK_LOG_ENABLED;
5: G_INIT_NUMBER CONSTANT NUMBER := -9999;
6: G_API_TYPE CONSTANT VARCHAR2(4) := '_PVT';
7: G_REQUIRED_VALUE CONSTANT VARCHAR2(200) := OKL_API.G_REQUIRED_VALUE;
8: G_COL_NAME_TOKEN CONSTANT VARCHAR2(200) := OKL_API.G_COL_NAME_TOKEN;
9:
10: -- varangan - Billing-Inline changes - Bug#5898792 - New constant added -Begin
11: -- sosharma changed the the value from STREAMS to VARIABLE_RATE
12: G_SOURCE_BILLING_TRX CONSTANT VARCHAR2(200) :='VARIABLE_RATE';
98: WHEN OTHERS THEN
99: IF l_get_fin_product%ISOPEN THEN
100: CLOSE l_get_fin_product;
101: END IF;
102: OKL_API.set_message(p_app_name => 'OKC',
103: p_msg_name => g_unexpected_error,
104: p_token1 => g_sqlcode_token,
105: p_token1_value => sqlcode,
106: p_token2 => g_sqlerrm_token,
104: p_token1 => g_sqlcode_token,
105: p_token1_value => sqlcode,
106: p_token2 => g_sqlerrm_token,
107: p_token2_value => sqlerrm);
108: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
109: END get_reporting_product;
110:
111: ------------------------------------------------------------------------------
112:
123:
124: ------------------------------------------------------------------------------
125: Procedure Create_Stream_Invoice (
126: p_api_version IN NUMBER,
127: p_init_msg_list IN VARCHAR2 DEFAULT OKL_API.G_FALSE,
128: x_return_status OUT NOCOPY VARCHAR2,
129: x_msg_count OUT NOCOPY NUMBER,
130: x_msg_data OUT NOCOPY VARCHAR2,
131: p_contract_id IN NUMBER,
132: p_line_id IN NUMBER DEFAULT NULL,
133: p_amount IN NUMBER,
134: p_due_date IN DATE,
135: p_stream_type_purpose IN VARCHAR2,
136: p_create_invoice_flag IN VARCHAR2 DEFAULT OKL_API.G_TRUE,
137: p_process_flag IN VARCHAR2 DEFAULT NULL,
138: p_parent_strm_element_id IN NUMBER DEFAULT NULL,
139: x_invoice_id OUT NOCOPY NUMBER,
140: x_stream_element_id OUT NOCOPY NUMBER) IS
185: l_acc_gen_primary_key_tbl Okl_Account_Generator_Pvt.primary_key_tbl;
186: l_meaning FND_LOOKUPS.meaning%TYPE;
187: l_description FND_LOOKUPS.description%TYPE;
188:
189: l_stream_created VARCHAR2(1) := OKL_API.G_FALSE;
190: l_strm_element_created VARCHAR2(1) := OKL_API.G_FALSE;
191: l_okl_trx_created VARCHAR2(1) := OKL_API.G_FALSE;
192: create_stream_invoice_failed EXCEPTION;
193:
186: l_meaning FND_LOOKUPS.meaning%TYPE;
187: l_description FND_LOOKUPS.description%TYPE;
188:
189: l_stream_created VARCHAR2(1) := OKL_API.G_FALSE;
190: l_strm_element_created VARCHAR2(1) := OKL_API.G_FALSE;
191: l_okl_trx_created VARCHAR2(1) := OKL_API.G_FALSE;
192: create_stream_invoice_failed EXCEPTION;
193:
194: -- 5033120
187: l_description FND_LOOKUPS.description%TYPE;
188:
189: l_stream_created VARCHAR2(1) := OKL_API.G_FALSE;
190: l_strm_element_created VARCHAR2(1) := OKL_API.G_FALSE;
191: l_okl_trx_created VARCHAR2(1) := OKL_API.G_FALSE;
192: create_stream_invoice_failed EXCEPTION;
193:
194: -- 5033120
195: l_trx_type_id Okl_Trx_Types_V.id%TYPE;
300:
301: l_sec_rep_method VARCHAR2(30);
302: */
303: l_rep_sty_id OKL_STRM_TYPE_V.id%TYPE;
304: l_rep_strm_element_created VARCHAR2(1) := OKL_API.G_FALSE;
305: l_rep_stream_created VARCHAR2(1) := OKL_API.G_FALSE;
306: lx_rep_product OKL_PRODUCTS_V.NAME%TYPE;
307: lx_rep_product_id NUMBER;
308:
301: l_sec_rep_method VARCHAR2(30);
302: */
303: l_rep_sty_id OKL_STRM_TYPE_V.id%TYPE;
304: l_rep_strm_element_created VARCHAR2(1) := OKL_API.G_FALSE;
305: l_rep_stream_created VARCHAR2(1) := OKL_API.G_FALSE;
306: lx_rep_product OKL_PRODUCTS_V.NAME%TYPE;
307: lx_rep_product_id NUMBER;
308:
309:
327: OKL_VARIABLE_INTEREST_PVT.print_debug(' p_create_invoice_flag: '|| p_create_invoice_flag);
328: OKL_VARIABLE_INTEREST_PVT.print_debug(' p_process_flag : '|| p_process_flag);
329: OKL_VARIABLE_INTEREST_PVT.print_debug(' p_parent_strm_element_id : '|| p_parent_strm_element_id);
330:
331: x_return_status := OKL_API.G_RET_STS_SUCCESS;
332:
333: -- Get sty_id for the contract
334: IF (p_stream_type_purpose = 'VARIABLE_INTEREST') THEN
335: Okl_Streams_Util.get_primary_stream_type(
353: ELSE
354: OKL_VARIABLE_INTEREST_PVT.print_debug( ' -- ERROR: Could not retrieve Stream Id for purpose '|| p_stream_type_purpose );
355: END IF;
356:
357: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
358: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
359: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
360: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
361: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
355: END IF;
356:
357: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
358: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
359: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
360: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
361: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
362: RAISE create_stream_invoice_failed;
363: END IF;
356:
357: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
358: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
359: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
360: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
361: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type');
362: RAISE create_stream_invoice_failed;
363: END IF;
364:
408: ELSE
409: OKL_VARIABLE_INTEREST_PVT.print_debug (' -- Error: '||x_msg_data);
410: END IF;
411:
412: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
413: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams');
414: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
415: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
416: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams');
410: END IF;
411:
412: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
413: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams');
414: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
415: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
416: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams');
417: RAISE create_stream_invoice_failed;
418: END IF;
411:
412: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
413: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams');
414: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
415: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
416: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams');
417: RAISE create_stream_invoice_failed;
418: END IF;
419:
416: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams');
417: RAISE create_stream_invoice_failed;
418: END IF;
419:
420: l_stream_created := OKL_API.G_TRUE;
421:
422: OKL_VARIABLE_INTEREST_PVT.print_debug ('Stm ID: '||lx_stmv_rec.id);
423: l_selv_rec.stm_id := lx_stmv_rec.id;
424: OKL_VARIABLE_INTEREST_PVT.print_debug ('Stm ID: '||l_selv_rec.stm_id);
467: ELSE
468: OKL_VARIABLE_INTEREST_PVT.print_debug (' -- Error: '||x_msg_data);
469: END IF;
470:
471: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
472: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements');
473: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
474: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
475: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements');
469: END IF;
470:
471: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
472: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements');
473: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
474: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
475: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements');
476: RAISE create_stream_invoice_failed;
477: END IF;
470:
471: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
472: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements');
473: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
474: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
475: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements');
476: RAISE create_stream_invoice_failed;
477: END IF;
478:
475: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements');
476: RAISE create_stream_invoice_failed;
477: END IF;
478:
479: l_strm_element_created := OKL_API.G_TRUE;
480:
481: x_stream_element_id := lx_selv_rec.id;
482:
483: ---------------sechawla 19-feb-09 MG Impact on Varibale Rate user story BEGIN ------------
503: p_contract_id => p_contract_id,
504: x_rep_product => lx_rep_product,
505: x_rep_product_id => lx_rep_product_id);
506:
507: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
508: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
509: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
510: RAISE OKL_API.G_EXCEPTION_ERROR;
511: END IF;
504: x_rep_product => lx_rep_product,
505: x_rep_product_id => lx_rep_product_id);
506:
507: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
508: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
509: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
510: RAISE OKL_API.G_EXCEPTION_ERROR;
511: END IF;
512:
505: x_rep_product_id => lx_rep_product_id);
506:
507: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
508: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
509: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
510: RAISE OKL_API.G_EXCEPTION_ERROR;
511: END IF;
512:
513: /* --Check the secondary_rep_method
506:
507: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
508: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
509: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
510: RAISE OKL_API.G_EXCEPTION_ERROR;
511: END IF;
512:
513: /* --Check the secondary_rep_method
514: OPEN l_sec_rep_method_csr ;
545: ELSE
546: OKL_VARIABLE_INTEREST_PVT.print_debug( ' -- ERROR: Could not retrieve Reporting Stream Id for purpose '|| p_stream_type_purpose );
547: END IF;
548:
549: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
550: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
551: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
552: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
553: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
547: END IF;
548:
549: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
550: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
551: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
552: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
553: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
554: RAISE create_stream_invoice_failed;
555: END IF;
548:
549: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
550: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
551: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
552: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
553: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Util.get_primary/dependent_stream_type_rep');
554: RAISE create_stream_invoice_failed;
555: END IF;
556:
595: ELSE
596: OKL_VARIABLE_INTEREST_PVT.print_debug (' -- Error: '||x_msg_data);
597: END IF;
598:
599: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
600: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
601: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
602: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
603: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
597: END IF;
598:
599: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
600: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
601: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
602: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
603: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
604: RAISE create_stream_invoice_failed;
605: END IF;
598:
599: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
600: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
601: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
602: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
603: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
604: RAISE create_stream_invoice_failed;
605: END IF;
606:
603: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_streams for reporting streams');
604: RAISE create_stream_invoice_failed;
605: END IF;
606:
607: l_rep_stream_created := OKL_API.G_TRUE;
608:
609: OKL_VARIABLE_INTEREST_PVT.print_debug ('Stm ID: '||lx_rep_stmv_rec.id);
610: l_rep_selv_rec.stm_id := lx_rep_stmv_rec.id;
611: OKL_VARIABLE_INTEREST_PVT.print_debug ('Stm ID: '||l_rep_selv_rec.stm_id);
655: ELSE
656: OKL_VARIABLE_INTEREST_PVT.print_debug (' -- Error: '||x_msg_data);
657: END IF;
658:
659: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
660: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
661: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
662: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
663: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
657: END IF;
658:
659: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
660: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
661: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
662: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
663: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
664: RAISE create_stream_invoice_failed;
665: END IF;
658:
659: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
660: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
661: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
662: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
663: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
664: RAISE create_stream_invoice_failed;
665: END IF;
666:
663: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Streams_Pub.create_stream_elements for reporting streams');
664: RAISE create_stream_invoice_failed;
665: END IF;
666:
667: l_rep_strm_element_created := OKL_API.G_TRUE;
668:
669: END IF;
670: END IF;
671: ---------------sechawla 19-feb-09 MG Impact on Varibale Rate user story END ------------
679: RAISE create_stream_invoice_failed;
680: END IF;
681: CLOSE set_of_books_csr;
682:
683: IF (p_create_invoice_flag = OKL_API.G_TRUE) THEN
684: IF (OKL_VARIABLE_INTEREST_PVT.G_BILLING_TRX_TYPE_ID IS NULL) THEN
685: OPEN trx_type_csr ('Billing');
686: FETCH trx_type_csr INTO OKL_VARIABLE_INTEREST_PVT.G_BILLING_TRX_TYPE_ID, OKL_VARIABLE_INTEREST_PVT.G_BILLING_TRX_TRY_ID, OKL_VARIABLE_INTEREST_PVT.G_BILLING_TRX_DESC;
687: IF (trx_type_csr%NOTFOUND) THEN
712: -- get the contract number
713: OPEN get_contract_number(p_contract_id);
714: FETCH get_contract_number INTO l_cntrct_number;
715: CLOSE get_contract_number;
716: Okl_Api.set_message(p_app_name => g_app_name,
717: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
718: p_token1 => 'CONTRACT_NUMBER',
719: p_token1_value => l_cntrct_number);
720: RAISE OKL_API.G_EXCEPTION_ERROR;
716: Okl_Api.set_message(p_app_name => g_app_name,
717: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
718: p_token1 => 'CONTRACT_NUMBER',
719: p_token1_value => l_cntrct_number);
720: RAISE OKL_API.G_EXCEPTION_ERROR;
721: END IF;
722:
723: OKL_VARIABLE_INTEREST_PVT.print_debug('Executing procedure OKL_TRX_AR_INVOICES_PUB.INSERT_TRX_AR_INVOICES');
724:
771: x_taiv_rec => lx_taiv_rec,
772: x_tilv_tbl => lx_tilv_tbl,
773: x_tldv_tbl => lx_tldv_tbl);
774:
775: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
776: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to okl_internal_billing_pvt.create_billing_trx');
777: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
778: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
779: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to okl_internal_billing_pvt.create_billing_trx');
773: x_tldv_tbl => lx_tldv_tbl);
774:
775: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
776: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to okl_internal_billing_pvt.create_billing_trx');
777: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
778: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
779: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to okl_internal_billing_pvt.create_billing_trx');
780: RAISE create_stream_invoice_failed;
781: END IF;
774:
775: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
776: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to okl_internal_billing_pvt.create_billing_trx');
777: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
778: ELSIF (x_return_status = OKL_API.G_RET_STS_ERROR) THEN
779: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to okl_internal_billing_pvt.create_billing_trx');
780: RAISE create_stream_invoice_failed;
781: END IF;
782: --sosharma added for billing changes
954: p_tclv_tbl => l_trxL_in_tbl,
955: x_tcnv_rec => l_trxH_out_rec,
956: x_tclv_tbl => l_trxL_out_tbl);
957:
958: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
959: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
960: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
962: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
956: x_tclv_tbl => l_trxL_out_tbl);
957:
958: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
959: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
960: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
962: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
963: RAISE create_stream_invoice_failed;
964: END IF;
957:
958: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
959: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
960: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
961: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
962: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
963: RAISE create_stream_invoice_failed;
964: END IF;
965:
962: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Trx_Contracts_Pub.create_trx_contracts');
963: RAISE create_stream_invoice_failed;
964: END IF;
965:
966: IF ((l_trxH_out_rec.id = OKL_API.G_MISS_NUM) OR
967: (l_trxH_out_rec.id IS NULL) ) THEN
968: OKL_API.set_message(G_APP_NAME, G_REQUIRED_VALUE,G_COL_NAME_TOKEN,'TRANSACTION_ID');
969: OKL_VARIABLE_INTEREST_PVT.print_error_message ('ERROR : OKL transaction ID is NULL');
970: RAISE create_stream_invoice_failed;
964: END IF;
965:
966: IF ((l_trxH_out_rec.id = OKL_API.G_MISS_NUM) OR
967: (l_trxH_out_rec.id IS NULL) ) THEN
968: OKL_API.set_message(G_APP_NAME, G_REQUIRED_VALUE,G_COL_NAME_TOKEN,'TRANSACTION_ID');
969: OKL_VARIABLE_INTEREST_PVT.print_error_message ('ERROR : OKL transaction ID is NULL');
970: RAISE create_stream_invoice_failed;
971: END IF;
972:
969: OKL_VARIABLE_INTEREST_PVT.print_error_message ('ERROR : OKL transaction ID is NULL');
970: RAISE create_stream_invoice_failed;
971: END IF;
972:
973: l_okl_trx_created := OKL_API.G_TRUE;
974:
975: ------------------------------------------------------------
976: -- Derive and Insert Distribution Line
977: ------------------------------------------------------------
986: x_acc_gen_tbl => l_acc_gen_primary_key_tbl,
987: x_return_status => x_return_status);
988:
989: OKL_VARIABLE_INTEREST_PVT.print_debug('End Debug OKLRVARB.pls call Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen ');
990: IF ( x_return_status = okl_api.g_ret_sts_success) THEN
991: FND_FILE.PUT_LINE (FND_FILE.LOG, ' -- Accounting engine called successfully ');
992: ELSE
993: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Calling Accounting engine.');
994: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
990: IF ( x_return_status = okl_api.g_ret_sts_success) THEN
991: FND_FILE.PUT_LINE (FND_FILE.LOG, ' -- Accounting engine called successfully ');
992: ELSE
993: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Calling Accounting engine.');
994: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
995: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
996: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
997: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
998: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
992: ELSE
993: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Calling Accounting engine.');
994: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
995: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
996: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
997: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
998: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
999: RAISE create_stream_invoice_failed;
1000: END IF;
993: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Calling Accounting engine.');
994: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
995: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
996: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
997: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
998: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Acc_Call_Pvt.Okl_Populate_Acc_Gen');
999: RAISE create_stream_invoice_failed;
1000: END IF;
1001: END IF;
1050: --END: Changes by dpsingh for SLA Uptake, Bug #5964482
1051:
1052: OKL_VARIABLE_INTEREST_PVT.print_debug('End Debug OKLRVARB.pls call Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST ');
1053:
1054: IF ( x_return_status = okl_api.g_ret_sts_success) THEN
1055: FND_FILE.PUT_LINE (FND_FILE.LOG, ' -- Accounting distributions created. ');
1056: ELSE
1057: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Accounting distributions not created.'||x_msg_count || x_msg_data);
1058: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1054: IF ( x_return_status = okl_api.g_ret_sts_success) THEN
1055: FND_FILE.PUT_LINE (FND_FILE.LOG, ' -- Accounting distributions created. ');
1056: ELSE
1057: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Accounting distributions not created.'||x_msg_count || x_msg_data);
1058: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1059: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1060: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1061: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1062: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1056: ELSE
1057: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Accounting distributions not created.'||x_msg_count || x_msg_data);
1058: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1059: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1060: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1061: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1062: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1063: RAISE create_stream_invoice_failed;
1064: END IF;
1057: FND_FILE.PUT_LINE (FND_FILE.LOG, '*=> ERROR : Accounting distributions not created.'||x_msg_count || x_msg_data);
1058: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1059: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1060: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1061: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1062: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to Okl_Account_Dist_Pub.CREATE_ACCOUNTING_DIST');
1063: RAISE create_stream_invoice_failed;
1064: END IF;
1065: END IF;
1077: ,P_TCLV_TBL => l_trxL_out_tbl
1078: ,p_ctxt_val_tbl => l_ctxt_tbl
1079: ,p_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
1080:
1081: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1082: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1083: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1084: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
1085: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1079: ,p_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
1080:
1081: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1082: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1083: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1084: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
1085: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1086: RAISE Okl_Api.G_EXCEPTION_ERROR;
1087: END IF;
1080:
1081: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1082: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1083: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1084: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
1085: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1086: RAISE Okl_Api.G_EXCEPTION_ERROR;
1087: END IF;
1088: -- end the call to MG engine .. racheruv. Bug 7690456
1082: OKL_VARIABLE_INTEREST_PVT.print_error_message('Unexpected error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1083: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1084: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
1085: OKL_VARIABLE_INTEREST_PVT.print_error_message('Error raised in call to OKL_MULTIGAAP_ENGINE_PVT.CREATE_SEC_REP_TRX');
1086: RAISE Okl_Api.G_EXCEPTION_ERROR;
1087: END IF;
1088: -- end the call to MG engine .. racheruv. Bug 7690456
1089: END IF;
1090:
1113: END IF;
1114:
1115: -- Daily Interest calculation conc. program does not use savepoint. Delete the streams/Trx
1116: IF (p_process_flag = 'DAILY_INTEREST') THEN
1117: IF (l_strm_element_created = OKL_API.G_TRUE) THEN
1118: OKL_STREAMS_PUB.delete_stream_elements(
1119: p_api_version => 1.0,
1120: p_init_msg_list => OKC_API.G_FALSE,
1121: x_return_status => x_return_status,
1122: x_msg_count => x_msg_count,
1123: x_msg_data => x_msg_data,
1124: p_selv_rec => lx_selv_rec);
1125: END IF;
1126: IF (l_stream_created = OKL_API.G_TRUE) THEN
1127: OKL_STREAMS_PUB.delete_streams(
1128: p_api_version => 1.0,
1129: p_init_msg_list => OKC_API.G_FALSE,
1130: x_return_status => x_return_status,
1132: x_msg_data => x_msg_data,
1133: p_stmv_rec => lx_stmv_rec);
1134: END IF;
1135:
1136: IF (l_okl_trx_created = OKL_API.G_TRUE) THEN
1137: OKL_TRX_CONTRACTS_PUB.delete_trx_contracts(
1138: p_api_version => 1.0,
1139: p_init_msg_list => OKC_API.G_FALSE,
1140: x_return_status => x_return_status,
1143: p_tcnv_rec => l_trxH_out_rec);
1144: END IF;
1145:
1146: END IF;
1147: x_return_status := OKL_API.G_RET_STS_ERROR;
1148:
1149: WHEN OTHERS THEN
1150: OKL_VARIABLE_INTEREST_PVT.print_error_message('Exception raised in procedure CREATE_STREAM_INVOICE');
1151: IF (stream_csr%ISOPEN) THEN
1168: CLOSE rep_stream_csr;
1169: END IF;
1170: -- Daily Interest calculation conc. program does not use savepoint. Delete the streams/Trx
1171: IF (p_process_flag = 'DAILY_INTEREST') THEN
1172: IF (l_strm_element_created = OKL_API.G_TRUE) THEN
1173: OKL_STREAMS_PUB.delete_stream_elements(
1174: p_api_version => 1.0,
1175: p_init_msg_list => OKC_API.G_FALSE,
1176: x_return_status => x_return_status,
1177: x_msg_count => x_msg_count,
1178: x_msg_data => x_msg_data,
1179: p_selv_rec => lx_selv_rec);
1180: END IF;
1181: IF (l_stream_created = OKL_API.G_TRUE) THEN
1182: OKL_STREAMS_PUB.delete_streams(
1183: p_api_version => 1.0,
1184: p_init_msg_list => OKC_API.G_FALSE,
1185: x_return_status => x_return_status,
1187: x_msg_data => x_msg_data,
1188: p_stmv_rec => lx_stmv_rec);
1189: END IF;
1190:
1191: IF (l_okl_trx_created = OKL_API.G_TRUE) THEN
1192: OKL_TRX_CONTRACTS_PUB.delete_trx_contracts(
1193: p_api_version => 1.0,
1194: p_init_msg_list => OKC_API.G_FALSE,
1195: x_return_status => x_return_status,
1199: END IF;
1200:
1201: END IF;
1202:
1203: Okl_Api.SET_MESSAGE(
1204: p_app_name => G_APP_NAME,
1205: p_msg_name => G_UNEXPECTED_ERROR,
1206: p_token1 => G_SQLCODE_TOKEN,
1207: p_token1_value => SQLCODE,
1207: p_token1_value => SQLCODE,
1208: p_token2 => G_SQLERRM_TOKEN,
1209: p_token2_value => SQLERRM);
1210:
1211: x_return_status := OKL_API.G_RET_STS_ERROR;
1212:
1213: END Create_Stream_Invoice;
1214:
1215: END;