21: G_FUNC_CURRENCY_CODE_REP OKL_TRX_CONTRACTS.CURRENCY_CODE%TYPE;
22: G_ACCRUAL_DATE DATE;
23:
24: TYPE trx_rec_type IS RECORD (
25: old_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
26: new_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
27: ID okl_trx_contracts_all.ID%TYPE := OKL_API.G_MISS_NUM
28: );
29:
22: G_ACCRUAL_DATE DATE;
23:
24: TYPE trx_rec_type IS RECORD (
25: old_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
26: new_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
27: ID okl_trx_contracts_all.ID%TYPE := OKL_API.G_MISS_NUM
28: );
29:
30: TYPE trx_tbl_type IS TABLE OF trx_rec_type INDEX BY BINARY_INTEGER;
23:
24: TYPE trx_rec_type IS RECORD (
25: old_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
26: new_trx_number okl_trx_contracts_all.trx_number%TYPE := OKL_API.G_MISS_CHAR,
27: ID okl_trx_contracts_all.ID%TYPE := OKL_API.G_MISS_NUM
28: );
29:
30: TYPE trx_tbl_type IS TABLE OF trx_rec_type INDEX BY BINARY_INTEGER;
31: G_trx_number_tbl trx_tbl_type;
101: l_sysdate DATE := SYSDATE;
102: l_rent_sty_id NUMBER;
103: l_receivable_balance NUMBER := 0;
104: l_sty_name VARCHAR2(2000) := 'RENT';
105: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
106:
107: -- SGIYER
108: -- Commenting Cursor below as not needed. user Defined Streams Project.
109: --CURSOR get_sty_id_csr IS
136: p_primary_sty_purpose => 'RENT',
137: x_return_status => l_return_status,
138: x_primary_sty_id => l_rent_sty_id);
139:
140: IF l_return_status <> Okl_Api.G_RET_STS_SUCCESS THEN
141: RAISE NO_DATA_FOUND;
142: END IF;
143:
144: -- Open the cursor to get the receivable balance
197:
198: ELSIF p_operand_code = 'BUNP' THEN
199: l_return_value := NVL(l_outstanding_invoices,0);
200: ELSE
201: RAISE Okl_Api.G_EXCEPTION_ERROR;
202: END IF;
203:
204: RETURN l_return_value;
205: EXCEPTION
203:
204: RETURN l_return_value;
205: EXCEPTION
206:
207: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
208: -- store SQL error message on message stack for caller
209: Okl_Api.set_message(p_app_name => g_app_name,
210: p_msg_name => 'OKL_AGN_INVALID_OPERAND_CODE');
211:
205: EXCEPTION
206:
207: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
208: -- store SQL error message on message stack for caller
209: Okl_Api.set_message(p_app_name => g_app_name,
210: p_msg_name => 'OKL_AGN_INVALID_OPERAND_CODE');
211:
212: WHEN OTHERS THEN
213: -- store SQL error message on message stack for caller
210: p_msg_name => 'OKL_AGN_INVALID_OPERAND_CODE');
211:
212: WHEN OTHERS THEN
213: -- store SQL error message on message stack for caller
214: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
215: p_msg_name => g_unexpected_error,
216: p_token1 => g_sqlcode_token,
217: p_token1_value => SQLCODE,
218: p_token2 => g_sqlerrm_token,
253: AND chr.scs_code in ('LEASE','LOAN');
254:
255: l_syndicate_flag VARCHAR2(1) := 'N';
256: l_api_version NUMBER;
257: l_return_status VARCHAR2(1) := Okl_API.G_RET_STS_SUCCESS;
258: l_msg_count NUMBER;
259: l_msg_data VARCHAR2(2000);
260:
261: BEGIN
267: x_syndicate_flag := l_syndicate_flag;
268: RETURN l_return_status;
269: EXCEPTION
270: WHEN OTHERS THEN
271: OKL_API.SET_MESSAGE( p_app_name => G_APP_NAME
272: ,p_msg_name => G_UNEXPECTED_ERROR
273: ,p_token1 => G_SQLCODE_TOKEN
274: ,p_token1_value => SQLCODE
275: ,p_token2 => G_SQLERRM_TOKEN
273: ,p_token1 => G_SQLCODE_TOKEN
274: ,p_token1_value => SQLCODE
275: ,p_token2 => G_SQLERRM_TOKEN
276: ,p_token2_value => SQLERRM);
277: l_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
278: RETURN(l_return_status);
279:
280: END GET_SYNDICATE_FLAG;
281:
294: WHERE r.dnz_chr_id = p_ctr_id
295: AND r.rule_information_category = 'LAFCTG';
296:
297: l_rule_information1 VARCHAR2(2000);
298: l_return_status VARCHAR2(1) := Okl_API.G_RET_STS_SUCCESS;
299: l_msg_count NUMBER;
300: l_msg_data VARCHAR2(2000);
301:
302: BEGIN
313:
314: RETURN l_return_status;
315: EXCEPTION
316: WHEN OTHERS THEN
317: OKL_API.SET_MESSAGE( p_app_name => G_APP_NAME
318: ,p_msg_name => G_UNEXPECTED_ERROR
319: ,p_token1 => G_SQLCODE_TOKEN
320: ,p_token1_value => SQLCODE
321: ,p_token2 => G_SQLERRM_TOKEN
319: ,p_token1 => G_SQLCODE_TOKEN
320: ,p_token1_value => SQLCODE
321: ,p_token2 => G_SQLERRM_TOKEN
322: ,p_token2_value => SQLERRM);
323: l_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
324: RETURN(l_return_status);
325:
326: END GET_FACTORING_FLAG;
327:
429: x_result VARCHAR2(1);
430: -- Bug 5036337.Commenting below as no longer needed.
431: -- l_formula_name CONSTANT VARCHAR2(30) := 'CONTRACT_ACTUAL_INCOME_ACCRUAL';
432: l_api_version CONSTANT NUMBER := 1.0;
433: l_init_msg_list VARCHAR2(20) DEFAULT Okl_Api.G_FALSE;
434: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
435: l_msg_count NUMBER;
436: l_msg_data VARCHAR2(2000);
437: -- l_formula_amount NUMBER := 0;
430: -- Bug 5036337.Commenting below as no longer needed.
431: -- l_formula_name CONSTANT VARCHAR2(30) := 'CONTRACT_ACTUAL_INCOME_ACCRUAL';
432: l_api_version CONSTANT NUMBER := 1.0;
433: l_init_msg_list VARCHAR2(20) DEFAULT Okl_Api.G_FALSE;
434: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
435: l_msg_count NUMBER;
436: l_msg_data VARCHAR2(2000);
437: -- l_formula_amount NUMBER := 0;
438: -- l_ctxt_val_tbl Okl_Account_Dist_Pub.ctxt_val_tbl_type;
464: l_multi_gaap_yn := 'N';
465: end if;
466:
467: IF l_contract_number IS NULL THEN
468: Okl_Api.set_message(p_app_name => g_app_name,
469: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
470: RAISE OKL_API.G_EXCEPTION_ERROR;
471: END IF;
472:
466:
467: IF l_contract_number IS NULL THEN
468: Okl_Api.set_message(p_app_name => g_app_name,
469: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
470: RAISE OKL_API.G_EXCEPTION_ERROR;
471: END IF;
472:
473: FOR j IN get_rev_rec_method_csr(p_khr_id)
474: LOOP
475: l_rev_rec_method := j.revenue_recognition_method;
476: END LOOP;
477:
478: IF l_rev_rec_method IS NULL THEN
479: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
480: RAISE OKL_API.G_EXCEPTION_ERROR;
481: END IF;
482:
483: IF l_rev_rec_method = 'STREAMS' THEN
476: END LOOP;
477:
478: IF l_rev_rec_method IS NULL THEN
479: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
480: RAISE OKL_API.G_EXCEPTION_ERROR;
481: END IF;
482:
483: IF l_rev_rec_method = 'STREAMS' THEN
484:
520: CLOSE khr_start_date_csr;
521:
522:
523: IF l_khr_start_date IS NULL THEN
524: OKL_API.set_message
525: (G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'START_DATE');
526: END IF;
527:
528: OKL_STREAM_GENERATOR_PVT.get_next_billing_date(
537: x_msg_count => l_msg_count,
538: x_msg_data => l_msg_data);
539:
540: -- store the highest degree of error
541: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
542: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
543: -- need to leave
544: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
545: ELSE
538: x_msg_data => l_msg_data);
539:
540: -- store the highest degree of error
541: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
542: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
543: -- need to leave
544: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
545: ELSE
546: RAISE OKL_API.G_EXCEPTION_ERROR;
540: -- store the highest degree of error
541: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
542: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
543: -- need to leave
544: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
545: ELSE
546: RAISE OKL_API.G_EXCEPTION_ERROR;
547: END IF;
548: END IF;
542: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
543: -- need to leave
544: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
545: ELSE
546: RAISE OKL_API.G_EXCEPTION_ERROR;
547: END IF;
548: END IF;
549:
550: -- If the next due date returned by okl_stream_generator_pvt.get_next_billing_date is null,
662: -- ,p_additional_parameters => l_ctxt_val_tbl
663: -- ,x_value => l_formula_amount);
664: --
665: -- -- store the highest degree of error
666: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
667: -- IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
668: -- -- need to leave
669: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
670: -- ELSE
663: -- ,x_value => l_formula_amount);
664: --
665: -- -- store the highest degree of error
666: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
667: -- IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
668: -- -- need to leave
669: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
670: -- ELSE
671: -- RAISE OKL_API.G_EXCEPTION_ERROR;
665: -- -- store the highest degree of error
666: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
667: -- IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
668: -- -- need to leave
669: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
670: -- ELSE
671: -- RAISE OKL_API.G_EXCEPTION_ERROR;
672: -- END IF;
673: -- END IF;
667: -- IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
668: -- -- need to leave
669: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
670: -- ELSE
671: -- RAISE OKL_API.G_EXCEPTION_ERROR;
672: -- END IF;
673: -- END IF;
674:
675: -- IF l_formula_amount = 0 THEN
679: -- END IF;
680: END IF;
681:
682: ELSE
683: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
684: RAISE OKL_API.G_EXCEPTION_ERROR;
685: END IF;
686:
687: RETURN x_result;
680: END IF;
681:
682: ELSE
683: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
684: RAISE OKL_API.G_EXCEPTION_ERROR;
685: END IF;
686:
687: RETURN x_result;
688:
686:
687: RETURN x_result;
688:
689: EXCEPTION
690: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
691: RETURN NULL;
692:
693: WHEN OKL_API.G_EXCEPTION_ERROR THEN
694: RETURN NULL;
689: EXCEPTION
690: WHEN OKL_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
691: RETURN NULL;
692:
693: WHEN OKL_API.G_EXCEPTION_ERROR THEN
694: RETURN NULL;
695:
696: WHEN OTHERS THEN
697: IF check_streams_accrual_csr%ISOPEN THEN
706: CLOSE khr_start_date_csr;
707: END IF;
708:
709: -- store SQL error message on message stack for caller
710: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
711: p_msg_name => g_unexpected_error,
712: p_token1 => g_sqlcode_token,
713: p_token1_value => SQLCODE,
714: p_token2 => g_sqlerrm_token,
775: ||RPAD(FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_CURR_UNDERLINE'),9)
776: ||LPAD(FND_MESSAGE.GET_STRING('OKL','OKL_GLP_RPT_AMT_LINE'),17) ||
777: LPAD('==============',15)); -- MGAAP 7263041
778:
779: x_return_status := OKL_API.G_RET_STS_SUCCESS;
780:
781: EXCEPTION
782: WHEN OTHERS THEN
783: -- store SQL error message on message stack for caller
780:
781: EXCEPTION
782: WHEN OTHERS THEN
783: -- store SQL error message on message stack for caller
784: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
785: p_msg_name => g_unexpected_error,
786: p_token1 => g_sqlcode_token,
787: p_token1_value => SQLCODE,
788: p_token2 => g_sqlerrm_token,
786: p_token1 => g_sqlcode_token,
787: p_token1_value => SQLCODE,
788: p_token2 => g_sqlerrm_token,
789: p_token2_value => SQLERRM);
790: x_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
791:
792: END REPORT_HEADER;
793:
794: -- Function to validate contract against accrual rule
832: l_rule accrual_rule_csr%ROWTYPE;
833:
834: BEGIN
835: -- initialize return status
836: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
837: -- open cursor for processing
838: OPEN accrual_rule_csr;
839: LOOP
840: FETCH accrual_rule_csr INTO l_rule;
839: LOOP
840: FETCH accrual_rule_csr INTO l_rule;
841: IF accrual_rule_csr%NOTFOUND THEN
842: IF accrual_rule_csr%ROWCOUNT = 0 THEN
843: Okl_Api.set_message(p_app_name => g_app_name,
844: p_msg_name => 'OKL_AGN_RULE_NOT_FOUND');
845: RAISE G_EXCEPTION_HALT_VALIDATION;
846: ELSE
847: EXIT;
865: -- close the cursor if it is open
866: IF accrual_rule_csr%ISOPEN THEN
867: CLOSE accrual_rule_csr;
868: END IF;
869: x_return_status := Okl_Api.G_RET_STS_ERROR;
870:
871: WHEN OTHERS THEN
872: -- store SQL error message on message stack for caller
873: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
869: x_return_status := Okl_Api.G_RET_STS_ERROR;
870:
871: WHEN OTHERS THEN
872: -- store SQL error message on message stack for caller
873: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
874: p_msg_name => g_unexpected_error,
875: p_token1 => g_sqlcode_token,
876: p_token1_value => SQLCODE,
877: p_token2 => g_sqlerrm_token,
876: p_token1_value => SQLCODE,
877: p_token2 => g_sqlerrm_token,
878: p_token2_value => SQLERRM);
879: -- notify caller of an UNEXPECTED error
880: x_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
881: END VALIDATE_ACCRUAL_RULE;
882:
883: -- Procedure to select streams that need to be accrued
884: PROCEDURE GET_ACCRUAL_STREAMS(x_return_status OUT NOCOPY VARCHAR2
987: -- CLOSE select_streams_csr;
988:
989: -- Bug 4884618. Refering to new profile option.
990: IF l_sty_select_basis IS NULL THEN
991: Okl_Api.set_message(p_app_name => g_app_name,
992: p_msg_name => 'OKL_AGN_KHR_VALD_ERROR');
993: RAISE OKL_API.G_EXCEPTION_ERROR;
994: END IF;
995:
989: -- Bug 4884618. Refering to new profile option.
990: IF l_sty_select_basis IS NULL THEN
991: Okl_Api.set_message(p_app_name => g_app_name,
992: p_msg_name => 'OKL_AGN_KHR_VALD_ERROR');
993: RAISE OKL_API.G_EXCEPTION_ERROR;
994: END IF;
995:
996: -- Bug 4884618.
997: IF l_sty_select_basis = 'KHR_START_DATE' THEN
1005: END IF;
1006:
1007: x_stream_tbl := l_stream_tbl;
1008:
1009: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
1010:
1011: EXCEPTION
1012: WHEN OTHERS THEN
1013: -- store SQL error message on message stack for caller
1010:
1011: EXCEPTION
1012: WHEN OTHERS THEN
1013: -- store SQL error message on message stack for caller
1014: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
1015: p_msg_name => g_unexpected_error,
1016: p_token1 => g_sqlcode_token,
1017: p_token1_value => SQLCODE,
1018: p_token2 => g_sqlerrm_token,
1018: p_token2 => g_sqlerrm_token,
1019: p_token2_value => SQLERRM);
1020:
1021: -- notify caller of an UNEXPECTED error
1022: x_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
1023: END GET_ACCRUAL_STREAMS;
1024:
1025: PROCEDURE GET_ACCOUNT_GEN_DETAILS(
1026: p_contract_id IN NUMBER,
1070: l_bill_to_site VARCHAR2(2000);
1071:
1072: BEGIN
1073:
1074: x_return_status := OKL_API.G_RET_STS_SUCCESS;
1075:
1076: -- Bug 3596651
1077: -- **************************************************
1078: -- Populate the account generator table with Contract Salesperson
1144: CLOSE chr_bill_to_site_csr;
1145: END IF;
1146:
1147:
1148: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
1149: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
1150: p_msg_name => g_unexpected_error,
1151: p_token1 => g_sqlcode_token,
1152: p_token1_value => SQLCODE,
1145: END IF;
1146:
1147:
1148: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
1149: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
1150: p_msg_name => g_unexpected_error,
1151: p_token1 => g_sqlcode_token,
1152: p_token1_value => SQLCODE,
1153: p_token2 => g_sqlerrm_token,
1201: WHERE organization_id = p_org_id;
1202:
1203: BEGIN
1204:
1205: x_return_status := OKL_API.G_RET_STS_SUCCESS;
1206: -- Find set of books id
1207: IF (p_representation_type = 'PRIMARY') THEN -- MGAAP 7263041
1208: l_sob_id := Okl_Accounting_Util.GET_SET_OF_BOOKS_ID(
1209: p_representation_type => 'PRIMARY');
1212: p_representation_type => 'SECONDARY');
1213: END IF;
1214: IF (l_sob_id IS NULL) THEN
1215: -- store SQL error message on message stack for caller
1216: Okl_Api.set_message(p_app_name => g_app_name,
1217: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
1218: RAISE Okl_Api.G_EXCEPTION_ERROR;
1219: END IF;
1220: x_sob_id := l_sob_id;
1214: IF (l_sob_id IS NULL) THEN
1215: -- store SQL error message on message stack for caller
1216: Okl_Api.set_message(p_app_name => g_app_name,
1217: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
1218: RAISE Okl_Api.G_EXCEPTION_ERROR;
1219: END IF;
1220: x_sob_id := l_sob_id;
1221:
1222: -- Find set of books name
1230: p_start_date => l_period_start_date,
1231: p_end_date => l_period_end_date,
1232: p_ledger_id => l_sob_id); --MGAAP 7263041
1233: IF l_period_end_date IS NULL THEN
1234: Okl_Api.set_message(p_app_name => g_app_name,
1235: p_msg_name => 'OKL_AGN_PERIOD_END_DATE');
1236: RAISE Okl_Api.G_EXCEPTION_ERROR;
1237: END IF;
1238: x_period_end_date := l_period_end_date;
1232: p_ledger_id => l_sob_id); --MGAAP 7263041
1233: IF l_period_end_date IS NULL THEN
1234: Okl_Api.set_message(p_app_name => g_app_name,
1235: p_msg_name => 'OKL_AGN_PERIOD_END_DATE');
1236: RAISE Okl_Api.G_EXCEPTION_ERROR;
1237: END IF;
1238: x_period_end_date := l_period_end_date;
1239: x_period_name := l_period_name;
1240: x_period_start_date := l_period_start_date;
1244: l_period_status := Okl_Accounting_Util.GET_OKL_PERIOD_STATUS(
1245: p_period_name => l_period_name,
1246: p_ledger_id => l_sob_id); --MGAAP 7263041
1247: IF l_period_status IS NULL THEN
1248: Okl_Api.set_message(p_app_name => g_app_name,
1249: p_msg_name => 'OKL_AGN_PERIOD_STATUS_ERROR',
1250: p_token1 => 'PERIOD_NAME',
1251: p_token1_value => l_period_name);
1252: RAISE Okl_Api.G_EXCEPTION_ERROR;
1248: Okl_Api.set_message(p_app_name => g_app_name,
1249: p_msg_name => 'OKL_AGN_PERIOD_STATUS_ERROR',
1250: p_token1 => 'PERIOD_NAME',
1251: p_token1_value => l_period_name);
1252: RAISE Okl_Api.G_EXCEPTION_ERROR;
1253: END IF;
1254:
1255: IF l_period_status NOT IN ('O','F') THEN
1256: Okl_Api.set_message(p_app_name => g_app_name,
1252: RAISE Okl_Api.G_EXCEPTION_ERROR;
1253: END IF;
1254:
1255: IF l_period_status NOT IN ('O','F') THEN
1256: Okl_Api.set_message(p_app_name => g_app_name,
1257: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
1258: RAISE Okl_Api.G_EXCEPTION_ERROR;
1259: END IF;
1260:
1254:
1255: IF l_period_status NOT IN ('O','F') THEN
1256: Okl_Api.set_message(p_app_name => g_app_name,
1257: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
1258: RAISE Okl_Api.G_EXCEPTION_ERROR;
1259: END IF;
1260:
1261: -- Find set of books id
1262: /* Call moved at the top
1266: l_sob_id := Okl_Accounting_Util.GET_SET_OF_BOOKS_ID('SECONDARY');
1267: END IF;
1268: IF (l_sob_id IS NULL) THEN
1269: -- store SQL error message on message stack for caller
1270: Okl_Api.set_message(p_app_name => g_app_name,
1271: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
1272: RAISE Okl_Api.G_EXCEPTION_ERROR;
1273: END IF;
1274: x_sob_id := l_sob_id;
1268: IF (l_sob_id IS NULL) THEN
1269: -- store SQL error message on message stack for caller
1270: Okl_Api.set_message(p_app_name => g_app_name,
1271: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
1272: RAISE Okl_Api.G_EXCEPTION_ERROR;
1273: END IF;
1274: x_sob_id := l_sob_id;
1275:
1276: -- Find set of books name
1280: -- Find org name for report
1281: l_org_id := mo_global.get_current_org_id();
1282: IF l_org_id IS NULL THEN
1283: -- store SQL error message on message stack for caller
1284: Okl_Api.set_message(p_app_name => g_app_name,
1285: p_msg_name => 'OKL_AGN_ORG_ID_ERROR');
1286: RAISE OKL_API.G_EXCEPTION_ERROR;
1287: END IF;
1288: x_org_id := l_org_id;
1282: IF l_org_id IS NULL THEN
1283: -- store SQL error message on message stack for caller
1284: Okl_Api.set_message(p_app_name => g_app_name,
1285: p_msg_name => 'OKL_AGN_ORG_ID_ERROR');
1286: RAISE OKL_API.G_EXCEPTION_ERROR;
1287: END IF;
1288: x_org_id := l_org_id;
1289:
1290: OPEN org_name_csr(l_org_id);
1292: CLOSE org_name_csr;
1293:
1294: IF l_org_name IS NULL THEN
1295: -- store SQL error message on message stack for caller
1296: okl_api.set_message(p_app_name => G_APP_NAME,
1297: p_msg_name => G_NO_MATCHING_RECORD,
1298: p_token1 => G_COL_NAME_TOKEN,
1299: p_token1_value => 'ORG_NAME');
1300: RAISE OKL_API.G_EXCEPTION_ERROR;
1296: okl_api.set_message(p_app_name => G_APP_NAME,
1297: p_msg_name => G_NO_MATCHING_RECORD,
1298: p_token1 => G_COL_NAME_TOKEN,
1299: p_token1_value => 'ORG_NAME');
1300: RAISE OKL_API.G_EXCEPTION_ERROR;
1301: END IF;
1302: x_org_name := l_org_name;
1303:
1304: -- Open accrual reversal days cursor to find out number of days to reverse in case of non-accrual processing
1307: CLOSE accrual_reversal_days_csr;
1308:
1309: IF l_accrual_reversal_days IS NULL THEN
1310: -- store SQL error message on message stack for caller
1311: Okl_Api.set_message(p_app_name => g_app_name,
1312: p_msg_name => 'OKL_AGN_REVERSAL_DAYS');
1313: RAISE Okl_Api.G_EXCEPTION_ERROR;
1314: END IF;
1315: x_accrual_reversal_days := l_accrual_reversal_days;
1309: IF l_accrual_reversal_days IS NULL THEN
1310: -- store SQL error message on message stack for caller
1311: Okl_Api.set_message(p_app_name => g_app_name,
1312: p_msg_name => 'OKL_AGN_REVERSAL_DAYS');
1313: RAISE Okl_Api.G_EXCEPTION_ERROR;
1314: END IF;
1315: x_accrual_reversal_days := l_accrual_reversal_days;
1316:
1317: -- Find currency code for the set of books id
1318: l_func_currency_code := Okl_Accounting_Util.GET_FUNC_CURR_CODE(
1319: p_ledger_id => l_sob_id); --MGAAP 7263041
1320: IF (l_func_currency_code IS NULL) THEN
1321: -- store SQL error message on message stack for caller
1322: Okl_Api.set_message(p_app_name => g_app_name,
1323: p_msg_name => 'OKL_AGN_CURR_CODE_ERROR');
1324: RAISE Okl_Api.G_EXCEPTION_ERROR;
1325: END IF;
1326: x_func_currency_code := l_func_currency_code;
1320: IF (l_func_currency_code IS NULL) THEN
1321: -- store SQL error message on message stack for caller
1322: Okl_Api.set_message(p_app_name => g_app_name,
1323: p_msg_name => 'OKL_AGN_CURR_CODE_ERROR');
1324: RAISE Okl_Api.G_EXCEPTION_ERROR;
1325: END IF;
1326: x_func_currency_code := l_func_currency_code;
1327:
1328: -- Open cursor to find the transaction type id for accruals
1330: FETCH trx_type_id_csr INTO l_try_id;
1331: CLOSE trx_type_id_csr;
1332: IF l_try_id IS NULL THEN
1333: -- store SQL error message on message stack for caller
1334: Okl_Api.set_message(p_app_name => g_app_name,
1335: p_msg_name => 'OKL_AGN_TRX_TYPE_ERROR',
1336: p_token1 => 'TRANSACTION_TYPE',
1337: p_token1_value => 'Accrual');
1338: RAISE Okl_Api.G_EXCEPTION_ERROR;
1334: Okl_Api.set_message(p_app_name => g_app_name,
1335: p_msg_name => 'OKL_AGN_TRX_TYPE_ERROR',
1336: p_token1 => 'TRANSACTION_TYPE',
1337: p_token1_value => 'Accrual');
1338: RAISE Okl_Api.G_EXCEPTION_ERROR;
1339: END IF;
1340: x_try_id := l_try_id;
1341:
1342: x_return_status := OKL_API.G_RET_STS_SUCCESS;
1338: RAISE Okl_Api.G_EXCEPTION_ERROR;
1339: END IF;
1340: x_try_id := l_try_id;
1341:
1342: x_return_status := OKL_API.G_RET_STS_SUCCESS;
1343:
1344: EXCEPTION
1345: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1346: IF trx_type_id_csr%ISOPEN THEN
1341:
1342: x_return_status := OKL_API.G_RET_STS_SUCCESS;
1343:
1344: EXCEPTION
1345: WHEN OKL_API.G_EXCEPTION_ERROR THEN
1346: IF trx_type_id_csr%ISOPEN THEN
1347: CLOSE trx_type_id_csr;
1348: END IF;
1349: IF accrual_reversal_days_csr%ISOPEN THEN
1352:
1353: IF org_name_csr%ISOPEN THEN
1354: CLOSE org_name_csr;
1355: END IF;
1356: x_return_status := OKL_API.G_RET_STS_ERROR;
1357:
1358: WHEN OTHERS THEN
1359: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
1360: IF trx_type_id_csr%ISOPEN THEN
1355: END IF;
1356: x_return_status := OKL_API.G_RET_STS_ERROR;
1357:
1358: WHEN OTHERS THEN
1359: x_return_status := OKL_API.G_RET_STS_UNEXP_ERROR;
1360: IF trx_type_id_csr%ISOPEN THEN
1361: CLOSE trx_type_id_csr;
1362: END IF;
1363: IF accrual_reversal_days_csr%ISOPEN THEN
1367: IF org_name_csr%ISOPEN THEN
1368: CLOSE org_name_csr;
1369: END IF;
1370: -- store SQL error message on message stack for caller
1371: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
1372: p_msg_name => g_unexpected_error,
1373: p_token1 => g_sqlcode_token,
1374: p_token1_value => SQLCODE,
1375: p_token2 => g_sqlerrm_token,
1548: FETCH primary_rep_trx_id_csr INTO l_primary_rep_trx_id;
1549: CLOSE primary_rep_trx_id_csr;
1550: /*IF l_primary_rep_trx_id IS NULL THEN
1551: -- store SQL error message on message stack for caller
1552: okl_api.set_message(p_app_name => G_APP_NAME,
1553: p_msg_name => G_NO_MATCHING_RECORD,
1554: p_token1 => G_COL_NAME_TOKEN,
1555: p_token1_value => 'PRIMARY_REP_TRX_ID');
1556: RAISE OKL_API.G_EXCEPTION_ERROR;
1552: okl_api.set_message(p_app_name => G_APP_NAME,
1553: p_msg_name => G_NO_MATCHING_RECORD,
1554: p_token1 => G_COL_NAME_TOKEN,
1555: p_token1_value => 'PRIMARY_REP_TRX_ID');
1556: RAISE OKL_API.G_EXCEPTION_ERROR;
1557: END IF;*/
1558: END IF;
1559:
1560: WRITE_TO_LOG('');
1558: END IF;
1559:
1560: WRITE_TO_LOG('');
1561: WRITE_TO_LOG('Inside the call to CREATE_ACCRUALS');
1562: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
1563: ,G_PKG_NAME
1564: ,p_init_msg_list
1565: ,l_api_version
1566: ,p_api_version
1566: ,p_api_version
1567: ,'_PVT'
1568: ,x_return_status);
1569:
1570: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1571: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1572: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1573: RAISE Okl_Api.G_EXCEPTION_ERROR;
1574: END IF;
1567: ,'_PVT'
1568: ,x_return_status);
1569:
1570: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1571: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1572: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1573: RAISE Okl_Api.G_EXCEPTION_ERROR;
1574: END IF;
1575:
1568: ,x_return_status);
1569:
1570: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1571: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1572: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1573: RAISE Okl_Api.G_EXCEPTION_ERROR;
1574: END IF;
1575:
1576: -- set tcn and tcl types.
1569:
1570: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1571: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
1572: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1573: RAISE Okl_Api.G_EXCEPTION_ERROR;
1574: END IF;
1575:
1576: -- set tcn and tcl types.
1577: IF p_accrual_rec.accrual_rule_yn = 'N' THEN
1585: l_legal_entity_id := OKL_LEGAL_ENTITY_UTIL.get_khr_le_id(p_accrual_rec.contract_id) ;
1586: IF l_legal_entity_id IS NOT NULL THEN
1587: l_tcnv_rec.legal_entity_id := l_legal_entity_id;
1588: ELSE
1589: Okl_Api.set_message(p_app_name => g_app_name,
1590: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
1591: p_token1 => 'CONTRACT_NUMBER',
1592: p_token1_value => p_accrual_rec.contract_number);
1593: RAISE OKL_API.G_EXCEPTION_ERROR;
1589: Okl_Api.set_message(p_app_name => g_app_name,
1590: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
1591: p_token1 => 'CONTRACT_NUMBER',
1592: p_token1_value => p_accrual_rec.contract_number);
1593: RAISE OKL_API.G_EXCEPTION_ERROR;
1594: END IF;
1595:
1596: -- Build the transaction record
1597: l_tcnv_rec.khr_id := p_accrual_rec.contract_id;
1734: ,x_tcnv_rec => x_tcnv_rec
1735: ,x_tclv_tbl => x_tclv_tbl );
1736: WRITE_TO_LOG('The status after creating Transaction Header and Transaction Lines is :'||x_return_status);
1737: -- store the highest degree of error
1738: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1739: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1740: -- need to leave
1741: Okl_Api.set_message(p_app_name => g_app_name,
1742: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1735: ,x_tclv_tbl => x_tclv_tbl );
1736: WRITE_TO_LOG('The status after creating Transaction Header and Transaction Lines is :'||x_return_status);
1737: -- store the highest degree of error
1738: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1739: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1740: -- need to leave
1741: Okl_Api.set_message(p_app_name => g_app_name,
1742: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1743: p_token1 => g_contract_number_token,
1737: -- store the highest degree of error
1738: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1739: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1740: -- need to leave
1741: Okl_Api.set_message(p_app_name => g_app_name,
1742: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1743: p_token1 => g_contract_number_token,
1744: p_token1_value => p_accrual_rec.contract_number);
1745: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1741: Okl_Api.set_message(p_app_name => g_app_name,
1742: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1743: p_token1 => g_contract_number_token,
1744: p_token1_value => p_accrual_rec.contract_number);
1745: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1746: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1747: Okl_Api.set_message(p_app_name => g_app_name,
1748: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1749: p_token1 => g_contract_number_token,
1742: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1743: p_token1 => g_contract_number_token,
1744: p_token1_value => p_accrual_rec.contract_number);
1745: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1746: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1747: Okl_Api.set_message(p_app_name => g_app_name,
1748: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1749: p_token1 => g_contract_number_token,
1750: p_token1_value => p_accrual_rec.contract_number);
1743: p_token1 => g_contract_number_token,
1744: p_token1_value => p_accrual_rec.contract_number);
1745: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1746: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1747: Okl_Api.set_message(p_app_name => g_app_name,
1748: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1749: p_token1 => g_contract_number_token,
1750: p_token1_value => p_accrual_rec.contract_number);
1751: RAISE OKL_API.G_EXCEPTION_ERROR;
1747: Okl_Api.set_message(p_app_name => g_app_name,
1748: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
1749: p_token1 => g_contract_number_token,
1750: p_token1_value => p_accrual_rec.contract_number);
1751: RAISE OKL_API.G_EXCEPTION_ERROR;
1752: END IF;
1753: END IF;
1754:
1755: --START: change by nikshah, for SLA Uptake Bug 5705866
1761: p_contract_id => p_accrual_rec.contract_id,
1762: x_return_status => x_return_status,
1763: x_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
1764: --check for error
1765: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1766: Okl_Api.set_message(p_app_name => g_app_name,
1767: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
1768: p_token1 => g_contract_number_token,
1769: p_token1_value => p_accrual_rec.contract_number);
1762: x_return_status => x_return_status,
1763: x_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
1764: --check for error
1765: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1766: Okl_Api.set_message(p_app_name => g_app_name,
1767: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
1768: p_token1 => g_contract_number_token,
1769: p_token1_value => p_accrual_rec.contract_number);
1770: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1766: Okl_Api.set_message(p_app_name => g_app_name,
1767: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
1768: p_token1 => g_contract_number_token,
1769: p_token1_value => p_accrual_rec.contract_number);
1770: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1771: END IF;
1772:
1773: l_count := 1;
1774:
1836: l_count := l_acc_gen_tbl(x).acc_gen_key_tbl.LAST + 1;
1837: l_acc_gen_tbl(x).acc_gen_key_tbl(l_count).source_table:= 'MTL_SYSTEM_ITEMS_VL';
1838: l_acc_gen_tbl(x).acc_gen_key_tbl(l_count).primary_key_column := l_inv_item_id;
1839: ELSE
1840: Okl_Api.set_message(p_app_name => g_app_name,
1841: p_msg_name => 'OKL_AGN_INV_ITEM_ID_ERROR',
1842: p_token1 => g_contract_number_token,
1843: p_token1_value => p_accrual_rec.contract_number,
1844: p_token2 => 'LINE_ID',
1842: p_token1 => g_contract_number_token,
1843: p_token1_value => p_accrual_rec.contract_number,
1844: p_token2 => 'LINE_ID',
1845: p_token2_value => x_tclv_tbl(x).kle_id);
1846: RAISE OKL_API.G_EXCEPTION_ERROR;
1847: END IF;
1848: ELSIF l_lty_code = 'LINK_SERV_ASSET' THEN
1849: --get kle_id of parent line
1850: OPEN get_parent_kle_id_csr(x_tclv_tbl(x).kle_id);
1852: CLOSE get_parent_kle_id_csr;
1853:
1854: IF l_parent_kle_id IS NULL THEN
1855: --raise exception
1856: Okl_Api.set_message(p_app_name => g_app_name,
1857: p_msg_name => 'OKL_AGN_PARENT_KLE_ID_ERROR',
1858: p_token1 => g_contract_number_token,
1859: p_token1_value => p_accrual_rec.contract_number,
1860: p_token2 => 'LINE_ID',
1858: p_token1 => g_contract_number_token,
1859: p_token1_value => p_accrual_rec.contract_number,
1860: p_token2 => 'LINE_ID',
1861: p_token2_value => x_tclv_tbl(x).kle_id);
1862: RAISE OKL_API.G_EXCEPTION_ERROR;
1863: END IF;
1864:
1865: OPEN l_mtl_sys_item_csr(p_accrual_rec.contract_id, l_parent_kle_id);
1866: FETCH l_mtl_sys_item_csr INTO l_inv_item_id;
1873: l_acc_gen_tbl(x).acc_gen_key_tbl(l_count).primary_key_column := l_inv_item_id;
1874: ELSE
1875: -- if it is linked service asset, then corresponding inv item id
1876: -- of associated asset MUST be available. if not, raise exception.
1877: Okl_Api.set_message(p_app_name => g_app_name,
1878: p_msg_name => 'OKL_AGN_INV_ITEM_ID_ERROR',
1879: p_token1 => g_contract_number_token,
1880: p_token1_value => p_accrual_rec.contract_number,
1881: p_token2 => 'LINE_ID',
1879: p_token1 => g_contract_number_token,
1880: p_token1_value => p_accrual_rec.contract_number,
1881: p_token2 => 'LINE_ID',
1882: p_token2_value => l_parent_kle_id);
1883: RAISE OKL_API.G_EXCEPTION_ERROR;
1884:
1885: END IF;
1886: END IF; --IF l_lty_code = 'FREE_FORM1' THEN
1887: END IF; -- IF lty_code IS NOT NULL
1905: l_acc_gen_tbl(x).acc_gen_key_tbl(l_count).source_table:= 'MTL_SYSTEM_ITEMS_VL';
1906: l_acc_gen_tbl(x).acc_gen_key_tbl(l_count).primary_key_column := l_inv_item_id;
1907: ELSE
1908: FND_FILE.PUT_LINE(FND_FILE.LOG, 'l_kle_id_status is REPEAT but l_inv_item_id is NULL. So no value to assign.');
1909: RAISE OKL_API.G_EXCEPTION_ERROR;
1910: END IF;
1911: END IF; --IF l_lty_code IN ('FREE_FORM1','LINK_SERV_ASSET') THEN
1912: END IF; -- IF kle_id_status = 'NEW'
1913: END IF; --IF x_tclv_tbl(x).kle_id is NOT NULL THEN
1956: ,x_inv_acct_code => l_inv_acct_code
1957: );
1958:
1959: -- store the highest degree of error
1960: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1961: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1962: -- need to leave
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1957: );
1958:
1959: -- store the highest degree of error
1960: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1961: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1962: -- need to leave
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1959: -- store the highest degree of error
1960: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
1961: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1962: -- need to leave
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1966: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1967: Okl_Api.set_message(p_app_name => g_app_name,
1961: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
1962: -- need to leave
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1966: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1967: Okl_Api.set_message(p_app_name => g_app_name,
1968: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1969: RAISE OKL_API.G_EXCEPTION_ERROR;
1962: -- need to leave
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1966: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1967: Okl_Api.set_message(p_app_name => g_app_name,
1968: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1969: RAISE OKL_API.G_EXCEPTION_ERROR;
1970: END IF;
1963: Okl_Api.set_message(p_app_name => g_app_name,
1964: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1966: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1967: Okl_Api.set_message(p_app_name => g_app_name,
1968: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1969: RAISE OKL_API.G_EXCEPTION_ERROR;
1970: END IF;
1971: END IF;
1965: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
1966: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
1967: Okl_Api.set_message(p_app_name => g_app_name,
1968: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
1969: RAISE OKL_API.G_EXCEPTION_ERROR;
1970: END IF;
1971: END IF;
1972:
1973:
2021: x_amount_tbl => l_amount_out_tbl,
2022: p_trx_header_id => l_tcn_id);
2023:
2024: -- store the highest degree of error
2025: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2026: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2027: -- need to leave
2028: Okl_Api.set_message(p_app_name => g_app_name,
2029: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2022: p_trx_header_id => l_tcn_id);
2023:
2024: -- store the highest degree of error
2025: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2026: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2027: -- need to leave
2028: Okl_Api.set_message(p_app_name => g_app_name,
2029: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2030: p_token1 => g_contract_number_token,
2024: -- store the highest degree of error
2025: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2026: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2027: -- need to leave
2028: Okl_Api.set_message(p_app_name => g_app_name,
2029: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2030: p_token1 => g_contract_number_token,
2031: p_token1_value => p_accrual_rec.contract_number);
2032: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2028: Okl_Api.set_message(p_app_name => g_app_name,
2029: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2030: p_token1 => g_contract_number_token,
2031: p_token1_value => p_accrual_rec.contract_number);
2032: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2033: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2034: -- record that there was an error
2035: Okl_Api.set_message(p_app_name => g_app_name,
2036: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2029: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2030: p_token1 => g_contract_number_token,
2031: p_token1_value => p_accrual_rec.contract_number);
2032: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2033: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2034: -- record that there was an error
2035: Okl_Api.set_message(p_app_name => g_app_name,
2036: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2037: p_token1 => g_contract_number_token,
2031: p_token1_value => p_accrual_rec.contract_number);
2032: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2033: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2034: -- record that there was an error
2035: Okl_Api.set_message(p_app_name => g_app_name,
2036: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2037: p_token1 => g_contract_number_token,
2038: p_token1_value => p_accrual_rec.contract_number);
2039: RAISE OKL_API.G_EXCEPTION_ERROR;
2035: Okl_Api.set_message(p_app_name => g_app_name,
2036: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
2037: p_token1 => g_contract_number_token,
2038: p_token1_value => p_accrual_rec.contract_number);
2039: RAISE OKL_API.G_EXCEPTION_ERROR;
2040: END IF;
2041: END IF;
2042:
2043: l_dist_info_tbl.DELETE;
2068: -- ,x_msg_data => x_msg_data
2069: -- ,p_selv_tbl => l_selv_tbl
2070: -- ,x_selv_tbl => x_selv_tbl );
2071: -- -- store the highest degree of error
2072: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2073: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2074: -- -- need to leave
2075: -- Okl_Api.set_message(p_app_name => g_app_name,
2076: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2069: -- ,p_selv_tbl => l_selv_tbl
2070: -- ,x_selv_tbl => x_selv_tbl );
2071: -- -- store the highest degree of error
2072: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2073: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2074: -- -- need to leave
2075: -- Okl_Api.set_message(p_app_name => g_app_name,
2076: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2077: -- p_token1 => g_contract_number_token,
2071: -- -- store the highest degree of error
2072: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2073: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2074: -- -- need to leave
2075: -- Okl_Api.set_message(p_app_name => g_app_name,
2076: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2077: -- p_token1 => g_contract_number_token,
2078: -- p_token1_value => p_accrual_rec.contract_number);
2079: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2075: -- Okl_Api.set_message(p_app_name => g_app_name,
2076: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2077: -- p_token1 => g_contract_number_token,
2078: -- p_token1_value => p_accrual_rec.contract_number);
2079: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2080: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2081: -- Okl_Api.set_message(p_app_name => g_app_name,
2082: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2083: -- p_token1 => g_contract_number_token,
2076: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2077: -- p_token1 => g_contract_number_token,
2078: -- p_token1_value => p_accrual_rec.contract_number);
2079: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2080: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2081: -- Okl_Api.set_message(p_app_name => g_app_name,
2082: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2083: -- p_token1 => g_contract_number_token,
2084: -- p_token1_value => p_accrual_rec.contract_number);
2077: -- p_token1 => g_contract_number_token,
2078: -- p_token1_value => p_accrual_rec.contract_number);
2079: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2080: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2081: -- Okl_Api.set_message(p_app_name => g_app_name,
2082: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2083: -- p_token1 => g_contract_number_token,
2084: -- p_token1_value => p_accrual_rec.contract_number);
2085: -- RAISE OKL_API.G_EXCEPTION_ERROR;
2081: -- Okl_Api.set_message(p_app_name => g_app_name,
2082: -- p_msg_name => 'OKL_AGN_STE_UPD_ERROR',
2083: -- p_token1 => g_contract_number_token,
2084: -- p_token1_value => p_accrual_rec.contract_number);
2085: -- RAISE OKL_API.G_EXCEPTION_ERROR;
2086: -- END IF;
2087: -- END IF;
2088:
2089: --
2105: -- ,p_init_msg_list => p_init_msg_list
2106: -- ,x_return_status => x_return_status
2107: -- ,x_msg_count => x_msg_count
2108: -- ,x_msg_data => x_msg_data
2109: -- ,p_restricted_update => 'OKL_API.G_TRUE'
2110: -- ,p_chrv_rec => l_chrv_rec
2111: -- ,p_khrv_rec => l_khrv_rec
2112: -- ,x_chrv_rec => x_chrv_rec
2113: -- ,x_khrv_rec => x_khrv_rec );
2111: -- ,p_khrv_rec => l_khrv_rec
2112: -- ,x_chrv_rec => x_chrv_rec
2113: -- ,x_khrv_rec => x_khrv_rec );
2114: -- -- store the highest degree of error
2115: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2116: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2117: -- -- need to leave
2118: -- Okl_Api.set_message(p_app_name => g_app_name,
2119: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2112: -- ,x_chrv_rec => x_chrv_rec
2113: -- ,x_khrv_rec => x_khrv_rec );
2114: -- -- store the highest degree of error
2115: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2116: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2117: -- -- need to leave
2118: -- Okl_Api.set_message(p_app_name => g_app_name,
2119: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2120: -- p_token1 => g_contract_number_token,
2114: -- -- store the highest degree of error
2115: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2116: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2117: -- -- need to leave
2118: -- Okl_Api.set_message(p_app_name => g_app_name,
2119: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2120: -- p_token1 => g_contract_number_token,
2121: -- p_token1_value => p_accrual_rec.contract_number);
2122: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2118: -- Okl_Api.set_message(p_app_name => g_app_name,
2119: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2120: -- p_token1 => g_contract_number_token,
2121: -- p_token1_value => p_accrual_rec.contract_number);
2122: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2123: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2124: -- -- record that there was an error
2125: -- Okl_Api.set_message(p_app_name => g_app_name,
2126: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2119: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2120: -- p_token1 => g_contract_number_token,
2121: -- p_token1_value => p_accrual_rec.contract_number);
2122: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2123: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2124: -- -- record that there was an error
2125: -- Okl_Api.set_message(p_app_name => g_app_name,
2126: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2127: -- p_token1 => g_contract_number_token,
2121: -- p_token1_value => p_accrual_rec.contract_number);
2122: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2123: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
2124: -- -- record that there was an error
2125: -- Okl_Api.set_message(p_app_name => g_app_name,
2126: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2127: -- p_token1 => g_contract_number_token,
2128: -- p_token1_value => p_accrual_rec.contract_number);
2129: -- RAISE OKL_API.G_EXCEPTION_ERROR;
2125: -- Okl_Api.set_message(p_app_name => g_app_name,
2126: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
2127: -- p_token1 => g_contract_number_token,
2128: -- p_token1_value => p_accrual_rec.contract_number);
2129: -- RAISE OKL_API.G_EXCEPTION_ERROR;
2130: -- END IF;
2131: -- END IF;
2132: -- END IF;
2133:
2130: -- END IF;
2131: -- END IF;
2132: -- END IF;
2133:
2134: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2135: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2136:
2137: EXCEPTION
2138: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2131: -- END IF;
2132: -- END IF;
2133:
2134: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2135: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2136:
2137: EXCEPTION
2138: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2139: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2134: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2135: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2136:
2137: EXCEPTION
2138: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2139: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2140: ,g_pkg_name
2141: ,'OKL_API.G_RET_STS_ERROR'
2142: ,x_msg_count
2135: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2136:
2137: EXCEPTION
2138: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2139: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2140: ,g_pkg_name
2141: ,'OKL_API.G_RET_STS_ERROR'
2142: ,x_msg_count
2143: ,x_msg_data
2137: EXCEPTION
2138: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2139: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2140: ,g_pkg_name
2141: ,'OKL_API.G_RET_STS_ERROR'
2142: ,x_msg_count
2143: ,x_msg_data
2144: ,'_PVT');
2145: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2141: ,'OKL_API.G_RET_STS_ERROR'
2142: ,x_msg_count
2143: ,x_msg_data
2144: ,'_PVT');
2145: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2146: -- store SQL error message on message stack for caller
2147: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2148: p_msg_name => g_unexpected_error,
2149: p_token1 => g_sqlcode_token,
2143: ,x_msg_data
2144: ,'_PVT');
2145: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2146: -- store SQL error message on message stack for caller
2147: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2148: p_msg_name => g_unexpected_error,
2149: p_token1 => g_sqlcode_token,
2150: p_token1_value => SQLCODE,
2151: p_token2 => g_sqlerrm_token,
2149: p_token1 => g_sqlcode_token,
2150: p_token1_value => SQLCODE,
2151: p_token2 => g_sqlerrm_token,
2152: p_token2_value => SQLERRM);
2153: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2154: ,g_pkg_name
2155: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
2156: ,x_msg_count
2157: ,x_msg_data
2151: p_token2 => g_sqlerrm_token,
2152: p_token2_value => SQLERRM);
2153: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2154: ,g_pkg_name
2155: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
2156: ,x_msg_count
2157: ,x_msg_data
2158: ,'_PVT');
2159: WHEN OTHERS THEN
2169: CLOSE get_parent_kle_id_csr;
2170: END IF;
2171:
2172: -- store SQL error message on message stack for caller
2173: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2174: p_msg_name => g_unexpected_error,
2175: p_token1 => g_sqlcode_token,
2176: p_token1_value => SQLCODE,
2177: p_token2 => g_sqlerrm_token,
2176: p_token1_value => SQLCODE,
2177: p_token2 => g_sqlerrm_token,
2178: p_token2_value => SQLERRM);
2179:
2180: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
2181: (l_api_name,
2182: G_PKG_NAME,
2183: 'OTHERS',
2184: x_msg_count,
2201:
2202: --local variables
2203: l_api_name VARCHAR2(20) := 'CREATE_ACCRUALS';
2204: l_api_version CONSTANT NUMBER := 1.0;
2205: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
2206: l_period_name VARCHAR2(2000);
2207: l_period_start_date DATE;
2208: l_period_end_date DATE;
2209: l_period_status VARCHAR2(1);
2270:
2271: BEGIN
2272:
2273: -- Set save point
2274: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
2275: ,G_PKG_NAME
2276: ,p_init_msg_list
2277: ,l_api_version
2278: ,p_api_version
2278: ,p_api_version
2279: ,'_PVT'
2280: ,x_return_status);
2281:
2282: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2283: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2284: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2285: RAISE Okl_Api.G_EXCEPTION_ERROR;
2286: END IF;
2279: ,'_PVT'
2280: ,x_return_status);
2281:
2282: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2283: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2284: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2285: RAISE Okl_Api.G_EXCEPTION_ERROR;
2286: END IF;
2287:
2280: ,x_return_status);
2281:
2282: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2283: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2284: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2285: RAISE Okl_Api.G_EXCEPTION_ERROR;
2286: END IF;
2287:
2288: -- validate input parameters
2281:
2282: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2283: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2284: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2285: RAISE Okl_Api.G_EXCEPTION_ERROR;
2286: END IF;
2287:
2288: -- validate input parameters
2289: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
2285: RAISE Okl_Api.G_EXCEPTION_ERROR;
2286: END IF;
2287:
2288: -- validate input parameters
2289: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
2290: Okl_Api.set_message(p_app_name => g_app_name,
2291: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2292: RAISE Okl_Api.G_EXCEPTION_ERROR;
2293: END IF;
2286: END IF;
2287:
2288: -- validate input parameters
2289: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
2290: Okl_Api.set_message(p_app_name => g_app_name,
2291: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2292: RAISE Okl_Api.G_EXCEPTION_ERROR;
2293: END IF;
2294:
2288: -- validate input parameters
2289: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
2290: Okl_Api.set_message(p_app_name => g_app_name,
2291: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2292: RAISE Okl_Api.G_EXCEPTION_ERROR;
2293: END IF;
2294:
2295: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
2296: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2291: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2292: RAISE Okl_Api.G_EXCEPTION_ERROR;
2293: END IF;
2294:
2295: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
2296: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2297: p_msg_name => 'OKL_AGN_DATE_ERROR');
2298: RAISE Okl_Api.G_EXCEPTION_ERROR;
2299: END IF;
2292: RAISE Okl_Api.G_EXCEPTION_ERROR;
2293: END IF;
2294:
2295: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
2296: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2297: p_msg_name => 'OKL_AGN_DATE_ERROR');
2298: RAISE Okl_Api.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2294:
2295: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
2296: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2297: p_msg_name => 'OKL_AGN_DATE_ERROR');
2298: RAISE Okl_Api.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2301: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
2302: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2297: p_msg_name => 'OKL_AGN_DATE_ERROR');
2298: RAISE Okl_Api.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2301: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
2302: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2303: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
2304: RAISE Okl_Api.G_EXCEPTION_ERROR;
2305: END IF;
2298: RAISE Okl_Api.G_EXCEPTION_ERROR;
2299: END IF;
2300:
2301: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
2302: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2303: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
2304: RAISE Okl_Api.G_EXCEPTION_ERROR;
2305: END IF;
2306:
2300:
2301: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
2302: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2303: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
2304: RAISE Okl_Api.G_EXCEPTION_ERROR;
2305: END IF;
2306:
2307: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
2308: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2303: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
2304: RAISE Okl_Api.G_EXCEPTION_ERROR;
2305: END IF;
2306:
2307: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
2308: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2309: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
2310: RAISE Okl_Api.G_EXCEPTION_ERROR;
2311: END IF;
2304: RAISE Okl_Api.G_EXCEPTION_ERROR;
2305: END IF;
2306:
2307: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
2308: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2309: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
2310: RAISE Okl_Api.G_EXCEPTION_ERROR;
2311: END IF;
2312:
2306:
2307: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
2308: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
2309: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
2310: RAISE Okl_Api.G_EXCEPTION_ERROR;
2311: END IF;
2312:
2313: -- get common info
2314: GET_COMMON_INFO (p_accrual_date => p_accrual_rec.accrual_date,
2324: x_accrual_reversal_days => l_accrual_reversal_days,
2325: x_func_currency_code => l_func_currency_code,
2326: x_return_status => l_return_status
2327: );
2328: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2329: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2330: -- need to leave
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2325: x_func_currency_code => l_func_currency_code,
2326: x_return_status => l_return_status
2327: );
2328: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2329: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2330: -- need to leave
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2327: );
2328: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2329: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2330: -- need to leave
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2334: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2335: Okl_Api.set_message(p_app_name => g_app_name,
2329: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2330: -- need to leave
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2334: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2335: Okl_Api.set_message(p_app_name => g_app_name,
2336: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2337: RAISE OKL_API.G_EXCEPTION_ERROR;
2330: -- need to leave
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2334: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2335: Okl_Api.set_message(p_app_name => g_app_name,
2336: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2337: RAISE OKL_API.G_EXCEPTION_ERROR;
2338: END IF;
2331: Okl_Api.set_message(p_app_name => g_app_name,
2332: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2334: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2335: Okl_Api.set_message(p_app_name => g_app_name,
2336: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2337: RAISE OKL_API.G_EXCEPTION_ERROR;
2338: END IF;
2339: END IF;
2333: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2334: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2335: Okl_Api.set_message(p_app_name => g_app_name,
2336: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
2337: RAISE OKL_API.G_EXCEPTION_ERROR;
2338: END IF;
2339: END IF;
2340:
2341: IF l_period_status NOT IN ('O','F') THEN
2338: END IF;
2339: END IF;
2340:
2341: IF l_period_status NOT IN ('O','F') THEN
2342: Okl_Api.set_message(p_app_name => g_app_name,
2343: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
2344: RAISE Okl_Api.G_EXCEPTION_ERROR;
2345: END IF;
2346:
2340:
2341: IF l_period_status NOT IN ('O','F') THEN
2342: Okl_Api.set_message(p_app_name => g_app_name,
2343: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
2344: RAISE Okl_Api.G_EXCEPTION_ERROR;
2345: END IF;
2346:
2347: -- get the contract number
2348: OPEN contract_details_csr(p_accrual_rec.contract_id);
2361: l_reporting_pdt_id; -- MGAAP 7263014
2362: CLOSE contract_details_csr;
2363:
2364: IF l_contract_number IS NULL THEN
2365: Okl_Api.set_message(p_app_name => g_app_name,
2366: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
2367: RAISE OKL_API.G_EXCEPTION_ERROR;
2368: END IF;
2369:
2363:
2364: IF l_contract_number IS NULL THEN
2365: Okl_Api.set_message(p_app_name => g_app_name,
2366: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
2367: RAISE OKL_API.G_EXCEPTION_ERROR;
2368: END IF;
2369:
2370: IF l_product_id IS NULL THEN
2371: -- store SQL error message on message stack for caller
2368: END IF;
2369:
2370: IF l_product_id IS NULL THEN
2371: -- store SQL error message on message stack for caller
2372: okl_api.set_message(p_app_name => G_APP_NAME,
2373: p_msg_name => G_NO_MATCHING_RECORD,
2374: p_token1 => G_COL_NAME_TOKEN,
2375: p_token1_value => 'PDT_ID');
2376: RAISE OKL_API.G_EXCEPTION_ERROR;
2372: okl_api.set_message(p_app_name => G_APP_NAME,
2373: p_msg_name => G_NO_MATCHING_RECORD,
2374: p_token1 => G_COL_NAME_TOKEN,
2375: p_token1_value => 'PDT_ID');
2376: RAISE OKL_API.G_EXCEPTION_ERROR;
2377: END IF;
2378:
2379: IF p_representation_type = 'SECONDARY' THEN -- MGAAP 7263041
2380: IF l_reporting_pdt_id IS NULL THEN
2378:
2379: IF p_representation_type = 'SECONDARY' THEN -- MGAAP 7263041
2380: IF l_reporting_pdt_id IS NULL THEN
2381: -- store SQL error message on message stack for caller
2382: okl_api.set_message(p_app_name => G_APP_NAME,
2383: p_msg_name => G_NO_MATCHING_RECORD,
2384: p_token1 => G_COL_NAME_TOKEN,
2385: p_token1_value => 'REPORTING_PDT_ID');
2386: RAISE OKL_API.G_EXCEPTION_ERROR;
2382: okl_api.set_message(p_app_name => G_APP_NAME,
2383: p_msg_name => G_NO_MATCHING_RECORD,
2384: p_token1 => G_COL_NAME_TOKEN,
2385: p_token1_value => 'REPORTING_PDT_ID');
2386: RAISE OKL_API.G_EXCEPTION_ERROR;
2387: END IF;
2388:
2389: END IF;
2390:
2389: END IF;
2390:
2391: IF l_khr_currency_code IS NULL THEN
2392: -- store SQL error message on message stack for caller
2393: okl_api.set_message(p_app_name => G_APP_NAME,
2394: p_msg_name => G_NO_MATCHING_RECORD,
2395: p_token1 => G_COL_NAME_TOKEN,
2396: p_token1_value => 'CURRENCY_CODE');
2397: RAISE OKL_API.G_EXCEPTION_ERROR;
2393: okl_api.set_message(p_app_name => G_APP_NAME,
2394: p_msg_name => G_NO_MATCHING_RECORD,
2395: p_token1 => G_COL_NAME_TOKEN,
2396: p_token1_value => 'CURRENCY_CODE');
2397: RAISE OKL_API.G_EXCEPTION_ERROR;
2398: END IF;
2399:
2400: IF l_start_date IS NULL THEN
2401: -- store SQL error message on message stack for caller
2398: END IF;
2399:
2400: IF l_start_date IS NULL THEN
2401: -- store SQL error message on message stack for caller
2402: okl_api.set_message(p_app_name => G_APP_NAME,
2403: p_msg_name => G_NO_MATCHING_RECORD,
2404: p_token1 => G_COL_NAME_TOKEN,
2405: p_token1_value => 'START_DATE');
2406: RAISE OKL_API.G_EXCEPTION_ERROR;
2402: okl_api.set_message(p_app_name => G_APP_NAME,
2403: p_msg_name => G_NO_MATCHING_RECORD,
2404: p_token1 => G_COL_NAME_TOKEN,
2405: p_token1_value => 'START_DATE');
2406: RAISE OKL_API.G_EXCEPTION_ERROR;
2407: END IF;
2408:
2409: IF l_sts_code IS NULL THEN
2410: -- store SQL error message on message stack for caller
2407: END IF;
2408:
2409: IF l_sts_code IS NULL THEN
2410: -- store SQL error message on message stack for caller
2411: okl_api.set_message(p_app_name => G_APP_NAME,
2412: p_msg_name => G_NO_MATCHING_RECORD,
2413: p_token1 => G_COL_NAME_TOKEN,
2414: p_token1_value => 'STS_CODE');
2415: RAISE OKL_API.G_EXCEPTION_ERROR;
2411: okl_api.set_message(p_app_name => G_APP_NAME,
2412: p_msg_name => G_NO_MATCHING_RECORD,
2413: p_token1 => G_COL_NAME_TOKEN,
2414: p_token1_value => 'STS_CODE');
2415: RAISE OKL_API.G_EXCEPTION_ERROR;
2416: END IF;
2417:
2418: IF l_sts_code NOT IN ('BOOKED', 'EVERGREEN', 'ACTIVE') THEN
2419: -- store SQL error message on message stack for caller
2416: END IF;
2417:
2418: IF l_sts_code NOT IN ('BOOKED', 'EVERGREEN', 'ACTIVE') THEN
2419: -- store SQL error message on message stack for caller
2420: okl_api.set_message(p_app_name => G_APP_NAME,
2421: p_msg_name => 'OKL_AGN_STS_CODE_ERROR',
2422: p_token1 => g_contract_number_token,
2423: p_token1_value => l_contract_number);
2424: RAISE OKL_API.G_EXCEPTION_ERROR;
2420: okl_api.set_message(p_app_name => G_APP_NAME,
2421: p_msg_name => 'OKL_AGN_STS_CODE_ERROR',
2422: p_token1 => g_contract_number_token,
2423: p_token1_value => l_contract_number);
2424: RAISE OKL_API.G_EXCEPTION_ERROR;
2425: END IF;
2426:
2427: IF l_generate_accrual_yn IS NULL THEN
2428: -- store SQL error message on message stack for caller
2425: END IF;
2426:
2427: IF l_generate_accrual_yn IS NULL THEN
2428: -- store SQL error message on message stack for caller
2429: okl_api.set_message(p_app_name => G_APP_NAME,
2430: p_msg_name => G_NO_MATCHING_RECORD,
2431: p_token1 => G_COL_NAME_TOKEN,
2432: p_token1_value => 'GENERATE_ACCRUAL_YN');
2433: RAISE OKL_API.G_EXCEPTION_ERROR;
2429: okl_api.set_message(p_app_name => G_APP_NAME,
2430: p_msg_name => G_NO_MATCHING_RECORD,
2431: p_token1 => G_COL_NAME_TOKEN,
2432: p_token1_value => 'GENERATE_ACCRUAL_YN');
2433: RAISE OKL_API.G_EXCEPTION_ERROR;
2434: END IF;
2435:
2436: IF l_generate_accrual_override_yn IS NULL THEN
2437: -- store SQL error message on message stack for caller
2434: END IF;
2435:
2436: IF l_generate_accrual_override_yn IS NULL THEN
2437: -- store SQL error message on message stack for caller
2438: okl_api.set_message(p_app_name => G_APP_NAME,
2439: p_msg_name => G_NO_MATCHING_RECORD,
2440: p_token1 => G_COL_NAME_TOKEN,
2441: p_token1_value => 'GENERATE_ACCRUAL_OVERRIDE_YN');
2442: RAISE OKL_API.G_EXCEPTION_ERROR;
2438: okl_api.set_message(p_app_name => G_APP_NAME,
2439: p_msg_name => G_NO_MATCHING_RECORD,
2440: p_token1 => G_COL_NAME_TOKEN,
2441: p_token1_value => 'GENERATE_ACCRUAL_OVERRIDE_YN');
2442: RAISE OKL_API.G_EXCEPTION_ERROR;
2443: END IF;
2444: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
2445: IF l_deal_type IS NULL AND l_sts_code in ('BOOKED', 'EVERGREEN') THEN
2446: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 end
2444: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
2445: IF l_deal_type IS NULL AND l_sts_code in ('BOOKED', 'EVERGREEN') THEN
2446: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 end
2447: -- store SQL error message on message stack for caller
2448: okl_api.set_message(p_app_name => G_APP_NAME,
2449: p_msg_name => G_NO_MATCHING_RECORD,
2450: p_token1 => G_COL_NAME_TOKEN,
2451: p_token1_value => 'DEAL_TYPE');
2452: RAISE OKL_API.G_EXCEPTION_ERROR;
2448: okl_api.set_message(p_app_name => G_APP_NAME,
2449: p_msg_name => G_NO_MATCHING_RECORD,
2450: p_token1 => G_COL_NAME_TOKEN,
2451: p_token1_value => 'DEAL_TYPE');
2452: RAISE OKL_API.G_EXCEPTION_ERROR;
2453: END IF;
2454:
2455: -- Check contract currency against functional currency
2456: IF l_func_currency_code <> l_khr_currency_code THEN
2455: -- Check contract currency against functional currency
2456: IF l_func_currency_code <> l_khr_currency_code THEN
2457: --validate data
2458: IF l_currency_conversion_type IS NULL THEN
2459: Okl_Api.set_message(p_app_name => g_app_name,
2460: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
2461: p_token1 => g_contract_number_token,
2462: p_token1_value => l_contract_number);
2463: RAISE Okl_Api.G_EXCEPTION_ERROR;
2459: Okl_Api.set_message(p_app_name => g_app_name,
2460: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
2461: p_token1 => g_contract_number_token,
2462: p_token1_value => l_contract_number);
2463: RAISE Okl_Api.G_EXCEPTION_ERROR;
2464: END IF;
2465: IF l_currency_conversion_date IS NULL THEN
2466: Okl_Api.set_message(p_app_name => g_app_name,
2467: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
2462: p_token1_value => l_contract_number);
2463: RAISE Okl_Api.G_EXCEPTION_ERROR;
2464: END IF;
2465: IF l_currency_conversion_date IS NULL THEN
2466: Okl_Api.set_message(p_app_name => g_app_name,
2467: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
2468: p_token1 => g_contract_number_token,
2469: p_token1_value => l_contract_number);
2470: RAISE Okl_Api.G_EXCEPTION_ERROR;
2466: Okl_Api.set_message(p_app_name => g_app_name,
2467: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
2468: p_token1 => g_contract_number_token,
2469: p_token1_value => l_contract_number);
2470: RAISE Okl_Api.G_EXCEPTION_ERROR;
2471: END IF;
2472: IF l_currency_conversion_type = 'User' THEN
2473: IF l_currency_conversion_rate IS NULL THEN
2474: Okl_Api.set_message(p_app_name => g_app_name,
2470: RAISE Okl_Api.G_EXCEPTION_ERROR;
2471: END IF;
2472: IF l_currency_conversion_type = 'User' THEN
2473: IF l_currency_conversion_rate IS NULL THEN
2474: Okl_Api.set_message(p_app_name => g_app_name,
2475: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
2476: p_token1 => g_contract_number_token,
2477: p_token1_value => l_contract_number);
2478: RAISE Okl_Api.G_EXCEPTION_ERROR;
2474: Okl_Api.set_message(p_app_name => g_app_name,
2475: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
2476: p_token1 => g_contract_number_token,
2477: p_token1_value => l_contract_number);
2478: RAISE Okl_Api.G_EXCEPTION_ERROR;
2479: END IF;
2480: ELSE
2481: l_currency_conversion_rate := OKL_ACCOUNTING_UTIL.get_curr_con_rate
2482: (p_from_curr_code => l_khr_currency_code,
2485: p_con_type => l_currency_conversion_type);
2486:
2487:
2488: IF l_currency_conversion_rate IS NULL THEN
2489: Okl_Api.set_message(p_app_name => g_app_name,
2490: p_msg_name => 'OKL_AGN_CURR_RATE_ERROR',
2491: p_token1 => 'CONVERSION_TYPE',
2492: p_token1_value => l_currency_conversion_type,
2493: p_token2 => 'FROM_CURRENCY',
2494: p_token2_value => l_khr_currency_code,
2495: p_token3 => 'TO_CURRENCY',
2496: p_token3_value => l_func_currency_code
2497: );
2498: RAISE Okl_Api.G_EXCEPTION_ERROR;
2499: END IF;
2500: l_currency_conversion_date := p_accrual_rec.accrual_date; --Bug #5410825
2501: END IF;
2502: END IF;
2512: l_accrual_rule_value := x.accrual_yn;
2513: END LOOP;
2514:
2515: IF l_accrual_rule_value IS NULL THEN
2516: Okl_Api.set_message(p_app_name => g_app_name,
2517: p_msg_name => 'OKL_AGN_ACCRUAL_VAL_ERROR',
2518: p_token1 => 'STREAM_TYPE',
2519: p_token1_value => p_stream_tbl(i).stream_type_name);
2520: RAISE OKL_API.G_EXCEPTION_ERROR;
2516: Okl_Api.set_message(p_app_name => g_app_name,
2517: p_msg_name => 'OKL_AGN_ACCRUAL_VAL_ERROR',
2518: p_token1 => 'STREAM_TYPE',
2519: p_token1_value => p_stream_tbl(i).stream_type_name);
2520: RAISE OKL_API.G_EXCEPTION_ERROR;
2521: END IF;
2522:
2523: IF l_accrual_rule_value = 'ACRL_WITH_RULE' THEN
2524: l_accrual_strm_tbl(l_counter1).stream_type_id := p_stream_tbl(i).stream_type_id;
2532: l_non_accrual_strm_tbl(l_counter2).kle_id := p_stream_tbl(i).kle_id;
2533: l_total2 := l_total2 + p_stream_tbl(i).stream_amount;
2534: l_counter2 := l_counter2 + 1;
2535: ELSE
2536: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'ACCRUAL_YN');
2537: RAISE OKL_API.G_EXCEPTION_ERROR;
2538: END IF;
2539:
2540: END LOOP;
2533: l_total2 := l_total2 + p_stream_tbl(i).stream_amount;
2534: l_counter2 := l_counter2 + 1;
2535: ELSE
2536: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'ACCRUAL_YN');
2537: RAISE OKL_API.G_EXCEPTION_ERROR;
2538: END IF;
2539:
2540: END LOOP;
2541:
2545: VALIDATE_ACCRUAL_RULE(x_return_status => l_return_status
2546: ,x_result => l_rule_result
2547: ,p_ctr_id => p_accrual_rec.contract_id);
2548: -- store the highest degree of error
2549: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2550: Okl_Api.set_message(p_app_name => g_app_name,
2551: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
2552: p_token1 => g_contract_number_token,
2553: p_token1_value => l_contract_number);
2546: ,x_result => l_rule_result
2547: ,p_ctr_id => p_accrual_rec.contract_id);
2548: -- store the highest degree of error
2549: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2550: Okl_Api.set_message(p_app_name => g_app_name,
2551: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
2552: p_token1 => g_contract_number_token,
2553: p_token1_value => l_contract_number);
2554: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2550: Okl_Api.set_message(p_app_name => g_app_name,
2551: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
2552: p_token1 => g_contract_number_token,
2553: p_token1_value => l_contract_number);
2554: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2555: END IF;
2556:
2557: -- Build the accrual record
2558: l_accrual_rec.contract_id := p_accrual_rec.contract_id;
2594: l_accrual_rec.memo_yn := 'Y';
2595: l_accrual_rec.accrual_activity := 'NON-ACCRUAL';
2596: ELSE
2597: -- invalid value
2598: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'l_rule_result');
2599: RAISE OKL_API.G_EXCEPTION_ERROR;
2600: END IF;
2601: ELSIF l_generate_accrual_override_yn = 'Y' THEN
2602: -- create memo entires
2595: l_accrual_rec.accrual_activity := 'NON-ACCRUAL';
2596: ELSE
2597: -- invalid value
2598: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'l_rule_result');
2599: RAISE OKL_API.G_EXCEPTION_ERROR;
2600: END IF;
2601: ELSIF l_generate_accrual_override_yn = 'Y' THEN
2602: -- create memo entires
2603: l_accrual_rec.rule_result := l_rule_result;
2605: l_accrual_rec.memo_yn := 'Y';
2606: l_accrual_rec.accrual_activity := 'NON-ACCRUAL';
2607: ELSE
2608: -- invalid value
2609: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'l_generate_accrual_override_yn');
2610: RAISE OKL_API.G_EXCEPTION_ERROR;
2611: END IF;
2612:
2613: -- Call CREATE_ACCRUAL procedure to create accrual transactions and entries
2606: l_accrual_rec.accrual_activity := 'NON-ACCRUAL';
2607: ELSE
2608: -- invalid value
2609: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'l_generate_accrual_override_yn');
2610: RAISE OKL_API.G_EXCEPTION_ERROR;
2611: END IF;
2612:
2613: -- Call CREATE_ACCRUAL procedure to create accrual transactions and entries
2614: CREATE_ACCRUALS (
2622: p_accrual_rec => l_accrual_rec,
2623: p_stream_tbl => l_accrual_strm_tbl,
2624: p_representation_type => p_representation_type);
2625:
2626: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2627: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2628: -- need to leave
2629: Okl_Api.set_message(p_app_name => g_app_name,
2630: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2623: p_stream_tbl => l_accrual_strm_tbl,
2624: p_representation_type => p_representation_type);
2625:
2626: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2627: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2628: -- need to leave
2629: Okl_Api.set_message(p_app_name => g_app_name,
2630: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2631: p_token1 => g_contract_number_token,
2625:
2626: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2627: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2628: -- need to leave
2629: Okl_Api.set_message(p_app_name => g_app_name,
2630: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2631: p_token1 => g_contract_number_token,
2632: p_token1_value => l_contract_number);
2633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2629: Okl_Api.set_message(p_app_name => g_app_name,
2630: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2631: p_token1 => g_contract_number_token,
2632: p_token1_value => l_contract_number);
2633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2634: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2635: Okl_Api.set_message(p_app_name => g_app_name,
2636: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2637: p_token1 => g_contract_number_token,
2630: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2631: p_token1 => g_contract_number_token,
2632: p_token1_value => l_contract_number);
2633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2634: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2635: Okl_Api.set_message(p_app_name => g_app_name,
2636: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2637: p_token1 => g_contract_number_token,
2638: p_token1_value => l_contract_number);
2631: p_token1 => g_contract_number_token,
2632: p_token1_value => l_contract_number);
2633: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2634: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2635: Okl_Api.set_message(p_app_name => g_app_name,
2636: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2637: p_token1 => g_contract_number_token,
2638: p_token1_value => l_contract_number);
2639: RAISE OKL_API.G_EXCEPTION_ERROR;
2635: Okl_Api.set_message(p_app_name => g_app_name,
2636: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2637: p_token1 => g_contract_number_token,
2638: p_token1_value => l_contract_number);
2639: RAISE OKL_API.G_EXCEPTION_ERROR;
2640: END IF;
2641: END IF;
2642: END IF;
2643:
2686: p_accrual_rec => l_accrual_rec,
2687: p_stream_tbl => l_non_accrual_strm_tbl,
2688: p_representation_type => p_representation_type);
2689:
2690: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2691: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2692: -- need to leave
2693: Okl_Api.set_message(p_app_name => g_app_name,
2694: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2687: p_stream_tbl => l_non_accrual_strm_tbl,
2688: p_representation_type => p_representation_type);
2689:
2690: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2691: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2692: -- need to leave
2693: Okl_Api.set_message(p_app_name => g_app_name,
2694: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2695: p_token1 => g_contract_number_token,
2689:
2690: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
2691: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2692: -- need to leave
2693: Okl_Api.set_message(p_app_name => g_app_name,
2694: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2695: p_token1 => g_contract_number_token,
2696: p_token1_value => l_contract_number);
2697: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2693: Okl_Api.set_message(p_app_name => g_app_name,
2694: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2695: p_token1 => g_contract_number_token,
2696: p_token1_value => l_contract_number);
2697: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2698: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2699: Okl_Api.set_message(p_app_name => g_app_name,
2700: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2701: p_token1 => g_contract_number_token,
2694: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2695: p_token1 => g_contract_number_token,
2696: p_token1_value => l_contract_number);
2697: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2698: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2699: Okl_Api.set_message(p_app_name => g_app_name,
2700: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2701: p_token1 => g_contract_number_token,
2702: p_token1_value => l_contract_number);
2695: p_token1 => g_contract_number_token,
2696: p_token1_value => l_contract_number);
2697: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
2698: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2699: Okl_Api.set_message(p_app_name => g_app_name,
2700: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2701: p_token1 => g_contract_number_token,
2702: p_token1_value => l_contract_number);
2703: RAISE OKL_API.G_EXCEPTION_ERROR;
2699: Okl_Api.set_message(p_app_name => g_app_name,
2700: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
2701: p_token1 => g_contract_number_token,
2702: p_token1_value => l_contract_number);
2703: RAISE OKL_API.G_EXCEPTION_ERROR;
2704: END IF;
2705: END IF;
2706: END IF;
2707: ELSE
2704: END IF;
2705: END IF;
2706: END IF;
2707: ELSE
2708: Okl_Api.set_message(p_app_name => g_app_name,
2709: p_msg_name => 'OKL_AGN_STRM_TBL_ERROR');
2710: RAISE OKL_API.G_EXCEPTION_ERROR;
2711: END IF; -- IF l_stream_tbl.COUNT >0
2712:
2706: END IF;
2707: ELSE
2708: Okl_Api.set_message(p_app_name => g_app_name,
2709: p_msg_name => 'OKL_AGN_STRM_TBL_ERROR');
2710: RAISE OKL_API.G_EXCEPTION_ERROR;
2711: END IF; -- IF l_stream_tbl.COUNT >0
2712:
2713: x_trx_number := l_tcnv_rec.trx_number;
2714:
2711: END IF; -- IF l_stream_tbl.COUNT >0
2712:
2713: x_trx_number := l_tcnv_rec.trx_number;
2714:
2715: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2716: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2717:
2718: EXCEPTION
2719: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2712:
2713: x_trx_number := l_tcnv_rec.trx_number;
2714:
2715: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2716: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2717:
2718: EXCEPTION
2719: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2720: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2715: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
2716: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2717:
2718: EXCEPTION
2719: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2720: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2721: ,g_pkg_name
2722: ,'OKL_API.G_RET_STS_ERROR'
2723: ,x_msg_count
2716: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
2717:
2718: EXCEPTION
2719: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2720: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2721: ,g_pkg_name
2722: ,'OKL_API.G_RET_STS_ERROR'
2723: ,x_msg_count
2724: ,x_msg_data
2718: EXCEPTION
2719: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
2720: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2721: ,g_pkg_name
2722: ,'OKL_API.G_RET_STS_ERROR'
2723: ,x_msg_count
2724: ,x_msg_data
2725: ,'_PVT');
2726:
2723: ,x_msg_count
2724: ,x_msg_data
2725: ,'_PVT');
2726:
2727: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2728: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2729: ,g_pkg_name
2730: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
2731: ,x_msg_count
2724: ,x_msg_data
2725: ,'_PVT');
2726:
2727: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2728: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2729: ,g_pkg_name
2730: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
2731: ,x_msg_count
2732: ,x_msg_data
2726:
2727: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
2728: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
2729: ,g_pkg_name
2730: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
2731: ,x_msg_count
2732: ,x_msg_data
2733: ,'_PVT');
2734:
2737: IF contract_details_csr%ISOPEN THEN
2738: CLOSE contract_details_csr;
2739: END IF;
2740:
2741: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
2742: (l_api_name,
2743: G_PKG_NAME,
2744: 'OTHERS',
2745: x_msg_count,
2767:
2768: --local variables
2769: l_api_name VARCHAR2(20) := 'ACCELERATE_ACCRUALS';
2770: l_api_version CONSTANT NUMBER := 1.0;
2771: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
2772: l_try_name CONSTANT VARCHAR2(7) := 'Accrual';
2773: l_period_name VARCHAR2(2000);
2774: l_period_start_date DATE;
2775: l_period_end_date DATE;
2831: -- AND to_currency = p_to_currency
2832: -- AND status_code = 'C';
2833:
2834: BEGIN
2835: x_return_status := OKL_API.G_RET_STS_SUCCESS;
2836:
2837: -- Set save point
2838: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
2839: ,G_PKG_NAME
2834: BEGIN
2835: x_return_status := OKL_API.G_RET_STS_SUCCESS;
2836:
2837: -- Set save point
2838: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
2839: ,G_PKG_NAME
2840: ,p_init_msg_list
2841: ,l_api_version
2842: ,p_api_version
2842: ,p_api_version
2843: ,'_PVT'
2844: ,x_return_status);
2845:
2846: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2847: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2848: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2849: RAISE Okl_Api.G_EXCEPTION_ERROR;
2850: END IF;
2843: ,'_PVT'
2844: ,x_return_status);
2845:
2846: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2847: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2848: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2849: RAISE Okl_Api.G_EXCEPTION_ERROR;
2850: END IF;
2851:
2844: ,x_return_status);
2845:
2846: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2847: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2848: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2849: RAISE Okl_Api.G_EXCEPTION_ERROR;
2850: END IF;
2851:
2852: -- validate input parameters
2845:
2846: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
2847: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
2848: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
2849: RAISE Okl_Api.G_EXCEPTION_ERROR;
2850: END IF;
2851:
2852: -- validate input parameters
2853: IF (p_acceleration_rec.khr_id IS NULL) OR (p_acceleration_rec.khr_id = OKL_API.G_MISS_NUM) THEN
2849: RAISE Okl_Api.G_EXCEPTION_ERROR;
2850: END IF;
2851:
2852: -- validate input parameters
2853: IF (p_acceleration_rec.khr_id IS NULL) OR (p_acceleration_rec.khr_id = OKL_API.G_MISS_NUM) THEN
2854: Okl_Api.set_message(p_app_name => g_app_name,
2855: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2856: RAISE Okl_Api.G_EXCEPTION_ERROR;
2857: END IF;
2850: END IF;
2851:
2852: -- validate input parameters
2853: IF (p_acceleration_rec.khr_id IS NULL) OR (p_acceleration_rec.khr_id = OKL_API.G_MISS_NUM) THEN
2854: Okl_Api.set_message(p_app_name => g_app_name,
2855: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2856: RAISE Okl_Api.G_EXCEPTION_ERROR;
2857: END IF;
2858:
2852: -- validate input parameters
2853: IF (p_acceleration_rec.khr_id IS NULL) OR (p_acceleration_rec.khr_id = OKL_API.G_MISS_NUM) THEN
2854: Okl_Api.set_message(p_app_name => g_app_name,
2855: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2856: RAISE Okl_Api.G_EXCEPTION_ERROR;
2857: END IF;
2858:
2859: IF (p_acceleration_rec.acceleration_date IS NULL) OR (p_acceleration_rec.acceleration_date = OKL_API.G_MISS_DATE) THEN
2860: Okl_Api.set_message(p_app_name => g_app_name,
2855: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
2856: RAISE Okl_Api.G_EXCEPTION_ERROR;
2857: END IF;
2858:
2859: IF (p_acceleration_rec.acceleration_date IS NULL) OR (p_acceleration_rec.acceleration_date = OKL_API.G_MISS_DATE) THEN
2860: Okl_Api.set_message(p_app_name => g_app_name,
2861: p_msg_name => 'OKL_AGN_ACN_DATE_ERROR');
2862: RAISE Okl_Api.G_EXCEPTION_ERROR;
2863: END IF;
2856: RAISE Okl_Api.G_EXCEPTION_ERROR;
2857: END IF;
2858:
2859: IF (p_acceleration_rec.acceleration_date IS NULL) OR (p_acceleration_rec.acceleration_date = OKL_API.G_MISS_DATE) THEN
2860: Okl_Api.set_message(p_app_name => g_app_name,
2861: p_msg_name => 'OKL_AGN_ACN_DATE_ERROR');
2862: RAISE Okl_Api.G_EXCEPTION_ERROR;
2863: END IF;
2864:
2858:
2859: IF (p_acceleration_rec.acceleration_date IS NULL) OR (p_acceleration_rec.acceleration_date = OKL_API.G_MISS_DATE) THEN
2860: Okl_Api.set_message(p_app_name => g_app_name,
2861: p_msg_name => 'OKL_AGN_ACN_DATE_ERROR');
2862: RAISE Okl_Api.G_EXCEPTION_ERROR;
2863: END IF;
2864:
2865: -- Changes for Bug 4040248
2866: -- remove validation and run accruals for specified stream type if provided and
2864:
2865: -- Changes for Bug 4040248
2866: -- remove validation and run accruals for specified stream type if provided and
2867: -- for all stream types marked for accrual if not provided.
2868: -- IF (p_acceleration_rec.sty_id IS NULL) OR (p_acceleration_rec.sty_id = OKL_API.G_MISS_NUM) THEN
2869: -- Okl_Api.set_message(p_app_name => g_app_name,
2870: -- p_msg_name => 'OKL_AGN_ACN_STY_ERROR');
2871: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
2872: -- END IF;
2865: -- Changes for Bug 4040248
2866: -- remove validation and run accruals for specified stream type if provided and
2867: -- for all stream types marked for accrual if not provided.
2868: -- IF (p_acceleration_rec.sty_id IS NULL) OR (p_acceleration_rec.sty_id = OKL_API.G_MISS_NUM) THEN
2869: -- Okl_Api.set_message(p_app_name => g_app_name,
2870: -- p_msg_name => 'OKL_AGN_ACN_STY_ERROR');
2871: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
2872: -- END IF;
2873:
2867: -- for all stream types marked for accrual if not provided.
2868: -- IF (p_acceleration_rec.sty_id IS NULL) OR (p_acceleration_rec.sty_id = OKL_API.G_MISS_NUM) THEN
2869: -- Okl_Api.set_message(p_app_name => g_app_name,
2870: -- p_msg_name => 'OKL_AGN_ACN_STY_ERROR');
2871: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
2872: -- END IF;
2873:
2874: IF (p_acceleration_rec.accrual_rule_yn IS NULL) OR (p_acceleration_rec.accrual_rule_yn = OKL_API.G_MISS_CHAR) THEN
2875: Okl_Api.set_message(p_app_name => g_app_name,
2870: -- p_msg_name => 'OKL_AGN_ACN_STY_ERROR');
2871: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
2872: -- END IF;
2873:
2874: IF (p_acceleration_rec.accrual_rule_yn IS NULL) OR (p_acceleration_rec.accrual_rule_yn = OKL_API.G_MISS_CHAR) THEN
2875: Okl_Api.set_message(p_app_name => g_app_name,
2876: p_msg_name => 'OKL_AGN_ACN_RULE_ERROR');
2877: RAISE Okl_Api.G_EXCEPTION_ERROR;
2878: END IF;
2871: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
2872: -- END IF;
2873:
2874: IF (p_acceleration_rec.accrual_rule_yn IS NULL) OR (p_acceleration_rec.accrual_rule_yn = OKL_API.G_MISS_CHAR) THEN
2875: Okl_Api.set_message(p_app_name => g_app_name,
2876: p_msg_name => 'OKL_AGN_ACN_RULE_ERROR');
2877: RAISE Okl_Api.G_EXCEPTION_ERROR;
2878: END IF;
2879:
2873:
2874: IF (p_acceleration_rec.accrual_rule_yn IS NULL) OR (p_acceleration_rec.accrual_rule_yn = OKL_API.G_MISS_CHAR) THEN
2875: Okl_Api.set_message(p_app_name => g_app_name,
2876: p_msg_name => 'OKL_AGN_ACN_RULE_ERROR');
2877: RAISE Okl_Api.G_EXCEPTION_ERROR;
2878: END IF;
2879:
2880: IF (p_acceleration_rec.accelerate_till_date IS NULL) OR (p_acceleration_rec.accelerate_till_date = OKL_API.G_MISS_DATE) THEN
2881: Okl_Api.set_message(p_app_name => g_app_name,
2876: p_msg_name => 'OKL_AGN_ACN_RULE_ERROR');
2877: RAISE Okl_Api.G_EXCEPTION_ERROR;
2878: END IF;
2879:
2880: IF (p_acceleration_rec.accelerate_till_date IS NULL) OR (p_acceleration_rec.accelerate_till_date = OKL_API.G_MISS_DATE) THEN
2881: Okl_Api.set_message(p_app_name => g_app_name,
2882: p_msg_name => 'OKL_AGN_ACN_TILL_DATE_ERROR');
2883: RAISE Okl_Api.G_EXCEPTION_ERROR;
2884: END IF;
2877: RAISE Okl_Api.G_EXCEPTION_ERROR;
2878: END IF;
2879:
2880: IF (p_acceleration_rec.accelerate_till_date IS NULL) OR (p_acceleration_rec.accelerate_till_date = OKL_API.G_MISS_DATE) THEN
2881: Okl_Api.set_message(p_app_name => g_app_name,
2882: p_msg_name => 'OKL_AGN_ACN_TILL_DATE_ERROR');
2883: RAISE Okl_Api.G_EXCEPTION_ERROR;
2884: END IF;
2885:
2879:
2880: IF (p_acceleration_rec.accelerate_till_date IS NULL) OR (p_acceleration_rec.accelerate_till_date = OKL_API.G_MISS_DATE) THEN
2881: Okl_Api.set_message(p_app_name => g_app_name,
2882: p_msg_name => 'OKL_AGN_ACN_TILL_DATE_ERROR');
2883: RAISE Okl_Api.G_EXCEPTION_ERROR;
2884: END IF;
2885:
2886: -- check for kle_id
2887: --akrangan cursor modified for bug 5526955 begin
3054: OPEN trx_type_id_csr;
3055: FETCH trx_type_id_csr INTO l_try_id;
3056: CLOSE trx_type_id_csr;
3057: IF l_try_id IS NULL THEN
3058: Okl_Api.set_message(p_app_name => g_app_name,
3059: p_msg_name => 'OKL_AGN_TRY_ID_ERROR');
3060: RAISE Okl_Api.G_EXCEPTION_ERROR;
3061: END IF;
3062:
3056: CLOSE trx_type_id_csr;
3057: IF l_try_id IS NULL THEN
3058: Okl_Api.set_message(p_app_name => g_app_name,
3059: p_msg_name => 'OKL_AGN_TRY_ID_ERROR');
3060: RAISE Okl_Api.G_EXCEPTION_ERROR;
3061: END IF;
3062:
3063: -- Find set of books id
3064: l_sob_id := Okl_Accounting_Util.GET_SET_OF_BOOKS_ID(
3064: l_sob_id := Okl_Accounting_Util.GET_SET_OF_BOOKS_ID(
3065: p_representation_type => p_representation_type);
3066: IF (l_sob_id IS NULL) THEN
3067: -- store SQL error message on message stack for caller
3068: Okl_Api.set_message(p_app_name => g_app_name,
3069: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
3070: RAISE Okl_Api.G_EXCEPTION_ERROR;
3071: END IF;
3072:
3066: IF (l_sob_id IS NULL) THEN
3067: -- store SQL error message on message stack for caller
3068: Okl_Api.set_message(p_app_name => g_app_name,
3069: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
3070: RAISE Okl_Api.G_EXCEPTION_ERROR;
3071: END IF;
3072:
3073: -- Get period end date
3074: --Okl_Accounting_Util.GET_PERIOD_INFO(p_acceleration_rec.acceleration_date,l_period_name,l_period_start_date,l_period_end_date);
3078: p_start_date => l_period_start_date,
3079: p_end_date => l_period_end_date,
3080: p_ledger_id => l_sob_id); --MGAAP 7263041
3081: IF l_period_name IS NULL THEN
3082: Okl_Api.set_message(p_app_name => g_app_name,
3083: p_msg_name => 'OKL_AGN_PERIOD_END_DATE');
3084: RAISE Okl_Api.G_EXCEPTION_ERROR;
3085: END IF;
3086:
3080: p_ledger_id => l_sob_id); --MGAAP 7263041
3081: IF l_period_name IS NULL THEN
3082: Okl_Api.set_message(p_app_name => g_app_name,
3083: p_msg_name => 'OKL_AGN_PERIOD_END_DATE');
3084: RAISE Okl_Api.G_EXCEPTION_ERROR;
3085: END IF;
3086:
3087: -- validate accrual date for open period check
3088: l_period_status := Okl_Accounting_Util.GET_OKL_PERIOD_STATUS(
3088: l_period_status := Okl_Accounting_Util.GET_OKL_PERIOD_STATUS(
3089: p_period_name => l_period_name,
3090: p_ledger_id => l_sob_id); --MGAAP 7263041
3091: IF l_period_status IS NULL THEN
3092: Okl_Api.set_message(p_app_name => g_app_name,
3093: p_msg_name => 'OKL_AGN_PERIOD_STATUS_ERROR',
3094: p_token1 => 'PERIOD_NAME',
3095: p_token1_value => l_period_name);
3096: RAISE Okl_Api.G_EXCEPTION_ERROR;
3092: Okl_Api.set_message(p_app_name => g_app_name,
3093: p_msg_name => 'OKL_AGN_PERIOD_STATUS_ERROR',
3094: p_token1 => 'PERIOD_NAME',
3095: p_token1_value => l_period_name);
3096: RAISE Okl_Api.G_EXCEPTION_ERROR;
3097: END IF;
3098:
3099: IF l_period_status NOT IN ('O','F') THEN
3100: Okl_Api.set_message(p_app_name => g_app_name,
3096: RAISE Okl_Api.G_EXCEPTION_ERROR;
3097: END IF;
3098:
3099: IF l_period_status NOT IN ('O','F') THEN
3100: Okl_Api.set_message(p_app_name => g_app_name,
3101: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
3102: RAISE Okl_Api.G_EXCEPTION_ERROR;
3103: END IF;
3104:
3098:
3099: IF l_period_status NOT IN ('O','F') THEN
3100: Okl_Api.set_message(p_app_name => g_app_name,
3101: p_msg_name => 'OKL_AGN_OPEN_PERIOD_ERROR');
3102: RAISE Okl_Api.G_EXCEPTION_ERROR;
3103: END IF;
3104:
3105: -- Find set of books id
3106: /* Moved before call to get period info
3107: l_sob_id := Okl_Accounting_Util.GET_SET_OF_BOOKS_ID(
3108: p_representation_type => p_representation_type);
3109: IF (l_sob_id IS NULL) THEN
3110: -- store SQL error message on message stack for caller
3111: Okl_Api.set_message(p_app_name => g_app_name,
3112: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
3113: RAISE Okl_Api.G_EXCEPTION_ERROR;
3114: END IF; */
3115:
3109: IF (l_sob_id IS NULL) THEN
3110: -- store SQL error message on message stack for caller
3111: Okl_Api.set_message(p_app_name => g_app_name,
3112: p_msg_name => 'OKL_AGN_SOB_ID_ERROR');
3113: RAISE Okl_Api.G_EXCEPTION_ERROR;
3114: END IF; */
3115:
3116: -- Find currency code for the set of books id
3117: l_func_currency_code := Okl_Accounting_Util.GET_FUNC_CURR_CODE(
3117: l_func_currency_code := Okl_Accounting_Util.GET_FUNC_CURR_CODE(
3118: p_ledger_id => l_sob_id); --MGAAP 7263041
3119: IF (l_func_currency_code IS NULL) THEN
3120: -- store SQL error message on message stack for caller
3121: Okl_Api.set_message(p_app_name => g_app_name,
3122: p_msg_name => 'OKL_AGN_CURR_CODE_ERROR');
3123: RAISE Okl_Api.G_EXCEPTION_ERROR;
3124: END IF;
3125:
3119: IF (l_func_currency_code IS NULL) THEN
3120: -- store SQL error message on message stack for caller
3121: Okl_Api.set_message(p_app_name => g_app_name,
3122: p_msg_name => 'OKL_AGN_CURR_CODE_ERROR');
3123: RAISE Okl_Api.G_EXCEPTION_ERROR;
3124: END IF;
3125:
3126: -- get contract details
3127: FOR x IN contract_details_csr(p_acceleration_rec.khr_id)
3139: -- Check contract currency against functional currency
3140: IF l_func_currency_code <> l_currency_code THEN
3141: --validate data
3142: IF l_currency_conversion_type IS NULL THEN
3143: Okl_Api.set_message(p_app_name => g_app_name,
3144: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
3145: p_token1 => g_contract_number_token,
3146: p_token1_value => l_contract_number);
3147: RAISE Okl_Api.G_EXCEPTION_ERROR;
3143: Okl_Api.set_message(p_app_name => g_app_name,
3144: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
3145: p_token1 => g_contract_number_token,
3146: p_token1_value => l_contract_number);
3147: RAISE Okl_Api.G_EXCEPTION_ERROR;
3148: END IF;
3149:
3150: IF l_currency_conversion_date IS NULL THEN
3151: Okl_Api.set_message(p_app_name => g_app_name,
3147: RAISE Okl_Api.G_EXCEPTION_ERROR;
3148: END IF;
3149:
3150: IF l_currency_conversion_date IS NULL THEN
3151: Okl_Api.set_message(p_app_name => g_app_name,
3152: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
3153: p_token1 => g_contract_number_token,
3154: p_token1_value => l_contract_number);
3155: RAISE Okl_Api.G_EXCEPTION_ERROR;
3151: Okl_Api.set_message(p_app_name => g_app_name,
3152: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
3153: p_token1 => g_contract_number_token,
3154: p_token1_value => l_contract_number);
3155: RAISE Okl_Api.G_EXCEPTION_ERROR;
3156: END IF;
3157:
3158: IF l_currency_conversion_type = 'User' THEN
3159: IF l_currency_conversion_rate IS NULL THEN
3156: END IF;
3157:
3158: IF l_currency_conversion_type = 'User' THEN
3159: IF l_currency_conversion_rate IS NULL THEN
3160: Okl_Api.set_message(p_app_name => g_app_name,
3161: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
3162: p_token1 => g_contract_number_token,
3163: p_token1_value => l_contract_number);
3164: RAISE Okl_Api.G_EXCEPTION_ERROR;
3160: Okl_Api.set_message(p_app_name => g_app_name,
3161: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
3162: p_token1 => g_contract_number_token,
3163: p_token1_value => l_contract_number);
3164: RAISE Okl_Api.G_EXCEPTION_ERROR;
3165: END IF;
3166: ELSE
3167: l_currency_conversion_rate := OKL_ACCOUNTING_UTIL.get_curr_con_rate
3168: (p_from_curr_code => l_currency_code,
3169: p_to_curr_code => l_func_currency_code,
3170: p_con_date => p_acceleration_rec.acceleration_date, --Bug #5410825
3171: p_con_type => l_currency_conversion_type);
3172: IF l_currency_conversion_rate IS NULL THEN
3173: Okl_Api.set_message(p_app_name => g_app_name,
3174: p_msg_name => 'OKL_AGN_CURR_RATE_ERROR',
3175: p_token1 => 'CONVERSION_TYPE',
3176: p_token1_value => l_currency_conversion_type,
3177: p_token2 => 'FROM_CURRENCY',
3178: p_token2_value => l_currency_code,
3179: p_token3 => 'TO_CURRENCY',
3180: p_token3_value => l_func_currency_code
3181: );
3182: RAISE Okl_Api.G_EXCEPTION_ERROR;
3183: END IF;
3184: l_currency_conversion_date := p_acceleration_rec.acceleration_date; --Bug #5410825
3185: END IF;
3186: END IF;
3214: VALIDATE_ACCRUAL_RULE(x_return_status => l_return_status
3215: ,x_result => l_rule_result
3216: ,p_ctr_id => p_acceleration_rec.khr_id);
3217: -- store the highest degree of error
3218: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3219: Okl_Api.set_message(p_app_name => g_app_name,
3220: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
3221: p_token1 => g_contract_number_token,
3222: p_token1_value => l_contract_number);
3215: ,x_result => l_rule_result
3216: ,p_ctr_id => p_acceleration_rec.khr_id);
3217: -- store the highest degree of error
3218: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3219: Okl_Api.set_message(p_app_name => g_app_name,
3220: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
3221: p_token1 => g_contract_number_token,
3222: p_token1_value => l_contract_number);
3223: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3219: Okl_Api.set_message(p_app_name => g_app_name,
3220: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
3221: p_token1 => g_contract_number_token,
3222: p_token1_value => l_contract_number);
3223: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3224: END IF;
3225:
3226: l_accrual_rec.rule_result := l_rule_result;
3227: l_accrual_rec.override_status := l_override_status;
3260: p_stream_tbl => l_stream_tbl,
3261: p_representation_type => p_representation_type); --MGAAP 7263041
3262:
3263: x_trx_number := l_tcnv_rec.trx_number; --MGAAP 7263041
3264: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3265: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3266: Okl_Api.set_message(p_app_name => g_app_name,
3267: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3268: p_token1 => g_contract_number_token,
3261: p_representation_type => p_representation_type); --MGAAP 7263041
3262:
3263: x_trx_number := l_tcnv_rec.trx_number; --MGAAP 7263041
3264: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3265: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3266: Okl_Api.set_message(p_app_name => g_app_name,
3267: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3268: p_token1 => g_contract_number_token,
3269: p_token1_value => l_contract_number);
3262:
3263: x_trx_number := l_tcnv_rec.trx_number; --MGAAP 7263041
3264: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3265: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3266: Okl_Api.set_message(p_app_name => g_app_name,
3267: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3268: p_token1 => g_contract_number_token,
3269: p_token1_value => l_contract_number);
3270: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3266: Okl_Api.set_message(p_app_name => g_app_name,
3267: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3268: p_token1 => g_contract_number_token,
3269: p_token1_value => l_contract_number);
3270: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3271: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3272: Okl_Api.set_message(p_app_name => g_app_name,
3273: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3274: p_token1 => g_contract_number_token,
3267: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3268: p_token1 => g_contract_number_token,
3269: p_token1_value => l_contract_number);
3270: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3271: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3272: Okl_Api.set_message(p_app_name => g_app_name,
3273: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3274: p_token1 => g_contract_number_token,
3275: p_token1_value => l_contract_number);
3268: p_token1 => g_contract_number_token,
3269: p_token1_value => l_contract_number);
3270: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3271: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3272: Okl_Api.set_message(p_app_name => g_app_name,
3273: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3274: p_token1 => g_contract_number_token,
3275: p_token1_value => l_contract_number);
3276: RAISE OKL_API.G_EXCEPTION_ERROR;
3272: Okl_Api.set_message(p_app_name => g_app_name,
3273: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3274: p_token1 => g_contract_number_token,
3275: p_token1_value => l_contract_number);
3276: RAISE OKL_API.G_EXCEPTION_ERROR;
3277: END IF;
3278: END IF;
3279:
3280: END IF; -- IF l_stream_tbl.COUNT > 0
3278: END IF;
3279:
3280: END IF; -- IF l_stream_tbl.COUNT > 0
3281:
3282: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3283: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3284:
3285: EXCEPTION
3286: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3279:
3280: END IF; -- IF l_stream_tbl.COUNT > 0
3281:
3282: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3283: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3284:
3285: EXCEPTION
3286: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3287: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3282: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3283: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3284:
3285: EXCEPTION
3286: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3287: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3288: ,g_pkg_name
3289: ,'OKL_API.G_RET_STS_ERROR'
3290: ,x_msg_count
3283: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3284:
3285: EXCEPTION
3286: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3287: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3288: ,g_pkg_name
3289: ,'OKL_API.G_RET_STS_ERROR'
3290: ,x_msg_count
3291: ,x_msg_data
3285: EXCEPTION
3286: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3287: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3288: ,g_pkg_name
3289: ,'OKL_API.G_RET_STS_ERROR'
3290: ,x_msg_count
3291: ,x_msg_data
3292: ,'_PVT');
3293:
3290: ,x_msg_count
3291: ,x_msg_data
3292: ,'_PVT');
3293:
3294: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3295: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3296: ,g_pkg_name
3297: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3298: ,x_msg_count
3291: ,x_msg_data
3292: ,'_PVT');
3293:
3294: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3295: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3296: ,g_pkg_name
3297: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3298: ,x_msg_count
3299: ,x_msg_data
3293:
3294: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3295: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3296: ,g_pkg_name
3297: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3298: ,x_msg_count
3299: ,x_msg_data
3300: ,'_PVT');
3301:
3299: ,x_msg_data
3300: ,'_PVT');
3301:
3302: WHEN OTHERS THEN
3303: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
3304: (l_api_name,
3305: G_PKG_NAME,
3306: 'OTHERS',
3307: x_msg_count,
3397: WRITE_TO_LOG('p_reverse_rec.memo_yn :'||p_reverse_rec.memo_yn);
3398: WRITE_TO_LOG('p_reverse_rec.description :'||p_reverse_rec.description);
3399: WRITE_TO_LOG('p_reverse_rec.accrual_activity :'||p_reverse_rec.accrual_activity);
3400:
3401: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
3402: ,G_PKG_NAME
3403: ,p_init_msg_list
3404: ,l_api_version
3405: ,p_api_version
3405: ,p_api_version
3406: ,'_PVT'
3407: ,x_return_status);
3408:
3409: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3410: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3411: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3412: RAISE Okl_Api.G_EXCEPTION_ERROR;
3413: END IF;
3406: ,'_PVT'
3407: ,x_return_status);
3408:
3409: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3410: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3411: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3412: RAISE Okl_Api.G_EXCEPTION_ERROR;
3413: END IF;
3414:
3407: ,x_return_status);
3408:
3409: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3410: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3411: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3412: RAISE Okl_Api.G_EXCEPTION_ERROR;
3413: END IF;
3414:
3415: -- Reverse transactions and accounting for number of days setup by the user
3408:
3409: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3410: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3411: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3412: RAISE Okl_Api.G_EXCEPTION_ERROR;
3413: END IF;
3414:
3415: -- Reverse transactions and accounting for number of days setup by the user
3416: -- Open reverse trx cursor to find out transaction id's TO REVERSE IN CASE OF non-accrual
3451: p_acct_date => p_reverse_rec.accrual_date,
3452: p_source_id_tbl => l_source_id_tbl);
3453: WRITE_TO_LOG('Return status after the call to Okl_Reversal_Pub.REVERSE_ENTRIES :'||x_return_status);
3454: -- store the highest degree of error
3455: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3456: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3457: -- need to leave
3458: Okl_Api.set_message(p_app_name => g_app_name,
3459: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3452: p_source_id_tbl => l_source_id_tbl);
3453: WRITE_TO_LOG('Return status after the call to Okl_Reversal_Pub.REVERSE_ENTRIES :'||x_return_status);
3454: -- store the highest degree of error
3455: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3456: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3457: -- need to leave
3458: Okl_Api.set_message(p_app_name => g_app_name,
3459: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3460: p_token1 => g_contract_number_token,
3454: -- store the highest degree of error
3455: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3456: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3457: -- need to leave
3458: Okl_Api.set_message(p_app_name => g_app_name,
3459: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3460: p_token1 => g_contract_number_token,
3461: p_token1_value => p_reverse_rec.contract_number);
3462: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3458: Okl_Api.set_message(p_app_name => g_app_name,
3459: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3460: p_token1 => g_contract_number_token,
3461: p_token1_value => p_reverse_rec.contract_number);
3462: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3463: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3464: -- record that there was an error
3465: Okl_Api.set_message(p_app_name => g_app_name,
3466: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3459: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3460: p_token1 => g_contract_number_token,
3461: p_token1_value => p_reverse_rec.contract_number);
3462: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3463: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3464: -- record that there was an error
3465: Okl_Api.set_message(p_app_name => g_app_name,
3466: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3467: p_token1 => g_contract_number_token,
3461: p_token1_value => p_reverse_rec.contract_number);
3462: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3463: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3464: -- record that there was an error
3465: Okl_Api.set_message(p_app_name => g_app_name,
3466: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3467: p_token1 => g_contract_number_token,
3468: p_token1_value => p_reverse_rec.contract_number);
3469: RAISE OKL_API.G_EXCEPTION_ERROR;
3465: Okl_Api.set_message(p_app_name => g_app_name,
3466: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3467: p_token1 => g_contract_number_token,
3468: p_token1_value => p_reverse_rec.contract_number);
3469: RAISE OKL_API.G_EXCEPTION_ERROR;
3470: END IF;
3471: END IF;
3472:
3473: WRITE_TO_LOG('Prior to the call to Okl_Trx_Contracts_Pub.update_trx_contracts');
3482: x_tcnv_tbl => x_rev_tcnv_tbl);
3483: WRITE_TO_LOG('Return status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts :'||x_return_status);
3484:
3485: -- store the highest degree of error
3486: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3487: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3488: -- need to leave
3489: Okl_Api.set_message(p_app_name => g_app_name,
3490: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3483: WRITE_TO_LOG('Return status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts :'||x_return_status);
3484:
3485: -- store the highest degree of error
3486: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3487: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3488: -- need to leave
3489: Okl_Api.set_message(p_app_name => g_app_name,
3490: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3491: p_token1 => g_contract_number_token,
3485: -- store the highest degree of error
3486: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3487: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3488: -- need to leave
3489: Okl_Api.set_message(p_app_name => g_app_name,
3490: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3491: p_token1 => g_contract_number_token,
3492: p_token1_value => p_reverse_rec.contract_number);
3493: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3489: Okl_Api.set_message(p_app_name => g_app_name,
3490: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3491: p_token1 => g_contract_number_token,
3492: p_token1_value => p_reverse_rec.contract_number);
3493: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3494: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3495: -- record that there was an error
3496: Okl_Api.set_message(p_app_name => g_app_name,
3497: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3490: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3491: p_token1 => g_contract_number_token,
3492: p_token1_value => p_reverse_rec.contract_number);
3493: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3494: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3495: -- record that there was an error
3496: Okl_Api.set_message(p_app_name => g_app_name,
3497: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3498: p_token1 => g_contract_number_token,
3492: p_token1_value => p_reverse_rec.contract_number);
3493: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3494: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3495: -- record that there was an error
3496: Okl_Api.set_message(p_app_name => g_app_name,
3497: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3498: p_token1 => g_contract_number_token,
3499: p_token1_value => p_reverse_rec.contract_number);
3500: RAISE OKL_API.G_EXCEPTION_ERROR;
3496: Okl_Api.set_message(p_app_name => g_app_name,
3497: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3498: p_token1 => g_contract_number_token,
3499: p_token1_value => p_reverse_rec.contract_number);
3500: RAISE OKL_API.G_EXCEPTION_ERROR;
3501: END IF;
3502: END IF;
3503:
3504: -- Create a new trasaction for the reversed transaction to reflect memo entries
3572: p_accrual_rec => l_accrual_rec,
3573: p_stream_tbl => l_stream_tbl,
3574: p_representation_type => p_representation_type); -- MGAAP 7263041
3575: -- store the highest degree of error
3576: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3577: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3578: -- need to leave
3579: Okl_Api.set_message(p_app_name => g_app_name,
3580: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3573: p_stream_tbl => l_stream_tbl,
3574: p_representation_type => p_representation_type); -- MGAAP 7263041
3575: -- store the highest degree of error
3576: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3577: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3578: -- need to leave
3579: Okl_Api.set_message(p_app_name => g_app_name,
3580: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3581: p_token1 => g_contract_number_token,
3575: -- store the highest degree of error
3576: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3577: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3578: -- need to leave
3579: Okl_Api.set_message(p_app_name => g_app_name,
3580: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3581: p_token1 => g_contract_number_token,
3582: p_token1_value => p_reverse_rec.contract_number);
3583: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3579: Okl_Api.set_message(p_app_name => g_app_name,
3580: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3581: p_token1 => g_contract_number_token,
3582: p_token1_value => p_reverse_rec.contract_number);
3583: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3584: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3585: Okl_Api.set_message(p_app_name => g_app_name,
3586: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3587: p_token1 => g_contract_number_token,
3580: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3581: p_token1 => g_contract_number_token,
3582: p_token1_value => p_reverse_rec.contract_number);
3583: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3584: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3585: Okl_Api.set_message(p_app_name => g_app_name,
3586: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3587: p_token1 => g_contract_number_token,
3588: p_token1_value => p_reverse_rec.contract_number);
3581: p_token1 => g_contract_number_token,
3582: p_token1_value => p_reverse_rec.contract_number);
3583: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3584: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3585: Okl_Api.set_message(p_app_name => g_app_name,
3586: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3587: p_token1 => g_contract_number_token,
3588: p_token1_value => p_reverse_rec.contract_number);
3589: RAISE OKL_API.G_EXCEPTION_ERROR;
3585: Okl_Api.set_message(p_app_name => g_app_name,
3586: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
3587: p_token1 => g_contract_number_token,
3588: p_token1_value => p_reverse_rec.contract_number);
3589: RAISE OKL_API.G_EXCEPTION_ERROR;
3590: END IF;
3591: END IF;
3592:
3593: -- MGAAP start 7263041
3605:
3606: END LOOP;
3607: END IF; -- for l_tcnv_tbl.count > 0;
3608:
3609: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3610: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3611:
3612: EXCEPTION
3613:
3606: END LOOP;
3607: END IF; -- for l_tcnv_tbl.count > 0;
3608:
3609: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3610: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3611:
3612: EXCEPTION
3613:
3614: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3610: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3611:
3612: EXCEPTION
3613:
3614: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3615: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3616: ,g_pkg_name
3617: ,'OKL_API.G_RET_STS_ERROR'
3618: ,x_msg_count
3611:
3612: EXCEPTION
3613:
3614: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3615: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3616: ,g_pkg_name
3617: ,'OKL_API.G_RET_STS_ERROR'
3618: ,x_msg_count
3619: ,x_msg_data
3613:
3614: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3615: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3616: ,g_pkg_name
3617: ,'OKL_API.G_RET_STS_ERROR'
3618: ,x_msg_count
3619: ,x_msg_data
3620: ,'_PVT');
3621: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3617: ,'OKL_API.G_RET_STS_ERROR'
3618: ,x_msg_count
3619: ,x_msg_data
3620: ,'_PVT');
3621: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3622: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3623: ,g_pkg_name
3624: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3625: ,x_msg_count
3618: ,x_msg_count
3619: ,x_msg_data
3620: ,'_PVT');
3621: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3622: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3623: ,g_pkg_name
3624: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3625: ,x_msg_count
3626: ,x_msg_data
3620: ,'_PVT');
3621: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3622: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3623: ,g_pkg_name
3624: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3625: ,x_msg_count
3626: ,x_msg_data
3627: ,'_PVT');
3628: WHEN OTHERS THEN
3625: ,x_msg_count
3626: ,x_msg_data
3627: ,'_PVT');
3628: WHEN OTHERS THEN
3629: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
3630: (l_api_name,
3631: G_PKG_NAME,
3632: 'OTHERS',
3633: x_msg_count,
3724: WHERE tcn_id = p_tcn_id;
3725:
3726: BEGIN
3727: -- Set save point
3728: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
3729: ,G_PKG_NAME
3730: ,p_init_msg_list
3731: ,l_api_version
3732: ,p_api_version
3732: ,p_api_version
3733: ,'_PVT'
3734: ,x_return_status);
3735:
3736: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3737: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3738: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3739: RAISE Okl_Api.G_EXCEPTION_ERROR;
3740: END IF;
3733: ,'_PVT'
3734: ,x_return_status);
3735:
3736: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3737: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3738: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3739: RAISE Okl_Api.G_EXCEPTION_ERROR;
3740: END IF;
3741:
3734: ,x_return_status);
3735:
3736: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3737: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3738: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3739: RAISE Okl_Api.G_EXCEPTION_ERROR;
3740: END IF;
3741:
3742: --Validate in parameters
3735:
3736: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3737: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3738: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3739: RAISE Okl_Api.G_EXCEPTION_ERROR;
3740: END IF;
3741:
3742: --Validate in parameters
3743: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3739: RAISE Okl_Api.G_EXCEPTION_ERROR;
3740: END IF;
3741:
3742: --Validate in parameters
3743: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3744: Okl_Api.set_message(p_app_name => g_app_name,
3745: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3746: RAISE OKL_API.G_EXCEPTION_ERROR;
3747: END IF;
3740: END IF;
3741:
3742: --Validate in parameters
3743: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3744: Okl_Api.set_message(p_app_name => g_app_name,
3745: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3746: RAISE OKL_API.G_EXCEPTION_ERROR;
3747: END IF;
3748:
3742: --Validate in parameters
3743: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3744: Okl_Api.set_message(p_app_name => g_app_name,
3745: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3746: RAISE OKL_API.G_EXCEPTION_ERROR;
3747: END IF;
3748:
3749: IF p_reversal_date IS NULL OR p_reversal_date = OKL_API.G_MISS_DATE THEN
3750: Okl_Api.set_message(p_app_name => g_app_name,
3745: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3746: RAISE OKL_API.G_EXCEPTION_ERROR;
3747: END IF;
3748:
3749: IF p_reversal_date IS NULL OR p_reversal_date = OKL_API.G_MISS_DATE THEN
3750: Okl_Api.set_message(p_app_name => g_app_name,
3751: p_msg_name => 'OKL_AGN_REV_DATE_ERROR');
3752: RAISE OKL_API.G_EXCEPTION_ERROR;
3753: END IF;
3746: RAISE OKL_API.G_EXCEPTION_ERROR;
3747: END IF;
3748:
3749: IF p_reversal_date IS NULL OR p_reversal_date = OKL_API.G_MISS_DATE THEN
3750: Okl_Api.set_message(p_app_name => g_app_name,
3751: p_msg_name => 'OKL_AGN_REV_DATE_ERROR');
3752: RAISE OKL_API.G_EXCEPTION_ERROR;
3753: END IF;
3754:
3748:
3749: IF p_reversal_date IS NULL OR p_reversal_date = OKL_API.G_MISS_DATE THEN
3750: Okl_Api.set_message(p_app_name => g_app_name,
3751: p_msg_name => 'OKL_AGN_REV_DATE_ERROR');
3752: RAISE OKL_API.G_EXCEPTION_ERROR;
3753: END IF;
3754:
3755: IF p_accounting_date IS NULL OR p_accounting_date = OKL_API.G_MISS_DATE THEN
3756: Okl_Api.set_message(p_app_name => g_app_name,
3751: p_msg_name => 'OKL_AGN_REV_DATE_ERROR');
3752: RAISE OKL_API.G_EXCEPTION_ERROR;
3753: END IF;
3754:
3755: IF p_accounting_date IS NULL OR p_accounting_date = OKL_API.G_MISS_DATE THEN
3756: Okl_Api.set_message(p_app_name => g_app_name,
3757: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3758: RAISE OKL_API.G_EXCEPTION_ERROR;
3759: END IF;
3752: RAISE OKL_API.G_EXCEPTION_ERROR;
3753: END IF;
3754:
3755: IF p_accounting_date IS NULL OR p_accounting_date = OKL_API.G_MISS_DATE THEN
3756: Okl_Api.set_message(p_app_name => g_app_name,
3757: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3758: RAISE OKL_API.G_EXCEPTION_ERROR;
3759: END IF;
3760:
3754:
3755: IF p_accounting_date IS NULL OR p_accounting_date = OKL_API.G_MISS_DATE THEN
3756: Okl_Api.set_message(p_app_name => g_app_name,
3757: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3758: RAISE OKL_API.G_EXCEPTION_ERROR;
3759: END IF;
3760:
3761: IF p_reverse_from IS NULL OR p_reverse_from = OKL_API.G_MISS_DATE THEN
3762: Okl_Api.set_message(p_app_name => g_app_name,
3757: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3758: RAISE OKL_API.G_EXCEPTION_ERROR;
3759: END IF;
3760:
3761: IF p_reverse_from IS NULL OR p_reverse_from = OKL_API.G_MISS_DATE THEN
3762: Okl_Api.set_message(p_app_name => g_app_name,
3763: p_msg_name => 'OKL_AGN_FROM_DATE_ERROR');
3764: RAISE OKL_API.G_EXCEPTION_ERROR;
3765: END IF;
3758: RAISE OKL_API.G_EXCEPTION_ERROR;
3759: END IF;
3760:
3761: IF p_reverse_from IS NULL OR p_reverse_from = OKL_API.G_MISS_DATE THEN
3762: Okl_Api.set_message(p_app_name => g_app_name,
3763: p_msg_name => 'OKL_AGN_FROM_DATE_ERROR');
3764: RAISE OKL_API.G_EXCEPTION_ERROR;
3765: END IF;
3766:
3760:
3761: IF p_reverse_from IS NULL OR p_reverse_from = OKL_API.G_MISS_DATE THEN
3762: Okl_Api.set_message(p_app_name => g_app_name,
3763: p_msg_name => 'OKL_AGN_FROM_DATE_ERROR');
3764: RAISE OKL_API.G_EXCEPTION_ERROR;
3765: END IF;
3766:
3767: -- get contract_number
3768: OPEN get_contract_number_csr(p_khr_id);
3769: FETCH get_contract_number_csr INTO l_contract_number;
3770: CLOSE get_contract_number_csr;
3771:
3772: IF l_contract_number IS NULL THEN
3773: Okl_Api.set_message(p_app_name => g_app_name,
3774: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
3775: RAISE OKL_API.G_EXCEPTION_ERROR;
3776: END IF;
3777:
3771:
3772: IF l_contract_number IS NULL THEN
3773: Okl_Api.set_message(p_app_name => g_app_name,
3774: p_msg_name => 'OKL_REV_LPV_CNTRCT_NUM_ERROR');
3775: RAISE OKL_API.G_EXCEPTION_ERROR;
3776: END IF;
3777:
3778: -- Open reverse trx cursor
3779: FOR l_reverse_trx_csr IN reverse_trx_csr
3807: p_source_table => l_source_table,
3808: p_acct_date => p_accounting_date,
3809: p_source_id_tbl => l_source_id_tbl);
3810: -- store the highest degree of error
3811: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3812: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3813: -- need to leave
3814: Okl_Api.set_message(p_app_name => g_app_name,
3815: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3808: p_acct_date => p_accounting_date,
3809: p_source_id_tbl => l_source_id_tbl);
3810: -- store the highest degree of error
3811: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3812: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3813: -- need to leave
3814: Okl_Api.set_message(p_app_name => g_app_name,
3815: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3816: p_token1 => g_contract_number_token,
3810: -- store the highest degree of error
3811: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3812: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3813: -- need to leave
3814: Okl_Api.set_message(p_app_name => g_app_name,
3815: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3816: p_token1 => g_contract_number_token,
3817: p_token1_value => l_contract_number);
3818: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3814: Okl_Api.set_message(p_app_name => g_app_name,
3815: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3816: p_token1 => g_contract_number_token,
3817: p_token1_value => l_contract_number);
3818: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3819: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3820: -- record that there was an error
3821: Okl_Api.set_message(p_app_name => g_app_name,
3822: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3815: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3816: p_token1 => g_contract_number_token,
3817: p_token1_value => l_contract_number);
3818: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3819: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3820: -- record that there was an error
3821: Okl_Api.set_message(p_app_name => g_app_name,
3822: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3823: p_token1 => g_contract_number_token,
3817: p_token1_value => l_contract_number);
3818: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3819: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3820: -- record that there was an error
3821: Okl_Api.set_message(p_app_name => g_app_name,
3822: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3823: p_token1 => g_contract_number_token,
3824: p_token1_value => l_contract_number);
3825: RAISE OKL_API.G_EXCEPTION_ERROR;
3821: Okl_Api.set_message(p_app_name => g_app_name,
3822: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
3823: p_token1 => g_contract_number_token,
3824: p_token1_value => l_contract_number);
3825: RAISE OKL_API.G_EXCEPTION_ERROR;
3826: END IF;
3827: END IF;
3828:
3829: --Call the transaction public api for update
3835: x_msg_data => x_msg_data,
3836: p_tcnv_tbl => l_tcnv_tbl,
3837: x_tcnv_tbl => x_tcnv_tbl);
3838: -- store the highest degree of error
3839: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3840: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3841: -- need to leave
3842: Okl_Api.set_message(p_app_name => g_app_name,
3843: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3836: p_tcnv_tbl => l_tcnv_tbl,
3837: x_tcnv_tbl => x_tcnv_tbl);
3838: -- store the highest degree of error
3839: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3840: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3841: -- need to leave
3842: Okl_Api.set_message(p_app_name => g_app_name,
3843: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3844: p_token1 => g_contract_number_token,
3838: -- store the highest degree of error
3839: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
3840: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3841: -- need to leave
3842: Okl_Api.set_message(p_app_name => g_app_name,
3843: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3844: p_token1 => g_contract_number_token,
3845: p_token1_value => l_contract_number);
3846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3842: Okl_Api.set_message(p_app_name => g_app_name,
3843: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3844: p_token1 => g_contract_number_token,
3845: p_token1_value => l_contract_number);
3846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3847: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3848: -- record that there was an error
3849: Okl_Api.set_message(p_app_name => g_app_name,
3850: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3843: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3844: p_token1 => g_contract_number_token,
3845: p_token1_value => l_contract_number);
3846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3847: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3848: -- record that there was an error
3849: Okl_Api.set_message(p_app_name => g_app_name,
3850: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3851: p_token1 => g_contract_number_token,
3845: p_token1_value => l_contract_number);
3846: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3847: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
3848: -- record that there was an error
3849: Okl_Api.set_message(p_app_name => g_app_name,
3850: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3851: p_token1 => g_contract_number_token,
3852: p_token1_value => l_contract_number);
3853: RAISE OKL_API.G_EXCEPTION_ERROR;
3849: Okl_Api.set_message(p_app_name => g_app_name,
3850: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
3851: p_token1 => g_contract_number_token,
3852: p_token1_value => l_contract_number);
3853: RAISE OKL_API.G_EXCEPTION_ERROR;
3854: END IF;
3855: END IF;
3856:
3857: END IF; -- for l_tcnv_tbl.count > 0;
3867: x_msg_count => x_msg_count,
3868: x_msg_data => x_msg_data,
3869: p_tcnv_tbl => l_tcnv_tbl);
3870:
3871: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
3872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3873: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
3874: RAISE OKL_API.G_EXCEPTION_ERROR;
3875: END IF;
3868: x_msg_data => x_msg_data,
3869: p_tcnv_tbl => l_tcnv_tbl);
3870:
3871: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
3872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3873: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
3874: RAISE OKL_API.G_EXCEPTION_ERROR;
3875: END IF;
3876:
3869: p_tcnv_tbl => l_tcnv_tbl);
3870:
3871: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
3872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3873: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
3874: RAISE OKL_API.G_EXCEPTION_ERROR;
3875: END IF;
3876:
3877: END IF; */
3870:
3871: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
3872: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
3873: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
3874: RAISE OKL_API.G_EXCEPTION_ERROR;
3875: END IF;
3876:
3877: END IF; */
3878:
3875: END IF;
3876:
3877: END IF; */
3878:
3879: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3880: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3881:
3882: EXCEPTION
3883:
3876:
3877: END IF; */
3878:
3879: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
3880: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3881:
3882: EXCEPTION
3883:
3884: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3880: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
3881:
3882: EXCEPTION
3883:
3884: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3885: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3886: ,g_pkg_name
3887: ,'OKL_API.G_RET_STS_ERROR'
3888: ,x_msg_count
3881:
3882: EXCEPTION
3883:
3884: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3885: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3886: ,g_pkg_name
3887: ,'OKL_API.G_RET_STS_ERROR'
3888: ,x_msg_count
3889: ,x_msg_data
3883:
3884: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
3885: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3886: ,g_pkg_name
3887: ,'OKL_API.G_RET_STS_ERROR'
3888: ,x_msg_count
3889: ,x_msg_data
3890: ,'_PVT');
3891: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3887: ,'OKL_API.G_RET_STS_ERROR'
3888: ,x_msg_count
3889: ,x_msg_data
3890: ,'_PVT');
3891: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3892: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3893: ,g_pkg_name
3894: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3895: ,x_msg_count
3888: ,x_msg_count
3889: ,x_msg_data
3890: ,'_PVT');
3891: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3892: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3893: ,g_pkg_name
3894: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3895: ,x_msg_count
3896: ,x_msg_data
3890: ,'_PVT');
3891: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
3892: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
3893: ,g_pkg_name
3894: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
3895: ,x_msg_count
3896: ,x_msg_data
3897: ,'_PVT');
3898: WHEN OTHERS THEN
3895: ,x_msg_count
3896: ,x_msg_data
3897: ,'_PVT');
3898: WHEN OTHERS THEN
3899: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
3900: (l_api_name,
3901: G_PKG_NAME,
3902: 'OTHERS',
3903: x_msg_count,
3956: WHERE tcn_id = p_tcn_id;
3957:
3958: BEGIN
3959: -- Set save point
3960: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
3961: ,G_PKG_NAME
3962: ,p_init_msg_list
3963: ,l_api_version
3964: ,p_api_version
3964: ,p_api_version
3965: ,'_PVT'
3966: ,x_return_status);
3967:
3968: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3969: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3970: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3971: RAISE Okl_Api.G_EXCEPTION_ERROR;
3972: END IF;
3965: ,'_PVT'
3966: ,x_return_status);
3967:
3968: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3969: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3970: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3971: RAISE Okl_Api.G_EXCEPTION_ERROR;
3972: END IF;
3973:
3966: ,x_return_status);
3967:
3968: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3969: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3970: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3971: RAISE Okl_Api.G_EXCEPTION_ERROR;
3972: END IF;
3973:
3974: --Validate in parameters
3967:
3968: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
3969: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
3970: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
3971: RAISE Okl_Api.G_EXCEPTION_ERROR;
3972: END IF;
3973:
3974: --Validate in parameters
3975: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3971: RAISE Okl_Api.G_EXCEPTION_ERROR;
3972: END IF;
3973:
3974: --Validate in parameters
3975: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3976: Okl_Api.set_message(p_app_name => g_app_name,
3977: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3978: RAISE OKL_API.G_EXCEPTION_ERROR;
3979: END IF;
3972: END IF;
3973:
3974: --Validate in parameters
3975: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3976: Okl_Api.set_message(p_app_name => g_app_name,
3977: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3978: RAISE OKL_API.G_EXCEPTION_ERROR;
3979: END IF;
3980:
3974: --Validate in parameters
3975: IF p_khr_id IS NULL OR p_khr_id = OKL_API.G_MISS_NUM THEN
3976: Okl_Api.set_message(p_app_name => g_app_name,
3977: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3978: RAISE OKL_API.G_EXCEPTION_ERROR;
3979: END IF;
3980:
3981: IF p_reverse_date IS NULL OR p_reverse_date = OKL_API.G_MISS_DATE THEN
3982: Okl_Api.set_message(p_app_name => g_app_name,
3977: p_msg_name => 'OKL_AGN_KHR_ID_ERROR');
3978: RAISE OKL_API.G_EXCEPTION_ERROR;
3979: END IF;
3980:
3981: IF p_reverse_date IS NULL OR p_reverse_date = OKL_API.G_MISS_DATE THEN
3982: Okl_Api.set_message(p_app_name => g_app_name,
3983: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3984: RAISE OKL_API.G_EXCEPTION_ERROR;
3985: END IF;
3978: RAISE OKL_API.G_EXCEPTION_ERROR;
3979: END IF;
3980:
3981: IF p_reverse_date IS NULL OR p_reverse_date = OKL_API.G_MISS_DATE THEN
3982: Okl_Api.set_message(p_app_name => g_app_name,
3983: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3984: RAISE OKL_API.G_EXCEPTION_ERROR;
3985: END IF;
3986:
3980:
3981: IF p_reverse_date IS NULL OR p_reverse_date = OKL_API.G_MISS_DATE THEN
3982: Okl_Api.set_message(p_app_name => g_app_name,
3983: p_msg_name => 'OKL_AGN_ACC_DATE_ERROR');
3984: RAISE OKL_API.G_EXCEPTION_ERROR;
3985: END IF;
3986:
3987: -- get contract_number
3988: OPEN get_contract_number_csr(p_khr_id);
4023: p_source_table => l_source_table,
4024: p_acct_date => p_reverse_date,
4025: p_source_id_tbl => l_source_id_tbl);
4026: -- store the highest degree of error
4027: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4028: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4029: -- need to leave
4030: Okl_Api.set_message(p_app_name => g_app_name,
4031: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4024: p_acct_date => p_reverse_date,
4025: p_source_id_tbl => l_source_id_tbl);
4026: -- store the highest degree of error
4027: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4028: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4029: -- need to leave
4030: Okl_Api.set_message(p_app_name => g_app_name,
4031: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4032: p_token1 => g_contract_number_token,
4026: -- store the highest degree of error
4027: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4028: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4029: -- need to leave
4030: Okl_Api.set_message(p_app_name => g_app_name,
4031: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4032: p_token1 => g_contract_number_token,
4033: p_token1_value => l_contract_number);
4034: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4030: Okl_Api.set_message(p_app_name => g_app_name,
4031: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4032: p_token1 => g_contract_number_token,
4033: p_token1_value => l_contract_number);
4034: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4035: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4036: -- record that there was an error
4037: Okl_Api.set_message(p_app_name => g_app_name,
4038: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4031: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4032: p_token1 => g_contract_number_token,
4033: p_token1_value => l_contract_number);
4034: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4035: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4036: -- record that there was an error
4037: Okl_Api.set_message(p_app_name => g_app_name,
4038: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4039: p_token1 => g_contract_number_token,
4033: p_token1_value => l_contract_number);
4034: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4035: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4036: -- record that there was an error
4037: Okl_Api.set_message(p_app_name => g_app_name,
4038: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4039: p_token1 => g_contract_number_token,
4040: p_token1_value => l_contract_number);
4041: RAISE OKL_API.G_EXCEPTION_ERROR;
4037: Okl_Api.set_message(p_app_name => g_app_name,
4038: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4039: p_token1 => g_contract_number_token,
4040: p_token1_value => l_contract_number);
4041: RAISE OKL_API.G_EXCEPTION_ERROR;
4042: END IF;
4043: END IF;
4044:
4045: --Call the transaction public api for update
4051: x_msg_data => x_msg_data,
4052: p_tcnv_tbl => l_tcnv_tbl,
4053: x_tcnv_tbl => x_tcnv_tbl);
4054: -- store the highest degree of error
4055: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4056: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4057: -- need to leave
4058: Okl_Api.set_message(p_app_name => g_app_name,
4059: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4052: p_tcnv_tbl => l_tcnv_tbl,
4053: x_tcnv_tbl => x_tcnv_tbl);
4054: -- store the highest degree of error
4055: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4056: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4057: -- need to leave
4058: Okl_Api.set_message(p_app_name => g_app_name,
4059: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4060: p_token1 => g_contract_number_token,
4054: -- store the highest degree of error
4055: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4056: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4057: -- need to leave
4058: Okl_Api.set_message(p_app_name => g_app_name,
4059: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4060: p_token1 => g_contract_number_token,
4061: p_token1_value => l_contract_number);
4062: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4058: Okl_Api.set_message(p_app_name => g_app_name,
4059: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4060: p_token1 => g_contract_number_token,
4061: p_token1_value => l_contract_number);
4062: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4063: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4064: -- record that there was an error
4065: Okl_Api.set_message(p_app_name => g_app_name,
4066: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4059: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4060: p_token1 => g_contract_number_token,
4061: p_token1_value => l_contract_number);
4062: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4063: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4064: -- record that there was an error
4065: Okl_Api.set_message(p_app_name => g_app_name,
4066: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4067: p_token1 => g_contract_number_token,
4061: p_token1_value => l_contract_number);
4062: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4063: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4064: -- record that there was an error
4065: Okl_Api.set_message(p_app_name => g_app_name,
4066: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4067: p_token1 => g_contract_number_token,
4068: p_token1_value => l_contract_number);
4069: RAISE OKL_API.G_EXCEPTION_ERROR;
4065: Okl_Api.set_message(p_app_name => g_app_name,
4066: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4067: p_token1 => g_contract_number_token,
4068: p_token1_value => l_contract_number);
4069: RAISE OKL_API.G_EXCEPTION_ERROR;
4070: END IF;
4071: END IF;
4072:
4073: END IF; -- for l_tcnv_tbl.count > 0;
4083: x_msg_count => x_msg_count,
4084: x_msg_data => x_msg_data,
4085: p_tcnv_tbl => l_tcnv_tbl);
4086:
4087: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
4088: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4089: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
4090: RAISE OKL_API.G_EXCEPTION_ERROR;
4091: END IF;
4084: x_msg_data => x_msg_data,
4085: p_tcnv_tbl => l_tcnv_tbl);
4086:
4087: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
4088: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4089: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
4090: RAISE OKL_API.G_EXCEPTION_ERROR;
4091: END IF;
4092:
4085: p_tcnv_tbl => l_tcnv_tbl);
4086:
4087: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
4088: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4089: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
4090: RAISE OKL_API.G_EXCEPTION_ERROR;
4091: END IF;
4092:
4093: END IF; */
4086:
4087: IF (x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR) THEN
4088: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4089: ELSIF (x_return_Status = OKL_API.G_RET_STS_ERROR) THEN
4090: RAISE OKL_API.G_EXCEPTION_ERROR;
4091: END IF;
4092:
4093: END IF; */
4094:
4091: END IF;
4092:
4093: END IF; */
4094:
4095: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
4096: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4097:
4098: EXCEPTION
4099:
4092:
4093: END IF; */
4094:
4095: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
4096: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4097:
4098: EXCEPTION
4099:
4100: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4096: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4097:
4098: EXCEPTION
4099:
4100: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4101: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4102: ,g_pkg_name
4103: ,'OKL_API.G_RET_STS_ERROR'
4104: ,x_msg_count
4097:
4098: EXCEPTION
4099:
4100: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4101: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4102: ,g_pkg_name
4103: ,'OKL_API.G_RET_STS_ERROR'
4104: ,x_msg_count
4105: ,x_msg_data
4099:
4100: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4101: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4102: ,g_pkg_name
4103: ,'OKL_API.G_RET_STS_ERROR'
4104: ,x_msg_count
4105: ,x_msg_data
4106: ,'_PVT');
4107: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4103: ,'OKL_API.G_RET_STS_ERROR'
4104: ,x_msg_count
4105: ,x_msg_data
4106: ,'_PVT');
4107: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4108: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4109: ,g_pkg_name
4110: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4111: ,x_msg_count
4104: ,x_msg_count
4105: ,x_msg_data
4106: ,'_PVT');
4107: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4108: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4109: ,g_pkg_name
4110: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4111: ,x_msg_count
4112: ,x_msg_data
4106: ,'_PVT');
4107: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4108: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4109: ,g_pkg_name
4110: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4111: ,x_msg_count
4112: ,x_msg_data
4113: ,'_PVT');
4114: WHEN OTHERS THEN
4111: ,x_msg_count
4112: ,x_msg_data
4113: ,'_PVT');
4114: WHEN OTHERS THEN
4115: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
4116: (l_api_name,
4117: G_PKG_NAME,
4118: 'OTHERS',
4119: x_msg_count,
4205: WRITE_TO_LOG('p_catchup_rec.memo_yn :'||p_catchup_rec.memo_yn);
4206: WRITE_TO_LOG('p_catchup_rec.description :'||p_catchup_rec.description);
4207: WRITE_TO_LOG('p_catchup_rec.accrual_activity :'||p_catchup_rec.accrual_activity);
4208: -- Set save point
4209: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
4210: ,G_PKG_NAME
4211: ,p_init_msg_list
4212: ,l_api_version
4213: ,p_api_version
4213: ,p_api_version
4214: ,'_PVT'
4215: ,x_return_status);
4216:
4217: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4218: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4219: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4220: RAISE Okl_Api.G_EXCEPTION_ERROR;
4221: END IF;
4214: ,'_PVT'
4215: ,x_return_status);
4216:
4217: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4218: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4219: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4220: RAISE Okl_Api.G_EXCEPTION_ERROR;
4221: END IF;
4222:
4215: ,x_return_status);
4216:
4217: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4218: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4219: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4220: RAISE Okl_Api.G_EXCEPTION_ERROR;
4221: END IF;
4222:
4223: FOR l_catchup_trx_csr IN catchup_trx_csr(p_catchup_rec.contract_id)
4216:
4217: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4218: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4219: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4220: RAISE Okl_Api.G_EXCEPTION_ERROR;
4221: END IF;
4222:
4223: FOR l_catchup_trx_csr IN catchup_trx_csr(p_catchup_rec.contract_id)
4224: LOOP
4258: p_source_id_tbl => l_source_id_tbl);
4259: WRITE_TO_LOG('Return status after the call to Okl_Reversal_Pub.REVERSE_ENTRIES :'||x_return_status);
4260:
4261: -- store the highest degree of error
4262: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4263: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4264: -- need to leave
4265: Okl_Api.set_message(p_app_name => g_app_name,
4266: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4259: WRITE_TO_LOG('Return status after the call to Okl_Reversal_Pub.REVERSE_ENTRIES :'||x_return_status);
4260:
4261: -- store the highest degree of error
4262: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4263: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4264: -- need to leave
4265: Okl_Api.set_message(p_app_name => g_app_name,
4266: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4267: p_token1 => g_contract_number_token,
4261: -- store the highest degree of error
4262: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4263: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4264: -- need to leave
4265: Okl_Api.set_message(p_app_name => g_app_name,
4266: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4267: p_token1 => g_contract_number_token,
4268: p_token1_value => p_catchup_rec.contract_number);
4269: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4265: Okl_Api.set_message(p_app_name => g_app_name,
4266: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4267: p_token1 => g_contract_number_token,
4268: p_token1_value => p_catchup_rec.contract_number);
4269: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4270: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4271: -- record that there was an error
4272: Okl_Api.set_message(p_app_name => g_app_name,
4273: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4266: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4267: p_token1 => g_contract_number_token,
4268: p_token1_value => p_catchup_rec.contract_number);
4269: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4270: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4271: -- record that there was an error
4272: Okl_Api.set_message(p_app_name => g_app_name,
4273: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4274: p_token1 => g_contract_number_token,
4268: p_token1_value => p_catchup_rec.contract_number);
4269: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4270: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4271: -- record that there was an error
4272: Okl_Api.set_message(p_app_name => g_app_name,
4273: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4274: p_token1 => g_contract_number_token,
4275: p_token1_value => p_catchup_rec.contract_number);
4276: RAISE OKL_API.G_EXCEPTION_ERROR;
4272: Okl_Api.set_message(p_app_name => g_app_name,
4273: p_msg_name => 'OKL_AGN_REV_DIST_ERROR',
4274: p_token1 => g_contract_number_token,
4275: p_token1_value => p_catchup_rec.contract_number);
4276: RAISE OKL_API.G_EXCEPTION_ERROR;
4277: END IF;
4278: END IF;
4279:
4280: WRITE_TO_LOG('Prior to the call to Okl_Trx_Contracts_Pub.update_trx_contracts');
4289: x_tcnv_tbl => x_rev_tcnv_tbl);
4290: WRITE_TO_LOG('Return status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts :'||x_return_status);
4291:
4292: -- store the highest degree of error
4293: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4294: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4295: -- need to leave
4296: Okl_Api.set_message(p_app_name => g_app_name,
4297: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4290: WRITE_TO_LOG('Return status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts :'||x_return_status);
4291:
4292: -- store the highest degree of error
4293: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4294: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4295: -- need to leave
4296: Okl_Api.set_message(p_app_name => g_app_name,
4297: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4298: p_token1 => g_contract_number_token,
4292: -- store the highest degree of error
4293: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4294: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4295: -- need to leave
4296: Okl_Api.set_message(p_app_name => g_app_name,
4297: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4298: p_token1 => g_contract_number_token,
4299: p_token1_value => p_catchup_rec.contract_number);
4300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4296: Okl_Api.set_message(p_app_name => g_app_name,
4297: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4298: p_token1 => g_contract_number_token,
4299: p_token1_value => p_catchup_rec.contract_number);
4300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4301: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4302: -- record that there was an error
4303: Okl_Api.set_message(p_app_name => g_app_name,
4304: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4297: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4298: p_token1 => g_contract_number_token,
4299: p_token1_value => p_catchup_rec.contract_number);
4300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4301: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4302: -- record that there was an error
4303: Okl_Api.set_message(p_app_name => g_app_name,
4304: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4305: p_token1 => g_contract_number_token,
4299: p_token1_value => p_catchup_rec.contract_number);
4300: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4301: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4302: -- record that there was an error
4303: Okl_Api.set_message(p_app_name => g_app_name,
4304: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4305: p_token1 => g_contract_number_token,
4306: p_token1_value => p_catchup_rec.contract_number);
4307: RAISE OKL_API.G_EXCEPTION_ERROR;
4303: Okl_Api.set_message(p_app_name => g_app_name,
4304: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4305: p_token1 => g_contract_number_token,
4306: p_token1_value => p_catchup_rec.contract_number);
4307: RAISE OKL_API.G_EXCEPTION_ERROR;
4308: END IF;
4309: END IF;
4310:
4311: -- Bug 4634293. Moving below initialization inside loop. Commenting below line.
4380: p_accrual_rec => l_accrual_rec,
4381: p_stream_tbl => l_stream_tbl,
4382: p_representation_type => p_representation_type); -- MGAAP 7263041
4383: -- store the highest degree of error
4384: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4385: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4386: -- need to leave
4387: Okl_Api.set_message(p_app_name => g_app_name,
4388: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4381: p_stream_tbl => l_stream_tbl,
4382: p_representation_type => p_representation_type); -- MGAAP 7263041
4383: -- store the highest degree of error
4384: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4385: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4386: -- need to leave
4387: Okl_Api.set_message(p_app_name => g_app_name,
4388: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4389: p_token1 => g_contract_number_token,
4383: -- store the highest degree of error
4384: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4385: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4386: -- need to leave
4387: Okl_Api.set_message(p_app_name => g_app_name,
4388: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4389: p_token1 => g_contract_number_token,
4390: p_token1_value => p_catchup_rec.contract_number);
4391: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4387: Okl_Api.set_message(p_app_name => g_app_name,
4388: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4389: p_token1 => g_contract_number_token,
4390: p_token1_value => p_catchup_rec.contract_number);
4391: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4392: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4393: Okl_Api.set_message(p_app_name => g_app_name,
4394: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4395: p_token1 => g_contract_number_token,
4388: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4389: p_token1 => g_contract_number_token,
4390: p_token1_value => p_catchup_rec.contract_number);
4391: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4392: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4393: Okl_Api.set_message(p_app_name => g_app_name,
4394: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4395: p_token1 => g_contract_number_token,
4396: p_token1_value => p_catchup_rec.contract_number);
4389: p_token1 => g_contract_number_token,
4390: p_token1_value => p_catchup_rec.contract_number);
4391: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4392: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4393: Okl_Api.set_message(p_app_name => g_app_name,
4394: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4395: p_token1 => g_contract_number_token,
4396: p_token1_value => p_catchup_rec.contract_number);
4397: RAISE OKL_API.G_EXCEPTION_ERROR;
4393: Okl_Api.set_message(p_app_name => g_app_name,
4394: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4395: p_token1 => g_contract_number_token,
4396: p_token1_value => p_catchup_rec.contract_number);
4397: RAISE OKL_API.G_EXCEPTION_ERROR;
4398: END IF;
4399: END IF;
4400:
4401: -- MGAAP start 7263041
4413:
4414: END LOOP;
4415: END IF; -- for IF x_tclv_tbl.COUNT > 0
4416:
4417: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
4418: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4419:
4420: EXCEPTION
4421:
4414: END LOOP;
4415: END IF; -- for IF x_tclv_tbl.COUNT > 0
4416:
4417: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
4418: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4419:
4420: EXCEPTION
4421:
4422: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4418: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
4419:
4420: EXCEPTION
4421:
4422: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4423: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4424: ,g_pkg_name
4425: ,'OKL_API.G_RET_STS_ERROR'
4426: ,x_msg_count
4419:
4420: EXCEPTION
4421:
4422: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4423: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4424: ,g_pkg_name
4425: ,'OKL_API.G_RET_STS_ERROR'
4426: ,x_msg_count
4427: ,x_msg_data
4421:
4422: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
4423: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4424: ,g_pkg_name
4425: ,'OKL_API.G_RET_STS_ERROR'
4426: ,x_msg_count
4427: ,x_msg_data
4428: ,'_PVT');
4429: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4425: ,'OKL_API.G_RET_STS_ERROR'
4426: ,x_msg_count
4427: ,x_msg_data
4428: ,'_PVT');
4429: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4430: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4431: ,g_pkg_name
4432: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4433: ,x_msg_count
4426: ,x_msg_count
4427: ,x_msg_data
4428: ,'_PVT');
4429: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4430: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4431: ,g_pkg_name
4432: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4433: ,x_msg_count
4434: ,x_msg_data
4428: ,'_PVT');
4429: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
4430: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
4431: ,g_pkg_name
4432: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
4433: ,x_msg_count
4434: ,x_msg_data
4435: ,'_PVT');
4436: WHEN OTHERS THEN
4433: ,x_msg_count
4434: ,x_msg_data
4435: ,'_PVT');
4436: WHEN OTHERS THEN
4437: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
4438: (l_api_name,
4439: G_PKG_NAME,
4440: 'OTHERS',
4441: x_msg_count,
4554:
4555: BEGIN
4556: -- Set save point
4557: WRITE_TO_LOG('Inside procedure CREATE_ACCRUALS_FORMULA');
4558: x_return_status := Okl_Api.START_ACTIVITY(l_api_name
4559: ,G_PKG_NAME
4560: ,p_init_msg_list
4561: ,l_api_version
4562: ,p_api_version
4562: ,p_api_version
4563: ,'_PVT'
4564: ,x_return_status);
4565:
4566: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4567: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4568: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4569: RAISE Okl_Api.G_EXCEPTION_ERROR;
4570: END IF;
4563: ,'_PVT'
4564: ,x_return_status);
4565:
4566: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4567: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4568: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4569: RAISE Okl_Api.G_EXCEPTION_ERROR;
4570: END IF;
4571:
4564: ,x_return_status);
4565:
4566: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4567: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4568: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4569: RAISE Okl_Api.G_EXCEPTION_ERROR;
4570: END IF;
4571:
4572: -- set tcn and tcl types.
4565:
4566: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4567: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
4568: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4569: RAISE Okl_Api.G_EXCEPTION_ERROR;
4570: END IF;
4571:
4572: -- set tcn and tcl types.
4573: IF p_accrual_rec.accrual_rule_yn = 'N' THEN
4600: WRITE_TO_LOG('x_fact_synd_code :'||l_fact_sync_code);
4601: WRITE_TO_LOG('x_inv_acct_code :'||l_inv_acct_code);
4602:
4603: -- store the highest degree of error
4604: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4605: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4606: -- need to leave
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4601: WRITE_TO_LOG('x_inv_acct_code :'||l_inv_acct_code);
4602:
4603: -- store the highest degree of error
4604: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4605: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4606: -- need to leave
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4603: -- store the highest degree of error
4604: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4605: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4606: -- need to leave
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4610: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4611: Okl_Api.set_message(p_app_name => g_app_name,
4605: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4606: -- need to leave
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4610: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4611: Okl_Api.set_message(p_app_name => g_app_name,
4612: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4613: RAISE OKL_API.G_EXCEPTION_ERROR;
4606: -- need to leave
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4610: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4611: Okl_Api.set_message(p_app_name => g_app_name,
4612: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4613: RAISE OKL_API.G_EXCEPTION_ERROR;
4614: END IF;
4607: Okl_Api.set_message(p_app_name => g_app_name,
4608: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4610: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4611: Okl_Api.set_message(p_app_name => g_app_name,
4612: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4613: RAISE OKL_API.G_EXCEPTION_ERROR;
4614: END IF;
4615: END IF;
4609: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4610: ELSIF (x_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
4611: Okl_Api.set_message(p_app_name => g_app_name,
4612: p_msg_name => 'OKL_ACC_SEC_PVT_ERROR');
4613: RAISE OKL_API.G_EXCEPTION_ERROR;
4614: END IF;
4615: END IF;
4616:
4617: -- determine number of transaction lines to create
4634: p_tmpl_identify_rec => l_tmpl_identify_rec,
4635: x_template_tbl => l_template_tbl,
4636: p_validity_date => p_accrual_rec.accrual_date);
4637: -- store the highest degree of error
4638: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4639: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4640: -- need to leave
4641: Okl_Api.set_message(p_app_name => g_app_name,
4642: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4635: x_template_tbl => l_template_tbl,
4636: p_validity_date => p_accrual_rec.accrual_date);
4637: -- store the highest degree of error
4638: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4639: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4640: -- need to leave
4641: Okl_Api.set_message(p_app_name => g_app_name,
4642: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4643: p_token1 => g_contract_number_token,
4637: -- store the highest degree of error
4638: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4639: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4640: -- need to leave
4641: Okl_Api.set_message(p_app_name => g_app_name,
4642: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4643: p_token1 => g_contract_number_token,
4644: p_token1_value => p_accrual_rec.contract_number);
4645: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4641: Okl_Api.set_message(p_app_name => g_app_name,
4642: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4643: p_token1 => g_contract_number_token,
4644: p_token1_value => p_accrual_rec.contract_number);
4645: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4646: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4647: Okl_Api.set_message(p_app_name => g_app_name,
4648: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4649: p_token1 => g_contract_number_token,
4642: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4643: p_token1 => g_contract_number_token,
4644: p_token1_value => p_accrual_rec.contract_number);
4645: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4646: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4647: Okl_Api.set_message(p_app_name => g_app_name,
4648: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4649: p_token1 => g_contract_number_token,
4650: p_token1_value => p_accrual_rec.contract_number);
4643: p_token1 => g_contract_number_token,
4644: p_token1_value => p_accrual_rec.contract_number);
4645: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4646: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4647: Okl_Api.set_message(p_app_name => g_app_name,
4648: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4649: p_token1 => g_contract_number_token,
4650: p_token1_value => p_accrual_rec.contract_number);
4651: RAISE OKL_API.G_EXCEPTION_ERROR;
4647: Okl_Api.set_message(p_app_name => g_app_name,
4648: p_msg_name => 'OKL_AGN_GET_TMPL_ERROR',
4649: p_token1 => g_contract_number_token,
4650: p_token1_value => p_accrual_rec.contract_number);
4651: RAISE OKL_API.G_EXCEPTION_ERROR;
4652: END IF;
4653: END IF;
4654: -- If templates are not found, then raise an error. Get_template_info will not return error.
4655: IF l_template_tbl.COUNT = 0 THEN
4652: END IF;
4653: END IF;
4654: -- If templates are not found, then raise an error. Get_template_info will not return error.
4655: IF l_template_tbl.COUNT = 0 THEN
4656: Okl_Api.set_message(p_app_name => g_app_name,
4657: p_msg_name => 'OKL_TMPL_NOT_FOUND');
4658: RAISE OKL_API.G_EXCEPTION_ERROR;
4659: ELSE
4660: -- Build the transaction record
4654: -- If templates are not found, then raise an error. Get_template_info will not return error.
4655: IF l_template_tbl.COUNT = 0 THEN
4656: Okl_Api.set_message(p_app_name => g_app_name,
4657: p_msg_name => 'OKL_TMPL_NOT_FOUND');
4658: RAISE OKL_API.G_EXCEPTION_ERROR;
4659: ELSE
4660: -- Build the transaction record
4661: --Added by dpsingh for LE Uptake
4662: l_legal_entity_id := OKL_LEGAL_ENTITY_UTIL.get_khr_le_id(p_accrual_rec.contract_id) ;
4662: l_legal_entity_id := OKL_LEGAL_ENTITY_UTIL.get_khr_le_id(p_accrual_rec.contract_id) ;
4663: IF l_legal_entity_id IS NOT NULL THEN
4664: l_tcnv_rec.legal_entity_id := l_legal_entity_id;
4665: ELSE
4666: Okl_Api.set_message(p_app_name => g_app_name,
4667: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
4668: p_token1 => 'CONTRACT_NUMBER',
4669: p_token1_value => p_accrual_rec.contract_number);
4670: RAISE OKL_API.G_EXCEPTION_ERROR;
4666: Okl_Api.set_message(p_app_name => g_app_name,
4667: p_msg_name => 'OKL_LE_NOT_EXIST_CNTRCT',
4668: p_token1 => 'CONTRACT_NUMBER',
4669: p_token1_value => p_accrual_rec.contract_number);
4670: RAISE OKL_API.G_EXCEPTION_ERROR;
4671: END IF;
4672:
4673: l_tcnv_rec.khr_id := p_accrual_rec.contract_id;
4674: l_tcnv_rec.pdt_id := p_accrual_rec.product_id;
4786: ,p_tclv_tbl => l_tclv_tbl
4787: ,x_tcnv_rec => x_tcnv_rec
4788: ,x_tclv_tbl => x_tclv_tbl );
4789: -- store the highest degree of error
4790: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4791: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4792: -- need to leave
4793: Okl_Api.set_message(p_app_name => g_app_name,
4794: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4787: ,x_tcnv_rec => x_tcnv_rec
4788: ,x_tclv_tbl => x_tclv_tbl );
4789: -- store the highest degree of error
4790: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4791: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4792: -- need to leave
4793: Okl_Api.set_message(p_app_name => g_app_name,
4794: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4795: p_token1 => g_contract_number_token,
4789: -- store the highest degree of error
4790: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4791: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4792: -- need to leave
4793: Okl_Api.set_message(p_app_name => g_app_name,
4794: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4795: p_token1 => g_contract_number_token,
4796: p_token1_value => p_accrual_rec.contract_number);
4797: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4793: Okl_Api.set_message(p_app_name => g_app_name,
4794: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4795: p_token1 => g_contract_number_token,
4796: p_token1_value => p_accrual_rec.contract_number);
4797: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4798: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4799: Okl_Api.set_message(p_app_name => g_app_name,
4800: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4801: p_token1 => g_contract_number_token,
4794: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4795: p_token1 => g_contract_number_token,
4796: p_token1_value => p_accrual_rec.contract_number);
4797: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4798: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4799: Okl_Api.set_message(p_app_name => g_app_name,
4800: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4801: p_token1 => g_contract_number_token,
4802: p_token1_value => p_accrual_rec.contract_number);
4795: p_token1 => g_contract_number_token,
4796: p_token1_value => p_accrual_rec.contract_number);
4797: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4798: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4799: Okl_Api.set_message(p_app_name => g_app_name,
4800: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4801: p_token1 => g_contract_number_token,
4802: p_token1_value => p_accrual_rec.contract_number);
4803: RAISE OKL_API.G_EXCEPTION_ERROR;
4799: Okl_Api.set_message(p_app_name => g_app_name,
4800: p_msg_name => 'OKL_AGN_TRX_CRE_ERROR',
4801: p_token1 => g_contract_number_token,
4802: p_token1_value => p_accrual_rec.contract_number);
4803: RAISE OKL_API.G_EXCEPTION_ERROR;
4804: END IF;
4805: END IF;
4806: l_ctxt_val_tbl := p_ctxt_val_tbl;
4807:
4810: p_contract_id => p_accrual_rec.contract_id,
4811: x_return_status => x_return_status,
4812: x_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
4813: --check for error
4814: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4815: Okl_Api.set_message(p_app_name => g_app_name,
4816: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
4817: p_token1 => g_contract_number_token,
4818: p_token1_value => p_accrual_rec.contract_number);
4811: x_return_status => x_return_status,
4812: x_acc_gen_primary_key_tbl => l_acc_gen_primary_key_tbl);
4813: --check for error
4814: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4815: Okl_Api.set_message(p_app_name => g_app_name,
4816: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
4817: p_token1 => g_contract_number_token,
4818: p_token1_value => p_accrual_rec.contract_number);
4819: RAISE OKL_API.G_EXCEPTION_ERROR;
4815: Okl_Api.set_message(p_app_name => g_app_name,
4816: p_msg_name => 'OKL_AGN_ACC_GEN_ERROR',
4817: p_token1 => g_contract_number_token,
4818: p_token1_value => p_accrual_rec.contract_number);
4819: RAISE OKL_API.G_EXCEPTION_ERROR;
4820: END IF;
4821:
4822: --START: Changes by nikshah 21-Feb-2007 for SLA Uptake, Bug #5707866
4823: l_tcn_id := x_tcnv_rec.id;
4899: x_amount_tbl => l_amount_out_tbl,
4900: p_trx_header_id => l_tcn_id);
4901:
4902: -- store the highest degree of error
4903: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4904: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4905: -- need to leave
4906: Okl_Api.set_message(p_app_name => g_app_name,
4907: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4900: p_trx_header_id => l_tcn_id);
4901:
4902: -- store the highest degree of error
4903: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4904: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4905: -- need to leave
4906: Okl_Api.set_message(p_app_name => g_app_name,
4907: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4908: p_token1 => g_contract_number_token,
4902: -- store the highest degree of error
4903: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4904: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4905: -- need to leave
4906: Okl_Api.set_message(p_app_name => g_app_name,
4907: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4908: p_token1 => g_contract_number_token,
4909: p_token1_value => p_accrual_rec.contract_number);
4910: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4906: Okl_Api.set_message(p_app_name => g_app_name,
4907: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4908: p_token1 => g_contract_number_token,
4909: p_token1_value => p_accrual_rec.contract_number);
4910: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4911: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4912: -- record that there was an error
4913: Okl_Api.set_message(p_app_name => g_app_name,
4914: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4907: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4908: p_token1 => g_contract_number_token,
4909: p_token1_value => p_accrual_rec.contract_number);
4910: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4911: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4912: -- record that there was an error
4913: Okl_Api.set_message(p_app_name => g_app_name,
4914: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4915: p_token1 => g_contract_number_token,
4909: p_token1_value => p_accrual_rec.contract_number);
4910: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4911: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4912: -- record that there was an error
4913: Okl_Api.set_message(p_app_name => g_app_name,
4914: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4915: p_token1 => g_contract_number_token,
4916: p_token1_value => p_accrual_rec.contract_number);
4917: RAISE OKL_API.G_EXCEPTION_ERROR;
4913: Okl_Api.set_message(p_app_name => g_app_name,
4914: p_msg_name => 'OKL_AGN_CRE_DIST_ERROR',
4915: p_token1 => g_contract_number_token,
4916: p_token1_value => p_accrual_rec.contract_number);
4917: RAISE OKL_API.G_EXCEPTION_ERROR;
4918: END IF;
4919: END IF;
4920:
4921: IF l_template_out_tbl.COUNT > 0 THEN
4922: FOR i IN l_template_out_tbl.FIRST..l_template_out_tbl.LAST
4923: LOOP
4924: -- verify template tbl count with amount tbl count
4925: IF l_template_out_tbl(i).template_tbl.COUNT <> l_amount_out_tbl(i).amount_tbl.COUNT THEN
4926: Okl_Api.set_message(p_app_name => g_app_name,
4927: p_msg_name => 'OKL_AGN_TMP_AMTCOUNT_MISMATCH');
4928: RAISE OKL_API.G_EXCEPTION_ERROR;
4929: END IF;
4930: END LOOP;
4924: -- verify template tbl count with amount tbl count
4925: IF l_template_out_tbl(i).template_tbl.COUNT <> l_amount_out_tbl(i).amount_tbl.COUNT THEN
4926: Okl_Api.set_message(p_app_name => g_app_name,
4927: p_msg_name => 'OKL_AGN_TMP_AMTCOUNT_MISMATCH');
4928: RAISE OKL_API.G_EXCEPTION_ERROR;
4929: END IF;
4930: END LOOP;
4931: END IF;
4932: --END: Changes by nikshah 21-Feb-2007 for SLA Uptake, Bug #5707866
4964: ,x_tcnv_rec => x_tcnv_rec
4965: ,x_tclv_tbl => x_tclv_tbl );
4966: WRITE_TO_LOG('Return Status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts is '||x_return_status);
4967: -- store the highest degree of error
4968: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4969: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4970: -- need to leave
4971: Okl_Api.set_message(p_app_name => g_app_name,
4972: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4965: ,x_tclv_tbl => x_tclv_tbl );
4966: WRITE_TO_LOG('Return Status after the call to Okl_Trx_Contracts_Pub.update_trx_contracts is '||x_return_status);
4967: -- store the highest degree of error
4968: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4969: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4970: -- need to leave
4971: Okl_Api.set_message(p_app_name => g_app_name,
4972: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4973: p_token1 => g_contract_number_token,
4967: -- store the highest degree of error
4968: IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
4969: IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
4970: -- need to leave
4971: Okl_Api.set_message(p_app_name => g_app_name,
4972: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4973: p_token1 => g_contract_number_token,
4974: p_token1_value => p_accrual_rec.contract_number);
4975: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4971: Okl_Api.set_message(p_app_name => g_app_name,
4972: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4973: p_token1 => g_contract_number_token,
4974: p_token1_value => p_accrual_rec.contract_number);
4975: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4976: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4977: Okl_Api.set_message(p_app_name => g_app_name,
4978: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4979: p_token1 => g_contract_number_token,
4972: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4973: p_token1 => g_contract_number_token,
4974: p_token1_value => p_accrual_rec.contract_number);
4975: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4976: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4977: Okl_Api.set_message(p_app_name => g_app_name,
4978: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4979: p_token1 => g_contract_number_token,
4980: p_token1_value => p_accrual_rec.contract_number);
4973: p_token1 => g_contract_number_token,
4974: p_token1_value => p_accrual_rec.contract_number);
4975: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
4976: ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
4977: Okl_Api.set_message(p_app_name => g_app_name,
4978: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4979: p_token1 => g_contract_number_token,
4980: p_token1_value => p_accrual_rec.contract_number);
4981: RAISE OKL_API.G_EXCEPTION_ERROR;
4977: Okl_Api.set_message(p_app_name => g_app_name,
4978: p_msg_name => 'OKL_AGN_TRX_UPD_ERROR',
4979: p_token1 => g_contract_number_token,
4980: p_token1_value => p_accrual_rec.contract_number);
4981: RAISE OKL_API.G_EXCEPTION_ERROR;
4982: END IF;
4983: END IF;
4984: -- Modified by kthiruva on 16-Jul-2007 as part of SLA Uptake Impact.
4985: -- Else portion of the condition removed as part of Bug 6137099. When the amount returned by the accounting engine
5000: -- ,p_init_msg_list => p_init_msg_list
5001: -- ,x_return_status => x_return_status
5002: -- ,x_msg_count => x_msg_count
5003: -- ,x_msg_data => x_msg_data
5004: -- ,p_restricted_update => 'OKL_API.G_TRUE'
5005: -- ,p_chrv_rec => l_chrv_rec
5006: -- ,p_khrv_rec => l_khrv_rec
5007: -- ,x_chrv_rec => x_chrv_rec
5008: -- ,x_khrv_rec => x_khrv_rec );
5006: -- ,p_khrv_rec => l_khrv_rec
5007: -- ,x_chrv_rec => x_chrv_rec
5008: -- ,x_khrv_rec => x_khrv_rec );
5009: -- -- store the highest degree of error
5010: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5011: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5012: -- -- need to leave
5013: -- Okl_Api.set_message(p_app_name => g_app_name,
5014: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5007: -- ,x_chrv_rec => x_chrv_rec
5008: -- ,x_khrv_rec => x_khrv_rec );
5009: -- -- store the highest degree of error
5010: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5011: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5012: -- -- need to leave
5013: -- Okl_Api.set_message(p_app_name => g_app_name,
5014: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5015: -- p_token1 => g_contract_number_token,
5009: -- -- store the highest degree of error
5010: -- IF (x_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5011: -- IF (x_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5012: -- -- need to leave
5013: -- Okl_Api.set_message(p_app_name => g_app_name,
5014: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5015: -- p_token1 => g_contract_number_token,
5016: -- p_token1_value => p_accrual_rec.contract_number);
5017: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5013: -- Okl_Api.set_message(p_app_name => g_app_name,
5014: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5015: -- p_token1 => g_contract_number_token,
5016: -- p_token1_value => p_accrual_rec.contract_number);
5017: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5018: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5019: -- -- record that there was an error
5020: -- Okl_Api.set_message(p_app_name => g_app_name,
5021: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5014: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5015: -- p_token1 => g_contract_number_token,
5016: -- p_token1_value => p_accrual_rec.contract_number);
5017: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5018: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5019: -- -- record that there was an error
5020: -- Okl_Api.set_message(p_app_name => g_app_name,
5021: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5022: -- p_token1 => g_contract_number_token,
5016: -- p_token1_value => p_accrual_rec.contract_number);
5017: -- RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5018: -- ELSIF (x_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5019: -- -- record that there was an error
5020: -- Okl_Api.set_message(p_app_name => g_app_name,
5021: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5022: -- p_token1 => g_contract_number_token,
5023: -- p_token1_value => p_accrual_rec.contract_number);
5024: -- RAISE OKL_API.G_EXCEPTION_ERROR;
5020: -- Okl_Api.set_message(p_app_name => g_app_name,
5021: -- p_msg_name => 'OKL_AGN_KHR_UPD_ERROR',
5022: -- p_token1 => g_contract_number_token,
5023: -- p_token1_value => p_accrual_rec.contract_number);
5024: -- RAISE OKL_API.G_EXCEPTION_ERROR;
5025: -- END IF;
5026: -- END IF;
5027:
5028: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5024: -- RAISE OKL_API.G_EXCEPTION_ERROR;
5025: -- END IF;
5026: -- END IF;
5027:
5028: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5029: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5030:
5031: END IF; -- For l_template_tbl.COUNT > 0
5032:
5025: -- END IF;
5026: -- END IF;
5027:
5028: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5029: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5030:
5031: END IF; -- For l_template_tbl.COUNT > 0
5032:
5033: EXCEPTION
5030:
5031: END IF; -- For l_template_tbl.COUNT > 0
5032:
5033: EXCEPTION
5034: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5035: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5036: ,g_pkg_name
5037: ,'OKL_API.G_RET_STS_ERROR'
5038: ,x_msg_count
5031: END IF; -- For l_template_tbl.COUNT > 0
5032:
5033: EXCEPTION
5034: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5035: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5036: ,g_pkg_name
5037: ,'OKL_API.G_RET_STS_ERROR'
5038: ,x_msg_count
5039: ,x_msg_data
5033: EXCEPTION
5034: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5035: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5036: ,g_pkg_name
5037: ,'OKL_API.G_RET_STS_ERROR'
5038: ,x_msg_count
5039: ,x_msg_data
5040: ,'_PVT');
5041: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5037: ,'OKL_API.G_RET_STS_ERROR'
5038: ,x_msg_count
5039: ,x_msg_data
5040: ,'_PVT');
5041: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5042: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5043: ,g_pkg_name
5044: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5045: ,x_msg_count
5038: ,x_msg_count
5039: ,x_msg_data
5040: ,'_PVT');
5041: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5042: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5043: ,g_pkg_name
5044: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5045: ,x_msg_count
5046: ,x_msg_data
5040: ,'_PVT');
5041: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5042: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5043: ,g_pkg_name
5044: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5045: ,x_msg_count
5046: ,x_msg_data
5047: ,'_PVT');
5048: WHEN OTHERS THEN
5045: ,x_msg_count
5046: ,x_msg_data
5047: ,'_PVT');
5048: WHEN OTHERS THEN
5049: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
5050: (l_api_name,
5051: G_PKG_NAME,
5052: 'OTHERS',
5053: x_msg_count,
5076: l_cblv_rec OKL_CONTRACT_BALANCES_PVT.okl_cblv_rec;
5077: x_cblv_rec OKL_CONTRACT_BALANCES_PVT.okl_cblv_rec;
5078: l_api_version CONSTANT NUMBER := 1.0;
5079: l_api_name CONSTANT VARCHAR2(30) := 'UPDATE_BALANCES';
5080: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
5081: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
5082: l_msg_count NUMBER;
5083: l_msg_data VARCHAR2(2000);
5084:
5077: x_cblv_rec OKL_CONTRACT_BALANCES_PVT.okl_cblv_rec;
5078: l_api_version CONSTANT NUMBER := 1.0;
5079: l_api_name CONSTANT VARCHAR2(30) := 'UPDATE_BALANCES';
5080: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
5081: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
5082: l_msg_count NUMBER;
5083: l_msg_data VARCHAR2(2000);
5084:
5085:
5084:
5085:
5086: BEGIN
5087: -- Set save point
5088: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
5089: ,G_PKG_NAME
5090: ,l_init_msg_list
5091: ,l_api_version
5092: ,l_api_version
5092: ,l_api_version
5093: ,'_PVT'
5094: ,l_return_status);
5095:
5096: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5097: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5098: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5099: RAISE Okl_Api.G_EXCEPTION_ERROR;
5100: END IF;
5093: ,'_PVT'
5094: ,l_return_status);
5095:
5096: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5097: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5098: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5099: RAISE Okl_Api.G_EXCEPTION_ERROR;
5100: END IF;
5101:
5094: ,l_return_status);
5095:
5096: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5097: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5098: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5099: RAISE Okl_Api.G_EXCEPTION_ERROR;
5100: END IF;
5101:
5102: OPEN get_balances_id_csr(p_khr_id);
5095:
5096: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5097: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5098: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5099: RAISE Okl_Api.G_EXCEPTION_ERROR;
5100: END IF;
5101:
5102: OPEN get_balances_id_csr(p_khr_id);
5103: FETCH get_balances_id_csr INTO l_balances_id;
5118: , p_cblv_rec => l_cblv_rec
5119: , x_cblv_rec => x_cblv_rec);
5120:
5121: -- store the highest degree of error
5122: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5123: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5124: -- need to leave
5125: Okl_Api.set_message(p_app_name => g_app_name,
5126: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5119: , x_cblv_rec => x_cblv_rec);
5120:
5121: -- store the highest degree of error
5122: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5123: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5124: -- need to leave
5125: Okl_Api.set_message(p_app_name => g_app_name,
5126: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5127: p_token1 => g_contract_number_token,
5121: -- store the highest degree of error
5122: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5123: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5124: -- need to leave
5125: Okl_Api.set_message(p_app_name => g_app_name,
5126: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5127: p_token1 => g_contract_number_token,
5128: p_token1_value => p_khr_number);
5129: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5125: Okl_Api.set_message(p_app_name => g_app_name,
5126: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5127: p_token1 => g_contract_number_token,
5128: p_token1_value => p_khr_number);
5129: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5130: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5131: Okl_Api.set_message(p_app_name => g_app_name,
5132: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5133: p_token1 => g_contract_number_token,
5126: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5127: p_token1 => g_contract_number_token,
5128: p_token1_value => p_khr_number);
5129: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5130: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5131: Okl_Api.set_message(p_app_name => g_app_name,
5132: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5133: p_token1 => g_contract_number_token,
5134: p_token1_value => p_khr_number);
5127: p_token1 => g_contract_number_token,
5128: p_token1_value => p_khr_number);
5129: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5130: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5131: Okl_Api.set_message(p_app_name => g_app_name,
5132: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5133: p_token1 => g_contract_number_token,
5134: p_token1_value => p_khr_number);
5135: RAISE OKL_API.G_EXCEPTION_ERROR;
5131: Okl_Api.set_message(p_app_name => g_app_name,
5132: p_msg_name => 'OKL_AGN_UPD_BAL_ERROR',
5133: p_token1 => g_contract_number_token,
5134: p_token1_value => p_khr_number);
5135: RAISE OKL_API.G_EXCEPTION_ERROR;
5136: END IF;
5137: END IF;
5138: ELSE
5139: OKL_CONTRACT_BALANCES_PVT.create_contract_balance(
5144: , x_msg_data => l_msg_data
5145: , p_cblv_rec => l_cblv_rec
5146: , x_cblv_rec => x_cblv_rec);
5147: -- store the highest degree of error
5148: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5149: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5150: -- need to leave
5151: Okl_Api.set_message(p_app_name => g_app_name,
5152: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5145: , p_cblv_rec => l_cblv_rec
5146: , x_cblv_rec => x_cblv_rec);
5147: -- store the highest degree of error
5148: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5149: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5150: -- need to leave
5151: Okl_Api.set_message(p_app_name => g_app_name,
5152: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5153: p_token1 => g_contract_number_token,
5147: -- store the highest degree of error
5148: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5149: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5150: -- need to leave
5151: Okl_Api.set_message(p_app_name => g_app_name,
5152: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5153: p_token1 => g_contract_number_token,
5154: p_token1_value => p_khr_number);
5155: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5151: Okl_Api.set_message(p_app_name => g_app_name,
5152: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5153: p_token1 => g_contract_number_token,
5154: p_token1_value => p_khr_number);
5155: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5156: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5157: Okl_Api.set_message(p_app_name => g_app_name,
5158: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5159: p_token1 => g_contract_number_token,
5152: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5153: p_token1 => g_contract_number_token,
5154: p_token1_value => p_khr_number);
5155: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5156: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5157: Okl_Api.set_message(p_app_name => g_app_name,
5158: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5159: p_token1 => g_contract_number_token,
5160: p_token1_value => p_khr_number);
5153: p_token1 => g_contract_number_token,
5154: p_token1_value => p_khr_number);
5155: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5156: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
5157: Okl_Api.set_message(p_app_name => g_app_name,
5158: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5159: p_token1 => g_contract_number_token,
5160: p_token1_value => p_khr_number);
5161: RAISE OKL_API.G_EXCEPTION_ERROR;
5157: Okl_Api.set_message(p_app_name => g_app_name,
5158: p_msg_name => 'OKL_AGN_CRE_BAL_ERROR',
5159: p_token1 => g_contract_number_token,
5160: p_token1_value => p_khr_number);
5161: RAISE OKL_API.G_EXCEPTION_ERROR;
5162: END IF;
5163: END IF;
5164: END IF;
5165: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5161: RAISE OKL_API.G_EXCEPTION_ERROR;
5162: END IF;
5163: END IF;
5164: END IF;
5165: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5166: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5167:
5168: EXCEPTION
5169: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5162: END IF;
5163: END IF;
5164: END IF;
5165: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5166: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5167:
5168: EXCEPTION
5169: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5170: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5165: Okl_Api.END_ACTIVITY(x_msg_count, x_msg_data);
5166: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5167:
5168: EXCEPTION
5169: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5170: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5171: ,g_pkg_name
5172: ,'OKL_API.G_RET_STS_ERROR'
5173: ,x_msg_count
5166: x_return_status := Okl_Api.G_RET_STS_SUCCESS;
5167:
5168: EXCEPTION
5169: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5170: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5171: ,g_pkg_name
5172: ,'OKL_API.G_RET_STS_ERROR'
5173: ,x_msg_count
5174: ,x_msg_data
5168: EXCEPTION
5169: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
5170: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5171: ,g_pkg_name
5172: ,'OKL_API.G_RET_STS_ERROR'
5173: ,x_msg_count
5174: ,x_msg_data
5175: ,'_PVT');
5176:
5173: ,x_msg_count
5174: ,x_msg_data
5175: ,'_PVT');
5176:
5177: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5178: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5179: ,g_pkg_name
5180: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5181: ,x_msg_count
5174: ,x_msg_data
5175: ,'_PVT');
5176:
5177: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5178: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5179: ,g_pkg_name
5180: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5181: ,x_msg_count
5182: ,x_msg_data
5176:
5177: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
5178: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
5179: ,g_pkg_name
5180: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
5181: ,x_msg_count
5182: ,x_msg_data
5183: ,'_PVT');
5184:
5187: IF get_balances_id_csr%ISOPEN THEN
5188: CLOSE get_balances_id_csr;
5189: END IF;
5190:
5191: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
5192: (l_api_name,
5193: G_PKG_NAME,
5194: 'OTHERS',
5195: x_msg_count,
5230: l_sob_name VARCHAR2(2000);
5231: l_sysdate DATE := SYSDATE;
5232: l_api_version CONSTANT NUMBER := 1.0;
5233: l_api_name CONSTANT VARCHAR2(30) := 'PROCESS_ACCRUALS';
5234: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
5235: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
5236: l_msg_count NUMBER;
5237: l_msg_data VARCHAR2(2000);
5238: l_period_name VARCHAR2(2000);
5231: l_sysdate DATE := SYSDATE;
5232: l_api_version CONSTANT NUMBER := 1.0;
5233: l_api_name CONSTANT VARCHAR2(30) := 'PROCESS_ACCRUALS';
5234: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
5235: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
5236: l_msg_count NUMBER;
5237: l_msg_data VARCHAR2(2000);
5238: l_period_name VARCHAR2(2000);
5239: l_period_start_date DATE;
5416: BEGIN
5417: WRITE_TO_LOG('');
5418: WRITE_TO_LOG('Inside procedure PROCESS_ACCRUALS');
5419: -- Set save point
5420: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
5421: ,G_PKG_NAME
5422: ,l_init_msg_list
5423: ,l_api_version
5424: ,p_api_version
5424: ,p_api_version
5425: ,'_PVT'
5426: ,l_return_status);
5427:
5428: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5429: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5430: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Unexpected error in Start Activity');
5431: END IF;
5432: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5428: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5429: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5430: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Unexpected error in Start Activity');
5431: END IF;
5432: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5433: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5434: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5435: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error in Start Activity');
5436: END IF;
5429: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5430: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Unexpected error in Start Activity');
5431: END IF;
5432: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5433: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5434: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5435: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error in Start Activity');
5436: END IF;
5437: RAISE Okl_Api.G_EXCEPTION_ERROR;
5433: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5434: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5435: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error in Start Activity');
5436: END IF;
5437: RAISE Okl_Api.G_EXCEPTION_ERROR;
5438: END IF;
5439:
5440: l_contract_id := p_process_accrual_rec.contract_id;
5441: l_contract_number := p_process_accrual_rec.contract_number;
5461: -- Check contract currency against functional currency
5462: IF l_func_currency_code <> l_khr_currency_code THEN
5463: --validate data
5464: IF l_currency_conv_type IS NULL THEN
5465: Okl_Api.set_message(p_app_name => g_app_name,
5466: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
5467: p_token1 => g_contract_number_token,
5468: p_token1_value => l_contract_number);
5469: RAISE Okl_Api.G_EXCEPTION_ERROR;
5465: Okl_Api.set_message(p_app_name => g_app_name,
5466: p_msg_name => 'OKL_AGN_CURR_TYPE_ERROR',
5467: p_token1 => g_contract_number_token,
5468: p_token1_value => l_contract_number);
5469: RAISE Okl_Api.G_EXCEPTION_ERROR;
5470: END IF;
5471: IF l_currency_conv_date IS NULL THEN
5472: Okl_Api.set_message(p_app_name => g_app_name,
5473: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
5468: p_token1_value => l_contract_number);
5469: RAISE Okl_Api.G_EXCEPTION_ERROR;
5470: END IF;
5471: IF l_currency_conv_date IS NULL THEN
5472: Okl_Api.set_message(p_app_name => g_app_name,
5473: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
5474: p_token1 => g_contract_number_token,
5475: p_token1_value => l_contract_number);
5476: RAISE Okl_Api.G_EXCEPTION_ERROR;
5472: Okl_Api.set_message(p_app_name => g_app_name,
5473: p_msg_name => 'OKL_AGN_CURR_DATE_ERROR',
5474: p_token1 => g_contract_number_token,
5475: p_token1_value => l_contract_number);
5476: RAISE Okl_Api.G_EXCEPTION_ERROR;
5477: END IF;
5478: IF l_currency_conv_type = 'User' THEN
5479: IF l_currency_conv_rate IS NULL THEN
5480: Okl_Api.set_message(p_app_name => g_app_name,
5476: RAISE Okl_Api.G_EXCEPTION_ERROR;
5477: END IF;
5478: IF l_currency_conv_type = 'User' THEN
5479: IF l_currency_conv_rate IS NULL THEN
5480: Okl_Api.set_message(p_app_name => g_app_name,
5481: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
5482: p_token1 => g_contract_number_token,
5483: p_token1_value => l_contract_number);
5484: RAISE Okl_Api.G_EXCEPTION_ERROR;
5480: Okl_Api.set_message(p_app_name => g_app_name,
5481: p_msg_name => 'OKL_AGN_CURR_USER_RATE_ERROR',
5482: p_token1 => g_contract_number_token,
5483: p_token1_value => l_contract_number);
5484: RAISE Okl_Api.G_EXCEPTION_ERROR;
5485: END IF;
5486: ELSE
5487: --Bug 3875747
5488: -- Use util to identify rate and not own query
5491: p_con_date => l_accrual_date, -- Bug#5410825
5492: p_con_type => l_currency_conv_type);
5493:
5494: IF l_currency_conv_rate IS NULL THEN
5495: Okl_Api.set_message(p_app_name => g_app_name,
5496: p_msg_name => 'OKL_AGN_CURR_RATE_ERROR',
5497: p_token1 => 'CONVERSION_TYPE',
5498: p_token1_value => l_currency_conv_type,
5499: p_token2 => 'FROM_CURRENCY',
5500: p_token2_value => l_khr_currency_code,
5501: p_token3 => 'TO_CURRENCY',
5502: p_token3_value => l_func_currency_code
5503: );
5504: RAISE Okl_Api.G_EXCEPTION_ERROR;
5505: END IF;
5506: l_currency_conv_date := l_accrual_date; --Bug 5410825
5507: END IF;
5508: END IF;
5512: -- OPEN billing_rule_csr(l_contract_id);
5513: -- FETCH billing_rule_csr INTO l_billing_rule_csr_v;
5514: -- IF billing_rule_csr%NOTFOUND THEN
5515: -- CLOSE billing_rule_csr;
5516: -- Okl_Api.set_message(p_app_name => g_app_name,
5517: -- p_msg_name => 'OKL_AGN_BILLING_RULE_ERROR',
5518: -- p_token1 => g_contract_number_token,
5519: -- p_token1_value => l_contract_number);
5520: -- RAISE G_EXCEPTION_HALT_VALIDATION;
5524: -- ELSIF l_billing_rule_csr_v.object1_id1 = '-2' THEN
5525: -- l_billing_type := 'ADVANCE';
5526: -- ELSE
5527: -- -- store SQL error message on message stack for caller
5528: -- Okl_Api.set_message(p_app_name => g_app_name,
5529: -- p_msg_name => 'OKL_AGN_INVALID_BILLING_RULE',
5530: -- p_token1 => g_contract_number_token,
5531: -- p_token1_value => l_contract_number);
5532: -- RAISE G_EXCEPTION_HALT_VALIDATION;
5546: -- --IF interest_rule_csr%NOTFOUND THEN
5547: -- -- commenting for bug# 2451627
5548: -- --CLOSE interest_rule_csr;
5549: -- ---- store SQL error message on message stack for caller
5550: -- --Okl_Api.set_message(p_app_name => g_app_name,
5551: -- -- p_msg_name => 'OKL_AGN_INT_RULE_ERROR',
5552: -- -- p_token1 => g_contract_number_token,
5553: -- -- p_token1_value => l_contract_number);
5554: -- --RAISE G_EXCEPTION_HALT_VALIDATION;
5612: WRITE_TO_LOG('Org Name :'||G_org_name);
5613: WRITE_TO_LOG('Accrual Rev Days :'||G_accrual_reversal_days);
5614: WRITE_TO_LOG('Func Currency Code:'||G_func_currency_code_rep);
5615:
5616: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5617: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5613: WRITE_TO_LOG('Accrual Rev Days :'||G_accrual_reversal_days);
5614: WRITE_TO_LOG('Func Currency Code:'||G_func_currency_code_rep);
5615:
5616: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5617: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5614: WRITE_TO_LOG('Func Currency Code:'||G_func_currency_code_rep);
5615:
5616: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5617: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5622: Okl_Api.set_message(p_app_name => g_app_name,
5616: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5617: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5622: Okl_Api.set_message(p_app_name => g_app_name,
5623: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5624: RAISE OKL_API.G_EXCEPTION_ERROR;
5617: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5622: Okl_Api.set_message(p_app_name => g_app_name,
5623: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5624: RAISE OKL_API.G_EXCEPTION_ERROR;
5625: END IF;
5618: Okl_Api.set_message(p_app_name => g_app_name,
5619: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5622: Okl_Api.set_message(p_app_name => g_app_name,
5623: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5624: RAISE OKL_API.G_EXCEPTION_ERROR;
5625: END IF;
5626: END IF;
5620: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5621: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5622: Okl_Api.set_message(p_app_name => g_app_name,
5623: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
5624: RAISE OKL_API.G_EXCEPTION_ERROR;
5625: END IF;
5626: END IF;
5627: END IF;
5628:
5636: CLOSE last_status_csr;
5637:
5638: IF l_previous_accrual_status IS NULL THEN
5639: -- Bug 2852781
5640: Okl_Api.set_message(p_app_name => g_app_name,
5641: p_msg_name => 'OKL_AGN_LAST_STATUS_ERROR',
5642: p_token1 => g_contract_number_token,
5643: p_token1_value => l_contract_number);
5644: RAISE Okl_Api.G_EXCEPTION_ERROR;
5640: Okl_Api.set_message(p_app_name => g_app_name,
5641: p_msg_name => 'OKL_AGN_LAST_STATUS_ERROR',
5642: p_token1 => g_contract_number_token,
5643: p_token1_value => l_contract_number);
5644: RAISE Okl_Api.G_EXCEPTION_ERROR;
5645: END IF;
5646: IF l_previous_override_status IS NULL THEN
5647: -- Bug 2852781
5648: Okl_Api.set_message(p_app_name => g_app_name,
5644: RAISE Okl_Api.G_EXCEPTION_ERROR;
5645: END IF;
5646: IF l_previous_override_status IS NULL THEN
5647: -- Bug 2852781
5648: Okl_Api.set_message(p_app_name => g_app_name,
5649: p_msg_name => 'OKL_AGN_LAST_STATUS_ERROR',
5650: p_token1 => g_contract_number_token,
5651: p_token1_value => l_contract_number);
5652: RAISE Okl_Api.G_EXCEPTION_ERROR;
5648: Okl_Api.set_message(p_app_name => g_app_name,
5649: p_msg_name => 'OKL_AGN_LAST_STATUS_ERROR',
5650: p_token1 => g_contract_number_token,
5651: p_token1_value => l_contract_number);
5652: RAISE Okl_Api.G_EXCEPTION_ERROR;
5653: END IF;
5654: ELSE
5655: -- No accrual activity. First run. So assign values from contract header.
5656: l_previous_accrual_status := l_accrual_status;
5659:
5660:
5661: -- -- Check if contract is syndicated
5662: -- l_return_status := GET_SYNDICATE_FLAG(l_contract_id,l_syndication_flag);
5663: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5664: -- Okl_Api.set_message(p_app_name => g_app_name,
5665: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5666: -- p_token1 => g_contract_number_token,
5667: -- p_token1_value => l_contract_number);
5660:
5661: -- -- Check if contract is syndicated
5662: -- l_return_status := GET_SYNDICATE_FLAG(l_contract_id,l_syndication_flag);
5663: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5664: -- Okl_Api.set_message(p_app_name => g_app_name,
5665: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5666: -- p_token1 => g_contract_number_token,
5667: -- p_token1_value => l_contract_number);
5668: -- RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5664: -- Okl_Api.set_message(p_app_name => g_app_name,
5665: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5666: -- p_token1 => g_contract_number_token,
5667: -- p_token1_value => l_contract_number);
5668: -- RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5669: -- END IF;
5670: --
5671: -- IF l_syndication_flag = 'Y' THEN
5672: -- l_factoring_synd_flag := 'SYNDICATION';
5672: -- l_factoring_synd_flag := 'SYNDICATION';
5673: -- ELSE
5674: -- -- check if contract is factored
5675: -- l_return_status := GET_FACTORING_FLAG(l_contract_id,l_factoring_flag);
5676: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5677: -- Okl_Api.set_message(p_app_name => g_app_name,
5678: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5679: -- p_token1 => g_contract_number_token,
5680: -- p_token1_value => l_contract_number);
5673: -- ELSE
5674: -- -- check if contract is factored
5675: -- l_return_status := GET_FACTORING_FLAG(l_contract_id,l_factoring_flag);
5676: -- IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5677: -- Okl_Api.set_message(p_app_name => g_app_name,
5678: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5679: -- p_token1 => g_contract_number_token,
5680: -- p_token1_value => l_contract_number);
5681: -- RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5677: -- Okl_Api.set_message(p_app_name => g_app_name,
5678: -- p_msg_name => 'OKL_AGN_FAC_SYND_ERROR',
5679: -- p_token1 => g_contract_number_token,
5680: -- p_token1_value => l_contract_number);
5681: -- RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5682: -- END IF;
5683: -- IF l_factoring_flag = 'Y' THEN
5684: -- l_factoring_synd_flag := 'FACTORING';
5685: -- END IF;
5689: VALIDATE_ACCRUAL_RULE(x_return_status => l_return_status
5690: ,x_result => l_rule_result
5691: ,p_ctr_id => l_contract_id);
5692: -- store the highest degree of error
5693: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5694: Okl_Api.set_message(p_app_name => g_app_name,
5695: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
5696: p_token1 => g_contract_number_token,
5697: p_token1_value => l_contract_number);
5690: ,x_result => l_rule_result
5691: ,p_ctr_id => l_contract_id);
5692: -- store the highest degree of error
5693: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5694: Okl_Api.set_message(p_app_name => g_app_name,
5695: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
5696: p_token1 => g_contract_number_token,
5697: p_token1_value => l_contract_number);
5698: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5694: Okl_Api.set_message(p_app_name => g_app_name,
5695: p_msg_name => 'OKL_AGN_RULE_VALD_ERROR',
5696: p_token1 => g_contract_number_token,
5697: p_token1_value => l_contract_number);
5698: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
5699: END IF;
5700:
5701: --
5702: -- Commenting for variable rate project. basis has changed.
5712: ,p_ctr_start_date => l_start_date
5713: ,p_period_end_date => l_period_end_date
5714: ,p_accrual_rule_yn => 'ACRL_WITH_RULE');
5715: -- store the highest degree of error
5716: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5717: Okl_Api.set_message(p_app_name => g_app_name,
5718: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5719: p_token1 => g_contract_number_token,
5720: p_token1_value => l_contract_number);
5713: ,p_period_end_date => l_period_end_date
5714: ,p_accrual_rule_yn => 'ACRL_WITH_RULE');
5715: -- store the highest degree of error
5716: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5717: Okl_Api.set_message(p_app_name => g_app_name,
5718: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5719: p_token1 => g_contract_number_token,
5720: p_token1_value => l_contract_number);
5721: RAISE OKL_API.G_EXCEPTION_ERROR;
5717: Okl_Api.set_message(p_app_name => g_app_name,
5718: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5719: p_token1 => g_contract_number_token,
5720: p_token1_value => l_contract_number);
5721: RAISE OKL_API.G_EXCEPTION_ERROR;
5722: END IF;
5723:
5724: WRITE_TO_LOG('The count of stream elements that need to be accrued for PRIMARY is :'||l_stream_tbl.COUNT);
5725: IF (l_stream_tbl.COUNT = 0)
5738: ,p_period_end_date => G_PERIOD_END_DATE_REP
5739: ,p_accrual_rule_yn => 'ACRL_WITH_RULE');
5740: OKL_STREAMS_SEC_PVT.RESET_REPO_STREAMS;
5741: -- store the highest degree of error
5742: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5743: Okl_Api.set_message(p_app_name => g_app_name,
5744: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5745: p_token1 => g_contract_number_token,
5746: p_token1_value => l_contract_number);
5739: ,p_accrual_rule_yn => 'ACRL_WITH_RULE');
5740: OKL_STREAMS_SEC_PVT.RESET_REPO_STREAMS;
5741: -- store the highest degree of error
5742: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5743: Okl_Api.set_message(p_app_name => g_app_name,
5744: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5745: p_token1 => g_contract_number_token,
5746: p_token1_value => l_contract_number);
5747: RAISE OKL_API.G_EXCEPTION_ERROR;
5743: Okl_Api.set_message(p_app_name => g_app_name,
5744: p_msg_name => 'OKL_AGN_STREAM_ERROR',
5745: p_token1 => g_contract_number_token,
5746: p_token1_value => l_contract_number);
5747: RAISE OKL_API.G_EXCEPTION_ERROR;
5748: END IF;
5749:
5750: WRITE_TO_LOG('The count of stream elements that need to be accrued for SECONDARY is :'||l_stream_tbl_rep.COUNT);
5751: IF (l_stream_tbl_rep.COUNT = 0)
5798: x_catch_tcnv_tbl => l_tcnv_tbl,
5799: x_catch_tclv_tbl => l_tclv_tbl,
5800: p_catchup_rec => l_catchup_rec );
5801: -- store the highest degree of error
5802: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5803: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5804: -- need to leave
5805: Okl_Api.set_message(p_app_name => g_app_name,
5806: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5799: x_catch_tclv_tbl => l_tclv_tbl,
5800: p_catchup_rec => l_catchup_rec );
5801: -- store the highest degree of error
5802: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5803: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5804: -- need to leave
5805: Okl_Api.set_message(p_app_name => g_app_name,
5806: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5807: p_token1 => g_contract_number_token,
5801: -- store the highest degree of error
5802: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5803: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5804: -- need to leave
5805: Okl_Api.set_message(p_app_name => g_app_name,
5806: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5807: p_token1 => g_contract_number_token,
5808: p_token1_value => l_contract_number);
5809: -- Select the contract for error reporting
5806: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5807: p_token1 => g_contract_number_token,
5808: p_token1_value => l_contract_number);
5809: -- Select the contract for error reporting
5810: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5811: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5812: Okl_Api.set_message(p_app_name => g_app_name,
5813: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5814: p_token1 => g_contract_number_token,
5807: p_token1 => g_contract_number_token,
5808: p_token1_value => l_contract_number);
5809: -- Select the contract for error reporting
5810: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5811: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5812: Okl_Api.set_message(p_app_name => g_app_name,
5813: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5814: p_token1 => g_contract_number_token,
5815: p_token1_value => l_contract_number);
5808: p_token1_value => l_contract_number);
5809: -- Select the contract for error reporting
5810: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5811: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5812: Okl_Api.set_message(p_app_name => g_app_name,
5813: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5814: p_token1 => g_contract_number_token,
5815: p_token1_value => l_contract_number);
5816: RAISE OKL_API.G_EXCEPTION_ERROR;
5812: Okl_Api.set_message(p_app_name => g_app_name,
5813: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5814: p_token1 => g_contract_number_token,
5815: p_token1_value => l_contract_number);
5816: RAISE OKL_API.G_EXCEPTION_ERROR;
5817: END IF;
5818: END IF;
5819:
5820: --Report content for reversal of non-accrual
5864: x_catch_tclv_tbl => l_tclv_tbl,
5865: p_catchup_rec => l_catchup_rec ,
5866: p_representation_type => 'SECONDARY' );
5867: -- store the highest degree of error
5868: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5869: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5870: -- need to leave
5871: Okl_Api.set_message(p_app_name => g_app_name,
5872: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5865: p_catchup_rec => l_catchup_rec ,
5866: p_representation_type => 'SECONDARY' );
5867: -- store the highest degree of error
5868: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5869: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5870: -- need to leave
5871: Okl_Api.set_message(p_app_name => g_app_name,
5872: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5873: p_token1 => g_contract_number_token,
5867: -- store the highest degree of error
5868: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5869: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5870: -- need to leave
5871: Okl_Api.set_message(p_app_name => g_app_name,
5872: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5873: p_token1 => g_contract_number_token,
5874: p_token1_value => l_contract_number);
5875: -- Select the contract for error reporting
5872: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5873: p_token1 => g_contract_number_token,
5874: p_token1_value => l_contract_number);
5875: -- Select the contract for error reporting
5876: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5877: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5878: Okl_Api.set_message(p_app_name => g_app_name,
5879: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5880: p_token1 => g_contract_number_token,
5873: p_token1 => g_contract_number_token,
5874: p_token1_value => l_contract_number);
5875: -- Select the contract for error reporting
5876: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5877: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5878: Okl_Api.set_message(p_app_name => g_app_name,
5879: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5880: p_token1 => g_contract_number_token,
5881: p_token1_value => l_contract_number);
5874: p_token1_value => l_contract_number);
5875: -- Select the contract for error reporting
5876: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5877: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5878: Okl_Api.set_message(p_app_name => g_app_name,
5879: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5880: p_token1 => g_contract_number_token,
5881: p_token1_value => l_contract_number);
5882: RAISE OKL_API.G_EXCEPTION_ERROR;
5878: Okl_Api.set_message(p_app_name => g_app_name,
5879: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
5880: p_token1 => g_contract_number_token,
5881: p_token1_value => l_contract_number);
5882: RAISE OKL_API.G_EXCEPTION_ERROR;
5883: END IF;
5884: END IF;
5885:
5886: --Report content for reversal of non-accrual
5969: p_accrual_rec => l_accrual_rec,
5970: p_stream_tbl => l_stream_tbl);
5971:
5972: -- store the highest degree of error
5973: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5974: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5975: -- need to leave
5976: Okl_Api.set_message(p_app_name => g_app_name,
5977: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5970: p_stream_tbl => l_stream_tbl);
5971:
5972: -- store the highest degree of error
5973: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5974: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5975: -- need to leave
5976: Okl_Api.set_message(p_app_name => g_app_name,
5977: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5978: p_token1 => g_contract_number_token,
5972: -- store the highest degree of error
5973: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
5974: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
5975: -- need to leave
5976: Okl_Api.set_message(p_app_name => g_app_name,
5977: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5978: p_token1 => g_contract_number_token,
5979: p_token1_value => l_contract_number);
5980: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5976: Okl_Api.set_message(p_app_name => g_app_name,
5977: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5978: p_token1 => g_contract_number_token,
5979: p_token1_value => l_contract_number);
5980: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5981: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5982: Okl_Api.set_message(p_app_name => g_app_name,
5983: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5984: p_token1 => g_contract_number_token,
5977: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5978: p_token1 => g_contract_number_token,
5979: p_token1_value => l_contract_number);
5980: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5981: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5982: Okl_Api.set_message(p_app_name => g_app_name,
5983: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5984: p_token1 => g_contract_number_token,
5985: p_token1_value => l_contract_number);
5978: p_token1 => g_contract_number_token,
5979: p_token1_value => l_contract_number);
5980: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
5981: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
5982: Okl_Api.set_message(p_app_name => g_app_name,
5983: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5984: p_token1 => g_contract_number_token,
5985: p_token1_value => l_contract_number);
5986: RAISE OKL_API.G_EXCEPTION_ERROR;
5982: Okl_Api.set_message(p_app_name => g_app_name,
5983: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
5984: p_token1 => g_contract_number_token,
5985: p_token1_value => l_contract_number);
5986: RAISE OKL_API.G_EXCEPTION_ERROR;
5987: END IF;
5988: END IF;
5989: IF p_process_accrual_rec.submission_mode='BATCH' THEN
5990: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
6052: p_stream_tbl => l_stream_tbl_rep,
6053: p_representation_type => 'SECONDARY'); --MGAAP
6054:
6055: -- store the highest degree of error
6056: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6057: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6058: -- need to leave
6059: Okl_Api.set_message(p_app_name => g_app_name,
6060: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6053: p_representation_type => 'SECONDARY'); --MGAAP
6054:
6055: -- store the highest degree of error
6056: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6057: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6058: -- need to leave
6059: Okl_Api.set_message(p_app_name => g_app_name,
6060: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6061: p_token1 => g_contract_number_token,
6055: -- store the highest degree of error
6056: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6057: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6058: -- need to leave
6059: Okl_Api.set_message(p_app_name => g_app_name,
6060: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6061: p_token1 => g_contract_number_token,
6062: p_token1_value => l_contract_number);
6063: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6059: Okl_Api.set_message(p_app_name => g_app_name,
6060: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6061: p_token1 => g_contract_number_token,
6062: p_token1_value => l_contract_number);
6063: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6064: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6065: Okl_Api.set_message(p_app_name => g_app_name,
6066: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6067: p_token1 => g_contract_number_token,
6060: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6061: p_token1 => g_contract_number_token,
6062: p_token1_value => l_contract_number);
6063: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6064: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6065: Okl_Api.set_message(p_app_name => g_app_name,
6066: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6067: p_token1 => g_contract_number_token,
6068: p_token1_value => l_contract_number);
6061: p_token1 => g_contract_number_token,
6062: p_token1_value => l_contract_number);
6063: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6064: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6065: Okl_Api.set_message(p_app_name => g_app_name,
6066: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6067: p_token1 => g_contract_number_token,
6068: p_token1_value => l_contract_number);
6069: RAISE OKL_API.G_EXCEPTION_ERROR;
6065: Okl_Api.set_message(p_app_name => g_app_name,
6066: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6067: p_token1 => g_contract_number_token,
6068: p_token1_value => l_contract_number);
6069: RAISE OKL_API.G_EXCEPTION_ERROR;
6070: END IF;
6071: END IF;
6072: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6073: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
6113: x_memo_tcnv_tbl => l_tcnv_tbl,
6114: x_memo_tclv_tbl => l_tclv_tbl,
6115: p_reverse_rec => l_reverse_rec );
6116: -- store the highest degree of error
6117: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6118: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6119: -- need to leave
6120: Okl_Api.set_message(p_app_name => g_app_name,
6121: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6114: x_memo_tclv_tbl => l_tclv_tbl,
6115: p_reverse_rec => l_reverse_rec );
6116: -- store the highest degree of error
6117: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6118: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6119: -- need to leave
6120: Okl_Api.set_message(p_app_name => g_app_name,
6121: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6122: p_token1 => g_contract_number_token,
6116: -- store the highest degree of error
6117: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6118: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6119: -- need to leave
6120: Okl_Api.set_message(p_app_name => g_app_name,
6121: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6122: p_token1 => g_contract_number_token,
6123: p_token1_value => l_contract_number);
6124: -- Select the contract for error reporting
6121: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6122: p_token1 => g_contract_number_token,
6123: p_token1_value => l_contract_number);
6124: -- Select the contract for error reporting
6125: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6126: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6127: Okl_Api.set_message(p_app_name => g_app_name,
6128: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6129: p_token1 => g_contract_number_token,
6122: p_token1 => g_contract_number_token,
6123: p_token1_value => l_contract_number);
6124: -- Select the contract for error reporting
6125: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6126: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6127: Okl_Api.set_message(p_app_name => g_app_name,
6128: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6129: p_token1 => g_contract_number_token,
6130: p_token1_value => l_contract_number);
6123: p_token1_value => l_contract_number);
6124: -- Select the contract for error reporting
6125: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6126: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6127: Okl_Api.set_message(p_app_name => g_app_name,
6128: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6129: p_token1 => g_contract_number_token,
6130: p_token1_value => l_contract_number);
6131: RAISE OKL_API.G_EXCEPTION_ERROR;
6127: Okl_Api.set_message(p_app_name => g_app_name,
6128: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6129: p_token1 => g_contract_number_token,
6130: p_token1_value => l_contract_number);
6131: RAISE OKL_API.G_EXCEPTION_ERROR;
6132: END IF;
6133: END IF;
6134: -- Report Content for reverse accruals
6135: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6181: x_memo_tclv_tbl => l_tclv_tbl,
6182: p_reverse_rec => l_reverse_rec,
6183: p_representation_type => 'SECONDARY' );
6184: -- store the highest degree of error
6185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6187: -- need to leave
6188: Okl_Api.set_message(p_app_name => g_app_name,
6189: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6182: p_reverse_rec => l_reverse_rec,
6183: p_representation_type => 'SECONDARY' );
6184: -- store the highest degree of error
6185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6187: -- need to leave
6188: Okl_Api.set_message(p_app_name => g_app_name,
6189: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6190: p_token1 => g_contract_number_token,
6184: -- store the highest degree of error
6185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6187: -- need to leave
6188: Okl_Api.set_message(p_app_name => g_app_name,
6189: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6190: p_token1 => g_contract_number_token,
6191: p_token1_value => l_contract_number);
6192: -- Select the contract for error reporting
6189: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6190: p_token1 => g_contract_number_token,
6191: p_token1_value => l_contract_number);
6192: -- Select the contract for error reporting
6193: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6194: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6195: Okl_Api.set_message(p_app_name => g_app_name,
6196: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6197: p_token1 => g_contract_number_token,
6190: p_token1 => g_contract_number_token,
6191: p_token1_value => l_contract_number);
6192: -- Select the contract for error reporting
6193: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6194: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6195: Okl_Api.set_message(p_app_name => g_app_name,
6196: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6197: p_token1 => g_contract_number_token,
6198: p_token1_value => l_contract_number);
6191: p_token1_value => l_contract_number);
6192: -- Select the contract for error reporting
6193: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6194: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6195: Okl_Api.set_message(p_app_name => g_app_name,
6196: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6197: p_token1 => g_contract_number_token,
6198: p_token1_value => l_contract_number);
6199: RAISE OKL_API.G_EXCEPTION_ERROR;
6195: Okl_Api.set_message(p_app_name => g_app_name,
6196: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6197: p_token1 => g_contract_number_token,
6198: p_token1_value => l_contract_number);
6199: RAISE OKL_API.G_EXCEPTION_ERROR;
6200: END IF;
6201: END IF;
6202: -- Report Content for reverse accruals
6203: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6286: p_accrual_rec => l_accrual_rec,
6287: p_stream_tbl => l_stream_tbl);
6288:
6289: -- store the highest degree of error
6290: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6291: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6292: -- need to leave
6293: Okl_Api.set_message(p_app_name => g_app_name,
6294: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6287: p_stream_tbl => l_stream_tbl);
6288:
6289: -- store the highest degree of error
6290: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6291: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6292: -- need to leave
6293: Okl_Api.set_message(p_app_name => g_app_name,
6294: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6295: p_token1 => g_contract_number_token,
6289: -- store the highest degree of error
6290: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6291: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6292: -- need to leave
6293: Okl_Api.set_message(p_app_name => g_app_name,
6294: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6295: p_token1 => g_contract_number_token,
6296: p_token1_value => l_contract_number);
6297: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6293: Okl_Api.set_message(p_app_name => g_app_name,
6294: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6295: p_token1 => g_contract_number_token,
6296: p_token1_value => l_contract_number);
6297: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6298: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6299: Okl_Api.set_message(p_app_name => g_app_name,
6300: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6301: p_token1 => g_contract_number_token,
6294: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6295: p_token1 => g_contract_number_token,
6296: p_token1_value => l_contract_number);
6297: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6298: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6299: Okl_Api.set_message(p_app_name => g_app_name,
6300: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6301: p_token1 => g_contract_number_token,
6302: p_token1_value => l_contract_number);
6295: p_token1 => g_contract_number_token,
6296: p_token1_value => l_contract_number);
6297: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6298: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6299: Okl_Api.set_message(p_app_name => g_app_name,
6300: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6301: p_token1 => g_contract_number_token,
6302: p_token1_value => l_contract_number);
6303: RAISE OKL_API.G_EXCEPTION_ERROR;
6299: Okl_Api.set_message(p_app_name => g_app_name,
6300: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6301: p_token1 => g_contract_number_token,
6302: p_token1_value => l_contract_number);
6303: RAISE OKL_API.G_EXCEPTION_ERROR;
6304: END IF;
6305: END IF;
6306:
6307: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6368: p_stream_tbl => l_stream_tbl_rep,
6369: p_representation_type => 'SECONDARY'); --MGAAP
6370:
6371: -- store the highest degree of error
6372: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6373: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6374: -- need to leave
6375: Okl_Api.set_message(p_app_name => g_app_name,
6376: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6369: p_representation_type => 'SECONDARY'); --MGAAP
6370:
6371: -- store the highest degree of error
6372: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6373: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6374: -- need to leave
6375: Okl_Api.set_message(p_app_name => g_app_name,
6376: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6377: p_token1 => g_contract_number_token,
6371: -- store the highest degree of error
6372: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6373: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6374: -- need to leave
6375: Okl_Api.set_message(p_app_name => g_app_name,
6376: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6377: p_token1 => g_contract_number_token,
6378: p_token1_value => l_contract_number);
6379: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6375: Okl_Api.set_message(p_app_name => g_app_name,
6376: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6377: p_token1 => g_contract_number_token,
6378: p_token1_value => l_contract_number);
6379: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6380: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6381: Okl_Api.set_message(p_app_name => g_app_name,
6382: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6383: p_token1 => g_contract_number_token,
6376: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6377: p_token1 => g_contract_number_token,
6378: p_token1_value => l_contract_number);
6379: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6380: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6381: Okl_Api.set_message(p_app_name => g_app_name,
6382: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6383: p_token1 => g_contract_number_token,
6384: p_token1_value => l_contract_number);
6377: p_token1 => g_contract_number_token,
6378: p_token1_value => l_contract_number);
6379: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6380: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6381: Okl_Api.set_message(p_app_name => g_app_name,
6382: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6383: p_token1 => g_contract_number_token,
6384: p_token1_value => l_contract_number);
6385: RAISE OKL_API.G_EXCEPTION_ERROR;
6381: Okl_Api.set_message(p_app_name => g_app_name,
6382: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6383: p_token1 => g_contract_number_token,
6384: p_token1_value => l_contract_number);
6385: RAISE OKL_API.G_EXCEPTION_ERROR;
6386: END IF;
6387: END IF;
6388:
6389: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6429: x_catch_tcnv_tbl => l_tcnv_tbl,
6430: x_catch_tclv_tbl => l_tclv_tbl,
6431: p_catchup_rec => l_catchup_rec );
6432: -- store the highest degree of error
6433: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6434: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6435: -- need to leave
6436: Okl_Api.set_message(p_app_name => g_app_name,
6437: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6430: x_catch_tclv_tbl => l_tclv_tbl,
6431: p_catchup_rec => l_catchup_rec );
6432: -- store the highest degree of error
6433: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6434: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6435: -- need to leave
6436: Okl_Api.set_message(p_app_name => g_app_name,
6437: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6438: p_token1 => g_contract_number_token,
6432: -- store the highest degree of error
6433: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6434: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6435: -- need to leave
6436: Okl_Api.set_message(p_app_name => g_app_name,
6437: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6438: p_token1 => g_contract_number_token,
6439: p_token1_value => l_contract_number);
6440: -- Select the contract for error reporting
6437: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6438: p_token1 => g_contract_number_token,
6439: p_token1_value => l_contract_number);
6440: -- Select the contract for error reporting
6441: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6442: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6443: Okl_Api.set_message(p_app_name => g_app_name,
6444: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6445: p_token1 => g_contract_number_token,
6438: p_token1 => g_contract_number_token,
6439: p_token1_value => l_contract_number);
6440: -- Select the contract for error reporting
6441: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6442: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6443: Okl_Api.set_message(p_app_name => g_app_name,
6444: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6445: p_token1 => g_contract_number_token,
6446: p_token1_value => l_contract_number);
6439: p_token1_value => l_contract_number);
6440: -- Select the contract for error reporting
6441: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6442: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6443: Okl_Api.set_message(p_app_name => g_app_name,
6444: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6445: p_token1 => g_contract_number_token,
6446: p_token1_value => l_contract_number);
6447: RAISE OKL_API.G_EXCEPTION_ERROR;
6443: Okl_Api.set_message(p_app_name => g_app_name,
6444: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6445: p_token1 => g_contract_number_token,
6446: p_token1_value => l_contract_number);
6447: RAISE OKL_API.G_EXCEPTION_ERROR;
6448: END IF;
6449: END IF; -- bug 2474969 moved end if which was after fnd_file
6450: -- as a result catchup entries were not printing.
6451:
6514: x_catch_tclv_tbl => l_tclv_tbl,
6515: p_catchup_rec => l_catchup_rec,
6516: p_representation_type => 'SECONDARY' );
6517: -- store the highest degree of error
6518: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6519: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6520: -- need to leave
6521: Okl_Api.set_message(p_app_name => g_app_name,
6522: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6515: p_catchup_rec => l_catchup_rec,
6516: p_representation_type => 'SECONDARY' );
6517: -- store the highest degree of error
6518: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6519: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6520: -- need to leave
6521: Okl_Api.set_message(p_app_name => g_app_name,
6522: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6523: p_token1 => g_contract_number_token,
6517: -- store the highest degree of error
6518: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6519: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6520: -- need to leave
6521: Okl_Api.set_message(p_app_name => g_app_name,
6522: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6523: p_token1 => g_contract_number_token,
6524: p_token1_value => l_contract_number);
6525: -- Select the contract for error reporting
6522: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6523: p_token1 => g_contract_number_token,
6524: p_token1_value => l_contract_number);
6525: -- Select the contract for error reporting
6526: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6527: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6528: Okl_Api.set_message(p_app_name => g_app_name,
6529: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6530: p_token1 => g_contract_number_token,
6523: p_token1 => g_contract_number_token,
6524: p_token1_value => l_contract_number);
6525: -- Select the contract for error reporting
6526: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6527: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6528: Okl_Api.set_message(p_app_name => g_app_name,
6529: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6530: p_token1 => g_contract_number_token,
6531: p_token1_value => l_contract_number);
6524: p_token1_value => l_contract_number);
6525: -- Select the contract for error reporting
6526: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6527: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6528: Okl_Api.set_message(p_app_name => g_app_name,
6529: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6530: p_token1 => g_contract_number_token,
6531: p_token1_value => l_contract_number);
6532: RAISE OKL_API.G_EXCEPTION_ERROR;
6528: Okl_Api.set_message(p_app_name => g_app_name,
6529: p_msg_name => 'OKL_AGN_CAT_ACR_ERROR',
6530: p_token1 => g_contract_number_token,
6531: p_token1_value => l_contract_number);
6532: RAISE OKL_API.G_EXCEPTION_ERROR;
6533: END IF;
6534: END IF; -- bug 2474969 moved end if which was after fnd_file
6535: -- as a result catchup entries were not printing.
6536:
6618: x_tclv_tbl => l_tclv_tbl,
6619: p_accrual_rec => l_accrual_rec,
6620: p_stream_tbl => l_stream_tbl);
6621: -- store the highest degree of error
6622: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6623: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6624: -- need to leave
6625: Okl_Api.set_message(p_app_name => g_app_name,
6626: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6619: p_accrual_rec => l_accrual_rec,
6620: p_stream_tbl => l_stream_tbl);
6621: -- store the highest degree of error
6622: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6623: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6624: -- need to leave
6625: Okl_Api.set_message(p_app_name => g_app_name,
6626: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6627: p_token1 => g_contract_number_token,
6621: -- store the highest degree of error
6622: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6623: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6624: -- need to leave
6625: Okl_Api.set_message(p_app_name => g_app_name,
6626: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6627: p_token1 => g_contract_number_token,
6628: p_token1_value => l_contract_number);
6629: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6625: Okl_Api.set_message(p_app_name => g_app_name,
6626: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6627: p_token1 => g_contract_number_token,
6628: p_token1_value => l_contract_number);
6629: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6630: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6631: Okl_Api.set_message(p_app_name => g_app_name,
6632: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6633: p_token1 => g_contract_number_token,
6626: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6627: p_token1 => g_contract_number_token,
6628: p_token1_value => l_contract_number);
6629: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6630: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6631: Okl_Api.set_message(p_app_name => g_app_name,
6632: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6633: p_token1 => g_contract_number_token,
6634: p_token1_value => l_contract_number);
6627: p_token1 => g_contract_number_token,
6628: p_token1_value => l_contract_number);
6629: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6630: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6631: Okl_Api.set_message(p_app_name => g_app_name,
6632: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6633: p_token1 => g_contract_number_token,
6634: p_token1_value => l_contract_number);
6635: RAISE OKL_API.G_EXCEPTION_ERROR;
6631: Okl_Api.set_message(p_app_name => g_app_name,
6632: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6633: p_token1 => g_contract_number_token,
6634: p_token1_value => l_contract_number);
6635: RAISE OKL_API.G_EXCEPTION_ERROR;
6636: END IF;
6637: END IF;
6638: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6639: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
6699: p_accrual_rec => l_accrual_rec,
6700: p_stream_tbl => l_stream_tbl_rep,
6701: p_representation_type => 'SECONDARY');
6702: -- store the highest degree of error
6703: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6704: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6705: -- need to leave
6706: Okl_Api.set_message(p_app_name => g_app_name,
6707: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6700: p_stream_tbl => l_stream_tbl_rep,
6701: p_representation_type => 'SECONDARY');
6702: -- store the highest degree of error
6703: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6704: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6705: -- need to leave
6706: Okl_Api.set_message(p_app_name => g_app_name,
6707: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6708: p_token1 => g_contract_number_token,
6702: -- store the highest degree of error
6703: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6704: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6705: -- need to leave
6706: Okl_Api.set_message(p_app_name => g_app_name,
6707: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6708: p_token1 => g_contract_number_token,
6709: p_token1_value => l_contract_number);
6710: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6706: Okl_Api.set_message(p_app_name => g_app_name,
6707: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6708: p_token1 => g_contract_number_token,
6709: p_token1_value => l_contract_number);
6710: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6711: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6712: Okl_Api.set_message(p_app_name => g_app_name,
6713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6714: p_token1 => g_contract_number_token,
6707: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6708: p_token1 => g_contract_number_token,
6709: p_token1_value => l_contract_number);
6710: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6711: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6712: Okl_Api.set_message(p_app_name => g_app_name,
6713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6714: p_token1 => g_contract_number_token,
6715: p_token1_value => l_contract_number);
6708: p_token1 => g_contract_number_token,
6709: p_token1_value => l_contract_number);
6710: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6711: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6712: Okl_Api.set_message(p_app_name => g_app_name,
6713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6714: p_token1 => g_contract_number_token,
6715: p_token1_value => l_contract_number);
6716: RAISE OKL_API.G_EXCEPTION_ERROR;
6712: Okl_Api.set_message(p_app_name => g_app_name,
6713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6714: p_token1 => g_contract_number_token,
6715: p_token1_value => l_contract_number);
6716: RAISE OKL_API.G_EXCEPTION_ERROR;
6717: END IF;
6718: END IF;
6719: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6720: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
6779: p_accrual_rec => l_accrual_rec,
6780: p_stream_tbl => l_stream_tbl);
6781:
6782: -- store the highest degree of error
6783: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6784: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6785: -- need to leave
6786: Okl_Api.set_message(p_app_name => g_app_name,
6787: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6780: p_stream_tbl => l_stream_tbl);
6781:
6782: -- store the highest degree of error
6783: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6784: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6785: -- need to leave
6786: Okl_Api.set_message(p_app_name => g_app_name,
6787: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6788: p_token1 => g_contract_number_token,
6782: -- store the highest degree of error
6783: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6784: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6785: -- need to leave
6786: Okl_Api.set_message(p_app_name => g_app_name,
6787: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6788: p_token1 => g_contract_number_token,
6789: p_token1_value => l_contract_number);
6790: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6786: Okl_Api.set_message(p_app_name => g_app_name,
6787: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6788: p_token1 => g_contract_number_token,
6789: p_token1_value => l_contract_number);
6790: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6791: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6792: Okl_Api.set_message(p_app_name => g_app_name,
6793: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6794: p_token1 => g_contract_number_token,
6787: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6788: p_token1 => g_contract_number_token,
6789: p_token1_value => l_contract_number);
6790: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6791: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6792: Okl_Api.set_message(p_app_name => g_app_name,
6793: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6794: p_token1 => g_contract_number_token,
6795: p_token1_value => l_contract_number);
6788: p_token1 => g_contract_number_token,
6789: p_token1_value => l_contract_number);
6790: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6791: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6792: Okl_Api.set_message(p_app_name => g_app_name,
6793: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6794: p_token1 => g_contract_number_token,
6795: p_token1_value => l_contract_number);
6796: RAISE OKL_API.G_EXCEPTION_ERROR;
6792: Okl_Api.set_message(p_app_name => g_app_name,
6793: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6794: p_token1 => g_contract_number_token,
6795: p_token1_value => l_contract_number);
6796: RAISE OKL_API.G_EXCEPTION_ERROR;
6797: END IF;
6798: END IF;
6799:
6800: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6863: p_stream_tbl => l_stream_tbl_rep,
6864: p_representation_type => 'SECONDARY');
6865:
6866: -- store the highest degree of error
6867: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6868: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6869: -- need to leave
6870: Okl_Api.set_message(p_app_name => g_app_name,
6871: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6864: p_representation_type => 'SECONDARY');
6865:
6866: -- store the highest degree of error
6867: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6868: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6869: -- need to leave
6870: Okl_Api.set_message(p_app_name => g_app_name,
6871: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6872: p_token1 => g_contract_number_token,
6866: -- store the highest degree of error
6867: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6868: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6869: -- need to leave
6870: Okl_Api.set_message(p_app_name => g_app_name,
6871: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6872: p_token1 => g_contract_number_token,
6873: p_token1_value => l_contract_number);
6874: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6870: Okl_Api.set_message(p_app_name => g_app_name,
6871: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6872: p_token1 => g_contract_number_token,
6873: p_token1_value => l_contract_number);
6874: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6875: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6876: Okl_Api.set_message(p_app_name => g_app_name,
6877: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6878: p_token1 => g_contract_number_token,
6871: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6872: p_token1 => g_contract_number_token,
6873: p_token1_value => l_contract_number);
6874: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6875: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6876: Okl_Api.set_message(p_app_name => g_app_name,
6877: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6878: p_token1 => g_contract_number_token,
6879: p_token1_value => l_contract_number);
6872: p_token1 => g_contract_number_token,
6873: p_token1_value => l_contract_number);
6874: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6875: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6876: Okl_Api.set_message(p_app_name => g_app_name,
6877: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6878: p_token1 => g_contract_number_token,
6879: p_token1_value => l_contract_number);
6880: RAISE OKL_API.G_EXCEPTION_ERROR;
6876: Okl_Api.set_message(p_app_name => g_app_name,
6877: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
6878: p_token1 => g_contract_number_token,
6879: p_token1_value => l_contract_number);
6880: RAISE OKL_API.G_EXCEPTION_ERROR;
6881: END IF;
6882: END IF;
6883:
6884: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6926: x_memo_tcnv_tbl => l_tcnv_tbl,
6927: x_memo_tclv_tbl => l_tclv_tbl,
6928: p_reverse_rec => l_reverse_rec );
6929: -- store the highest degree of error
6930: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6931: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6932: -- need to leave
6933: Okl_Api.set_message(p_app_name => g_app_name,
6934: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6927: x_memo_tclv_tbl => l_tclv_tbl,
6928: p_reverse_rec => l_reverse_rec );
6929: -- store the highest degree of error
6930: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6931: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6932: -- need to leave
6933: Okl_Api.set_message(p_app_name => g_app_name,
6934: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6935: p_token1 => g_contract_number_token,
6929: -- store the highest degree of error
6930: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6931: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6932: -- need to leave
6933: Okl_Api.set_message(p_app_name => g_app_name,
6934: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6935: p_token1 => g_contract_number_token,
6936: p_token1_value => l_contract_number);
6937: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6933: Okl_Api.set_message(p_app_name => g_app_name,
6934: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6935: p_token1 => g_contract_number_token,
6936: p_token1_value => l_contract_number);
6937: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6938: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6939: Okl_Api.set_message(p_app_name => g_app_name,
6940: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6941: p_token1 => g_contract_number_token,
6934: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6935: p_token1 => g_contract_number_token,
6936: p_token1_value => l_contract_number);
6937: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6938: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6939: Okl_Api.set_message(p_app_name => g_app_name,
6940: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6941: p_token1 => g_contract_number_token,
6942: p_token1_value => l_contract_number);
6935: p_token1 => g_contract_number_token,
6936: p_token1_value => l_contract_number);
6937: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
6938: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
6939: Okl_Api.set_message(p_app_name => g_app_name,
6940: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6941: p_token1 => g_contract_number_token,
6942: p_token1_value => l_contract_number);
6943: RAISE OKL_API.G_EXCEPTION_ERROR;
6939: Okl_Api.set_message(p_app_name => g_app_name,
6940: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6941: p_token1 => g_contract_number_token,
6942: p_token1_value => l_contract_number);
6943: RAISE OKL_API.G_EXCEPTION_ERROR;
6944: END IF;
6945: END IF;
6946:
6947: IF p_process_accrual_rec.submission_mode='BATCH' THEN
6993: x_memo_tclv_tbl => l_tclv_tbl,
6994: p_reverse_rec => l_reverse_rec,
6995: p_representation_type => 'SECONDARY' );
6996: -- store the highest degree of error
6997: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6998: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6999: -- need to leave
7000: Okl_Api.set_message(p_app_name => g_app_name,
7001: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
6994: p_reverse_rec => l_reverse_rec,
6995: p_representation_type => 'SECONDARY' );
6996: -- store the highest degree of error
6997: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6998: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6999: -- need to leave
7000: Okl_Api.set_message(p_app_name => g_app_name,
7001: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7002: p_token1 => g_contract_number_token,
6996: -- store the highest degree of error
6997: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
6998: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
6999: -- need to leave
7000: Okl_Api.set_message(p_app_name => g_app_name,
7001: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7002: p_token1 => g_contract_number_token,
7003: p_token1_value => l_contract_number);
7004: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7000: Okl_Api.set_message(p_app_name => g_app_name,
7001: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7002: p_token1 => g_contract_number_token,
7003: p_token1_value => l_contract_number);
7004: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7005: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7006: Okl_Api.set_message(p_app_name => g_app_name,
7007: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7008: p_token1 => g_contract_number_token,
7001: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7002: p_token1 => g_contract_number_token,
7003: p_token1_value => l_contract_number);
7004: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7005: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7006: Okl_Api.set_message(p_app_name => g_app_name,
7007: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7008: p_token1 => g_contract_number_token,
7009: p_token1_value => l_contract_number);
7002: p_token1 => g_contract_number_token,
7003: p_token1_value => l_contract_number);
7004: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7005: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7006: Okl_Api.set_message(p_app_name => g_app_name,
7007: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7008: p_token1 => g_contract_number_token,
7009: p_token1_value => l_contract_number);
7010: RAISE OKL_API.G_EXCEPTION_ERROR;
7006: Okl_Api.set_message(p_app_name => g_app_name,
7007: p_msg_name => 'OKL_AGN_REV_ACR_ERROR',
7008: p_token1 => g_contract_number_token,
7009: p_token1_value => l_contract_number);
7010: RAISE OKL_API.G_EXCEPTION_ERROR;
7011: END IF;
7012: END IF;
7013:
7014: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7098: p_accrual_rec => l_accrual_rec,
7099: p_stream_tbl => l_stream_tbl);
7100:
7101: -- store the highest degree of error
7102: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7103: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7104: -- need to leave
7105: Okl_Api.set_message(p_app_name => g_app_name,
7106: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7099: p_stream_tbl => l_stream_tbl);
7100:
7101: -- store the highest degree of error
7102: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7103: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7104: -- need to leave
7105: Okl_Api.set_message(p_app_name => g_app_name,
7106: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7107: p_token1 => g_contract_number_token,
7101: -- store the highest degree of error
7102: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7103: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7104: -- need to leave
7105: Okl_Api.set_message(p_app_name => g_app_name,
7106: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7107: p_token1 => g_contract_number_token,
7108: p_token1_value => l_contract_number);
7109: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7105: Okl_Api.set_message(p_app_name => g_app_name,
7106: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7107: p_token1 => g_contract_number_token,
7108: p_token1_value => l_contract_number);
7109: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7110: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7111: Okl_Api.set_message(p_app_name => g_app_name,
7112: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7113: p_token1 => g_contract_number_token,
7106: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7107: p_token1 => g_contract_number_token,
7108: p_token1_value => l_contract_number);
7109: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7110: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7111: Okl_Api.set_message(p_app_name => g_app_name,
7112: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7113: p_token1 => g_contract_number_token,
7114: p_token1_value => l_contract_number);
7107: p_token1 => g_contract_number_token,
7108: p_token1_value => l_contract_number);
7109: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7110: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7111: Okl_Api.set_message(p_app_name => g_app_name,
7112: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7113: p_token1 => g_contract_number_token,
7114: p_token1_value => l_contract_number);
7115: RAISE OKL_API.G_EXCEPTION_ERROR;
7111: Okl_Api.set_message(p_app_name => g_app_name,
7112: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7113: p_token1 => g_contract_number_token,
7114: p_token1_value => l_contract_number);
7115: RAISE OKL_API.G_EXCEPTION_ERROR;
7116: END IF;
7117: END IF;
7118: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7119: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7181: p_stream_tbl => l_stream_tbl_rep,
7182: p_representation_type => 'SECONDARY');
7183:
7184: -- store the highest degree of error
7185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7187: -- need to leave
7188: Okl_Api.set_message(p_app_name => g_app_name,
7189: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7182: p_representation_type => 'SECONDARY');
7183:
7184: -- store the highest degree of error
7185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7187: -- need to leave
7188: Okl_Api.set_message(p_app_name => g_app_name,
7189: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7190: p_token1 => g_contract_number_token,
7184: -- store the highest degree of error
7185: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7186: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7187: -- need to leave
7188: Okl_Api.set_message(p_app_name => g_app_name,
7189: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7190: p_token1 => g_contract_number_token,
7191: p_token1_value => l_contract_number);
7192: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7188: Okl_Api.set_message(p_app_name => g_app_name,
7189: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7190: p_token1 => g_contract_number_token,
7191: p_token1_value => l_contract_number);
7192: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7193: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7194: Okl_Api.set_message(p_app_name => g_app_name,
7195: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7196: p_token1 => g_contract_number_token,
7189: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7190: p_token1 => g_contract_number_token,
7191: p_token1_value => l_contract_number);
7192: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7193: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7194: Okl_Api.set_message(p_app_name => g_app_name,
7195: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7196: p_token1 => g_contract_number_token,
7197: p_token1_value => l_contract_number);
7190: p_token1 => g_contract_number_token,
7191: p_token1_value => l_contract_number);
7192: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7193: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7194: Okl_Api.set_message(p_app_name => g_app_name,
7195: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7196: p_token1 => g_contract_number_token,
7197: p_token1_value => l_contract_number);
7198: RAISE OKL_API.G_EXCEPTION_ERROR;
7194: Okl_Api.set_message(p_app_name => g_app_name,
7195: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7196: p_token1 => g_contract_number_token,
7197: p_token1_value => l_contract_number);
7198: RAISE OKL_API.G_EXCEPTION_ERROR;
7199: END IF;
7200: END IF;
7201: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7202: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7223: ,p_ctr_start_date => l_start_date
7224: ,p_period_end_date => l_period_end_date
7225: ,p_accrual_rule_yn => 'ACRL_WITHOUT_RULE');
7226: -- store the highest degree of error
7227: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7228: Okl_Api.set_message(p_app_name => g_app_name,
7229: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7230: p_token1 => g_contract_number_token,
7231: p_token1_value => l_contract_number);
7224: ,p_period_end_date => l_period_end_date
7225: ,p_accrual_rule_yn => 'ACRL_WITHOUT_RULE');
7226: -- store the highest degree of error
7227: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7228: Okl_Api.set_message(p_app_name => g_app_name,
7229: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7230: p_token1 => g_contract_number_token,
7231: p_token1_value => l_contract_number);
7232: RAISE OKL_API.G_EXCEPTION_ERROR;
7228: Okl_Api.set_message(p_app_name => g_app_name,
7229: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7230: p_token1 => g_contract_number_token,
7231: p_token1_value => l_contract_number);
7232: RAISE OKL_API.G_EXCEPTION_ERROR;
7233: END IF;
7234: l_tcnv_rec.trx_number := null; -- Bug 7555143
7235: l_tcnv_rec.ID := null;
7236: IF l_stream_tbl.COUNT > 0 THEN
7285: x_tclv_tbl => l_tclv_tbl,
7286: p_accrual_rec => l_accrual_rec,
7287: p_stream_tbl => l_stream_tbl);
7288:
7289: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7290: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7291: -- need to leave
7292: Okl_Api.set_message(p_app_name => g_app_name,
7293: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7286: p_accrual_rec => l_accrual_rec,
7287: p_stream_tbl => l_stream_tbl);
7288:
7289: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7290: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7291: -- need to leave
7292: Okl_Api.set_message(p_app_name => g_app_name,
7293: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7294: p_token1 => g_contract_number_token,
7288:
7289: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7290: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7291: -- need to leave
7292: Okl_Api.set_message(p_app_name => g_app_name,
7293: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7294: p_token1 => g_contract_number_token,
7295: p_token1_value => l_contract_number);
7296: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7292: Okl_Api.set_message(p_app_name => g_app_name,
7293: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7294: p_token1 => g_contract_number_token,
7295: p_token1_value => l_contract_number);
7296: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7297: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7298: Okl_Api.set_message(p_app_name => g_app_name,
7299: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7300: p_token1 => g_contract_number_token,
7293: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7294: p_token1 => g_contract_number_token,
7295: p_token1_value => l_contract_number);
7296: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7297: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7298: Okl_Api.set_message(p_app_name => g_app_name,
7299: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7300: p_token1 => g_contract_number_token,
7301: p_token1_value => l_contract_number);
7294: p_token1 => g_contract_number_token,
7295: p_token1_value => l_contract_number);
7296: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7297: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7298: Okl_Api.set_message(p_app_name => g_app_name,
7299: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7300: p_token1 => g_contract_number_token,
7301: p_token1_value => l_contract_number);
7302: RAISE OKL_API.G_EXCEPTION_ERROR;
7298: Okl_Api.set_message(p_app_name => g_app_name,
7299: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7300: p_token1 => g_contract_number_token,
7301: p_token1_value => l_contract_number);
7302: RAISE OKL_API.G_EXCEPTION_ERROR;
7303: END IF;
7304: END IF;
7305: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7306: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7324: ,p_ctr_start_date => l_start_date
7325: ,p_period_end_date => G_PERIOD_END_DATE_REP
7326: ,p_accrual_rule_yn => 'ACRL_WITHOUT_RULE');
7327: -- store the highest degree of error
7328: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7329: Okl_Api.set_message(p_app_name => g_app_name,
7330: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7331: p_token1 => g_contract_number_token,
7332: p_token1_value => l_contract_number);
7325: ,p_period_end_date => G_PERIOD_END_DATE_REP
7326: ,p_accrual_rule_yn => 'ACRL_WITHOUT_RULE');
7327: -- store the highest degree of error
7328: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7329: Okl_Api.set_message(p_app_name => g_app_name,
7330: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7331: p_token1 => g_contract_number_token,
7332: p_token1_value => l_contract_number);
7333: RAISE OKL_API.G_EXCEPTION_ERROR;
7329: Okl_Api.set_message(p_app_name => g_app_name,
7330: p_msg_name => 'OKL_AGN_STREAM_ERROR',
7331: p_token1 => g_contract_number_token,
7332: p_token1_value => l_contract_number);
7333: RAISE OKL_API.G_EXCEPTION_ERROR;
7334: END IF;
7335: IF l_stream_tbl_rep.COUNT > 0 THEN
7336:
7337: -- re-initialize necessary variables
7391: p_accrual_rec => l_accrual_rec,
7392: p_stream_tbl => l_stream_tbl_rep,
7393: p_representation_type => 'SECONDARY');
7394:
7395: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7396: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7397: -- need to leave
7398: Okl_Api.set_message(p_app_name => g_app_name,
7399: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7392: p_stream_tbl => l_stream_tbl_rep,
7393: p_representation_type => 'SECONDARY');
7394:
7395: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7396: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7397: -- need to leave
7398: Okl_Api.set_message(p_app_name => g_app_name,
7399: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7400: p_token1 => g_contract_number_token,
7394:
7395: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7396: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7397: -- need to leave
7398: Okl_Api.set_message(p_app_name => g_app_name,
7399: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7400: p_token1 => g_contract_number_token,
7401: p_token1_value => l_contract_number);
7402: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7398: Okl_Api.set_message(p_app_name => g_app_name,
7399: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7400: p_token1 => g_contract_number_token,
7401: p_token1_value => l_contract_number);
7402: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7403: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7404: Okl_Api.set_message(p_app_name => g_app_name,
7405: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7406: p_token1 => g_contract_number_token,
7399: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7400: p_token1 => g_contract_number_token,
7401: p_token1_value => l_contract_number);
7402: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7403: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7404: Okl_Api.set_message(p_app_name => g_app_name,
7405: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7406: p_token1 => g_contract_number_token,
7407: p_token1_value => l_contract_number);
7400: p_token1 => g_contract_number_token,
7401: p_token1_value => l_contract_number);
7402: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7403: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7404: Okl_Api.set_message(p_app_name => g_app_name,
7405: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7406: p_token1 => g_contract_number_token,
7407: p_token1_value => l_contract_number);
7408: RAISE OKL_API.G_EXCEPTION_ERROR;
7404: Okl_Api.set_message(p_app_name => g_app_name,
7405: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7406: p_token1 => g_contract_number_token,
7407: p_token1_value => l_contract_number);
7408: RAISE OKL_API.G_EXCEPTION_ERROR;
7409: END IF;
7410: END IF;
7411: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7412: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7439: -- FETCH sty_id_csr INTO l_sty_id;
7440: -- IF sty_id_csr%NOTFOUND THEN
7441: -- CLOSE sty_id_csr;
7442: -- -- store SQL error message on message stack for caller and entry in log file
7443: -- Okl_Api.set_message(p_app_name => g_app_name,
7444: -- p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7445: -- p_token1 => g_stream_name_token,
7446: -- p_token1_value => 'VARIABLE INCOME ACCRUAL');
7447: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
7443: -- Okl_Api.set_message(p_app_name => g_app_name,
7444: -- p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7445: -- p_token1 => g_stream_name_token,
7446: -- p_token1_value => 'VARIABLE INCOME ACCRUAL');
7447: -- RAISE Okl_Api.G_EXCEPTION_ERROR;
7448: -- END IF;
7449: -- CLOSE sty_id_csr;
7450:
7451: -- Get the stream type id for variable interest rate product
7455: p_dependent_sty_purpose => 'VARIABLE_INTEREST_INCOME',
7456: x_return_status => l_return_status,
7457: x_dependent_sty_id => l_sty_id);
7458:
7459: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
7460: -- store SQL error message on message stack for caller and entry in log file
7461: Okl_Api.set_message(p_app_name => g_app_name,
7462: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7463: p_token1 => g_stream_name_token,
7457: x_dependent_sty_id => l_sty_id);
7458:
7459: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
7460: -- store SQL error message on message stack for caller and entry in log file
7461: Okl_Api.set_message(p_app_name => g_app_name,
7462: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7463: p_token1 => g_stream_name_token,
7464: p_token1_value => 'VARIABLE INTEREST INCOME');
7465: RAISE Okl_Api.G_EXCEPTION_ERROR;
7461: Okl_Api.set_message(p_app_name => g_app_name,
7462: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7463: p_token1 => g_stream_name_token,
7464: p_token1_value => 'VARIABLE INTEREST INCOME');
7465: RAISE Okl_Api.G_EXCEPTION_ERROR;
7466: END IF;
7467:
7468: -- MGAAP 7263041 start
7469: IF (l_multi_gaap_yn = 'Y') THEN
7474: p_dependent_sty_purpose => 'VARIABLE_INTEREST_INCOME',
7475: x_return_status => l_return_status,
7476: x_dependent_sty_id => l_sty_id_rep);
7477:
7478: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
7479: -- store SQL error message on message stack for caller and entry in log file
7480: Okl_Api.set_message(p_app_name => g_app_name,
7481: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7482: p_token1 => g_stream_name_token,
7476: x_dependent_sty_id => l_sty_id_rep);
7477:
7478: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
7479: -- store SQL error message on message stack for caller and entry in log file
7480: Okl_Api.set_message(p_app_name => g_app_name,
7481: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7482: p_token1 => g_stream_name_token,
7483: p_token1_value => 'VARIABLE INTEREST INCOME');
7484: RAISE Okl_Api.G_EXCEPTION_ERROR;
7480: Okl_Api.set_message(p_app_name => g_app_name,
7481: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
7482: p_token1 => g_stream_name_token,
7483: p_token1_value => 'VARIABLE INTEREST INCOME');
7484: RAISE Okl_Api.G_EXCEPTION_ERROR;
7485: END IF;
7486: END IF;
7487: -- MGAAP 7263041 end
7488:
7570: p_accrual_rec => l_accrual_rec,
7571: p_ctxt_val_tbl => l_ctxt_val_tbl);
7572:
7573: -- store the highest degree of error
7574: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7575: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7576: -- need to leave
7577: Okl_Api.set_message(p_app_name => g_app_name,
7578: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7571: p_ctxt_val_tbl => l_ctxt_val_tbl);
7572:
7573: -- store the highest degree of error
7574: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7575: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7576: -- need to leave
7577: Okl_Api.set_message(p_app_name => g_app_name,
7578: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7579: p_token1 => g_contract_number_token,
7573: -- store the highest degree of error
7574: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7575: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7576: -- need to leave
7577: Okl_Api.set_message(p_app_name => g_app_name,
7578: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7579: p_token1 => g_contract_number_token,
7580: p_token1_value => l_contract_number);
7581: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7577: Okl_Api.set_message(p_app_name => g_app_name,
7578: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7579: p_token1 => g_contract_number_token,
7580: p_token1_value => l_contract_number);
7581: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7582: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7583: Okl_Api.set_message(p_app_name => g_app_name,
7584: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7585: p_token1 => g_contract_number_token,
7578: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7579: p_token1 => g_contract_number_token,
7580: p_token1_value => l_contract_number);
7581: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7582: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7583: Okl_Api.set_message(p_app_name => g_app_name,
7584: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7585: p_token1 => g_contract_number_token,
7586: p_token1_value => l_contract_number);
7579: p_token1 => g_contract_number_token,
7580: p_token1_value => l_contract_number);
7581: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7582: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7583: Okl_Api.set_message(p_app_name => g_app_name,
7584: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7585: p_token1 => g_contract_number_token,
7586: p_token1_value => l_contract_number);
7587: RAISE OKL_API.G_EXCEPTION_ERROR;
7583: Okl_Api.set_message(p_app_name => g_app_name,
7584: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7585: p_token1 => g_contract_number_token,
7586: p_token1_value => l_contract_number);
7587: RAISE OKL_API.G_EXCEPTION_ERROR;
7588: END IF;
7589: END IF;
7590: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7591: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7621: p_ctxt_val_tbl => l_ctxt_val_tbl,
7622: p_representation_type => 'SECONDARY'); -- MGAAP
7623:
7624: -- store the highest degree of error
7625: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7626: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7627: -- need to leave
7628: Okl_Api.set_message(p_app_name => g_app_name,
7629: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7622: p_representation_type => 'SECONDARY'); -- MGAAP
7623:
7624: -- store the highest degree of error
7625: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7626: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7627: -- need to leave
7628: Okl_Api.set_message(p_app_name => g_app_name,
7629: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7630: p_token1 => g_contract_number_token,
7624: -- store the highest degree of error
7625: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7626: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7627: -- need to leave
7628: Okl_Api.set_message(p_app_name => g_app_name,
7629: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7630: p_token1 => g_contract_number_token,
7631: p_token1_value => l_contract_number);
7632: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7628: Okl_Api.set_message(p_app_name => g_app_name,
7629: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7630: p_token1 => g_contract_number_token,
7631: p_token1_value => l_contract_number);
7632: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7633: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7634: Okl_Api.set_message(p_app_name => g_app_name,
7635: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7636: p_token1 => g_contract_number_token,
7629: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7630: p_token1 => g_contract_number_token,
7631: p_token1_value => l_contract_number);
7632: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7633: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7634: Okl_Api.set_message(p_app_name => g_app_name,
7635: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7636: p_token1 => g_contract_number_token,
7637: p_token1_value => l_contract_number);
7630: p_token1 => g_contract_number_token,
7631: p_token1_value => l_contract_number);
7632: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7633: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7634: Okl_Api.set_message(p_app_name => g_app_name,
7635: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7636: p_token1 => g_contract_number_token,
7637: p_token1_value => l_contract_number);
7638: RAISE OKL_API.G_EXCEPTION_ERROR;
7634: Okl_Api.set_message(p_app_name => g_app_name,
7635: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7636: p_token1 => g_contract_number_token,
7637: p_token1_value => l_contract_number);
7638: RAISE OKL_API.G_EXCEPTION_ERROR;
7639: END IF;
7640: END IF;
7641: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7642: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7705: p_accrual_rec => l_accrual_rec,
7706: p_ctxt_val_tbl => l_ctxt_val_tbl);
7707:
7708: -- store the highest degree of error
7709: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7710: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7711: -- need to leave
7712: Okl_Api.set_message(p_app_name => g_app_name,
7713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7706: p_ctxt_val_tbl => l_ctxt_val_tbl);
7707:
7708: -- store the highest degree of error
7709: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7710: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7711: -- need to leave
7712: Okl_Api.set_message(p_app_name => g_app_name,
7713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7714: p_token1 => g_contract_number_token,
7708: -- store the highest degree of error
7709: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7710: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7711: -- need to leave
7712: Okl_Api.set_message(p_app_name => g_app_name,
7713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7714: p_token1 => g_contract_number_token,
7715: p_token1_value => l_contract_number);
7716: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7712: Okl_Api.set_message(p_app_name => g_app_name,
7713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7714: p_token1 => g_contract_number_token,
7715: p_token1_value => l_contract_number);
7716: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7717: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7718: Okl_Api.set_message(p_app_name => g_app_name,
7719: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7720: p_token1 => g_contract_number_token,
7713: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7714: p_token1 => g_contract_number_token,
7715: p_token1_value => l_contract_number);
7716: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7717: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7718: Okl_Api.set_message(p_app_name => g_app_name,
7719: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7720: p_token1 => g_contract_number_token,
7721: p_token1_value => l_contract_number);
7714: p_token1 => g_contract_number_token,
7715: p_token1_value => l_contract_number);
7716: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7717: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7718: Okl_Api.set_message(p_app_name => g_app_name,
7719: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7720: p_token1 => g_contract_number_token,
7721: p_token1_value => l_contract_number);
7722: RAISE OKL_API.G_EXCEPTION_ERROR;
7718: Okl_Api.set_message(p_app_name => g_app_name,
7719: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7720: p_token1 => g_contract_number_token,
7721: p_token1_value => l_contract_number);
7722: RAISE OKL_API.G_EXCEPTION_ERROR;
7723: END IF;
7724: END IF;
7725:
7726: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7757: p_ctxt_val_tbl => l_ctxt_val_tbl,
7758: p_representation_type => 'SECONDARY'); -- MGAAP
7759:
7760: -- store the highest degree of error
7761: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7762: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7763: -- need to leave
7764: Okl_Api.set_message(p_app_name => g_app_name,
7765: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7758: p_representation_type => 'SECONDARY'); -- MGAAP
7759:
7760: -- store the highest degree of error
7761: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7762: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7763: -- need to leave
7764: Okl_Api.set_message(p_app_name => g_app_name,
7765: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7766: p_token1 => g_contract_number_token,
7760: -- store the highest degree of error
7761: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7762: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7763: -- need to leave
7764: Okl_Api.set_message(p_app_name => g_app_name,
7765: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7766: p_token1 => g_contract_number_token,
7767: p_token1_value => l_contract_number);
7768: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7764: Okl_Api.set_message(p_app_name => g_app_name,
7765: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7766: p_token1 => g_contract_number_token,
7767: p_token1_value => l_contract_number);
7768: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7769: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7770: Okl_Api.set_message(p_app_name => g_app_name,
7771: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7772: p_token1 => g_contract_number_token,
7765: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7766: p_token1 => g_contract_number_token,
7767: p_token1_value => l_contract_number);
7768: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7769: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7770: Okl_Api.set_message(p_app_name => g_app_name,
7771: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7772: p_token1 => g_contract_number_token,
7773: p_token1_value => l_contract_number);
7766: p_token1 => g_contract_number_token,
7767: p_token1_value => l_contract_number);
7768: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7769: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7770: Okl_Api.set_message(p_app_name => g_app_name,
7771: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7772: p_token1 => g_contract_number_token,
7773: p_token1_value => l_contract_number);
7774: RAISE OKL_API.G_EXCEPTION_ERROR;
7770: Okl_Api.set_message(p_app_name => g_app_name,
7771: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7772: p_token1 => g_contract_number_token,
7773: p_token1_value => l_contract_number);
7774: RAISE OKL_API.G_EXCEPTION_ERROR;
7775: END IF;
7776: END IF;
7777:
7778: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7843: p_accrual_rec => l_accrual_rec,
7844: p_ctxt_val_tbl => l_ctxt_val_tbl);
7845:
7846: -- store the highest degree of error
7847: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7848: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7849: -- need to leave
7850: Okl_Api.set_message(p_app_name => g_app_name,
7851: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7844: p_ctxt_val_tbl => l_ctxt_val_tbl);
7845:
7846: -- store the highest degree of error
7847: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7848: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7849: -- need to leave
7850: Okl_Api.set_message(p_app_name => g_app_name,
7851: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7852: p_token1 => g_contract_number_token,
7846: -- store the highest degree of error
7847: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7848: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7849: -- need to leave
7850: Okl_Api.set_message(p_app_name => g_app_name,
7851: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7852: p_token1 => g_contract_number_token,
7853: p_token1_value => l_contract_number);
7854: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7850: Okl_Api.set_message(p_app_name => g_app_name,
7851: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7852: p_token1 => g_contract_number_token,
7853: p_token1_value => l_contract_number);
7854: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7855: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7856: Okl_Api.set_message(p_app_name => g_app_name,
7857: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7858: p_token1 => g_contract_number_token,
7851: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7852: p_token1 => g_contract_number_token,
7853: p_token1_value => l_contract_number);
7854: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7855: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7856: Okl_Api.set_message(p_app_name => g_app_name,
7857: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7858: p_token1 => g_contract_number_token,
7859: p_token1_value => l_contract_number);
7852: p_token1 => g_contract_number_token,
7853: p_token1_value => l_contract_number);
7854: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7855: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7856: Okl_Api.set_message(p_app_name => g_app_name,
7857: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7858: p_token1 => g_contract_number_token,
7859: p_token1_value => l_contract_number);
7860: RAISE OKL_API.G_EXCEPTION_ERROR;
7856: Okl_Api.set_message(p_app_name => g_app_name,
7857: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7858: p_token1 => g_contract_number_token,
7859: p_token1_value => l_contract_number);
7860: RAISE OKL_API.G_EXCEPTION_ERROR;
7861: END IF;
7862: END IF;
7863: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7864: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7893: p_ctxt_val_tbl => l_ctxt_val_tbl,
7894: p_representation_type => 'SECONDARY');
7895:
7896: -- store the highest degree of error
7897: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7898: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7899: -- need to leave
7900: Okl_Api.set_message(p_app_name => g_app_name,
7901: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7894: p_representation_type => 'SECONDARY');
7895:
7896: -- store the highest degree of error
7897: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7898: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7899: -- need to leave
7900: Okl_Api.set_message(p_app_name => g_app_name,
7901: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7902: p_token1 => g_contract_number_token,
7896: -- store the highest degree of error
7897: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7898: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7899: -- need to leave
7900: Okl_Api.set_message(p_app_name => g_app_name,
7901: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7902: p_token1 => g_contract_number_token,
7903: p_token1_value => l_contract_number);
7904: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7900: Okl_Api.set_message(p_app_name => g_app_name,
7901: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7902: p_token1 => g_contract_number_token,
7903: p_token1_value => l_contract_number);
7904: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7905: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7906: Okl_Api.set_message(p_app_name => g_app_name,
7907: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7908: p_token1 => g_contract_number_token,
7901: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7902: p_token1 => g_contract_number_token,
7903: p_token1_value => l_contract_number);
7904: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7905: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7906: Okl_Api.set_message(p_app_name => g_app_name,
7907: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7908: p_token1 => g_contract_number_token,
7909: p_token1_value => l_contract_number);
7902: p_token1 => g_contract_number_token,
7903: p_token1_value => l_contract_number);
7904: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7905: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
7906: Okl_Api.set_message(p_app_name => g_app_name,
7907: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7908: p_token1 => g_contract_number_token,
7909: p_token1_value => l_contract_number);
7910: RAISE OKL_API.G_EXCEPTION_ERROR;
7906: Okl_Api.set_message(p_app_name => g_app_name,
7907: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7908: p_token1 => g_contract_number_token,
7909: p_token1_value => l_contract_number);
7910: RAISE OKL_API.G_EXCEPTION_ERROR;
7911: END IF;
7912: END IF;
7913: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7914: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
7978: p_accrual_rec => l_accrual_rec,
7979: p_ctxt_val_tbl => l_ctxt_val_tbl);
7980:
7981: -- store the highest degree of error
7982: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7983: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7984: -- need to leave
7985: Okl_Api.set_message(p_app_name => g_app_name,
7986: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7979: p_ctxt_val_tbl => l_ctxt_val_tbl);
7980:
7981: -- store the highest degree of error
7982: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7983: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7984: -- need to leave
7985: Okl_Api.set_message(p_app_name => g_app_name,
7986: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7987: p_token1 => g_contract_number_token,
7981: -- store the highest degree of error
7982: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
7983: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
7984: -- need to leave
7985: Okl_Api.set_message(p_app_name => g_app_name,
7986: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7987: p_token1 => g_contract_number_token,
7988: p_token1_value => l_contract_number);
7989: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7985: Okl_Api.set_message(p_app_name => g_app_name,
7986: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7987: p_token1 => g_contract_number_token,
7988: p_token1_value => l_contract_number);
7989: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7990: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7991: Okl_Api.set_message(p_app_name => g_app_name,
7992: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7993: p_token1 => g_contract_number_token,
7986: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7987: p_token1 => g_contract_number_token,
7988: p_token1_value => l_contract_number);
7989: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7990: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7991: Okl_Api.set_message(p_app_name => g_app_name,
7992: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7993: p_token1 => g_contract_number_token,
7994: p_token1_value => l_contract_number);
7987: p_token1 => g_contract_number_token,
7988: p_token1_value => l_contract_number);
7989: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
7990: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
7991: Okl_Api.set_message(p_app_name => g_app_name,
7992: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7993: p_token1 => g_contract_number_token,
7994: p_token1_value => l_contract_number);
7995: RAISE OKL_API.G_EXCEPTION_ERROR;
7991: Okl_Api.set_message(p_app_name => g_app_name,
7992: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
7993: p_token1 => g_contract_number_token,
7994: p_token1_value => l_contract_number);
7995: RAISE OKL_API.G_EXCEPTION_ERROR;
7996: END IF;
7997: END IF;
7998: IF p_process_accrual_rec.submission_mode='BATCH' THEN
7999: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
8028: p_ctxt_val_tbl => l_ctxt_val_tbl,
8029: p_representation_type => 'SECONDARY'); -- MGAAP
8030:
8031: -- store the highest degree of error
8032: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8033: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8034: -- need to leave
8035: Okl_Api.set_message(p_app_name => g_app_name,
8036: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8029: p_representation_type => 'SECONDARY'); -- MGAAP
8030:
8031: -- store the highest degree of error
8032: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8033: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8034: -- need to leave
8035: Okl_Api.set_message(p_app_name => g_app_name,
8036: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8037: p_token1 => g_contract_number_token,
8031: -- store the highest degree of error
8032: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8033: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8034: -- need to leave
8035: Okl_Api.set_message(p_app_name => g_app_name,
8036: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8037: p_token1 => g_contract_number_token,
8038: p_token1_value => l_contract_number);
8039: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8035: Okl_Api.set_message(p_app_name => g_app_name,
8036: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8037: p_token1 => g_contract_number_token,
8038: p_token1_value => l_contract_number);
8039: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8040: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8041: Okl_Api.set_message(p_app_name => g_app_name,
8042: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8043: p_token1 => g_contract_number_token,
8036: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8037: p_token1 => g_contract_number_token,
8038: p_token1_value => l_contract_number);
8039: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8040: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8041: Okl_Api.set_message(p_app_name => g_app_name,
8042: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8043: p_token1 => g_contract_number_token,
8044: p_token1_value => l_contract_number);
8037: p_token1 => g_contract_number_token,
8038: p_token1_value => l_contract_number);
8039: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8040: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8041: Okl_Api.set_message(p_app_name => g_app_name,
8042: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8043: p_token1 => g_contract_number_token,
8044: p_token1_value => l_contract_number);
8045: RAISE OKL_API.G_EXCEPTION_ERROR;
8041: Okl_Api.set_message(p_app_name => g_app_name,
8042: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8043: p_token1 => g_contract_number_token,
8044: p_token1_value => l_contract_number);
8045: RAISE OKL_API.G_EXCEPTION_ERROR;
8046: END IF;
8047: END IF;
8048: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8049: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,RPAD(l_contract_number,28)||
8061: END IF; -- l_rev_rec_basis =
8062: END IF ; -- IF l_accrual_date - l_last_interest_calc_date > 0
8063:
8064: ELSE -- If l_trx_exists <> 'Y'
8065: Okl_Api.set_message(p_app_name => g_app_name,
8066: p_msg_name => 'OKL_AGN_EST_BILL_DATE_ERROR',
8067: p_token1 => g_contract_number_token,
8068: p_token1_value => l_contract_number,
8069: p_token2 => 'PERIOD',
8068: p_token1_value => l_contract_number,
8069: p_token2 => 'PERIOD',
8070: p_token2_value => to_char(l_accrual_date,'Mon-YY')
8071: );
8072: RAISE Okl_Api.G_EXCEPTION_ERROR;
8073: END IF; -- If l_trx_exists <> 'Y'
8074: ELSIF l_rev_rec_method = 'ACTUAL' THEN
8075:
8076: -- Bug 5036337.Commenting below as method t check has changed.
8097: p_dependent_sty_purpose => 'ACTUAL_INCOME_ACCRUAL',
8098: x_return_status => l_return_status,
8099: x_dependent_sty_id => l_sty_id);
8100:
8101: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
8102: -- store SQL error message on message stack for caller and entry in log file
8103: Okl_Api.set_message(p_app_name => g_app_name,
8104: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8105: p_token1 => g_stream_name_token,
8099: x_dependent_sty_id => l_sty_id);
8100:
8101: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
8102: -- store SQL error message on message stack for caller and entry in log file
8103: Okl_Api.set_message(p_app_name => g_app_name,
8104: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8105: p_token1 => g_stream_name_token,
8106: p_token1_value => 'ACTUAL INCOME ACCRUAL');
8107: RAISE Okl_Api.G_EXCEPTION_ERROR;
8103: Okl_Api.set_message(p_app_name => g_app_name,
8104: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8105: p_token1 => g_stream_name_token,
8106: p_token1_value => 'ACTUAL INCOME ACCRUAL');
8107: RAISE Okl_Api.G_EXCEPTION_ERROR;
8108: END IF;
8109:
8110: IF (l_multi_gaap_yn = 'Y') THEN
8111: OKL_STREAMS_UTIL.get_dependent_stream_type_rep(
8114: p_dependent_sty_purpose => 'ACTUAL_INCOME_ACCRUAL',
8115: x_return_status => l_return_status,
8116: x_dependent_sty_id => l_sty_id_rep);
8117:
8118: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
8119: -- store SQL error message on message stack for caller and entry in log file
8120: Okl_Api.set_message(p_app_name => g_app_name,
8121: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8122: p_token1 => g_stream_name_token,
8116: x_dependent_sty_id => l_sty_id_rep);
8117:
8118: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
8119: -- store SQL error message on message stack for caller and entry in log file
8120: Okl_Api.set_message(p_app_name => g_app_name,
8121: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8122: p_token1 => g_stream_name_token,
8123: p_token1_value => 'ACTUAL INCOME ACCRUAL');
8124: RAISE Okl_Api.G_EXCEPTION_ERROR;
8120: Okl_Api.set_message(p_app_name => g_app_name,
8121: p_msg_name => 'OKL_AGN_STRM_TYPE_ERROR',
8122: p_token1 => g_stream_name_token,
8123: p_token1_value => 'ACTUAL INCOME ACCRUAL');
8124: RAISE Okl_Api.G_EXCEPTION_ERROR;
8125: END IF;
8126: END IF;
8127:
8128: -- Get revenue recognition basis from stream type
8178: p_accrual_rec => l_accrual_rec,
8179: p_ctxt_val_tbl => l_ctxt_val_tbl);
8180:
8181: -- store the highest degree of error
8182: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8183: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8184: -- need to leave
8185: Okl_Api.set_message(p_app_name => g_app_name,
8186: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8179: p_ctxt_val_tbl => l_ctxt_val_tbl);
8180:
8181: -- store the highest degree of error
8182: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8183: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8184: -- need to leave
8185: Okl_Api.set_message(p_app_name => g_app_name,
8186: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8187: p_token1 => g_contract_number_token,
8181: -- store the highest degree of error
8182: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8183: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8184: -- need to leave
8185: Okl_Api.set_message(p_app_name => g_app_name,
8186: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8187: p_token1 => g_contract_number_token,
8188: p_token1_value => l_contract_number);
8189: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8185: Okl_Api.set_message(p_app_name => g_app_name,
8186: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8187: p_token1 => g_contract_number_token,
8188: p_token1_value => l_contract_number);
8189: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8190: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8191: Okl_Api.set_message(p_app_name => g_app_name,
8192: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8193: p_token1 => g_contract_number_token,
8186: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8187: p_token1 => g_contract_number_token,
8188: p_token1_value => l_contract_number);
8189: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8190: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8191: Okl_Api.set_message(p_app_name => g_app_name,
8192: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8193: p_token1 => g_contract_number_token,
8194: p_token1_value => l_contract_number);
8187: p_token1 => g_contract_number_token,
8188: p_token1_value => l_contract_number);
8189: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8190: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8191: Okl_Api.set_message(p_app_name => g_app_name,
8192: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8193: p_token1 => g_contract_number_token,
8194: p_token1_value => l_contract_number);
8195: RAISE OKL_API.G_EXCEPTION_ERROR;
8191: Okl_Api.set_message(p_app_name => g_app_name,
8192: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8193: p_token1 => g_contract_number_token,
8194: p_token1_value => l_contract_number);
8195: RAISE OKL_API.G_EXCEPTION_ERROR;
8196: END IF;
8197: END IF;
8198: -- Update balances table
8199: IF l_tcnv_rec.amount IS NOT NULL THEN
8204: ,l_return_status
8205: ,l_msg_count
8206: ,l_msg_data);
8207: -- store the highest degree of error
8208: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8209: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8210: -- need to leave
8211: Okl_Api.set_message(p_app_name => g_app_name,
8212: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8205: ,l_msg_count
8206: ,l_msg_data);
8207: -- store the highest degree of error
8208: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8209: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8210: -- need to leave
8211: Okl_Api.set_message(p_app_name => g_app_name,
8212: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8213: p_token1 => g_contract_number_token,
8207: -- store the highest degree of error
8208: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8209: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8210: -- need to leave
8211: Okl_Api.set_message(p_app_name => g_app_name,
8212: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8213: p_token1 => g_contract_number_token,
8214: p_token1_value => l_contract_number);
8215: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8211: Okl_Api.set_message(p_app_name => g_app_name,
8212: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8213: p_token1 => g_contract_number_token,
8214: p_token1_value => l_contract_number);
8215: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8216: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8217: Okl_Api.set_message(p_app_name => g_app_name,
8218: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8219: p_token1 => g_contract_number_token,
8212: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8213: p_token1 => g_contract_number_token,
8214: p_token1_value => l_contract_number);
8215: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8216: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8217: Okl_Api.set_message(p_app_name => g_app_name,
8218: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8219: p_token1 => g_contract_number_token,
8220: p_token1_value => l_contract_number);
8213: p_token1 => g_contract_number_token,
8214: p_token1_value => l_contract_number);
8215: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8216: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8217: Okl_Api.set_message(p_app_name => g_app_name,
8218: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8219: p_token1 => g_contract_number_token,
8220: p_token1_value => l_contract_number);
8221: RAISE OKL_API.G_EXCEPTION_ERROR;
8217: Okl_Api.set_message(p_app_name => g_app_name,
8218: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8219: p_token1 => g_contract_number_token,
8220: p_token1_value => l_contract_number);
8221: RAISE OKL_API.G_EXCEPTION_ERROR;
8222: END IF;
8223: END IF;
8224: END IF;
8225:
8253: p_ctxt_val_tbl => l_ctxt_val_tbl,
8254: p_representation_type => 'SECONDARY');
8255:
8256: -- store the highest degree of error
8257: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8258: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8259: -- need to leave
8260: Okl_Api.set_message(p_app_name => g_app_name,
8261: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8254: p_representation_type => 'SECONDARY');
8255:
8256: -- store the highest degree of error
8257: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8258: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8259: -- need to leave
8260: Okl_Api.set_message(p_app_name => g_app_name,
8261: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8262: p_token1 => g_contract_number_token,
8256: -- store the highest degree of error
8257: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8258: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8259: -- need to leave
8260: Okl_Api.set_message(p_app_name => g_app_name,
8261: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8262: p_token1 => g_contract_number_token,
8263: p_token1_value => l_contract_number);
8264: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8260: Okl_Api.set_message(p_app_name => g_app_name,
8261: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8262: p_token1 => g_contract_number_token,
8263: p_token1_value => l_contract_number);
8264: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8265: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8266: Okl_Api.set_message(p_app_name => g_app_name,
8267: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8268: p_token1 => g_contract_number_token,
8261: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8262: p_token1 => g_contract_number_token,
8263: p_token1_value => l_contract_number);
8264: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8265: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8266: Okl_Api.set_message(p_app_name => g_app_name,
8267: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8268: p_token1 => g_contract_number_token,
8269: p_token1_value => l_contract_number);
8262: p_token1 => g_contract_number_token,
8263: p_token1_value => l_contract_number);
8264: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8265: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8266: Okl_Api.set_message(p_app_name => g_app_name,
8267: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8268: p_token1 => g_contract_number_token,
8269: p_token1_value => l_contract_number);
8270: RAISE OKL_API.G_EXCEPTION_ERROR;
8266: Okl_Api.set_message(p_app_name => g_app_name,
8267: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8268: p_token1 => g_contract_number_token,
8269: p_token1_value => l_contract_number);
8270: RAISE OKL_API.G_EXCEPTION_ERROR;
8271: END IF;
8272: END IF;
8273:
8274: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8328: p_accrual_rec => l_accrual_rec,
8329: p_ctxt_val_tbl => l_ctxt_val_tbl);
8330:
8331: -- store the highest degree of error
8332: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8333: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8334: -- need to leave
8335: Okl_Api.set_message(p_app_name => g_app_name,
8336: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8329: p_ctxt_val_tbl => l_ctxt_val_tbl);
8330:
8331: -- store the highest degree of error
8332: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8333: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8334: -- need to leave
8335: Okl_Api.set_message(p_app_name => g_app_name,
8336: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8337: p_token1 => g_contract_number_token,
8331: -- store the highest degree of error
8332: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8333: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8334: -- need to leave
8335: Okl_Api.set_message(p_app_name => g_app_name,
8336: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8337: p_token1 => g_contract_number_token,
8338: p_token1_value => l_contract_number);
8339: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8335: Okl_Api.set_message(p_app_name => g_app_name,
8336: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8337: p_token1 => g_contract_number_token,
8338: p_token1_value => l_contract_number);
8339: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8340: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8341: Okl_Api.set_message(p_app_name => g_app_name,
8342: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8343: p_token1 => g_contract_number_token,
8336: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8337: p_token1 => g_contract_number_token,
8338: p_token1_value => l_contract_number);
8339: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8340: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8341: Okl_Api.set_message(p_app_name => g_app_name,
8342: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8343: p_token1 => g_contract_number_token,
8344: p_token1_value => l_contract_number);
8337: p_token1 => g_contract_number_token,
8338: p_token1_value => l_contract_number);
8339: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8340: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8341: Okl_Api.set_message(p_app_name => g_app_name,
8342: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8343: p_token1 => g_contract_number_token,
8344: p_token1_value => l_contract_number);
8345: RAISE OKL_API.G_EXCEPTION_ERROR;
8341: Okl_Api.set_message(p_app_name => g_app_name,
8342: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8343: p_token1 => g_contract_number_token,
8344: p_token1_value => l_contract_number);
8345: RAISE OKL_API.G_EXCEPTION_ERROR;
8346: END IF;
8347: END IF;
8348:
8349: -- Update balances table
8355: ,l_return_status
8356: ,l_msg_count
8357: ,l_msg_data);
8358: -- store the highest degree of error
8359: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8360: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8361: -- need to leave
8362: Okl_Api.set_message(p_app_name => g_app_name,
8363: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8356: ,l_msg_count
8357: ,l_msg_data);
8358: -- store the highest degree of error
8359: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8360: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8361: -- need to leave
8362: Okl_Api.set_message(p_app_name => g_app_name,
8363: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8364: p_token1 => g_contract_number_token,
8358: -- store the highest degree of error
8359: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8360: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8361: -- need to leave
8362: Okl_Api.set_message(p_app_name => g_app_name,
8363: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8364: p_token1 => g_contract_number_token,
8365: p_token1_value => l_contract_number);
8366: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8362: Okl_Api.set_message(p_app_name => g_app_name,
8363: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8364: p_token1 => g_contract_number_token,
8365: p_token1_value => l_contract_number);
8366: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8367: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8368: Okl_Api.set_message(p_app_name => g_app_name,
8369: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8370: p_token1 => g_contract_number_token,
8363: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8364: p_token1 => g_contract_number_token,
8365: p_token1_value => l_contract_number);
8366: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8367: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8368: Okl_Api.set_message(p_app_name => g_app_name,
8369: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8370: p_token1 => g_contract_number_token,
8371: p_token1_value => l_contract_number);
8364: p_token1 => g_contract_number_token,
8365: p_token1_value => l_contract_number);
8366: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8367: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8368: Okl_Api.set_message(p_app_name => g_app_name,
8369: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8370: p_token1 => g_contract_number_token,
8371: p_token1_value => l_contract_number);
8372: RAISE OKL_API.G_EXCEPTION_ERROR;
8368: Okl_Api.set_message(p_app_name => g_app_name,
8369: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8370: p_token1 => g_contract_number_token,
8371: p_token1_value => l_contract_number);
8372: RAISE OKL_API.G_EXCEPTION_ERROR;
8373: END IF;
8374: END IF;
8375: END IF;
8376:
8404: p_ctxt_val_tbl => l_ctxt_val_tbl,
8405: p_representation_type => 'SECONDARY'); -- MGAAP
8406:
8407: -- store the highest degree of error
8408: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8409: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8410: -- need to leave
8411: Okl_Api.set_message(p_app_name => g_app_name,
8412: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8405: p_representation_type => 'SECONDARY'); -- MGAAP
8406:
8407: -- store the highest degree of error
8408: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8409: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8410: -- need to leave
8411: Okl_Api.set_message(p_app_name => g_app_name,
8412: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8413: p_token1 => g_contract_number_token,
8407: -- store the highest degree of error
8408: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8409: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8410: -- need to leave
8411: Okl_Api.set_message(p_app_name => g_app_name,
8412: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8413: p_token1 => g_contract_number_token,
8414: p_token1_value => l_contract_number);
8415: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8411: Okl_Api.set_message(p_app_name => g_app_name,
8412: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8413: p_token1 => g_contract_number_token,
8414: p_token1_value => l_contract_number);
8415: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8416: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8417: Okl_Api.set_message(p_app_name => g_app_name,
8418: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8419: p_token1 => g_contract_number_token,
8412: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8413: p_token1 => g_contract_number_token,
8414: p_token1_value => l_contract_number);
8415: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8416: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8417: Okl_Api.set_message(p_app_name => g_app_name,
8418: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8419: p_token1 => g_contract_number_token,
8420: p_token1_value => l_contract_number);
8413: p_token1 => g_contract_number_token,
8414: p_token1_value => l_contract_number);
8415: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8416: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8417: Okl_Api.set_message(p_app_name => g_app_name,
8418: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8419: p_token1 => g_contract_number_token,
8420: p_token1_value => l_contract_number);
8421: RAISE OKL_API.G_EXCEPTION_ERROR;
8417: Okl_Api.set_message(p_app_name => g_app_name,
8418: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8419: p_token1 => g_contract_number_token,
8420: p_token1_value => l_contract_number);
8421: RAISE OKL_API.G_EXCEPTION_ERROR;
8422: END IF;
8423: END IF;
8424:
8425: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8480: p_accrual_rec => l_accrual_rec,
8481: p_ctxt_val_tbl => l_ctxt_val_tbl);
8482:
8483: -- store the highest degree of error
8484: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8485: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8486: -- need to leave
8487: Okl_Api.set_message(p_app_name => g_app_name,
8488: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8481: p_ctxt_val_tbl => l_ctxt_val_tbl);
8482:
8483: -- store the highest degree of error
8484: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8485: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8486: -- need to leave
8487: Okl_Api.set_message(p_app_name => g_app_name,
8488: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8489: p_token1 => g_contract_number_token,
8483: -- store the highest degree of error
8484: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8485: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8486: -- need to leave
8487: Okl_Api.set_message(p_app_name => g_app_name,
8488: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8489: p_token1 => g_contract_number_token,
8490: p_token1_value => l_contract_number);
8491: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8487: Okl_Api.set_message(p_app_name => g_app_name,
8488: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8489: p_token1 => g_contract_number_token,
8490: p_token1_value => l_contract_number);
8491: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8492: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8493: Okl_Api.set_message(p_app_name => g_app_name,
8494: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8495: p_token1 => g_contract_number_token,
8488: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8489: p_token1 => g_contract_number_token,
8490: p_token1_value => l_contract_number);
8491: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8492: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8493: Okl_Api.set_message(p_app_name => g_app_name,
8494: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8495: p_token1 => g_contract_number_token,
8496: p_token1_value => l_contract_number);
8489: p_token1 => g_contract_number_token,
8490: p_token1_value => l_contract_number);
8491: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8492: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8493: Okl_Api.set_message(p_app_name => g_app_name,
8494: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8495: p_token1 => g_contract_number_token,
8496: p_token1_value => l_contract_number);
8497: RAISE OKL_API.G_EXCEPTION_ERROR;
8493: Okl_Api.set_message(p_app_name => g_app_name,
8494: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8495: p_token1 => g_contract_number_token,
8496: p_token1_value => l_contract_number);
8497: RAISE OKL_API.G_EXCEPTION_ERROR;
8498: END IF;
8499: END IF;
8500: -- Update balances table
8501: IF l_tcnv_rec.amount IS NOT NULL THEN
8506: ,l_return_status
8507: ,l_msg_count
8508: ,l_msg_data);
8509: -- store the highest degree of error
8510: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8511: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8512: -- need to leave
8513: Okl_Api.set_message(p_app_name => g_app_name,
8514: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8507: ,l_msg_count
8508: ,l_msg_data);
8509: -- store the highest degree of error
8510: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8511: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8512: -- need to leave
8513: Okl_Api.set_message(p_app_name => g_app_name,
8514: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8515: p_token1 => g_contract_number_token,
8509: -- store the highest degree of error
8510: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8511: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8512: -- need to leave
8513: Okl_Api.set_message(p_app_name => g_app_name,
8514: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8515: p_token1 => g_contract_number_token,
8516: p_token1_value => l_contract_number);
8517: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8513: Okl_Api.set_message(p_app_name => g_app_name,
8514: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8515: p_token1 => g_contract_number_token,
8516: p_token1_value => l_contract_number);
8517: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8518: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8519: Okl_Api.set_message(p_app_name => g_app_name,
8520: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8521: p_token1 => g_contract_number_token,
8514: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8515: p_token1 => g_contract_number_token,
8516: p_token1_value => l_contract_number);
8517: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8518: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8519: Okl_Api.set_message(p_app_name => g_app_name,
8520: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8521: p_token1 => g_contract_number_token,
8522: p_token1_value => l_contract_number);
8515: p_token1 => g_contract_number_token,
8516: p_token1_value => l_contract_number);
8517: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8518: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8519: Okl_Api.set_message(p_app_name => g_app_name,
8520: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8521: p_token1 => g_contract_number_token,
8522: p_token1_value => l_contract_number);
8523: RAISE OKL_API.G_EXCEPTION_ERROR;
8519: Okl_Api.set_message(p_app_name => g_app_name,
8520: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8521: p_token1 => g_contract_number_token,
8522: p_token1_value => l_contract_number);
8523: RAISE OKL_API.G_EXCEPTION_ERROR;
8524: END IF;
8525: END IF;
8526: END IF;
8527:
8555: p_ctxt_val_tbl => l_ctxt_val_tbl,
8556: p_representation_type => 'SECONDARY');
8557:
8558: -- store the highest degree of error
8559: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8560: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8561: -- need to leave
8562: Okl_Api.set_message(p_app_name => g_app_name,
8563: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8556: p_representation_type => 'SECONDARY');
8557:
8558: -- store the highest degree of error
8559: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8560: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8561: -- need to leave
8562: Okl_Api.set_message(p_app_name => g_app_name,
8563: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8564: p_token1 => g_contract_number_token,
8558: -- store the highest degree of error
8559: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8560: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8561: -- need to leave
8562: Okl_Api.set_message(p_app_name => g_app_name,
8563: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8564: p_token1 => g_contract_number_token,
8565: p_token1_value => l_contract_number);
8566: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8562: Okl_Api.set_message(p_app_name => g_app_name,
8563: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8564: p_token1 => g_contract_number_token,
8565: p_token1_value => l_contract_number);
8566: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8567: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8568: Okl_Api.set_message(p_app_name => g_app_name,
8569: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8570: p_token1 => g_contract_number_token,
8563: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8564: p_token1 => g_contract_number_token,
8565: p_token1_value => l_contract_number);
8566: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8567: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8568: Okl_Api.set_message(p_app_name => g_app_name,
8569: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8570: p_token1 => g_contract_number_token,
8571: p_token1_value => l_contract_number);
8564: p_token1 => g_contract_number_token,
8565: p_token1_value => l_contract_number);
8566: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8567: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8568: Okl_Api.set_message(p_app_name => g_app_name,
8569: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8570: p_token1 => g_contract_number_token,
8571: p_token1_value => l_contract_number);
8572: RAISE OKL_API.G_EXCEPTION_ERROR;
8568: Okl_Api.set_message(p_app_name => g_app_name,
8569: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8570: p_token1 => g_contract_number_token,
8571: p_token1_value => l_contract_number);
8572: RAISE OKL_API.G_EXCEPTION_ERROR;
8573: END IF;
8574: END IF;
8575:
8576: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8631: p_accrual_rec => l_accrual_rec,
8632: p_ctxt_val_tbl => l_ctxt_val_tbl);
8633:
8634: -- store the highest degree of error
8635: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8636: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8637: -- need to leave
8638: Okl_Api.set_message(p_app_name => g_app_name,
8639: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8632: p_ctxt_val_tbl => l_ctxt_val_tbl);
8633:
8634: -- store the highest degree of error
8635: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8636: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8637: -- need to leave
8638: Okl_Api.set_message(p_app_name => g_app_name,
8639: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8640: p_token1 => g_contract_number_token,
8634: -- store the highest degree of error
8635: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8636: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8637: -- need to leave
8638: Okl_Api.set_message(p_app_name => g_app_name,
8639: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8640: p_token1 => g_contract_number_token,
8641: p_token1_value => l_contract_number);
8642: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8638: Okl_Api.set_message(p_app_name => g_app_name,
8639: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8640: p_token1 => g_contract_number_token,
8641: p_token1_value => l_contract_number);
8642: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8643: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8644: Okl_Api.set_message(p_app_name => g_app_name,
8645: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8646: p_token1 => g_contract_number_token,
8639: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8640: p_token1 => g_contract_number_token,
8641: p_token1_value => l_contract_number);
8642: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8643: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8644: Okl_Api.set_message(p_app_name => g_app_name,
8645: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8646: p_token1 => g_contract_number_token,
8647: p_token1_value => l_contract_number);
8640: p_token1 => g_contract_number_token,
8641: p_token1_value => l_contract_number);
8642: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8643: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8644: Okl_Api.set_message(p_app_name => g_app_name,
8645: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8646: p_token1 => g_contract_number_token,
8647: p_token1_value => l_contract_number);
8648: RAISE OKL_API.G_EXCEPTION_ERROR;
8644: Okl_Api.set_message(p_app_name => g_app_name,
8645: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8646: p_token1 => g_contract_number_token,
8647: p_token1_value => l_contract_number);
8648: RAISE OKL_API.G_EXCEPTION_ERROR;
8649: END IF;
8650: END IF;
8651: -- Update balances table
8652: IF l_tcnv_rec.amount IS NOT NULL THEN
8657: ,l_return_status
8658: ,l_msg_count
8659: ,l_msg_data);
8660: -- store the highest degree of error
8661: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8662: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8663: -- need to leave
8664: Okl_Api.set_message(p_app_name => g_app_name,
8665: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8658: ,l_msg_count
8659: ,l_msg_data);
8660: -- store the highest degree of error
8661: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8662: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8663: -- need to leave
8664: Okl_Api.set_message(p_app_name => g_app_name,
8665: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8666: p_token1 => g_contract_number_token,
8660: -- store the highest degree of error
8661: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8662: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8663: -- need to leave
8664: Okl_Api.set_message(p_app_name => g_app_name,
8665: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8666: p_token1 => g_contract_number_token,
8667: p_token1_value => l_contract_number);
8668: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8664: Okl_Api.set_message(p_app_name => g_app_name,
8665: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8666: p_token1 => g_contract_number_token,
8667: p_token1_value => l_contract_number);
8668: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8669: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8670: Okl_Api.set_message(p_app_name => g_app_name,
8671: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8672: p_token1 => g_contract_number_token,
8665: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8666: p_token1 => g_contract_number_token,
8667: p_token1_value => l_contract_number);
8668: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8669: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8670: Okl_Api.set_message(p_app_name => g_app_name,
8671: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8672: p_token1 => g_contract_number_token,
8673: p_token1_value => l_contract_number);
8666: p_token1 => g_contract_number_token,
8667: p_token1_value => l_contract_number);
8668: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8669: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8670: Okl_Api.set_message(p_app_name => g_app_name,
8671: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8672: p_token1 => g_contract_number_token,
8673: p_token1_value => l_contract_number);
8674: RAISE OKL_API.G_EXCEPTION_ERROR;
8670: Okl_Api.set_message(p_app_name => g_app_name,
8671: p_msg_name => 'OKL_AGN_BAL_UPD_ERROR',
8672: p_token1 => g_contract_number_token,
8673: p_token1_value => l_contract_number);
8674: RAISE OKL_API.G_EXCEPTION_ERROR;
8675: END IF;
8676: END IF;
8677: END IF;
8678:
8707: p_ctxt_val_tbl => l_ctxt_val_tbl,
8708: p_representation_type => 'SECONDARY');
8709:
8710: -- store the highest degree of error
8711: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8712: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8713: -- need to leave
8714: Okl_Api.set_message(p_app_name => g_app_name,
8715: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8708: p_representation_type => 'SECONDARY');
8709:
8710: -- store the highest degree of error
8711: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8712: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8713: -- need to leave
8714: Okl_Api.set_message(p_app_name => g_app_name,
8715: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8716: p_token1 => g_contract_number_token,
8710: -- store the highest degree of error
8711: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
8712: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8713: -- need to leave
8714: Okl_Api.set_message(p_app_name => g_app_name,
8715: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8716: p_token1 => g_contract_number_token,
8717: p_token1_value => l_contract_number);
8718: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8714: Okl_Api.set_message(p_app_name => g_app_name,
8715: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8716: p_token1 => g_contract_number_token,
8717: p_token1_value => l_contract_number);
8718: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8719: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8720: Okl_Api.set_message(p_app_name => g_app_name,
8721: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8722: p_token1 => g_contract_number_token,
8715: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8716: p_token1 => g_contract_number_token,
8717: p_token1_value => l_contract_number);
8718: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8719: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8720: Okl_Api.set_message(p_app_name => g_app_name,
8721: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8722: p_token1 => g_contract_number_token,
8723: p_token1_value => l_contract_number);
8716: p_token1 => g_contract_number_token,
8717: p_token1_value => l_contract_number);
8718: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
8719: ELSIF (l_return_status = Okl_Api.G_RET_STS_ERROR) THEN
8720: Okl_Api.set_message(p_app_name => g_app_name,
8721: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8722: p_token1 => g_contract_number_token,
8723: p_token1_value => l_contract_number);
8724: RAISE OKL_API.G_EXCEPTION_ERROR;
8720: Okl_Api.set_message(p_app_name => g_app_name,
8721: p_msg_name => 'OKL_AGN_CRE_ACR_ERROR',
8722: p_token1 => g_contract_number_token,
8723: p_token1_value => l_contract_number);
8724: RAISE OKL_API.G_EXCEPTION_ERROR;
8725: END IF;
8726: END IF;
8727:
8728: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8740: -- MGAAP 7263041 end
8741: END IF; -- l_rev_rec_basis =
8742:
8743: ELSE
8744: Okl_Api.set_message(p_app_name => g_app_name,
8745: p_msg_name => 'OKL_AGN_ACTUAL_DATE_ERROR',
8746: p_token1 => g_contract_number_token,
8747: p_token1_value => l_contract_number,
8748: p_token2 => 'ACCRUAL_DATE',
8747: p_token1_value => l_contract_number,
8748: p_token2 => 'ACCRUAL_DATE',
8749: p_token2_value => to_char(l_last_accrual_date,'DD-Mon-YYYY')
8750: );
8751: RAISE Okl_Api.G_EXCEPTION_ERROR;
8752:
8753: END IF; --IF TRUNC(l_accrual_date) >= TRUNC(l_last_accrual_date) THEN
8754:
8755: END IF; -- IF l_rev_rec_method = 'ACTUAL' THEN'
8754:
8755: END IF; -- IF l_rev_rec_method = 'ACTUAL' THEN'
8756:
8757: x_return_status := l_return_status;
8758: Okl_Api.END_ACTIVITY(l_msg_count, l_msg_data);
8759:
8760: EXCEPTION
8761:
8762: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8758: Okl_Api.END_ACTIVITY(l_msg_count, l_msg_data);
8759:
8760: EXCEPTION
8761:
8762: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8763: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8764: ,g_pkg_name
8765: ,'OKL_API.G_RET_STS_ERROR'
8766: ,l_msg_count
8759:
8760: EXCEPTION
8761:
8762: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8763: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8764: ,g_pkg_name
8765: ,'OKL_API.G_RET_STS_ERROR'
8766: ,l_msg_count
8767: ,l_msg_data
8761:
8762: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8763: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8764: ,g_pkg_name
8765: ,'OKL_API.G_RET_STS_ERROR'
8766: ,l_msg_count
8767: ,l_msg_data
8768: ,'_PVT');
8769:
8786: END IF;
8787: -- Bug 4700105.
8788: FND_MSG_PUB.Delete_Msg;
8789:
8790: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8791: -- Select the contract for error reporting
8792: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8793: ,g_pkg_name
8794: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8788: FND_MSG_PUB.Delete_Msg;
8789:
8790: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8791: -- Select the contract for error reporting
8792: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8793: ,g_pkg_name
8794: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8795: ,l_msg_count
8796: ,l_msg_data
8790: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8791: -- Select the contract for error reporting
8792: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8793: ,g_pkg_name
8794: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8795: ,l_msg_count
8796: ,l_msg_data
8797: ,'_PVT');
8798: IF p_process_accrual_rec.submission_mode='BATCH' THEN
8830: CLOSE last_int_date_csr;
8831: END IF;
8832:
8833: -- Select the contract for error reporting
8834: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8835: ,g_pkg_name
8836: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8837: ,l_msg_count
8838: ,l_msg_data
8832:
8833: -- Select the contract for error reporting
8834: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8835: ,g_pkg_name
8836: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8837: ,l_msg_count
8838: ,l_msg_data
8839: ,'_PVT');
8840:
8869: p_accrual_date IN DATE,
8870: p_batch_name IN VARCHAR2 ) RETURN NUMBER IS
8871:
8872: x_request_id NUMBER;
8873: l_return_status VARCHAR2(1) := Okl_Api.G_RET_STS_SUCCESS;
8874: l_msg_count NUMBER;
8875: l_msg_data VARCHAR2(2000);
8876: l_api_name VARCHAR2(2000) := 'SUBMIT_ACCRUALS';
8877: l_api_version CONSTANT NUMBER := 1.0;
8874: l_msg_count NUMBER;
8875: l_msg_data VARCHAR2(2000);
8876: l_api_name VARCHAR2(2000) := 'SUBMIT_ACCRUALS';
8877: l_api_version CONSTANT NUMBER := 1.0;
8878: l_init_msg_list VARCHAR2(20) DEFAULT Okl_Api.G_FALSE;
8879: l_accrual_date VARCHAR2(2000);
8880: BEGIN
8881: -- Set save point
8882: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
8878: l_init_msg_list VARCHAR2(20) DEFAULT Okl_Api.G_FALSE;
8879: l_accrual_date VARCHAR2(2000);
8880: BEGIN
8881: -- Set save point
8882: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
8883: ,G_PKG_NAME
8884: ,l_init_msg_list
8885: ,l_api_version
8886: ,p_api_version
8885: ,l_api_version
8886: ,p_api_version
8887: ,'_PVT'
8888: ,l_return_status);
8889: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8890: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
8891: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8892: RAISE Okl_Api.G_EXCEPTION_ERROR;
8893: END IF;
8886: ,p_api_version
8887: ,'_PVT'
8888: ,l_return_status);
8889: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8890: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
8891: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8892: RAISE Okl_Api.G_EXCEPTION_ERROR;
8893: END IF;
8894:
8887: ,'_PVT'
8888: ,l_return_status);
8889: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8890: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
8891: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8892: RAISE Okl_Api.G_EXCEPTION_ERROR;
8893: END IF;
8894:
8895: -- check for data before processing
8888: ,l_return_status);
8889: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
8890: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
8891: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
8892: RAISE Okl_Api.G_EXCEPTION_ERROR;
8893: END IF;
8894:
8895: -- check for data before processing
8896: IF (p_accrual_date IS NULL OR p_accrual_date = Okl_Api.G_MISS_DATE) THEN
8892: RAISE Okl_Api.G_EXCEPTION_ERROR;
8893: END IF;
8894:
8895: -- check for data before processing
8896: IF (p_accrual_date IS NULL OR p_accrual_date = Okl_Api.G_MISS_DATE) THEN
8897: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
8898: p_msg_name => 'OKL_AGN_DATE_ERROR');
8899: RAISE Okl_Api.G_EXCEPTION_ERROR;
8900: ELSE
8893: END IF;
8894:
8895: -- check for data before processing
8896: IF (p_accrual_date IS NULL OR p_accrual_date = Okl_Api.G_MISS_DATE) THEN
8897: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
8898: p_msg_name => 'OKL_AGN_DATE_ERROR');
8899: RAISE Okl_Api.G_EXCEPTION_ERROR;
8900: ELSE
8901: l_accrual_date := FND_DATE.DATE_TO_CANONICAL(p_accrual_date);
8895: -- check for data before processing
8896: IF (p_accrual_date IS NULL OR p_accrual_date = Okl_Api.G_MISS_DATE) THEN
8897: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
8898: p_msg_name => 'OKL_AGN_DATE_ERROR');
8899: RAISE Okl_Api.G_EXCEPTION_ERROR;
8900: ELSE
8901: l_accrual_date := FND_DATE.DATE_TO_CANONICAL(p_accrual_date);
8902: END IF;
8903:
8911:
8912: IF x_request_id = 0 THEN
8913: -- Handle submission error
8914: -- Raise Error if the request has not been submitted successfully.
8915: Okl_Api.SET_MESSAGE(G_APP_NAME, 'OKL_ERROR_SUB_CONC_PROG', 'CONC_PROG', 'Generate Accrual');
8916: RAISE Okl_Api.G_EXCEPTION_ERROR;
8917: ELSE
8918: --set return status
8919: x_return_status := l_return_status;
8912: IF x_request_id = 0 THEN
8913: -- Handle submission error
8914: -- Raise Error if the request has not been submitted successfully.
8915: Okl_Api.SET_MESSAGE(G_APP_NAME, 'OKL_ERROR_SUB_CONC_PROG', 'CONC_PROG', 'Generate Accrual');
8916: RAISE Okl_Api.G_EXCEPTION_ERROR;
8917: ELSE
8918: --set return status
8919: x_return_status := l_return_status;
8920: RETURN x_request_id;
8920: RETURN x_request_id;
8921: END IF;
8922:
8923: EXCEPTION
8924: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8925: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8926: ,g_pkg_name
8927: ,'OKL_API.G_RET_STS_ERROR'
8928: ,x_msg_count
8921: END IF;
8922:
8923: EXCEPTION
8924: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8925: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8926: ,g_pkg_name
8927: ,'OKL_API.G_RET_STS_ERROR'
8928: ,x_msg_count
8929: ,x_msg_data
8923: EXCEPTION
8924: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
8925: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8926: ,g_pkg_name
8927: ,'OKL_API.G_RET_STS_ERROR'
8928: ,x_msg_count
8929: ,x_msg_data
8930: ,'_PVT');
8931: RETURN x_request_id;
8928: ,x_msg_count
8929: ,x_msg_data
8930: ,'_PVT');
8931: RETURN x_request_id;
8932: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8933: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8934: ,g_pkg_name
8935: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8936: ,x_msg_count
8929: ,x_msg_data
8930: ,'_PVT');
8931: RETURN x_request_id;
8932: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8933: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8934: ,g_pkg_name
8935: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8936: ,x_msg_count
8937: ,x_msg_data
8931: RETURN x_request_id;
8932: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
8933: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
8934: ,g_pkg_name
8935: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
8936: ,x_msg_count
8937: ,x_msg_data
8938: ,'_PVT');
8939: RETURN x_request_id;
8937: ,x_msg_data
8938: ,'_PVT');
8939: RETURN x_request_id;
8940: WHEN OTHERS THEN
8941: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
8942: (l_api_name,
8943: G_PKG_NAME,
8944: 'OTHERS',
8945: x_msg_count,
8976: l_sob_name VARCHAR2(2000);
8977: l_api_version CONSTANT NUMBER := 1.0;
8978: p_api_version CONSTANT NUMBER := 1.0;
8979: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS';
8980: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
8981: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
8982: l_msg_count NUMBER;
8983: l_msg_data VARCHAR2(2000);
8984: l_period_name VARCHAR2(2000);
8977: l_api_version CONSTANT NUMBER := 1.0;
8978: p_api_version CONSTANT NUMBER := 1.0;
8979: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS';
8980: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
8981: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
8982: l_msg_count NUMBER;
8983: l_msg_data VARCHAR2(2000);
8984: l_period_name VARCHAR2(2000);
8985: l_period_start_date DATE;
9194: --START SGIYER
9195: l_num_workers := FND_PROFILE.VALUE('OKL_AGN_WORKERS');
9196:
9197: IF l_num_workers IS NULL THEN
9198: Okl_Api.set_message(p_app_name => g_app_name,
9199: p_msg_name => 'OKL_AGN_WORKER_ERROR');
9200: fnd_file.put_line(fnd_file.log, 'Please specify a value for the profile option OKL: Generate Accrual Concurrent Workers');
9201: RAISE OKL_API.G_EXCEPTION_ERROR;
9202: END IF;
9197: IF l_num_workers IS NULL THEN
9198: Okl_Api.set_message(p_app_name => g_app_name,
9199: p_msg_name => 'OKL_AGN_WORKER_ERROR');
9200: fnd_file.put_line(fnd_file.log, 'Please specify a value for the profile option OKL: Generate Accrual Concurrent Workers');
9201: RAISE OKL_API.G_EXCEPTION_ERROR;
9202: END IF;
9203: -- END SGIYER
9204:
9205: -- Select sequence for marking processes
9412: WRITE_TO_LOG('Accrual Rev Days :'||l_accrual_reversal_days);
9413: WRITE_TO_LOG('Func Currency Code:'||l_func_currency_code);
9414: --kthiruva - End of Changes
9415:
9416: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9417: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9418: -- need to leave
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9413: WRITE_TO_LOG('Func Currency Code:'||l_func_currency_code);
9414: --kthiruva - End of Changes
9415:
9416: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9417: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9418: -- need to leave
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9415:
9416: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9417: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9418: -- need to leave
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9422: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9423: Okl_Api.set_message(p_app_name => g_app_name,
9417: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9418: -- need to leave
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9422: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9423: Okl_Api.set_message(p_app_name => g_app_name,
9424: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9425: RAISE OKL_API.G_EXCEPTION_ERROR;
9418: -- need to leave
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9422: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9423: Okl_Api.set_message(p_app_name => g_app_name,
9424: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9425: RAISE OKL_API.G_EXCEPTION_ERROR;
9426: END IF;
9419: Okl_Api.set_message(p_app_name => g_app_name,
9420: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9422: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9423: Okl_Api.set_message(p_app_name => g_app_name,
9424: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9425: RAISE OKL_API.G_EXCEPTION_ERROR;
9426: END IF;
9427: END IF;
9421: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9422: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9423: Okl_Api.set_message(p_app_name => g_app_name,
9424: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9425: RAISE OKL_API.G_EXCEPTION_ERROR;
9426: END IF;
9427: END IF;
9428:
9429: -- Calculate the number of days (to_date) to reverse in case of non-accrual
9436: ,p_batch_name
9437: ,l_func_currency_code
9438: ,l_return_status);
9439:
9440: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9441: Okl_Api.set_message(p_app_name => g_app_name,
9442: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9443: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9444: END IF;
9437: ,l_func_currency_code
9438: ,l_return_status);
9439:
9440: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9441: Okl_Api.set_message(p_app_name => g_app_name,
9442: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9443: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9444: END IF;
9445:
9439:
9440: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9441: Okl_Api.set_message(p_app_name => g_app_name,
9442: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9443: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9444: END IF;
9445:
9446:
9447: l_counter := 1;
9524: x_msg_data => l_msg_data,
9525: p_process_accrual_rec => l_process_accrual_rec
9526: );
9527:
9528: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
9529: l_contract_error_tbl(l_contract_error_count) := l_process_accrual_rec.contract_number;
9530: l_contract_error_count := l_contract_error_count + 1;
9531: END IF;
9532:
9551: END IF; -- IF p_contract_number IS NULL THEN
9552:
9553:
9554: retcode := 0;
9555: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9556:
9557: EXCEPTION
9558: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9559: l_return_status := Okl_Api.G_RET_STS_ERROR;
9554: retcode := 0;
9555: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9556:
9557: EXCEPTION
9558: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9559: l_return_status := Okl_Api.G_RET_STS_ERROR;
9560:
9561: -- print the error message in the log file and output files
9562: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9555: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9556:
9557: EXCEPTION
9558: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9559: l_return_status := Okl_Api.G_RET_STS_ERROR;
9560:
9561: -- print the error message in the log file and output files
9562: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9563: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
9572: END IF;
9573:
9574: retcode := 2;
9575:
9576: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
9577: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9578:
9579: -- print the error message in the log file
9580: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9573:
9574: retcode := 2;
9575:
9576: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
9577: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9578:
9579: -- print the error message in the log file
9580: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9581: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
9592: retcode := 2;
9593:
9594: WHEN OTHERS THEN
9595:
9596: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9597:
9598: -- print the error message in the log file
9599: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9600: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
9648: l_sysdate DATE := SYSDATE;
9649: l_api_version CONSTANT NUMBER := 1.0;
9650: p_api_version CONSTANT NUMBER := 1.0;
9651: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS_PARALLEL';
9652: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
9653: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
9654: l_msg_count NUMBER;
9655: l_msg_data VARCHAR2(2000);
9656: l_period_name VARCHAR2(2000);
9649: l_api_version CONSTANT NUMBER := 1.0;
9650: p_api_version CONSTANT NUMBER := 1.0;
9651: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS_PARALLEL';
9652: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
9653: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
9654: l_msg_count NUMBER;
9655: l_msg_data VARCHAR2(2000);
9656: l_period_name VARCHAR2(2000);
9657: l_period_start_date DATE;
9754:
9755: -- request is a child request
9756: IF p_accrual_date IS NULL THEN
9757: --set message
9758: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
9759: p_msg_name => 'OKL_AGN_DATE_ERROR');
9760: RAISE Okl_Api.G_EXCEPTION_ERROR;
9761: END IF;
9762: l_accrual_date := FND_DATE.CANONICAL_TO_DATE(p_accrual_date);
9756: IF p_accrual_date IS NULL THEN
9757: --set message
9758: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
9759: p_msg_name => 'OKL_AGN_DATE_ERROR');
9760: RAISE Okl_Api.G_EXCEPTION_ERROR;
9761: END IF;
9762: l_accrual_date := FND_DATE.CANONICAL_TO_DATE(p_accrual_date);
9763:
9764: IF p_worker_id IS NULL THEN
9762: l_accrual_date := FND_DATE.CANONICAL_TO_DATE(p_accrual_date);
9763:
9764: IF p_worker_id IS NULL THEN
9765: --set message
9766: Okl_Api.set_message(p_app_name => g_app_name,
9767: p_msg_name => 'OKL_AGN_WORKER_ID_ERROR');
9768: RAISE Okl_Api.G_EXCEPTION_ERROR;
9769: END IF;
9770:
9764: IF p_worker_id IS NULL THEN
9765: --set message
9766: Okl_Api.set_message(p_app_name => g_app_name,
9767: p_msg_name => 'OKL_AGN_WORKER_ID_ERROR');
9768: RAISE Okl_Api.G_EXCEPTION_ERROR;
9769: END IF;
9770:
9771: IF p_rev_rec_method IS NULL THEN
9772: --set message
9769: END IF;
9770:
9771: IF p_rev_rec_method IS NULL THEN
9772: --set message
9773: Okl_Api.set_message(p_app_name => g_app_name,
9774: p_msg_name => 'OKL_AGN_REV_REC_ERROR');
9775: RAISE Okl_Api.G_EXCEPTION_ERROR;
9776: END IF;
9777:
9771: IF p_rev_rec_method IS NULL THEN
9772: --set message
9773: Okl_Api.set_message(p_app_name => g_app_name,
9774: p_msg_name => 'OKL_AGN_REV_REC_ERROR');
9775: RAISE Okl_Api.G_EXCEPTION_ERROR;
9776: END IF;
9777:
9778: -- get common info
9779: GET_COMMON_INFO (p_accrual_date => l_accrual_date,
9789: x_func_currency_code => l_func_currency_code,
9790: x_return_status => l_return_status
9791: );
9792:
9793: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9794: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9795: -- need to leave
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9790: x_return_status => l_return_status
9791: );
9792:
9793: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9794: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9795: -- need to leave
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9792:
9793: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9794: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9795: -- need to leave
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9799: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9800: Okl_Api.set_message(p_app_name => g_app_name,
9794: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
9795: -- need to leave
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9799: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9800: Okl_Api.set_message(p_app_name => g_app_name,
9801: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9802: RAISE OKL_API.G_EXCEPTION_ERROR;
9795: -- need to leave
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9799: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9800: Okl_Api.set_message(p_app_name => g_app_name,
9801: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9802: RAISE OKL_API.G_EXCEPTION_ERROR;
9803: END IF;
9796: Okl_Api.set_message(p_app_name => g_app_name,
9797: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9799: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9800: Okl_Api.set_message(p_app_name => g_app_name,
9801: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9802: RAISE OKL_API.G_EXCEPTION_ERROR;
9803: END IF;
9804: END IF;
9798: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9799: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
9800: Okl_Api.set_message(p_app_name => g_app_name,
9801: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
9802: RAISE OKL_API.G_EXCEPTION_ERROR;
9803: END IF;
9804: END IF;
9805:
9806: -- Calculate the number of days (to_date) to reverse in case of non-accrual
9812: ,l_accrual_date
9813: ,p_batch_name
9814: ,l_func_currency_code
9815: ,l_return_status);
9816: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9817: Okl_Api.set_message(p_app_name => g_app_name,
9818: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9819: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9820: END IF;
9813: ,p_batch_name
9814: ,l_func_currency_code
9815: ,l_return_status);
9816: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9817: Okl_Api.set_message(p_app_name => g_app_name,
9818: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9819: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9820: END IF;
9821:
9815: ,l_return_status);
9816: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
9817: Okl_Api.set_message(p_app_name => g_app_name,
9818: p_msg_name => 'OKL_AGN_REPORT_ERROR');
9819: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
9820: END IF;
9821:
9822: -- Open cursor to select contracts for accrual processing
9823: -- Bug 4602404.
9906: x_msg_count => l_msg_count,
9907: x_msg_data => l_msg_data,
9908: p_process_accrual_rec => l_process_accrual_rec);
9909:
9910: IF l_return_status <> OKL_API.G_RET_STS_SUCCESS THEN
9911: l_contract_error_tbl(l_contract_error_count) := l_process_accrual_rec.contract_number;
9912: l_contract_error_count := l_contract_error_count + 1;
9913: END IF;
9914:
9943: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_ADD_INFO'));
9944: END IF;
9945:
9946: retcode := 0;
9947: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9948:
9949: EXCEPTION
9950: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9951: l_return_status := Okl_Api.G_RET_STS_ERROR;
9946: retcode := 0;
9947: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9948:
9949: EXCEPTION
9950: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9951: l_return_status := Okl_Api.G_RET_STS_ERROR;
9952:
9953: -- print the error message in the log file and output files
9954: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9947: l_return_status := OKL_API.G_RET_STS_SUCCESS;
9948:
9949: EXCEPTION
9950: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
9951: l_return_status := Okl_Api.G_RET_STS_ERROR;
9952:
9953: -- print the error message in the log file and output files
9954: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9955: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
9964: END IF;
9965:
9966: retcode := 2;
9967:
9968: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
9969: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9970:
9971: -- print the error message in the log file
9972: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9965:
9966: retcode := 2;
9967:
9968: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
9969: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9970:
9971: -- print the error message in the log file
9972: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9973: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
9984: retcode := 2;
9985:
9986: WHEN OTHERS THEN
9987:
9988: l_return_status := Okl_Api.G_RET_STS_UNEXP_ERROR;
9989:
9990: -- print the error message in the log file
9991: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'');
9992: FND_FILE.PUT_LINE(FND_FILE.OUTPUT,FND_MESSAGE.GET_STRING('OKL','OKL_AGN_RPT_PROGRAM_ERROR'));
10037: l_reverse_date_to DATE;
10038: l_sob_name VARCHAR2(2000);
10039: l_api_version CONSTANT NUMBER := 1.0;
10040: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS';
10041: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
10042: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
10043: l_msg_count NUMBER;
10044: l_msg_data VARCHAR2(2000);
10045: l_period_name VARCHAR2(2000);
10038: l_sob_name VARCHAR2(2000);
10039: l_api_version CONSTANT NUMBER := 1.0;
10040: l_api_name CONSTANT VARCHAR2(30) := 'GENERATE_ACCRUALS';
10041: l_init_msg_list VARCHAR2(2000) := OKL_API.G_FALSE;
10042: l_return_status VARCHAR2(1) := OKL_API.G_RET_STS_SUCCESS;
10043: l_msg_count NUMBER;
10044: l_msg_data VARCHAR2(2000);
10045: l_period_name VARCHAR2(2000);
10046: l_period_start_date DATE;
10103:
10104: BEGIN
10105:
10106: -- Set save point
10107: l_return_status := Okl_Api.START_ACTIVITY(l_api_name
10108: ,G_PKG_NAME
10109: ,p_init_msg_list
10110: ,l_api_version
10111: ,p_api_version
10111: ,p_api_version
10112: ,'_PVT'
10113: ,x_return_status);
10114:
10115: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10116: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
10117: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10118: RAISE Okl_Api.G_EXCEPTION_ERROR;
10119: END IF;
10112: ,'_PVT'
10113: ,x_return_status);
10114:
10115: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10116: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
10117: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10118: RAISE Okl_Api.G_EXCEPTION_ERROR;
10119: END IF;
10120:
10113: ,x_return_status);
10114:
10115: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10116: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
10117: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10118: RAISE Okl_Api.G_EXCEPTION_ERROR;
10119: END IF;
10120:
10121: -- validate input parameters
10114:
10115: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10116: RAISE Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR;
10117: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10118: RAISE Okl_Api.G_EXCEPTION_ERROR;
10119: END IF;
10120:
10121: -- validate input parameters
10122: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
10118: RAISE Okl_Api.G_EXCEPTION_ERROR;
10119: END IF;
10120:
10121: -- validate input parameters
10122: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
10123: Okl_Api.set_message(p_app_name => g_app_name,
10124: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
10125: RAISE Okl_Api.G_EXCEPTION_ERROR;
10126: END IF;
10119: END IF;
10120:
10121: -- validate input parameters
10122: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
10123: Okl_Api.set_message(p_app_name => g_app_name,
10124: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
10125: RAISE Okl_Api.G_EXCEPTION_ERROR;
10126: END IF;
10127: l_contract_id := p_accrual_rec.contract_id;
10121: -- validate input parameters
10122: IF (p_accrual_rec.contract_id IS NULL) OR (p_accrual_rec.contract_id = OKL_API.G_MISS_NUM) THEN
10123: Okl_Api.set_message(p_app_name => g_app_name,
10124: p_msg_name => 'OKL_AGN_ACN_KHR_ID_ERROR');
10125: RAISE Okl_Api.G_EXCEPTION_ERROR;
10126: END IF;
10127: l_contract_id := p_accrual_rec.contract_id;
10128:
10129: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
10125: RAISE Okl_Api.G_EXCEPTION_ERROR;
10126: END IF;
10127: l_contract_id := p_accrual_rec.contract_id;
10128:
10129: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
10130: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10131: p_msg_name => 'OKL_AGN_DATE_ERROR');
10132: RAISE Okl_Api.G_EXCEPTION_ERROR;
10133: END IF;
10126: END IF;
10127: l_contract_id := p_accrual_rec.contract_id;
10128:
10129: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
10130: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10131: p_msg_name => 'OKL_AGN_DATE_ERROR');
10132: RAISE Okl_Api.G_EXCEPTION_ERROR;
10133: END IF;
10134: l_accrual_date := p_accrual_rec.accrual_date;
10128:
10129: IF (p_accrual_rec.accrual_date IS NULL) OR (p_accrual_rec.accrual_date = Okl_Api.G_MISS_DATE) THEN
10130: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10131: p_msg_name => 'OKL_AGN_DATE_ERROR');
10132: RAISE Okl_Api.G_EXCEPTION_ERROR;
10133: END IF;
10134: l_accrual_date := p_accrual_rec.accrual_date;
10135:
10136: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
10132: RAISE Okl_Api.G_EXCEPTION_ERROR;
10133: END IF;
10134: l_accrual_date := p_accrual_rec.accrual_date;
10135:
10136: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
10137: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10138: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
10139: RAISE Okl_Api.G_EXCEPTION_ERROR;
10140: END IF;
10133: END IF;
10134: l_accrual_date := p_accrual_rec.accrual_date;
10135:
10136: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
10137: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10138: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
10139: RAISE Okl_Api.G_EXCEPTION_ERROR;
10140: END IF;
10141: l_source_trx_id := p_accrual_rec.source_trx_id;
10135:
10136: IF (p_accrual_rec.source_trx_id IS NULL) OR (p_accrual_rec.source_trx_id = Okl_Api.G_MISS_NUM) THEN
10137: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10138: p_msg_name => 'OKL_AGN_SRC_TRX_ID_ERROR');
10139: RAISE Okl_Api.G_EXCEPTION_ERROR;
10140: END IF;
10141: l_source_trx_id := p_accrual_rec.source_trx_id;
10142:
10143: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
10139: RAISE Okl_Api.G_EXCEPTION_ERROR;
10140: END IF;
10141: l_source_trx_id := p_accrual_rec.source_trx_id;
10142:
10143: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
10144: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10145: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
10146: RAISE Okl_Api.G_EXCEPTION_ERROR;
10147: END IF;
10140: END IF;
10141: l_source_trx_id := p_accrual_rec.source_trx_id;
10142:
10143: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
10144: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10145: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
10146: RAISE Okl_Api.G_EXCEPTION_ERROR;
10147: END IF;
10148: l_source_trx_type := p_accrual_rec.source_trx_type;
10142:
10143: IF (p_accrual_rec.source_trx_type IS NULL) OR (p_accrual_rec.source_trx_type = Okl_Api.G_MISS_CHAR) THEN
10144: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10145: p_msg_name => 'OKL_AGN_SRC_TRX_TYPE_ERROR');
10146: RAISE Okl_Api.G_EXCEPTION_ERROR;
10147: END IF;
10148: l_source_trx_type := p_accrual_rec.source_trx_type;
10149:
10150: -- get common info
10173: WRITE_TO_LOG('Org Id :'||l_org_id);
10174: WRITE_TO_LOG('Org Name :'||l_org_name);
10175: WRITE_TO_LOG('Accrual Rev Days :'||l_accrual_reversal_days);
10176: WRITE_TO_LOG('Func Currency Code:'||l_func_currency_code);
10177: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10178: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10179: -- need to leave
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10174: WRITE_TO_LOG('Org Name :'||l_org_name);
10175: WRITE_TO_LOG('Accrual Rev Days :'||l_accrual_reversal_days);
10176: WRITE_TO_LOG('Func Currency Code:'||l_func_currency_code);
10177: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10178: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10179: -- need to leave
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10176: WRITE_TO_LOG('Func Currency Code:'||l_func_currency_code);
10177: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10178: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10179: -- need to leave
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10183: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10184: Okl_Api.set_message(p_app_name => g_app_name,
10178: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10179: -- need to leave
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10183: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10184: Okl_Api.set_message(p_app_name => g_app_name,
10185: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10186: RAISE OKL_API.G_EXCEPTION_ERROR;
10179: -- need to leave
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10183: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10184: Okl_Api.set_message(p_app_name => g_app_name,
10185: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10186: RAISE OKL_API.G_EXCEPTION_ERROR;
10187: END IF;
10180: Okl_Api.set_message(p_app_name => g_app_name,
10181: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10183: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10184: Okl_Api.set_message(p_app_name => g_app_name,
10185: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10186: RAISE OKL_API.G_EXCEPTION_ERROR;
10187: END IF;
10188: END IF;
10182: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10183: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10184: Okl_Api.set_message(p_app_name => g_app_name,
10185: p_msg_name => 'OKL_AGN_COM_INFO_ERROR');
10186: RAISE OKL_API.G_EXCEPTION_ERROR;
10187: END IF;
10188: END IF;
10189:
10190: -- Calculate the number of days (to_date) to reverse in case of non-accrual
10189:
10190: -- Calculate the number of days (to_date) to reverse in case of non-accrual
10191: l_reverse_date_to := l_accrual_date - l_accrual_reversal_days;
10192: IF l_reverse_date_to IS NULL THEN
10193: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVERSE_DATE_TO');
10194: RAISE OKL_API.G_EXCEPTION_ERROR;
10195: END IF;
10196:
10197: FOR l_accrual_contracts IN accrual_contract_csr (l_contract_id)
10190: -- Calculate the number of days (to_date) to reverse in case of non-accrual
10191: l_reverse_date_to := l_accrual_date - l_accrual_reversal_days;
10192: IF l_reverse_date_to IS NULL THEN
10193: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVERSE_DATE_TO');
10194: RAISE OKL_API.G_EXCEPTION_ERROR;
10195: END IF;
10196:
10197: FOR l_accrual_contracts IN accrual_contract_csr (l_contract_id)
10198: LOOP
10210: l_rev_rec_method := l_accrual_contracts.revenue_recognition_method;
10211: END LOOP;
10212:
10213: IF l_contract_number IS NULL THEN
10214: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CONTRACT_NUMBER');
10215: RAISE OKL_API.G_EXCEPTION_ERROR;
10216: END IF;
10217:
10218: IF l_sts_code IS NULL THEN
10211: END LOOP;
10212:
10213: IF l_contract_number IS NULL THEN
10214: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CONTRACT_NUMBER');
10215: RAISE OKL_API.G_EXCEPTION_ERROR;
10216: END IF;
10217:
10218: IF l_sts_code IS NULL THEN
10219: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'STS_CODE');
10215: RAISE OKL_API.G_EXCEPTION_ERROR;
10216: END IF;
10217:
10218: IF l_sts_code IS NULL THEN
10219: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'STS_CODE');
10220: RAISE OKL_API.G_EXCEPTION_ERROR;
10221: END IF;
10222:
10223: IF l_sts_code NOT IN ('BOOKED', 'EVERGREEN', 'ACTIVE') THEN
10216: END IF;
10217:
10218: IF l_sts_code IS NULL THEN
10219: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'STS_CODE');
10220: RAISE OKL_API.G_EXCEPTION_ERROR;
10221: END IF;
10222:
10223: IF l_sts_code NOT IN ('BOOKED', 'EVERGREEN', 'ACTIVE') THEN
10224: -- store SQL error message on message stack for caller
10221: END IF;
10222:
10223: IF l_sts_code NOT IN ('BOOKED', 'EVERGREEN', 'ACTIVE') THEN
10224: -- store SQL error message on message stack for caller
10225: okl_api.set_message(p_app_name => G_APP_NAME,
10226: p_msg_name => 'OKL_AGN_STS_CODE_ERROR',
10227: p_token1 => g_contract_number_token,
10228: p_token1_value => l_contract_number);
10229: RAISE OKL_API.G_EXCEPTION_ERROR;
10225: okl_api.set_message(p_app_name => G_APP_NAME,
10226: p_msg_name => 'OKL_AGN_STS_CODE_ERROR',
10227: p_token1 => g_contract_number_token,
10228: p_token1_value => l_contract_number);
10229: RAISE OKL_API.G_EXCEPTION_ERROR;
10230: END IF;
10231:
10232: IF l_product_id IS NULL THEN
10233: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'PRODUCT_ID');
10229: RAISE OKL_API.G_EXCEPTION_ERROR;
10230: END IF;
10231:
10232: IF l_product_id IS NULL THEN
10233: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'PRODUCT_ID');
10234: RAISE OKL_API.G_EXCEPTION_ERROR;
10235: END IF;
10236:
10237: IF l_accrual_status IS NULL THEN
10230: END IF;
10231:
10232: IF l_product_id IS NULL THEN
10233: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'PRODUCT_ID');
10234: RAISE OKL_API.G_EXCEPTION_ERROR;
10235: END IF;
10236:
10237: IF l_accrual_status IS NULL THEN
10238: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_YN');
10234: RAISE OKL_API.G_EXCEPTION_ERROR;
10235: END IF;
10236:
10237: IF l_accrual_status IS NULL THEN
10238: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_YN');
10239: RAISE OKL_API.G_EXCEPTION_ERROR;
10240: END IF;
10241:
10242: IF l_override_status IS NULL THEN
10235: END IF;
10236:
10237: IF l_accrual_status IS NULL THEN
10238: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_YN');
10239: RAISE OKL_API.G_EXCEPTION_ERROR;
10240: END IF;
10241:
10242: IF l_override_status IS NULL THEN
10243: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_OVERRIDE_YN');
10239: RAISE OKL_API.G_EXCEPTION_ERROR;
10240: END IF;
10241:
10242: IF l_override_status IS NULL THEN
10243: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_OVERRIDE_YN');
10244: RAISE OKL_API.G_EXCEPTION_ERROR;
10245: END IF;
10246:
10247: IF l_start_date IS NULL THEN
10240: END IF;
10241:
10242: IF l_override_status IS NULL THEN
10243: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'GENERATE_ACCRUAL_OVERRIDE_YN');
10244: RAISE OKL_API.G_EXCEPTION_ERROR;
10245: END IF;
10246:
10247: IF l_start_date IS NULL THEN
10248: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'START_DATE');
10244: RAISE OKL_API.G_EXCEPTION_ERROR;
10245: END IF;
10246:
10247: IF l_start_date IS NULL THEN
10248: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'START_DATE');
10249: RAISE OKL_API.G_EXCEPTION_ERROR;
10250: END IF;
10251: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
10252: IF l_deal_type IS NULL AND l_sts_code NOT IN ('ACTIVE') THEN
10245: END IF;
10246:
10247: IF l_start_date IS NULL THEN
10248: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'START_DATE');
10249: RAISE OKL_API.G_EXCEPTION_ERROR;
10250: END IF;
10251: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
10252: IF l_deal_type IS NULL AND l_sts_code NOT IN ('ACTIVE') THEN
10253: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 end
10250: END IF;
10251: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
10252: IF l_deal_type IS NULL AND l_sts_code NOT IN ('ACTIVE') THEN
10253: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 end
10254: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DEAL_TYPE');
10255: RAISE OKL_API.G_EXCEPTION_ERROR;
10256: END IF;
10257:
10258: IF l_khr_currency_code IS NULL THEN
10251: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 start
10252: IF l_deal_type IS NULL AND l_sts_code NOT IN ('ACTIVE') THEN
10253: -- modified by zrehman for Bug#6788005 on 11-Feb-2008 end
10254: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'DEAL_TYPE');
10255: RAISE OKL_API.G_EXCEPTION_ERROR;
10256: END IF;
10257:
10258: IF l_khr_currency_code IS NULL THEN
10259: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CURRENCY_CODE');
10255: RAISE OKL_API.G_EXCEPTION_ERROR;
10256: END IF;
10257:
10258: IF l_khr_currency_code IS NULL THEN
10259: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CURRENCY_CODE');
10260: RAISE OKL_API.G_EXCEPTION_ERROR;
10261: END IF;
10262:
10263: IF l_rev_rec_method IS NULL THEN
10256: END IF;
10257:
10258: IF l_khr_currency_code IS NULL THEN
10259: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'CURRENCY_CODE');
10260: RAISE OKL_API.G_EXCEPTION_ERROR;
10261: END IF;
10262:
10263: IF l_rev_rec_method IS NULL THEN
10264: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
10260: RAISE OKL_API.G_EXCEPTION_ERROR;
10261: END IF;
10262:
10263: IF l_rev_rec_method IS NULL THEN
10264: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
10265: RAISE OKL_API.G_EXCEPTION_ERROR;
10266: END IF;
10267:
10268:
10261: END IF;
10262:
10263: IF l_rev_rec_method IS NULL THEN
10264: OKL_API.set_message(G_APP_NAME, G_INVALID_VALUE,G_COL_NAME_TOKEN,'REVENUE_RECOGNITION_METHOD');
10265: RAISE OKL_API.G_EXCEPTION_ERROR;
10266: END IF;
10267:
10268:
10269: l_process_accrual_rec := NULL;
10303: x_msg_data => l_msg_data,
10304: p_process_accrual_rec => l_process_accrual_rec
10305: );
10306:
10307: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10308: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10309: -- need to leave
10310: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10311: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10304: p_process_accrual_rec => l_process_accrual_rec
10305: );
10306:
10307: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10308: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10309: -- need to leave
10310: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10311: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10312: RAISE OKL_API.G_EXCEPTION_ERROR;
10306:
10307: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10308: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10309: -- need to leave
10310: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10311: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10312: RAISE OKL_API.G_EXCEPTION_ERROR;
10313: END IF;
10314: END IF;
10307: IF (l_return_status <> Okl_Api.G_RET_STS_SUCCESS) THEN
10308: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10309: -- need to leave
10310: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10311: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10312: RAISE OKL_API.G_EXCEPTION_ERROR;
10313: END IF;
10314: END IF;
10315:
10308: IF (l_return_status = Okl_Api.G_RET_STS_UNEXP_ERROR) THEN
10309: -- need to leave
10310: RAISE OKL_API.G_EXCEPTION_UNEXPECTED_ERROR;
10311: ELSIF (l_return_Status = Okl_Api.G_RET_STS_ERROR) THEN
10312: RAISE OKL_API.G_EXCEPTION_ERROR;
10313: END IF;
10314: END IF;
10315:
10316: x_return_status := l_return_status;
10315:
10316: x_return_status := l_return_status;
10317:
10318: EXCEPTION
10319: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
10320: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10321: ,g_pkg_name
10322: ,'OKL_API.G_RET_STS_ERROR'
10323: ,x_msg_count
10316: x_return_status := l_return_status;
10317:
10318: EXCEPTION
10319: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
10320: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10321: ,g_pkg_name
10322: ,'OKL_API.G_RET_STS_ERROR'
10323: ,x_msg_count
10324: ,x_msg_data
10318: EXCEPTION
10319: WHEN Okl_Api.G_EXCEPTION_ERROR THEN
10320: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10321: ,g_pkg_name
10322: ,'OKL_API.G_RET_STS_ERROR'
10323: ,x_msg_count
10324: ,x_msg_data
10325: ,'_PVT');
10326:
10323: ,x_msg_count
10324: ,x_msg_data
10325: ,'_PVT');
10326:
10327: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
10328: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10329: ,g_pkg_name
10330: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
10331: ,x_msg_count
10324: ,x_msg_data
10325: ,'_PVT');
10326:
10327: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
10328: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10329: ,g_pkg_name
10330: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
10331: ,x_msg_count
10332: ,x_msg_data
10326:
10327: WHEN Okl_Api.G_EXCEPTION_UNEXPECTED_ERROR THEN
10328: x_return_status := Okl_Api.HANDLE_EXCEPTIONS(l_api_name
10329: ,g_pkg_name
10330: ,'OKL_API.G_RET_STS_UNEXP_ERROR'
10331: ,x_msg_count
10332: ,x_msg_data
10333: ,'_PVT');
10334:
10333: ,'_PVT');
10334:
10335: WHEN OTHERS THEN
10336:
10337: x_return_status :=Okl_Api.HANDLE_EXCEPTIONS
10338: (l_api_name,
10339: G_PKG_NAME,
10340: 'OTHERS',
10341: x_msg_count,
10354:
10355: EXCEPTION
10356: WHEN OTHERS THEN
10357: -- store SQL error message on message stack for caller
10358: Okl_Api.SET_MESSAGE(p_app_name => g_app_name,
10359: p_msg_name => g_unexpected_error,
10360: p_token1 => g_sqlcode_token,
10361: p_token1_value => SQLCODE,
10362: p_token2 => g_sqlerrm_token,