51: --PL/SQL Table to check the sections has already copied.
52: --If Yes give the new scn_id
53: ----------------------------------------------------------------------------
54: TYPE sections_rec_type IS RECORD (
55: old_scn_id NUMBER := OKC_API.G_MISS_NUM,
56: new_scn_id NUMBER := OKC_API.G_MISS_NUM);
57: TYPE sections_tbl_type IS TABLE OF sections_rec_type
58: INDEX BY BINARY_INTEGER;
59: g_sections sections_tbl_type;
52: --If Yes give the new scn_id
53: ----------------------------------------------------------------------------
54: TYPE sections_rec_type IS RECORD (
55: old_scn_id NUMBER := OKC_API.G_MISS_NUM,
56: new_scn_id NUMBER := OKC_API.G_MISS_NUM);
57: TYPE sections_tbl_type IS TABLE OF sections_rec_type
58: INDEX BY BINARY_INTEGER;
59: g_sections sections_tbl_type;
60:
61: --PL/SQL Table to check time value id has already copied.
62: --If Yes give the new tve_id ----Begins
63: -------------------------------------------------------------------------------
64: TYPE price_adjustments_rec_type IS RECORD (
65: old_pat_id NUMBER := OKC_API.G_MISS_NUM,
66: new_pat_id NUMBER := OKC_API.G_MISS_NUM);
67: TYPE price_adjustments_tbl_type IS TABLE OF price_adjustments_rec_type
68: INDEX BY BINARY_INTEGER;
69: g_price_adjustments price_adjustments_tbl_type;
62: --If Yes give the new tve_id ----Begins
63: -------------------------------------------------------------------------------
64: TYPE price_adjustments_rec_type IS RECORD (
65: old_pat_id NUMBER := OKC_API.G_MISS_NUM,
66: new_pat_id NUMBER := OKC_API.G_MISS_NUM);
67: TYPE price_adjustments_tbl_type IS TABLE OF price_adjustments_rec_type
68: INDEX BY BINARY_INTEGER;
69: g_price_adjustments price_adjustments_tbl_type;
70: ----------------------------------------------------------------------------
68: INDEX BY BINARY_INTEGER;
69: g_price_adjustments price_adjustments_tbl_type;
70: ----------------------------------------------------------------------------
71: TYPE timevalues_rec_type IS RECORD (
72: old_tve_id NUMBER := OKC_API.G_MISS_NUM,
73: new_tve_id NUMBER := OKC_API.G_MISS_NUM);
74: TYPE timevalues_tbl_type IS TABLE OF timevalues_rec_type
75: INDEX BY BINARY_INTEGER;
76: g_timevalues timevalues_tbl_type;
69: g_price_adjustments price_adjustments_tbl_type;
70: ----------------------------------------------------------------------------
71: TYPE timevalues_rec_type IS RECORD (
72: old_tve_id NUMBER := OKC_API.G_MISS_NUM,
73: new_tve_id NUMBER := OKC_API.G_MISS_NUM);
74: TYPE timevalues_tbl_type IS TABLE OF timevalues_rec_type
75: INDEX BY BINARY_INTEGER;
76: g_timevalues timevalues_tbl_type;
77:
79: --PL/SQL Table to check the rule has already copied.
80: --If Yes give the new rul_id ----Begins
81: ----------------------------------------------------------------------------
82: TYPE ruls_rec_type IS RECORD (
83: old_rul_id NUMBER := OKC_API.G_MISS_NUM,
84: new_rul_id NUMBER := OKC_API.G_MISS_NUM);
85: TYPE ruls_tbl_type IS TABLE OF ruls_rec_type
86: INDEX BY BINARY_INTEGER;
87: g_ruls ruls_tbl_type;
80: --If Yes give the new rul_id ----Begins
81: ----------------------------------------------------------------------------
82: TYPE ruls_rec_type IS RECORD (
83: old_rul_id NUMBER := OKC_API.G_MISS_NUM,
84: new_rul_id NUMBER := OKC_API.G_MISS_NUM);
85: TYPE ruls_tbl_type IS TABLE OF ruls_rec_type
86: INDEX BY BINARY_INTEGER;
87: g_ruls ruls_tbl_type;
88:
91: --PL/SQL Table to check the party has already copied.
92: --If Yes give the new cpl_id ----Begins
93: ----------------------------------------------------------------------------
94: TYPE party_rec_type IS RECORD (
95: old_cpl_id NUMBER := OKC_API.G_MISS_NUM,
96: new_cpl_id NUMBER := OKC_API.G_MISS_NUM);
97: TYPE party_tbl_type IS TABLE OF party_rec_type
98: INDEX BY BINARY_INTEGER;
99: g_party party_tbl_type; */
92: --If Yes give the new cpl_id ----Begins
93: ----------------------------------------------------------------------------
94: TYPE party_rec_type IS RECORD (
95: old_cpl_id NUMBER := OKC_API.G_MISS_NUM,
96: new_cpl_id NUMBER := OKC_API.G_MISS_NUM);
97: TYPE party_tbl_type IS TABLE OF party_rec_type
98: INDEX BY BINARY_INTEGER;
99: g_party party_tbl_type; */
100:
102: --Logic to check the event has already copied.
103: --If Yes give the new cnh_id ----Begins
104: ----------------------------------------------------------------------------
105: TYPE events_rec_type IS RECORD (
106: old_cnh_id NUMBER := OKC_API.G_MISS_NUM,
107: new_cnh_id NUMBER := OKC_API.G_MISS_NUM);
108: TYPE events_tbl_type IS TABLE OF events_rec_type
109: INDEX BY BINARY_INTEGER;
110: g_events events_tbl_type;
103: --If Yes give the new cnh_id ----Begins
104: ----------------------------------------------------------------------------
105: TYPE events_rec_type IS RECORD (
106: old_cnh_id NUMBER := OKC_API.G_MISS_NUM,
107: new_cnh_id NUMBER := OKC_API.G_MISS_NUM);
108: TYPE events_tbl_type IS TABLE OF events_rec_type
109: INDEX BY BINARY_INTEGER;
110: g_events events_tbl_type;
111: -- Added for Bug 1917514
124: -- To get PARENT_OLE_ID for top line, search for ID = header_id
125: -- for sub line, search for ID = Parent Line Id
126: ----------------------------------------------------------------------------
127: TYPE line_op_rec_type IS RECORD (
128: id NUMBER := OKC_API.G_MISS_NUM,
129: ole_id NUMBER := OKC_API.G_MISS_NUM);
130:
131: TYPE line_op_tbl_type IS TABLE OF line_op_rec_type
132: INDEX BY BINARY_INTEGER;
125: -- for sub line, search for ID = Parent Line Id
126: ----------------------------------------------------------------------------
127: TYPE line_op_rec_type IS RECORD (
128: id NUMBER := OKC_API.G_MISS_NUM,
129: ole_id NUMBER := OKC_API.G_MISS_NUM);
130:
131: TYPE line_op_tbl_type IS TABLE OF line_op_rec_type
132: INDEX BY BINARY_INTEGER;
133:
520: OKC_DEBUG.ReSet_Indentation;
521: END IF;
522: RETURN(TRUE);
523: Else
524: OKC_API.SET_MESSAGE('OKC', 'OKC_INVALID_TEMPLATE');
525: IF (l_debug = 'Y') THEN
526: OKC_DEBUG.ReSet_Indentation;
527: END IF;
528: RETURN(FALSE);
814:
815: EXCEPTION
816: WHEN OTHERS THEN
817: -- store SQL error message on message stack for caller
818: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
819: -- notify caller of an UNEXPECTED error
820:
821: END derive_line_style;
822:
854: l_scn_count NUMBER := 0;
855:
856: l_sccv_rec sccv_rec_type;
857: x_sccv_rec sccv_rec_type;
858: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
859:
860: TYPE sec_rec_type IS RECORD (
861: scn_id NUMBER := OKC_API.G_MISS_NUM);
862: TYPE sec_tbl_type IS TABLE OF sec_rec_type
857: x_sccv_rec sccv_rec_type;
858: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
859:
860: TYPE sec_rec_type IS RECORD (
861: scn_id NUMBER := OKC_API.G_MISS_NUM);
862: TYPE sec_tbl_type IS TABLE OF sec_rec_type
863: INDEX BY BINARY_INTEGER;
864: l_sec sec_tbl_type;
865:
887:
888: l_new_scn_id NUMBER;
889: l_scnv_rec scnv_rec_type;
890: x_scnv_rec scnv_rec_type;
891: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
892:
893: BEGIN
894: x_return_status := l_return_status;
895: IF get_new_scn_id(p_scn_id,l_new_scn_id) THEN
916: x_msg_data => x_msg_data,
917: p_scnv_rec => l_scnv_rec,
918: x_scnv_rec => x_scnv_rec);
919:
920: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
921: x_return_status := l_return_status;
922: RAISE G_EXCEPTION_HALT_VALIDATION;
923: END IF;
924:
930: WHEN G_EXCEPTION_HALT_VALIDATION THEN
931: NULL;
932: WHEN OTHERS THEN
933: -- store SQL error message on message stack for caller
934: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
935: -- notify caller of an UNEXPECTED error
936: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
937: END copy_section;
938:
932: WHEN OTHERS THEN
933: -- store SQL error message on message stack for caller
934: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
935: -- notify caller of an UNEXPECTED error
936: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
937: END copy_section;
938:
939: BEGIN
940: x_return_status := l_return_status;
968: p_scn_id => l_sec(i).scn_id,
969: p_to_chr_id => p_to_chr_id,
970: x_scn_id => l_scn_id_out);
971:
972: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
973: x_return_status := l_return_status;
974: RAISE G_EXCEPTION_HALT_VALIDATION;
975: END IF;
976: END LOOP;
996: x_msg_data => x_msg_data,
997: p_sccv_rec => l_sccv_rec,
998: x_sccv_rec => x_sccv_rec);
999:
1000: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1001: x_return_status := l_return_status;
1002: RAISE G_EXCEPTION_HALT_VALIDATION;
1003: END IF;
1004: End If;
1007: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1008: NULL;
1009: WHEN OTHERS THEN
1010: -- store SQL error message on message stack for caller
1011: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1012: -- notify caller of an UNEXPECTED error
1013: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1014: END copy_sections;
1015:
1009: WHEN OTHERS THEN
1010: -- store SQL error message on message stack for caller
1011: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1012: -- notify caller of an UNEXPECTED error
1013: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1014: END copy_sections;
1015:
1016: ----------------------------------------------------------------------------
1017: -- Proceudre copy_cover_times - Makes a copy of cover times
1036:
1037: l_new_tve_id NUMBER;
1038: l_ctiv_rec ctiv_rec_type;
1039: x_ctiv_rec ctiv_rec_type;
1040: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1041:
1042: BEGIN
1043:
1044: -------------------------------------------------------------------------
1066: p_to_chr_id => p_to_chr_id,
1067: p_to_template_yn => p_to_template_yn,
1068: x_tve_id => l_new_tve_id);
1069:
1070: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1071: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1072: x_return_status := l_return_status;
1073: RAISE G_EXCEPTION_HALT_VALIDATION;
1074: ELSE
1067: p_to_template_yn => p_to_template_yn,
1068: x_tve_id => l_new_tve_id);
1069:
1070: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1071: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1072: x_return_status := l_return_status;
1073: RAISE G_EXCEPTION_HALT_VALIDATION;
1074: ELSE
1075: x_return_status := l_return_status;
1089: x_msg_data => x_msg_data,
1090: p_ctiv_rec => l_ctiv_rec,
1091: x_ctiv_rec => x_ctiv_rec);
1092:
1093: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1094: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1095: x_return_status := l_return_status;
1096: RAISE G_EXCEPTION_HALT_VALIDATION;
1097: ELSE
1090: p_ctiv_rec => l_ctiv_rec,
1091: x_ctiv_rec => x_ctiv_rec);
1092:
1093: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1094: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1095: x_return_status := l_return_status;
1096: RAISE G_EXCEPTION_HALT_VALIDATION;
1097: ELSE
1098: x_return_status := l_return_status;
1105: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1106: NULL;
1107: WHEN OTHERS THEN
1108: -- store SQL error message on message stack for caller
1109: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1110: -- notify caller of an UNEXPECTED error
1111: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1112: END copy_cover_times;
1113:
1107: WHEN OTHERS THEN
1108: -- store SQL error message on message stack for caller
1109: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1110: -- notify caller of an UNEXPECTED error
1111: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1112: END copy_cover_times;
1113:
1114: ----------------------------------------------------------------------------
1115: -- Proceudre copy_react_intervals - Makes copy of react_intervals
1136:
1137: l_new_tve_id NUMBER;
1138: l_rilv_rec rilv_rec_type;
1139: x_rilv_rec rilv_rec_type;
1140: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1141:
1142: BEGIN
1143:
1144: -------------------------------------------------------------------------
1166: p_to_chr_id => p_to_chr_id,
1167: p_to_template_yn => p_to_template_yn,
1168: x_tve_id => l_new_tve_id);
1169:
1170: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1172: x_return_status := l_return_status;
1173: RAISE G_EXCEPTION_HALT_VALIDATION;
1174: ELSE
1167: p_to_template_yn => p_to_template_yn,
1168: x_tve_id => l_new_tve_id);
1169:
1170: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1171: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1172: x_return_status := l_return_status;
1173: RAISE G_EXCEPTION_HALT_VALIDATION;
1174: ELSE
1175: x_return_status := l_return_status;
1191: x_msg_data => x_msg_data,
1192: p_rilv_rec => l_rilv_rec,
1193: x_rilv_rec => x_rilv_rec);
1194:
1195: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1196: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1197: x_return_status := l_return_status;
1198: RAISE G_EXCEPTION_HALT_VALIDATION;
1199: ELSE
1192: p_rilv_rec => l_rilv_rec,
1193: x_rilv_rec => x_rilv_rec);
1194:
1195: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1196: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1197: x_return_status := l_return_status;
1198: RAISE G_EXCEPTION_HALT_VALIDATION;
1199: ELSE
1200: x_return_status := l_return_status;
1207: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1208: NULL;
1209: WHEN OTHERS THEN
1210: -- store SQL error message on message stack for caller
1211: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1212: -- notify caller of an UNEXPECTED error
1213: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1214: END copy_react_intervals;
1215:
1209: WHEN OTHERS THEN
1210: -- store SQL error message on message stack for caller
1211: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1212: -- notify caller of an UNEXPECTED error
1213: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1214: END copy_react_intervals;
1215:
1216: --------------------------------------------------------------------------
1217: --Proceudre copy_accesses - Makes a copy of the okc_k_accesses.
1226: p_to_chr_id IN NUMBER) IS
1227:
1228: l_cacv_rec cacv_rec_type;
1229: x_cacv_rec cacv_rec_type;
1230: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1231:
1232: CURSOR c_access IS
1233: SELECT id
1234: FROM okc_k_accesses_v
1249: x_msg_data => x_msg_data,
1250: p_cacv_rec => l_cacv_rec,
1251: x_cacv_rec => x_cacv_rec);
1252:
1253: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1254: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1255: x_return_status := l_return_status;
1256: RAISE G_EXCEPTION_HALT_VALIDATION;
1257: ELSE
1250: p_cacv_rec => l_cacv_rec,
1251: x_cacv_rec => x_cacv_rec);
1252:
1253: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1254: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1255: x_return_status := l_return_status;
1256: RAISE G_EXCEPTION_HALT_VALIDATION;
1257: ELSE
1258: x_return_status := l_return_status;
1264: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1265: NULL;
1266: WHEN OTHERS THEN
1267: -- store SQL error message on message stack for caller
1268: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1269: -- notify caller of an UNEXPECTED error
1270: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1271:
1272: END copy_accesses;
1266: WHEN OTHERS THEN
1267: -- store SQL error message on message stack for caller
1268: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1269: -- notify caller of an UNEXPECTED error
1270: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1271:
1272: END copy_accesses;
1273:
1274: ----------------------------------------------------------------------------
1284: p_to_chr_id IN NUMBER) IS
1285:
1286: l_cpsv_rec cpsv_rec_type;
1287: x_cpsv_rec cpsv_rec_type;
1288: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1289:
1290: CURSOR c_process IS
1291: SELECT id
1292: FROM okc_k_processes_v
1308: x_msg_data => x_msg_data,
1309: p_cpsv_rec => l_cpsv_rec,
1310: x_cpsv_rec => x_cpsv_rec);
1311:
1312: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1313: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1314: x_return_status := l_return_status;
1315: RAISE G_EXCEPTION_HALT_VALIDATION;
1316: ELSE
1309: p_cpsv_rec => l_cpsv_rec,
1310: x_cpsv_rec => x_cpsv_rec);
1311:
1312: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1313: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1314: x_return_status := l_return_status;
1315: RAISE G_EXCEPTION_HALT_VALIDATION;
1316: ELSE
1317: x_return_status := l_return_status;
1323: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1324: NULL;
1325: WHEN OTHERS THEN
1326: -- store SQL error message on message stack for caller
1327: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1328: -- notify caller of an UNEXPECTED error
1329: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1330:
1331: END copy_processes;
1325: WHEN OTHERS THEN
1326: -- store SQL error message on message stack for caller
1327: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1328: -- notify caller of an UNEXPECTED error
1329: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1330:
1331: END copy_processes;
1332:
1333: ----------------------------------------------------------------------------
1343: p_to_chr_id IN NUMBER) IS
1344:
1345: l_cgcv_rec cgcv_rec_type;
1346: x_cgcv_rec cgcv_rec_type;
1347: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1348:
1349: CURSOR c_grpings IS
1350: SELECT cgcv.id
1351: FROM okc_k_grpings_v cgcv,
1369: x_msg_data => x_msg_data,
1370: p_cgcv_rec => l_cgcv_rec,
1371: x_cgcv_rec => x_cgcv_rec);
1372:
1373: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1374: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1375: x_return_status := l_return_status;
1376: RAISE G_EXCEPTION_HALT_VALIDATION;
1377: ELSE
1370: p_cgcv_rec => l_cgcv_rec,
1371: x_cgcv_rec => x_cgcv_rec);
1372:
1373: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1374: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1375: x_return_status := l_return_status;
1376: RAISE G_EXCEPTION_HALT_VALIDATION;
1377: ELSE
1378: x_return_status := l_return_status;
1384: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1385: NULL;
1386: WHEN OTHERS THEN
1387: -- store SQL error message on message stack for caller
1388: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1389: -- notify caller of an UNEXPECTED error
1390: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1391:
1392: END copy_grpings;
1386: WHEN OTHERS THEN
1387: -- store SQL error message on message stack for caller
1388: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1389: -- notify caller of an UNEXPECTED error
1390: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1391:
1392: END copy_grpings;
1393:
1394: /*******************************************************************************
1407: p_to_chr_id IN NUMBER) IS
1408:
1409: l_gvev_rec gvev_rec_type;
1410: x_gvev_rec gvev_rec_type;
1411: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1412:
1413: CURSOR c_governances IS
1414: SELECT id
1415: FROM okc_governances_v
1421: ----------------------------------------------------------------------------
1422: FUNCTION get_gvev_rec(p_gve_id IN NUMBER,
1423: x_gvev_rec OUT NOCOPY gvev_rec_type)
1424: RETURN VARCHAR2 IS
1425: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1426: l_no_data_found BOOLEAN := TRUE;
1427:
1428: CURSOR c_gvev_rec IS
1429: SELECT
1449:
1450: l_no_data_found := c_gvev_rec%NOTFOUND;
1451: CLOSE c_gvev_rec;
1452: IF l_no_data_found THEN
1453: l_return_status := OKC_API.G_RET_STS_ERROR;
1454: return(l_return_status);
1455: ELSE
1456: return(l_return_status);
1457: END IF;
1457: END IF;
1458: EXCEPTION
1459: WHEN OTHERS THEN
1460: -- store SQL error message on message stack for caller
1461: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1462: -- notify caller of an UNEXPECTED error
1463: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1464: return(l_return_status);
1465:
1459: WHEN OTHERS THEN
1460: -- store SQL error message on message stack for caller
1461: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1462: -- notify caller of an UNEXPECTED error
1463: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1464: return(l_return_status);
1465:
1466: END get_gvev_rec;
1467: BEGIN
1480: x_msg_data => x_msg_data,
1481: p_gvev_rec => l_gvev_rec,
1482: x_gvev_rec => x_gvev_rec);
1483:
1484: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1485: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1486: x_return_status := l_return_status;
1487: RAISE G_EXCEPTION_HALT_VALIDATION;
1488: ELSE
1481: p_gvev_rec => l_gvev_rec,
1482: x_gvev_rec => x_gvev_rec);
1483:
1484: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1485: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1486: x_return_status := l_return_status;
1487: RAISE G_EXCEPTION_HALT_VALIDATION;
1488: ELSE
1489: x_return_status := l_return_status;
1495: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1496: NULL;
1497: WHEN OTHERS THEN
1498: -- store SQL error message on message stack for caller
1499: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1500: -- notify caller of an UNEXPECTED error
1501: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1502:
1503: END copy_governances;
1497: WHEN OTHERS THEN
1498: -- store SQL error message on message stack for caller
1499: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1500: -- notify caller of an UNEXPECTED error
1501: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1502:
1503: END copy_governances;
1504: *******************************************************************************/
1505:
1522: x_catv_rec catv_rec_type;
1523: l_atnv_rec atnv_rec_type;
1524: x_atnv_rec atnv_rec_type;
1525:
1526: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1527: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1528: l_new_rul_id NUMBER := OKC_API.G_MISS_NUM;
1529:
1530: CURSOR c_dnz_chr_id(p_id IN NUMBER) IS
1523: l_atnv_rec atnv_rec_type;
1524: x_atnv_rec atnv_rec_type;
1525:
1526: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1527: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1528: l_new_rul_id NUMBER := OKC_API.G_MISS_NUM;
1529:
1530: CURSOR c_dnz_chr_id(p_id IN NUMBER) IS
1531: SELECT dnz_chr_id
1524: x_atnv_rec atnv_rec_type;
1525:
1526: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1527: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1528: l_new_rul_id NUMBER := OKC_API.G_MISS_NUM;
1529:
1530: CURSOR c_dnz_chr_id(p_id IN NUMBER) IS
1531: SELECT dnz_chr_id
1532: FROM okc_k_lines_b
1562: If p_sav_sav_release IS NOT NULL Then
1563: l_catv_rec.sav_sav_release := p_sav_sav_release;
1564: End If;
1565:
1566: IF p_chr_id IS NULL OR p_chr_id = OKC_API.G_MISS_NUM THEN
1567: OPEN c_dnz_chr_id(p_cle_id);
1568: FETCH c_dnz_chr_id INTO l_catv_rec.dnz_chr_id;
1569: CLOSE c_dnz_chr_id;
1570: ELSE
1590: IF (l_debug = 'Y') THEN
1591: OKC_DEBUG.log('400 : create_k_article returns ' || l_return_status, 2);
1592: END IF;
1593:
1594: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1595: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1596: x_return_status := l_return_status;
1597: RAISE G_EXCEPTION_HALT_VALIDATION;
1598: ELSE
1591: OKC_DEBUG.log('400 : create_k_article returns ' || l_return_status, 2);
1592: END IF;
1593:
1594: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1595: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1596: x_return_status := l_return_status;
1597: RAISE G_EXCEPTION_HALT_VALIDATION;
1598: ELSE
1599: x_return_status := l_return_status;
1617: x_msg_data => x_msg_data,
1618: p_atnv_rec => l_atnv_rec,
1619: x_atnv_rec => x_atnv_rec);
1620:
1621: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1622: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1623: x_return_status := l_return_status;
1624: RAISE G_EXCEPTION_HALT_VALIDATION;
1625: ELSE
1618: p_atnv_rec => l_atnv_rec,
1619: x_atnv_rec => x_atnv_rec);
1620:
1621: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1622: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1623: x_return_status := l_return_status;
1624: RAISE G_EXCEPTION_HALT_VALIDATION;
1625: ELSE
1626: x_return_status := l_return_status;
1642: p_to_cat_id => x_catv_rec.id,
1643: p_to_chr_id => x_catv_rec.dnz_chr_id,
1644: p_scn_id => NULL);
1645:
1646: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1647: x_return_status := l_return_status;
1648: RAISE G_EXCEPTION_HALT_VALIDATION;
1649: END IF;
1650: END LOOP;
1661: OKC_DEBUG.ReSet_Indentation;
1662: END IF;
1663: WHEN OTHERS THEN
1664: -- store SQL error message on message stack for caller
1665: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1666: -- notify caller of an UNEXPECTED error
1667: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1668: IF (l_debug = 'Y') THEN
1669: OKC_DEBUG.ReSet_Indentation;
1663: WHEN OTHERS THEN
1664: -- store SQL error message on message stack for caller
1665: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1666: -- notify caller of an UNEXPECTED error
1667: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1668: IF (l_debug = 'Y') THEN
1669: OKC_DEBUG.ReSet_Indentation;
1670: END IF;
1671:
1685: p_chr_id IN NUMBER ,
1686: x_cat_id OUT NOCOPY NUMBER) IS
1687:
1688:
1689: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1690: l_sae_id NUMBER;
1691: l_sav_release VARCHAR2(150);
1692:
1693: CURSOR c_sav_sae_id(p_cat_id IN NUMBER) IS
1745: IF (l_debug = 'Y') THEN
1746: OKC_DEBUG.log('1006 : After OKC_COPY_CONTRACT_PUB.Copy_Articles ' || l_return_status );
1747: END IF;
1748:
1749: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1750: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1751: x_return_status := l_return_status;
1752: RAISE G_EXCEPTION_HALT_VALIDATION;
1753: ELSE
1746: OKC_DEBUG.log('1006 : After OKC_COPY_CONTRACT_PUB.Copy_Articles ' || l_return_status );
1747: END IF;
1748:
1749: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1750: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1751: x_return_status := l_return_status;
1752: RAISE G_EXCEPTION_HALT_VALIDATION;
1753: ELSE
1754: x_return_status := l_return_status;
1767: END IF;
1768: NULL;
1769: WHEN OTHERS THEN
1770: -- store SQL error message on message stack for caller
1771: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1772: -- notify caller of an UNEXPECTED error
1773: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1774: IF (l_debug = 'Y') THEN
1775: OKC_DEBUG.ReSet_Indentation;
1769: WHEN OTHERS THEN
1770: -- store SQL error message on message stack for caller
1771: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1772: -- notify caller of an UNEXPECTED error
1773: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1774: IF (l_debug = 'Y') THEN
1775: OKC_DEBUG.ReSet_Indentation;
1776: END IF;
1777:
1793:
1794: l_pavv_rec pavv_rec_type;
1795: x_pavv_rec pavv_rec_type;
1796:
1797: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1798: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1799:
1800: BEGIN
1801: x_return_status := l_return_status;
1794: l_pavv_rec pavv_rec_type;
1795: x_pavv_rec pavv_rec_type;
1796:
1797: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1798: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1799:
1800: BEGIN
1801: x_return_status := l_return_status;
1802: l_return_status := get_pavv_rec( p_pav_id => p_pav_id,
1813: x_msg_data => x_msg_data,
1814: p_pavv_rec => l_pavv_rec,
1815: x_pavv_rec => x_pavv_rec);
1816:
1817: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1818: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1819: x_return_status := l_return_status;
1820: RAISE G_EXCEPTION_HALT_VALIDATION;
1821: ELSE
1814: p_pavv_rec => l_pavv_rec,
1815: x_pavv_rec => x_pavv_rec);
1816:
1817: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1818: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1819: x_return_status := l_return_status;
1820: RAISE G_EXCEPTION_HALT_VALIDATION;
1821: ELSE
1822: x_return_status := l_return_status;
1829: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1830: NULL;
1831: WHEN OTHERS THEN
1832: -- store SQL error message on message stack for caller
1833: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1834: -- notify caller of an UNEXPECTED error
1835: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1836:
1837: END copy_price_att_values;
1831: WHEN OTHERS THEN
1832: -- store SQL error message on message stack for caller
1833: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1834: -- notify caller of an UNEXPECTED error
1835: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1836:
1837: END copy_price_att_values;
1838:
1839:
1853:
1854: l_patv_rec patv_rec_type;
1855: x_patv_rec patv_rec_type;
1856:
1857: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1858: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1859:
1860: l_new_pat_id NUMBER;
1861: BEGIN
1854: l_patv_rec patv_rec_type;
1855: x_patv_rec patv_rec_type;
1856:
1857: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1858: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1859:
1860: l_new_pat_id NUMBER;
1861: BEGIN
1862: x_return_status := l_return_status;
1879: p_patv_rec => l_patv_rec,
1880: x_patv_rec => x_patv_rec);
1881:
1882:
1883: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1885: x_return_status := l_return_status;
1886: RAISE G_EXCEPTION_HALT_VALIDATION;
1887: ELSE
1880: x_patv_rec => x_patv_rec);
1881:
1882:
1883: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1885: x_return_status := l_return_status;
1886: RAISE G_EXCEPTION_HALT_VALIDATION;
1887: ELSE
1888: x_return_status := l_return_status;
1896: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1897: NULL;
1898: WHEN OTHERS THEN
1899: -- store SQL error message on message stack for caller
1900: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1901: -- notify caller of an UNEXPECTED error
1902: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1903:
1904: END copy_price_adjustments;
1898: WHEN OTHERS THEN
1899: -- store SQL error message on message stack for caller
1900: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1901: -- notify caller of an UNEXPECTED error
1902: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1903:
1904: END copy_price_adjustments;
1905:
1906: ---------------------------------------------------------------------------------------------------
1918:
1919: l_pacv_rec pacv_rec_type;
1920: x_pacv_rec pacv_rec_type;
1921:
1922: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1923: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1924:
1925: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
1926: l_new_pat_id_from NUMBER := OKC_API.G_MISS_NUM; -- Added as per Bug 2554460
1919: l_pacv_rec pacv_rec_type;
1920: x_pacv_rec pacv_rec_type;
1921:
1922: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1923: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1924:
1925: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
1926: l_new_pat_id_from NUMBER := OKC_API.G_MISS_NUM; -- Added as per Bug 2554460
1927:
1921:
1922: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1923: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1924:
1925: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
1926: l_new_pat_id_from NUMBER := OKC_API.G_MISS_NUM; -- Added as per Bug 2554460
1927:
1928: BEGIN
1929: x_return_status := l_return_status;
1922: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
1923: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
1924:
1925: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
1926: l_new_pat_id_from NUMBER := OKC_API.G_MISS_NUM; -- Added as per Bug 2554460
1927:
1928: BEGIN
1929: x_return_status := l_return_status;
1930: l_return_status := get_pacv_rec( p_pac_id => p_pac_id,
1960: x_msg_data => x_msg_data,
1961: p_pacv_rec => l_pacv_rec,
1962: x_pacv_rec => x_pacv_rec);
1963:
1964: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1965: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1966: x_return_status := l_return_status;
1967: RAISE G_EXCEPTION_HALT_VALIDATION;
1968: ELSE
1961: p_pacv_rec => l_pacv_rec,
1962: x_pacv_rec => x_pacv_rec);
1963:
1964: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
1965: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
1966: x_return_status := l_return_status;
1967: RAISE G_EXCEPTION_HALT_VALIDATION;
1968: ELSE
1969: x_return_status := l_return_status;
1976: WHEN G_EXCEPTION_HALT_VALIDATION THEN
1977: NULL;
1978: WHEN OTHERS THEN
1979: -- store SQL error message on message stack for caller
1980: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1981: -- notify caller of an UNEXPECTED error
1982: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1983:
1984: END copy_price_adj_assocs;
1978: WHEN OTHERS THEN
1979: -- store SQL error message on message stack for caller
1980: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
1981: -- notify caller of an UNEXPECTED error
1982: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
1983:
1984: END copy_price_adj_assocs;
1985:
1986: ----------------------------------------------------------------
1996:
1997: l_paav_rec paav_rec_type;
1998: x_paav_rec paav_rec_type;
1999:
2000: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
2001:
2002: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2003:
2004:
1998: x_paav_rec paav_rec_type;
1999:
2000: l_new_pat_id NUMBER := OKC_API.G_MISS_NUM;
2001:
2002: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2003:
2004:
2005: CURSOR c_paav IS
2006: SELECT id
2031: x_msg_count => x_msg_count,
2032: x_msg_data => x_msg_data,
2033: p_paav_rec => l_paav_rec,
2034: x_paav_rec => x_paav_rec);
2035: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2036: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2037: x_return_status := l_return_status;
2038: RAISE G_EXCEPTION_HALT_VALIDATION;
2039: ELSE
2032: x_msg_data => x_msg_data,
2033: p_paav_rec => l_paav_rec,
2034: x_paav_rec => x_paav_rec);
2035: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2036: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2037: x_return_status := l_return_status;
2038: RAISE G_EXCEPTION_HALT_VALIDATION;
2039: ELSE
2040: x_return_status := l_return_status;
2048: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2049: NULL;
2050: WHEN OTHERS THEN
2051: -- store SQL error message on message stack for caller
2052: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2053: -- notify caller of an UNEXPECTED error
2054: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2055:
2056: END copy_price_adj_attribs;
2050: WHEN OTHERS THEN
2051: -- store SQL error message on message stack for caller
2052: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2053: -- notify caller of an UNEXPECTED error
2054: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2055:
2056: END copy_price_adj_attribs;
2057:
2058: --------------------------------------------------------------------------------------------
2065: ----------------------------------------------------------------------------
2066: FUNCTION get_scrv_rec(p_scrv_id IN NUMBER,
2067: x_scrv_rec OUT NOCOPY OKC_SALES_CREDIT_PUB.scrv_rec_type) RETURN VARCHAR2 IS
2068:
2069: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2070: l_no_data_found BOOLEAN := TRUE;
2071:
2072: CURSOR c_scrv_rec IS
2073: SELECT
2109:
2110: l_no_data_found := c_scrv_rec%NOTFOUND;
2111: CLOSE c_scrv_rec;
2112: IF l_no_data_found THEN
2113: l_return_status := OKC_API.G_RET_STS_ERROR;
2114: return(l_return_status);
2115: ELSE
2116: return(l_return_status);
2117: END IF;
2117: END IF;
2118: EXCEPTION
2119: WHEN OTHERS THEN
2120: -- store SQL error message on message stack for caller
2121: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2122: -- notify caller of an UNEXPECTED error
2123: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2124: return(l_return_status);
2125:
2119: WHEN OTHERS THEN
2120: -- store SQL error message on message stack for caller
2121: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2122: -- notify caller of an UNEXPECTED error
2123: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2124: return(l_return_status);
2125:
2126: END get_scrv_rec;
2127:
2145: l_scrv_rec OKC_SALES_credit_PUB.scrv_rec_type;
2146: x_scrv_rec OKC_SALES_credit_PUB.scrv_rec_type;
2147:
2148:
2149: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2150: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2151:
2152: BEGIN
2153: x_return_status := l_return_status;
2146: x_scrv_rec OKC_SALES_credit_PUB.scrv_rec_type;
2147:
2148:
2149: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2150: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2151:
2152: BEGIN
2153: x_return_status := l_return_status;
2154:
2169: p_scrv_rec => l_scrv_rec,
2170: x_scrv_rec => x_scrv_rec);
2171:
2172:
2173: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2174: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2175: x_return_status := l_return_status;
2176: RAISE G_EXCEPTION_HALT_VALIDATION;
2177: ELSE
2170: x_scrv_rec => x_scrv_rec);
2171:
2172:
2173: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2174: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2175: x_return_status := l_return_status;
2176: RAISE G_EXCEPTION_HALT_VALIDATION;
2177: ELSE
2178: x_return_status := l_return_status;
2185: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2186: NULL;
2187: WHEN OTHERS THEN
2188: -- store SQL error message on message stack for caller
2189: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2190: -- notify caller of an UNEXPECTED error
2191: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2192:
2193: END copy_sales_credits ;
2187: WHEN OTHERS THEN
2188: -- store SQL error message on message stack for caller
2189: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2190: -- notify caller of an UNEXPECTED error
2191: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2192:
2193: END copy_sales_credits ;
2194:
2195:
2203: FUNCTION get_okc_ph_line_breaks_v_rec(p_okc_ph_line_breaks_v_id IN NUMBER,
2204: x_okc_ph_line_breaks_v_rec OUT NOCOPY OKC_PH_LINE_BREAKS_PUB.okc_ph_line_breaks_v_rec_type)
2205: RETURN VARCHAR2 IS
2206:
2207: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2208: l_no_data_found BOOLEAN := TRUE;
2209:
2210: CURSOR c_okc_ph_line_breaks_v_rec IS
2211: SELECT
2255:
2256: l_no_data_found := c_okc_ph_line_breaks_v_rec%NOTFOUND;
2257: CLOSE c_okc_ph_line_breaks_v_rec;
2258: IF l_no_data_found THEN
2259: l_return_status := OKC_API.G_RET_STS_ERROR;
2260: return(l_return_status);
2261: ELSE
2262: return(l_return_status);
2263: END IF;
2263: END IF;
2264: EXCEPTION
2265: WHEN OTHERS THEN
2266: -- store SQL error message on message stack for caller
2267: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2268: -- notify caller of an UNEXPECTED error
2269: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2270: return(l_return_status);
2271:
2265: WHEN OTHERS THEN
2266: -- store SQL error message on message stack for caller
2267: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2268: -- notify caller of an UNEXPECTED error
2269: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2270: return(l_return_status);
2271:
2272: END get_okc_ph_line_breaks_v_rec;
2273:
2292: l_okc_ph_line_breaks_v_rec OKC_PH_LINE_BREAKS_PUB.okc_ph_line_breaks_v_rec_type;
2293: x_okc_ph_line_breaks_v_rec OKC_PH_LINE_BREAKS_PUB.okc_ph_line_breaks_v_rec_type;
2294:
2295:
2296: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2297: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2298:
2299: BEGIN
2300: x_return_status := l_return_status;
2293: x_okc_ph_line_breaks_v_rec OKC_PH_LINE_BREAKS_PUB.okc_ph_line_breaks_v_rec_type;
2294:
2295:
2296: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2297: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2298:
2299: BEGIN
2300: x_return_status := l_return_status;
2301:
2319: x_okc_ph_line_breaks_v_rec => x_okc_ph_line_breaks_v_rec);
2320:
2321:
2322:
2323: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2324: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2325: x_return_status := l_return_status;
2326: RAISE G_EXCEPTION_HALT_VALIDATION;
2327: ELSE
2320:
2321:
2322:
2323: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2324: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2325: x_return_status := l_return_status;
2326: RAISE G_EXCEPTION_HALT_VALIDATION;
2327: ELSE
2328: x_return_status := l_return_status;
2335: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2336: NULL;
2337: WHEN OTHERS THEN
2338: -- store SQL error message on message stack for caller
2339: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2340: -- notify caller of an UNEXPECTED error
2341: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2342:
2343: END copy_price_hold_line_breaks ;
2337: WHEN OTHERS THEN
2338: -- store SQL error message on message stack for caller
2339: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2340: -- notify caller of an UNEXPECTED error
2341: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2342:
2343: END copy_price_hold_line_breaks ;
2344:
2345: -- Price Hold is bosoleted and this procedure is nolonger required.
2349: ----------------------------------------------------------------------------
2350: FUNCTION get_gvev_rec(p_gve_id IN NUMBER,
2351: x_gvev_rec OUT NOCOPY gvev_rec_type)
2352: RETURN VARCHAR2 IS
2353: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2354: l_no_data_found BOOLEAN := TRUE;
2355:
2356: CURSOR c_gvev_rec IS
2357: SELECT
2377:
2378: l_no_data_found := c_gvev_rec%NOTFOUND;
2379: CLOSE c_gvev_rec;
2380: IF l_no_data_found THEN
2381: l_return_status := OKC_API.G_RET_STS_ERROR;
2382: return(l_return_status);
2383: ELSE
2384: return(l_return_status);
2385: END IF;
2385: END IF;
2386: EXCEPTION
2387: WHEN OTHERS THEN
2388: -- store SQL error message on message stack for caller
2389: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2390: -- notify caller of an UNEXPECTED error
2391: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2392: return(l_return_status);
2393:
2387: WHEN OTHERS THEN
2388: -- store SQL error message on message stack for caller
2389: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2390: -- notify caller of an UNEXPECTED error
2391: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2392: return(l_return_status);
2393:
2394: END get_gvev_rec;
2395:
2411:
2412: l_gvev_rec gvev_rec_type;
2413: x_gvev_rec gvev_rec_type;
2414:
2415: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2416:
2417: BEGIN
2418:
2419: x_return_status := l_return_status;
2420:
2421: l_return_status := get_gvev_rec(p_gve_id => p_gvev_id,
2422: x_gvev_rec => l_gvev_rec);
2423:
2424: IF p_cle_id IS NOT NULL AND p_cle_id <> OKC_API.G_MISS_NUM THEN
2425: --we are copying at line level so chr_id should be null
2426: l_gvev_rec.chr_id := NULL;
2427: ELSE
2428: --we are copying at header level
2441: x_msg_data => x_msg_data,
2442: p_gvev_rec => l_gvev_rec,
2443: x_gvev_rec => x_gvev_rec);
2444:
2445: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2446: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2447: x_return_status := l_return_status;
2448: RAISE G_EXCEPTION_HALT_VALIDATION;
2449: ELSE
2442: p_gvev_rec => l_gvev_rec,
2443: x_gvev_rec => x_gvev_rec);
2444:
2445: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2446: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2447: x_return_status := l_return_status;
2448: RAISE G_EXCEPTION_HALT_VALIDATION;
2449: ELSE
2450: x_return_status := l_return_status;
2457: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2458: NULL;
2459: WHEN OTHERS THEN
2460: -- store SQL error message on message stack for caller
2461: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2462: -- notify caller of an UNEXPECTED error
2463: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2464:
2465: END copy_governances;
2459: WHEN OTHERS THEN
2460: -- store SQL error message on message stack for caller
2461: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2462: -- notify caller of an UNEXPECTED error
2463: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2464:
2465: END copy_governances;
2466:
2467:
2488: x_ctcv_rec ctcv_rec_type;
2489:
2490: l_party_name VARCHAR2(200);
2491: l_party_desc VARCHAR2(2000);
2492: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2493: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2494:
2495: CURSOR c_dnz_chr_id(p_id IN NUMBER) IS
2496: SELECT dnz_chr_id
2489:
2490: l_party_name VARCHAR2(200);
2491: l_party_desc VARCHAR2(2000);
2492: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2493: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2494:
2495: CURSOR c_dnz_chr_id(p_id IN NUMBER) IS
2496: SELECT dnz_chr_id
2497: FROM okc_k_lines_b
2506: x_return_status := l_return_status;
2507: l_return_status := get_cplv_rec( p_cpl_id => p_cpl_id,
2508: x_cplv_rec => l_cplv_rec);
2509:
2510: IF p_chr_id IS NULL OR p_chr_id = OKC_API.G_MISS_NUM THEN
2511: OPEN c_dnz_chr_id(p_cle_id);
2512: FETCH c_dnz_chr_id INTO l_cplv_rec.dnz_chr_id;
2513: CLOSE c_dnz_chr_id;
2514: ELSE
2529: x_msg_data => x_msg_data,
2530: p_cplv_rec => l_cplv_rec,
2531: x_cplv_rec => x_cplv_rec);
2532:
2533: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2534: x_return_status := l_return_status;
2535: RAISE G_EXCEPTION_HALT_VALIDATION;
2536: END IF;
2537:
2556: x_msg_data => x_msg_data,
2557: p_ctcv_rec => l_ctcv_rec,
2558: x_ctcv_rec => x_ctcv_rec);
2559:
2560: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2561: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2562: x_return_status := l_return_status;
2563: RAISE G_EXCEPTION_HALT_VALIDATION;
2564: ELSE
2557: p_ctcv_rec => l_ctcv_rec,
2558: x_ctcv_rec => x_ctcv_rec);
2559:
2560: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2561: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2562: x_return_status := l_return_status;
2563: RAISE G_EXCEPTION_HALT_VALIDATION;
2564: ELSE
2565: x_return_status := OKC_API.G_RET_STS_WARNING;
2561: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2562: x_return_status := l_return_status;
2563: RAISE G_EXCEPTION_HALT_VALIDATION;
2564: ELSE
2565: x_return_status := OKC_API.G_RET_STS_WARNING;
2566: okc_util.get_name_desc_from_jtfv( p_object_code => x_cplv_rec.jtot_object1_code,
2567: p_id1 => x_cplv_rec.object1_id1,
2568: p_id2 => x_cplv_rec.object1_id2,
2569: x_name => l_party_name,
2568: p_id2 => x_cplv_rec.object1_id2,
2569: x_name => l_party_name,
2570: x_description => l_party_desc);
2571:
2572: OKC_API.set_message(G_APP_NAME,'OKC_CONTACT_NOT_COPIED','PARTY_NAME',l_party_name);
2573: END IF;
2574: END IF;
2575: END LOOP;
2576:
2578: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2579: NULL;
2580: WHEN OTHERS THEN
2581: -- store SQL error message on message stack for caller
2582: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2583: -- notify caller of an UNEXPECTED error
2584: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2585:
2586: END copy_party_roles;
2580: WHEN OTHERS THEN
2581: -- store SQL error message on message stack for caller
2582: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2583: -- notify caller of an UNEXPECTED error
2584: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2585:
2586: END copy_party_roles;
2587:
2588: ----------------------------------------------------------------------------
2607: x_ocev_rec ocev_rec_type;
2608: l_oatv_rec oatv_rec_type;
2609: x_oatv_rec oatv_rec_type;
2610:
2611: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2612: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2613: l_new_cnh_id NUMBER;
2614:
2615: CURSOR c_cnlv IS
2608: l_oatv_rec oatv_rec_type;
2609: x_oatv_rec oatv_rec_type;
2610:
2611: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2612: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2613: l_new_cnh_id NUMBER;
2614:
2615: CURSOR c_cnlv IS
2616: SELECT id
2663: x_msg_data => x_msg_data,
2664: p_cnhv_rec => l_cnhv_rec,
2665: x_cnhv_rec => x_cnhv_rec);
2666:
2667: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2668: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2669: x_return_status := l_return_status;
2670: RAISE G_EXCEPTION_HALT_VALIDATION;
2671: ELSE
2664: p_cnhv_rec => l_cnhv_rec,
2665: x_cnhv_rec => x_cnhv_rec);
2666:
2667: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2668: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2669: x_return_status := l_return_status;
2670: RAISE G_EXCEPTION_HALT_VALIDATION;
2671: ELSE
2672: x_return_status := OKC_API.G_RET_STS_WARNING;
2668: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2669: x_return_status := l_return_status;
2670: RAISE G_EXCEPTION_HALT_VALIDATION;
2671: ELSE
2672: x_return_status := OKC_API.G_RET_STS_WARNING;
2673:
2674: OKC_API.set_message(G_APP_NAME,'OKC_CONDITION_NOT_COPIED','CONDITION',l_cnhv_rec.name);
2675: RAISE G_EXCEPTION_HALT_VALIDATION;
2676: END IF;
2670: RAISE G_EXCEPTION_HALT_VALIDATION;
2671: ELSE
2672: x_return_status := OKC_API.G_RET_STS_WARNING;
2673:
2674: OKC_API.set_message(G_APP_NAME,'OKC_CONDITION_NOT_COPIED','CONDITION',l_cnhv_rec.name);
2675: RAISE G_EXCEPTION_HALT_VALIDATION;
2676: END IF;
2677: END IF;
2678:
2693: x_msg_data => x_msg_data,
2694: p_cnlv_rec => l_cnlv_rec,
2695: x_cnlv_rec => x_cnlv_rec);
2696:
2697: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2698: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2699: x_return_status := l_return_status;
2700: RAISE G_EXCEPTION_HALT_VALIDATION;
2701: ELSE
2694: p_cnlv_rec => l_cnlv_rec,
2695: x_cnlv_rec => x_cnlv_rec);
2696:
2697: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2698: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2699: x_return_status := l_return_status;
2700: RAISE G_EXCEPTION_HALT_VALIDATION;
2701: ELSE
2702: x_return_status := l_return_status;
2719: x_msg_data => x_msg_data,
2720: p_ocev_rec => l_ocev_rec,
2721: x_ocev_rec => x_ocev_rec);
2722:
2723: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2724: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2725: x_return_status := l_return_status;
2726: RAISE G_EXCEPTION_HALT_VALIDATION;
2727: ELSE
2720: p_ocev_rec => l_ocev_rec,
2721: x_ocev_rec => x_ocev_rec);
2722:
2723: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2724: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2725: x_return_status := l_return_status;
2726: RAISE G_EXCEPTION_HALT_VALIDATION;
2727: ELSE
2728: x_return_status := l_return_status;
2744: x_msg_data => x_msg_data,
2745: p_oatv_rec => l_oatv_rec,
2746: x_oatv_rec => x_oatv_rec);
2747:
2748: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2749: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2750: x_return_status := l_return_status;
2751: RAISE G_EXCEPTION_HALT_VALIDATION;
2752: ELSE
2745: p_oatv_rec => l_oatv_rec,
2746: x_oatv_rec => x_oatv_rec);
2747:
2748: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2749: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2750: x_return_status := l_return_status;
2751: RAISE G_EXCEPTION_HALT_VALIDATION;
2752: ELSE
2753: x_return_status := l_return_status;
2763: WHEN G_EXCEPTION_HALT_VALIDATION THEN
2764: NULL;
2765: WHEN OTHERS THEN
2766: -- store SQL error message on message stack for caller
2767: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2768: -- notify caller of an UNEXPECTED error
2769: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2770:
2771: END copy_events;
2765: WHEN OTHERS THEN
2766: -- store SQL error message on message stack for caller
2767: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
2768: -- notify caller of an UNEXPECTED error
2769: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
2770:
2771: END copy_events;
2772:
2773: ----------------------------------------------------------------------------
2791: x_rulv_rec rulv_rec_type;
2792: l_rmpv_rec rmpv_rec_type;
2793: x_rmpv_rec rmpv_rec_type;
2794:
2795: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2796: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2797: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2798: l_tve_id NUMBER;
2799: l_tve_id_out NUMBER;
2792: l_rmpv_rec rmpv_rec_type;
2793: x_rmpv_rec rmpv_rec_type;
2794:
2795: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2796: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2797: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2798: l_tve_id NUMBER;
2799: l_tve_id_out NUMBER;
2800: l_col_vals okc_time_util_pub.t_col_vals;
2793: x_rmpv_rec rmpv_rec_type;
2794:
2795: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2796: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
2797: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
2798: l_tve_id NUMBER;
2799: l_tve_id_out NUMBER;
2800: l_col_vals okc_time_util_pub.t_col_vals;
2801: l_col_vals_temp okc_time_util_pub.t_col_vals;
2869: x_return_status := l_return_status;
2870: l_return_status := get_rgpv_rec( p_rgp_id => p_rgp_id,
2871: x_rgpv_rec => l_rgpv_rec);
2872:
2873: IF p_chr_id IS NULL OR p_chr_id = OKC_API.G_MISS_NUM THEN
2874: OPEN c_dnz_chr_id(p_cle_id);
2875: FETCH c_dnz_chr_id INTO l_rgpv_rec.dnz_chr_id;
2876: CLOSE c_dnz_chr_id;
2877: ELSE
2947: x_msg_data => x_msg_data,
2948: p_rgpv_rec => l_rgpv_rec,
2949: x_rgpv_rec => x_rgpv_rec);
2950:
2951: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2952: x_return_status := l_return_status;
2953: RAISE G_EXCEPTION_HALT_VALIDATION;
2954: END IF;
2955:
2977: x_msg_data => x_msg_data,
2978: p_rmpv_rec => l_rmpv_rec,
2979: x_rmpv_rec => x_rmpv_rec);
2980:
2981: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2982: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2983: x_return_status := l_return_status;
2984: RAISE G_EXCEPTION_HALT_VALIDATION;
2985: ELSE
2978: p_rmpv_rec => l_rmpv_rec,
2979: x_rmpv_rec => x_rmpv_rec);
2980:
2981: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
2982: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2983: x_return_status := l_return_status;
2984: RAISE G_EXCEPTION_HALT_VALIDATION;
2985: ELSE
2986: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR then
2982: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
2983: x_return_status := l_return_status;
2984: RAISE G_EXCEPTION_HALT_VALIDATION;
2985: ELSE
2986: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR then
2987: x_return_status := OKC_API.G_RET_STS_WARNING;
2988: END IF;
2989: END IF;
2990: END IF;
2983: x_return_status := l_return_status;
2984: RAISE G_EXCEPTION_HALT_VALIDATION;
2985: ELSE
2986: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR then
2987: x_return_status := OKC_API.G_RET_STS_WARNING;
2988: END IF;
2989: END IF;
2990: END IF;
2991: END IF;
3043: p_to_chr_id => l_rgpv_rec.dnz_chr_id,-- the rule group dnz_chr_id is passed
3044: p_to_template_yn => p_to_template_yn,
3045: x_tve_id => l_tve_id_out);
3046:
3047: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3048: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3049: x_return_status := l_return_status;
3050: RAISE G_EXCEPTION_HALT_VALIDATION;
3051: ELSE
3044: p_to_template_yn => p_to_template_yn,
3045: x_tve_id => l_tve_id_out);
3046:
3047: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3048: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3049: x_return_status := l_return_status;
3050: RAISE G_EXCEPTION_HALT_VALIDATION;
3051: ELSE
3052: l_time_value_copied := 'N';
3173: x_msg_data => x_msg_data,
3174: p_rulv_rec => g_rulv_rec,
3175: x_rulv_rec => x_rulv_rec);
3176:
3177: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3178: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3179: x_return_status := l_return_status;
3180: RAISE G_EXCEPTION_HALT_VALIDATION;
3181: ELSE
3174: p_rulv_rec => g_rulv_rec,
3175: x_rulv_rec => x_rulv_rec);
3176:
3177: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3178: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3179: x_return_status := l_return_status;
3180: RAISE G_EXCEPTION_HALT_VALIDATION;
3181: ELSE
3182: x_return_status := l_return_status;
3203: p_chr_id => p_chr_id,
3204: p_cle_id => p_cle_id,
3205: p_to_chr_id => l_rgpv_rec.dnz_chr_id);
3206:
3207: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3208: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3209: x_return_status := l_return_status;
3210: RAISE G_EXCEPTION_HALT_VALIDATION;
3211: ELSE
3204: p_cle_id => p_cle_id,
3205: p_to_chr_id => l_rgpv_rec.dnz_chr_id);
3206:
3207: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3208: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3209: x_return_status := l_return_status;
3210: RAISE G_EXCEPTION_HALT_VALIDATION;
3211: ELSE
3212: x_return_status := l_return_status;
3234: p_chr_id => p_chr_id,
3235: p_cle_id => p_cle_id,
3236: p_to_chr_id => l_rgpv_rec.dnz_chr_id);
3237:
3238: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: x_return_status := l_return_status;
3241: RAISE G_EXCEPTION_HALT_VALIDATION;
3242: ELSE
3235: p_cle_id => p_cle_id,
3236: p_to_chr_id => l_rgpv_rec.dnz_chr_id);
3237:
3238: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3239: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3240: x_return_status := l_return_status;
3241: RAISE G_EXCEPTION_HALT_VALIDATION;
3242: ELSE
3243: x_return_status := l_return_status;
3265: END IF;
3266: NULL;
3267: WHEN OTHERS THEN
3268: -- store SQL error message on message stack for caller
3269: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3270: -- notify caller of an UNEXPECTED error
3271: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3272: IF (l_debug = 'Y') THEN
3273: OKC_DEBUG.ReSet_Indentation;
3267: WHEN OTHERS THEN
3268: -- store SQL error message on message stack for caller
3269: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3270: -- notify caller of an UNEXPECTED error
3271: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3272: IF (l_debug = 'Y') THEN
3273: OKC_DEBUG.ReSet_Indentation;
3274: END IF;
3275:
3290:
3291: l_cimv_rec cimv_rec_type;
3292: x_cimv_rec cimv_rec_type;
3293:
3294: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3295: l_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
3296: l_price_level_ind VARCHAR2(20);
3297: l_item_name VARCHAR2(2000);
3298: l_item_desc VARCHAR2(2000);
3291: l_cimv_rec cimv_rec_type;
3292: x_cimv_rec cimv_rec_type;
3293:
3294: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3295: l_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
3296: l_price_level_ind VARCHAR2(20);
3297: l_item_name VARCHAR2(2000);
3298: l_item_desc VARCHAR2(2000);
3299:
3352: x_msg_data => x_msg_data,
3353: p_cimv_rec => l_cimv_rec,
3354: x_cimv_rec => x_cimv_rec);
3355:
3356: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3357: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3358: --bug 2667634 start , changes commented for bug 2774888
3359: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3360: --bug 2667634 end
3353: p_cimv_rec => l_cimv_rec,
3354: x_cimv_rec => x_cimv_rec);
3355:
3356: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3357: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3358: --bug 2667634 start , changes commented for bug 2774888
3359: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3360: --bug 2667634 end
3361: x_return_status := l_return_status;
3355:
3356: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3357: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3358: --bug 2667634 start , changes commented for bug 2774888
3359: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
3360: --bug 2667634 end
3361: x_return_status := l_return_status;
3362: RAISE G_EXCEPTION_HALT_VALIDATION;
3363: ELSE
3388: x_msg_data => x_msg_data,
3389: p_cimv_rec => l_cimv_rec,
3390: x_cimv_rec => x_cimv_rec);
3391:
3392: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3393: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3394: x_return_status := l_return_status;
3395: RAISE G_EXCEPTION_HALT_VALIDATION;
3396: ELSE
3389: p_cimv_rec => l_cimv_rec,
3390: x_cimv_rec => x_cimv_rec);
3391:
3392: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3393: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3394: x_return_status := l_return_status;
3395: RAISE G_EXCEPTION_HALT_VALIDATION;
3396: ELSE
3397: okc_util.get_name_desc_from_jtfv( p_object_code => l_cimv_rec.jtot_object1_code,
3399: p_id2 => l_cimv_rec.object1_id2,
3400: x_name => l_item_name,
3401: x_description => l_item_desc);
3402:
3403: OKC_API.set_message(G_APP_NAME,'OKC_ITEM_NOT_COPIED','ITEM_NAME',l_item_name);
3404:
3405: -- Begin Added for Bug 2207226
3406:
3407: DELETE FROM okc_k_lines_b
3421: p_id2 => l_cimv_rec.object1_id2,
3422: x_name => l_item_name,
3423: x_description => l_item_desc);
3424:
3425: OKC_API.set_message(G_APP_NAME,'OKC_ITEM_NOT_COPIED','ITEM_NAME',l_item_name);
3426:
3427: -- Begin Added for Bug 2207226
3428:
3429: DELETE FROM okc_k_lines_b
3449: x_msg_data => x_msg_data,
3450: p_cimv_rec => l_cimv_rec,
3451: x_cimv_rec => x_cimv_rec);
3452:
3453: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3454: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3455: x_return_status := l_return_status;
3456: RAISE G_EXCEPTION_HALT_VALIDATION;
3457: ELSE
3450: p_cimv_rec => l_cimv_rec,
3451: x_cimv_rec => x_cimv_rec);
3452:
3453: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3454: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
3455: x_return_status := l_return_status;
3456: RAISE G_EXCEPTION_HALT_VALIDATION;
3457: ELSE
3458: okc_util.get_name_desc_from_jtfv( p_object_code => l_cimv_rec.jtot_object1_code,
3460: p_id2 => l_cimv_rec.object1_id2,
3461: x_name => l_item_name,
3462: x_description => l_item_desc);
3463:
3464: OKC_API.set_message(G_APP_NAME,'OKC_ITEM_NOT_COPIED','ITEM_NAME',l_item_name);
3465:
3466: -- Begin Added for Bug 2207226
3467:
3468: DELETE FROM okc_k_lines_b
3483: WHEN G_EXCEPTION_HALT_VALIDATION THEN
3484: NULL;
3485: WHEN OTHERS THEN
3486: -- store SQL error message on message stack for caller
3487: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3488: -- notify caller of an UNEXPECTED error
3489: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3490:
3491: END copy_items;
3485: WHEN OTHERS THEN
3486: -- store SQL error message on message stack for caller
3487: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3488: -- notify caller of an UNEXPECTED error
3489: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3490:
3491: END copy_items;
3492:
3493: --
3555:
3556: return x_from_version;
3557: EXCEPTION
3558: WHEN OTHERS THEN
3559: return OKC_API.G_RET_STS_UNEXP_ERROR;
3560:
3561: END Get_Major_Version;
3562:
3563: ----------------------------------------------------------------------------
3590: x_clev_rec clev_rec_type;
3591: xx_clev_rec clev_rec_type; ---for Bug#3155217.
3592:
3593: l_sts_code VARCHAR2(30);
3594: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3595: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3596: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
3597: l_rgp_id NUMBER;
3598: l_cat_id NUMBER;
3591: xx_clev_rec clev_rec_type; ---for Bug#3155217.
3592:
3593: l_sts_code VARCHAR2(30);
3594: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3595: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3596: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
3597: l_rgp_id NUMBER;
3598: l_cat_id NUMBER;
3599: l_pav_id NUMBER;
3592:
3593: l_sts_code VARCHAR2(30);
3594: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3595: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3596: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
3597: l_rgp_id NUMBER;
3598: l_cat_id NUMBER;
3599: l_pav_id NUMBER;
3600: l_pat_id NUMBER;
3765: l_lty_code VARCHAR2(90);
3766: l_clev_rec clev_rec_type := p_clev_rec;
3767: l_cimv_rec cimv_rec_type;
3768:
3769: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3770:
3771: CURSOR c_lse(p_id IN NUMBER) IS
3772: SELECT lty_code,
3773: priced_yn
3816: x_msg_count => x_msg_count,
3817: x_msg_data => x_msg_data,
3818: p_cimv_rec => l_cimv_rec);
3819:
3820: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3821: l_clev_rec.price_negotiated := NULL;
3822: l_clev_rec.PRICE_UNIT := NULL;
3823: l_clev_rec.name := NULL;
3824: END IF;
3844:
3845: l_item_id VARCHAR2(40);
3846: l_counter_grp_id NUMBER;
3847: l_found BOOLEAN;
3848: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
3849: l_ctr_grp_id_template NUMBER;
3850: l_ctr_grp_id_instance NUMBER;
3851: l_instcnd_inp_rec OKC_INST_CND_PUB.instcnd_inp_rec;
3852: l_ac_rec OKS_COVERAGES_PUB.ac_rec_type;
3893: p_source_object_id_instance => p_new_cle_id,
3894: x_ctr_grp_id_template => l_ctr_grp_id_template,
3895: x_ctr_grp_id_instance => l_ctr_grp_id_instance);
3896:
3897: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3898: x_return_status := l_return_status;
3899: RAISE G_EXCEPTION_HALT_VALIDATION;
3900: END IF;
3901:
3911: x_msg_count => x_msg_count,
3912: x_msg_data => x_msg_data,
3913: p_instcnd_inp_rec => l_instcnd_inp_rec);
3914:
3915: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3916: x_return_status := l_return_status;
3917: RAISE G_EXCEPTION_HALT_VALIDATION;
3918: END IF;
3919: End If;
3939: p_ac_rec_in => l_ac_rec,
3940: x_actual_coverage_id => l_actual_coverage_id);
3941: END IF;
3942:
3943: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
3944: x_return_status := l_return_status;
3945: RAISE G_EXCEPTION_HALT_VALIDATION;
3946: END IF;
3947:
3950: WHEN G_EXCEPTION_HALT_VALIDATION THEN
3951: NULL;
3952: WHEN OTHERS THEN
3953: -- store SQL error message on message stack for caller
3954: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3955: -- notify caller of an UNEXPECTED error
3956: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3957: END instantiate_counters_events;
3958:
3952: WHEN OTHERS THEN
3953: -- store SQL error message on message stack for caller
3954: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
3955: -- notify caller of an UNEXPECTED error
3956: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
3957: END instantiate_counters_events;
3958:
3959: FUNCTION get_parent_date(p_from_start_date IN DATE,
3960: p_from_end_date IN DATE,
3976: FROM okc_k_headers_b
3977: WHERE id = p_to_chr_id;
3978:
3979: BEGIN
3980: IF (p_to_chr_id IS NULL OR p_to_chr_id = OKC_API.G_MISS_NUM) THEN
3981: OPEN c_cle;
3982: FETCH c_cle INTO l_parent_start_date,l_parent_end_date;
3983: CLOSE c_cle;
3984: IF (NVL(p_from_start_date,sysdate)
4110:
4111: EXCEPTION
4112: when NO_DATA_FOUND then
4113: -- store SQL error message on message stack
4114: x_return_status := OKC_API.G_RET_STS_ERROR;
4115: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
4116: p_msg_name => 'OKC_NOT_FOUND',
4117: p_token1 => 'VALUE1',
4118: p_token1_value => 'Status Code',
4111: EXCEPTION
4112: when NO_DATA_FOUND then
4113: -- store SQL error message on message stack
4114: x_return_status := OKC_API.G_RET_STS_ERROR;
4115: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
4116: p_msg_name => 'OKC_NOT_FOUND',
4117: p_token1 => 'VALUE1',
4118: p_token1_value => 'Status Code',
4119: p_token2 => 'VALUE2',
4119: p_token2 => 'VALUE2',
4120: p_token2_value => 'OKC_CLASS_OPERATIONS_V');
4121: when OTHERS then
4122: -- store SQL error message on message stack
4123: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
4124: p_msg_name => g_unexpected_error,
4125: p_token1 => g_sqlcode_token,
4126: p_token1_value => sqlcode,
4127: p_token2 => g_sqlerrm_token,
4126: p_token1_value => sqlcode,
4127: p_token2 => g_sqlerrm_token,
4128: p_token2_value => sqlerrm);
4129: -- notify caller of an error as UNEXPETED error
4130: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4131: END Create_Renewal_Line_Link;
4132:
4133: BEGIN
4134:
4261:
4262: end if;
4263: end if;
4264:
4265: IF p_to_chr_id IS NULL OR p_to_chr_id = OKC_API.G_MISS_NUM THEN
4266: OPEN c_dnz_chr_id;
4267: FETCH c_dnz_chr_id INTO l_clev_rec.dnz_chr_id;
4268: CLOSE c_dnz_chr_id;
4269: ELSE
4378: OKC_DEBUG.log('555 : x_msg_count : '||x_msg_count);
4379: OKC_DEBUG.log('555 : x_msg_data : '||x_msg_data);
4380: END IF;
4381:
4382: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4383: x_return_status := l_return_status;
4384: RAISE G_EXCEPTION_HALT_VALIDATION;
4385: END IF;
4386:
4402: x_msg_data => x_msg_data,
4403: p_to_chr_id => l_clev_rec.dnz_chr_id,
4404: p_to_cle_id => x_cle_id);
4405:
4406: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4407: x_return_status := l_return_status;
4408: RAISE G_EXCEPTION_HALT_VALIDATION;
4409: END IF;
4410: END IF;
4415: IF (l_debug = 'Y') THEN
4416: OKC_DEBUG.log('750 : l_from_version : '||l_from_version);
4417: END IF;
4418:
4419: IF (l_from_version = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4420: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4421: RAISE G_EXCEPTION_HALT_VALIDATION;
4422: END IF;
4423:
4416: OKC_DEBUG.log('750 : l_from_version : '||l_from_version);
4417: END IF;
4418:
4419: IF (l_from_version = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4420: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4421: RAISE G_EXCEPTION_HALT_VALIDATION;
4422: END IF;
4423:
4424: -- set attachement session variables
4460: p_start_date => x_clev_rec.start_date,
4461: p_end_date => x_clev_rec.end_date,
4462: p_new_cle_id => x_clev_rec.id);
4463:
4464: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4465: x_return_status := l_return_status;
4466: RAISE G_EXCEPTION_HALT_VALIDATION;
4467: END IF;
4468: END IF;
4490: p_chr_id => NULL,
4491: p_to_template_yn => p_to_template_yn,
4492: x_rgp_id => l_rgp_id);
4493:
4494: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4495: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4496: x_return_status := l_return_status;
4497: RAISE G_EXCEPTION_HALT_VALIDATION;
4498: ELSE
4491: p_to_template_yn => p_to_template_yn,
4492: x_rgp_id => l_rgp_id);
4493:
4494: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4495: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4496: x_return_status := l_return_status;
4497: RAISE G_EXCEPTION_HALT_VALIDATION;
4498: ELSE
4499: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4495: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4496: x_return_status := l_return_status;
4497: RAISE G_EXCEPTION_HALT_VALIDATION;
4498: ELSE
4499: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4500: x_return_status := l_return_status;
4501: END IF;
4502: END IF;
4503: END IF;
4518: p_cle_id => x_clev_rec.id,
4519: p_chr_id => NULL,
4520: x_cat_id => l_cat_id);
4521:
4522: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4523: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4524: x_return_status := l_return_status;
4525: RAISE G_EXCEPTION_HALT_VALIDATION;
4526: ELSE
4519: p_chr_id => NULL,
4520: x_cat_id => l_cat_id);
4521:
4522: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4523: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4524: x_return_status := l_return_status;
4525: RAISE G_EXCEPTION_HALT_VALIDATION;
4526: ELSE
4527: x_return_status := l_return_status;
4546: p_cle_id => x_clev_rec.id,
4547: p_chr_id => NULL,
4548: x_pav_id => l_pav_id);
4549:
4550: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4551: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4552: x_return_status := l_return_status;
4553: RAISE G_EXCEPTION_HALT_VALIDATION;
4554: ELSE
4547: p_chr_id => NULL,
4548: x_pav_id => l_pav_id);
4549:
4550: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4551: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4552: x_return_status := l_return_status;
4553: RAISE G_EXCEPTION_HALT_VALIDATION;
4554: ELSE
4555: x_return_status := l_return_status;
4575: p_chr_id => x_clev_rec.dnz_chr_id,
4576: --p_chr_id => NULL, Modified for Bug 2027165
4577: x_pat_id => l_pat_id);
4578:
4579: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4580: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4581: x_return_status := l_return_status;
4582: RAISE G_EXCEPTION_HALT_VALIDATION;
4583: ELSE
4576: --p_chr_id => NULL, Modified for Bug 2027165
4577: x_pat_id => l_pat_id);
4578:
4579: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4580: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4581: x_return_status := l_return_status;
4582: RAISE G_EXCEPTION_HALT_VALIDATION;
4583: ELSE
4584: x_return_status := l_return_status;
4598: p_paa_id => NULL,
4599: p_pat_id => l_c_patv.id
4600: );
4601:
4602: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4603: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4604: x_return_status := l_return_status;
4605: RAISE G_EXCEPTION_HALT_VALIDATION;
4606: ELSE
4599: p_pat_id => l_c_patv.id
4600: );
4601:
4602: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4603: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4604: x_return_status := l_return_status;
4605: RAISE G_EXCEPTION_HALT_VALIDATION;
4606: ELSE
4607: x_return_status := l_return_status;
4626: p_cle_id => x_clev_rec.id,
4627: p_pat_id => NULL,
4628: x_pac_id => l_pac_id);
4629:
4630: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4631: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4632: x_return_status := l_return_status;
4633: RAISE G_EXCEPTION_HALT_VALIDATION;
4634: ELSE
4627: p_pat_id => NULL,
4628: x_pac_id => l_pac_id);
4629:
4630: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4631: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4632: x_return_status := l_return_status;
4633: RAISE G_EXCEPTION_HALT_VALIDATION;
4634: ELSE
4635: x_return_status := l_return_status;
4649: p_paa_id => l_c_paav.id,
4650: p_pat_id => NULL,
4651: x_paa_id => l_paa_id);
4652:
4653: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4654: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4655: x_return_status := l_return_status;
4656: RAISE G_EXCEPTION_HALT_VALIDATION;
4657: ELSE
4650: p_pat_id => NULL,
4651: x_paa_id => l_paa_id);
4652:
4653: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4654: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4655: x_return_status := l_return_status;
4656: RAISE G_EXCEPTION_HALT_VALIDATION;
4657: ELSE
4658: x_return_status := l_return_status;
4678: p_cle_id => x_clev_rec.id,
4679: p_chr_id => g_chrv_rec.id, --NULL, --must always have a value in sales credits table
4680: x_scrv_id => l_scrv_id);
4681:
4682: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4683: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4684: x_return_status := l_return_status;
4685: RAISE G_EXCEPTION_HALT_VALIDATION;
4686: ELSE
4679: p_chr_id => g_chrv_rec.id, --NULL, --must always have a value in sales credits table
4680: x_scrv_id => l_scrv_id);
4681:
4682: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4683: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4684: x_return_status := l_return_status;
4685: RAISE G_EXCEPTION_HALT_VALIDATION;
4686: ELSE
4687: x_return_status := l_return_status;
4710: p_chr_id => g_chrv_rec.id,
4711:
4712: x_gvev_id => l_gvev_id);
4713:
4714: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4715: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4716: x_return_status := l_return_status;
4717: RAISE G_EXCEPTION_HALT_VALIDATION;
4718: ELSE
4711:
4712: x_gvev_id => l_gvev_id);
4713:
4714: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4715: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4716: x_return_status := l_return_status;
4717: RAISE G_EXCEPTION_HALT_VALIDATION;
4718: ELSE
4719: x_return_status := l_return_status;
4741: p_okc_ph_line_breaks_v_rec_id => l_c_okc_ph_line_breaks_v.id,
4742: p_cle_id => x_clev_rec.id,
4743: x_okc_ph_line_breaks_v_rec_id => l_okc_ph_line_breaks_v_id);
4744:
4745: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4746: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4747: x_return_status := l_return_status;
4748: RAISE G_EXCEPTION_HALT_VALIDATION;
4749: ELSE
4742: p_cle_id => x_clev_rec.id,
4743: x_okc_ph_line_breaks_v_rec_id => l_okc_ph_line_breaks_v_id);
4744:
4745: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4746: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4747: x_return_status := l_return_status;
4748: RAISE G_EXCEPTION_HALT_VALIDATION;
4749: ELSE
4750: x_return_status := l_return_status;
4773: p_chr_id => NULL,
4774: p_rle_code => NULL,
4775: x_cpl_id => l_cpl_id);
4776:
4777: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4778: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4779: x_return_status := l_return_status;
4780: RAISE G_EXCEPTION_HALT_VALIDATION;
4781: ELSE
4774: p_rle_code => NULL,
4775: x_cpl_id => l_cpl_id);
4776:
4777: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4778: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4779: x_return_status := l_return_status;
4780: RAISE G_EXCEPTION_HALT_VALIDATION;
4781: ELSE
4782: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4778: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4779: x_return_status := l_return_status;
4780: RAISE G_EXCEPTION_HALT_VALIDATION;
4781: ELSE
4782: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4783: x_return_status := l_return_status;
4784: END IF;
4785: END IF;
4786: END IF;
4803: p_copy_reference => p_copy_reference,
4804: p_to_cle_id => x_clev_rec.id);
4805:
4806:
4807: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4808: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4809: -- bug 2667634 start , changes commented for bug 2774888
4810: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
4811: -- bug 2667634 end
4804: p_to_cle_id => x_clev_rec.id);
4805:
4806:
4807: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4808: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4809: -- bug 2667634 start , changes commented for bug 2774888
4810: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
4811: -- bug 2667634 end
4812: x_return_status := l_return_status;
4806:
4807: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4808: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
4809: -- bug 2667634 start , changes commented for bug 2774888
4810: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
4811: -- bug 2667634 end
4812: x_return_status := l_return_status;
4813: RAISE G_EXCEPTION_HALT_VALIDATION;
4814: ELSE
4811: -- bug 2667634 end
4812: x_return_status := l_return_status;
4813: RAISE G_EXCEPTION_HALT_VALIDATION;
4814: ELSE
4815: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4816: x_return_status := OKC_API.G_RET_STS_WARNING;
4817: END IF;
4818: END IF;
4819: END IF;
4812: x_return_status := l_return_status;
4813: RAISE G_EXCEPTION_HALT_VALIDATION;
4814: ELSE
4815: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
4816: x_return_status := OKC_API.G_RET_STS_WARNING;
4817: END IF;
4818: END IF;
4819: END IF;
4820:
4850: IF l_string is NOT NULL THEN -- Begin L_STRING IF
4851: proc_string := 'begin '||l_string || ' (:b1,:b2,:b3); end ;';
4852: EXECUTE IMMEDIATE proc_string using l_chr_id,l_cle_id1, out l_return_status; -- Bugfix 2151523(1917514) - changed l_cle_id to l_cle_id1.
4853:
4854: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
4855: x_return_status := l_return_status;
4856: RAISE G_EXCEPTION_HALT_VALIDATION;
4857: ELSE
4858: x_return_status := l_return_status;
4876: END IF;
4877: NULL;
4878: WHEN OTHERS THEN
4879: -- store SQL error message on message stack for caller
4880: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
4881: IF (l_debug = 'Y') THEN
4882: OKC_DEBUG.log('30000 : SQLCODE : '||SQLCODE);
4883: OKC_DEBUG.log('30000 : SQLERRM : '||SQLERRM);
4884: OKC_DEBUG.log('30000 : Exiting Procedure copy_contract_line ', 2);
4884: OKC_DEBUG.log('30000 : Exiting Procedure copy_contract_line ', 2);
4885: OKC_DEBUG.ReSet_Indentation;
4886: END IF;
4887: -- notify caller of an UNEXPECTED error
4888: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4889:
4890: END copy_contract_line;
4891:
4892: ----------------------------------------------------------------------------
4914: -- of the topline during update service
4915:
4916: IS
4917:
4918: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
4919: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
4920: l_cle_id_out NUMBER := OKC_API.G_MISS_NUM;
4921: i NUMBER := 0;
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4915:
4916: IS
4917:
4918: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
4919: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
4920: l_cle_id_out NUMBER := OKC_API.G_MISS_NUM;
4921: i NUMBER := 0;
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4923:
4916: IS
4917:
4918: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
4919: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
4920: l_cle_id_out NUMBER := OKC_API.G_MISS_NUM;
4921: i NUMBER := 0;
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4923:
4924: TYPE lines_rec_type IS RECORD (
4918: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
4919: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
4920: l_cle_id_out NUMBER := OKC_API.G_MISS_NUM;
4921: i NUMBER := 0;
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4923:
4924: TYPE lines_rec_type IS RECORD (
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4921: i NUMBER := 0;
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4923:
4924: TYPE lines_rec_type IS RECORD (
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4922: l_lse_id NUMBER := OKC_API.G_MISS_NUM;
4923:
4924: TYPE lines_rec_type IS RECORD (
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4930: ole_id NUMBER := OKC_API.G_MISS_NUM);
4923:
4924: TYPE lines_rec_type IS RECORD (
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4930: ole_id NUMBER := OKC_API.G_MISS_NUM);
4931:
4924: TYPE lines_rec_type IS RECORD (
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4930: ole_id NUMBER := OKC_API.G_MISS_NUM);
4931:
4932: TYPE lines_tbl_type IS TABLE OF lines_rec_type
4925: level NUMBER := OKC_API.G_MISS_NUM,
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4930: ole_id NUMBER := OKC_API.G_MISS_NUM);
4931:
4932: TYPE lines_tbl_type IS TABLE OF lines_rec_type
4933: INDEX BY BINARY_INTEGER;
4926: line_id NUMBER := OKC_API.G_MISS_NUM,
4927: new_line_id NUMBER := OKC_API.G_MISS_NUM,
4928: cle_id NUMBER := OKC_API.G_MISS_NUM,
4929: new_cle_id NUMBER := OKC_API.G_MISS_NUM,
4930: ole_id NUMBER := OKC_API.G_MISS_NUM);
4931:
4932: TYPE lines_tbl_type IS TABLE OF lines_rec_type
4933: INDEX BY BINARY_INTEGER;
4934:
4958: FUNCTION get_new_cle_id(p_line_id IN NUMBER,
4959: p_cle_id IN NUMBER,
4960: p_new_cle_id OUT NOCOPY NUMBER)
4961: RETURN VARCHAR2 IS
4962: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
4963: i NUMBER := 0;
4964: BEGIN
4965:
4966: IF l_lines_tbl.COUNT > 0 THEN
4973: EXIT WHEN (i = l_lines_tbl.LAST);
4974: i := l_lines_tbl.NEXT(i);
4975: END LOOP;
4976: END IF;
4977: l_return_status := OKC_API.G_RET_STS_ERROR;
4978: return(l_return_status);
4979: EXCEPTION
4980: WHEN OTHERS THEN
4981: -- store SQL error message on message stack for caller
4978: return(l_return_status);
4979: EXCEPTION
4980: WHEN OTHERS THEN
4981: -- store SQL error message on message stack for caller
4982: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
4983: -- notify caller of an UNEXPECTED error
4984: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4985: return(l_return_status);
4986: END get_new_cle_id;
4980: WHEN OTHERS THEN
4981: -- store SQL error message on message stack for caller
4982: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
4983: -- notify caller of an UNEXPECTED error
4984: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
4985: return(l_return_status);
4986: END get_new_cle_id;
4987:
4988: ----------------------------------------------------------------------------
5070: IF (l_debug = 'Y') THEN
5071: OKC_DEBUG.log('500 : copy_contract_line - x_return_status : '||l_return_status);
5072: END IF;
5073:
5074: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5075: x_return_status := l_return_status;
5076:
5077: -- Continue line copy in case of warning
5078: If (l_return_status <> OKC_API.G_RET_STS_WARNING) Then
5074: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5075: x_return_status := l_return_status;
5076:
5077: -- Continue line copy in case of warning
5078: If (l_return_status <> OKC_API.G_RET_STS_WARNING) Then
5079: RAISE G_EXCEPTION_HALT_VALIDATION;
5080: End If;
5081: END IF;
5082:
5084:
5085: END LOOP;
5086: i := 0;
5087:
5088: If (x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR) Then
5089: If (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) Then
5090: x_return_status := l_return_status;
5091: Elsif (x_return_status <> OKC_API.G_RET_STS_ERROR) Then
5092: If (l_return_status = OKC_API.G_RET_STS_ERROR) Then
5085: END LOOP;
5086: i := 0;
5087:
5088: If (x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR) Then
5089: If (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) Then
5090: x_return_status := l_return_status;
5091: Elsif (x_return_status <> OKC_API.G_RET_STS_ERROR) Then
5092: If (l_return_status = OKC_API.G_RET_STS_ERROR) Then
5093: x_return_status := l_return_status;
5087:
5088: If (x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR) Then
5089: If (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) Then
5090: x_return_status := l_return_status;
5091: Elsif (x_return_status <> OKC_API.G_RET_STS_ERROR) Then
5092: If (l_return_status = OKC_API.G_RET_STS_ERROR) Then
5093: x_return_status := l_return_status;
5094: Elsif (x_return_status <> OKC_API.G_RET_STS_WARNING) Then
5095: x_return_status := l_return_status;
5088: If (x_return_status <> OKC_API.G_RET_STS_UNEXP_ERROR) Then
5089: If (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) Then
5090: x_return_status := l_return_status;
5091: Elsif (x_return_status <> OKC_API.G_RET_STS_ERROR) Then
5092: If (l_return_status = OKC_API.G_RET_STS_ERROR) Then
5093: x_return_status := l_return_status;
5094: Elsif (x_return_status <> OKC_API.G_RET_STS_WARNING) Then
5095: x_return_status := l_return_status;
5096: End If;
5090: x_return_status := l_return_status;
5091: Elsif (x_return_status <> OKC_API.G_RET_STS_ERROR) Then
5092: If (l_return_status = OKC_API.G_RET_STS_ERROR) Then
5093: x_return_status := l_return_status;
5094: Elsif (x_return_status <> OKC_API.G_RET_STS_WARNING) Then
5095: x_return_status := l_return_status;
5096: End If;
5097: End If;
5098: End If;
5110: END IF;
5111: NULL;
5112: WHEN OTHERS THEN
5113: -- store SQL error message on message stack for caller
5114: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
5115: IF (l_debug = 'Y') THEN
5116: OKC_DEBUG.log('30000 : SQLCODE : '||SQLCODE);
5117: OKC_DEBUG.log('30000 : SQLERRM : '||SQLERRM);
5118: OKC_DEBUG.log('30000 : Exiting Procedure copy_contract_lines ', 2);
5118: OKC_DEBUG.log('30000 : Exiting Procedure copy_contract_lines ', 2);
5119: OKC_DEBUG.ReSet_Indentation;
5120: END IF;
5121: -- notify caller of an UNEXPECTED error
5122: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5123:
5124: END copy_contract_lines;
5125:
5126: ----------------------------------------------------------------------------
5172: x_msg_data => x_msg_data,
5173: p_oiev_rec => l_oiev_rec,
5174: x_oiev_rec => lx_oiev_rec);
5175:
5176: If (x_return_status = OKC_API.G_RET_STS_SUCCESS) Then
5177: l_olev_rec.SELECT_YN := NULL;
5178: l_olev_rec.ACTIVE_YN := 'Y';
5179: l_olev_rec.PROCESS_FLAG := 'P';
5180: l_olev_rec.OIE_ID := lx_oiev_rec.id;
5188: x_msg_count => x_msg_count,
5189: x_msg_data => x_msg_data,
5190: p_olev_rec => l_olev_rec,
5191: x_olev_rec => lx_olev_rec);
5192: If (x_return_status = OKC_API.G_RET_STS_SUCCESS) Then
5193: -- set g_op_lines table
5194: l_count := g_op_lines.COUNT + 1;
5195: g_op_lines(l_count).id := p_chrv_rec.ID;
5196: g_op_lines(l_count).ole_id := lx_olev_rec.ID;
5199:
5200: EXCEPTION
5201: when NO_DATA_FOUND then
5202: -- store SQL error message on message stack
5203: x_return_status := OKC_API.G_RET_STS_ERROR;
5204: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
5205: p_msg_name => 'OKC_NOT_FOUND',
5206: p_token1 => 'VALUE1',
5207: p_token1_value => 'Status Code',
5200: EXCEPTION
5201: when NO_DATA_FOUND then
5202: -- store SQL error message on message stack
5203: x_return_status := OKC_API.G_RET_STS_ERROR;
5204: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
5205: p_msg_name => 'OKC_NOT_FOUND',
5206: p_token1 => 'VALUE1',
5207: p_token1_value => 'Status Code',
5208: p_token2 => 'VALUE2',
5208: p_token2 => 'VALUE2',
5209: p_token2_value => 'OKC_CLASS_OPERATIONS_V');
5210: when OTHERS then
5211: -- store SQL error message on message stack
5212: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
5213: p_msg_name => g_unexpected_error,
5214: p_token1 => g_sqlcode_token,
5215: p_token1_value => sqlcode,
5216: p_token2 => g_sqlerrm_token,
5215: p_token1_value => sqlcode,
5216: p_token2 => g_sqlerrm_token,
5217: p_token2_value => sqlerrm);
5218: -- notify caller of an error as UNEXPECTED error
5219: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5220: END Create_Renewal_Header_Link;
5221:
5222: ----------------------------------------------------------------------------
5223: --Proceudre copy_contract_header
5250: l_paa_id NUMBER;
5251: l_sts_code VARCHAR2(30);
5252: l_status_type VARCHAR2(30) := 'ENTERED';
5253: l_orig_system_source_code VARCHAR2(30) := 'OKC_HDR';
5254: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
5255: l_from_version FND_ATTACHED_DOCUMENTS.PK2_VALUE%TYPE;
5256:
5257: l_euro_currency varchar2(15) := NULL; /* For Euro Conversion - Bug 2155930 */
5258: l_converted_amount number := NULL; /* For Euro Conversion - Bug 2155930 */
5381: END IF;
5382:
5383: IF l_chrv_rec.authoring_org_id <> okc_context.get_okc_org_id OR
5384: l_chrv_rec.inv_organization_id <> okc_context.get_okc_organization_id THEN
5385: OKC_API.SET_MESSAGE('OKC','OKC_INCOMPATIBLE_ORG');
5386: x_return_status := OKC_API.G_RET_STS_ERROR;
5387: RAISE G_EXCEPTION_HALT_VALIDATION;
5388: END IF;
5389:
5382:
5383: IF l_chrv_rec.authoring_org_id <> okc_context.get_okc_org_id OR
5384: l_chrv_rec.inv_organization_id <> okc_context.get_okc_organization_id THEN
5385: OKC_API.SET_MESSAGE('OKC','OKC_INCOMPATIBLE_ORG');
5386: x_return_status := OKC_API.G_RET_STS_ERROR;
5387: RAISE G_EXCEPTION_HALT_VALIDATION;
5388: END IF;
5389:
5390: --moving the initialization of g_application_id up for Bug 3693912
5417: if (g_pricelist is NULL) then
5418: fnd_message.set_name('OKC','OKC_PROFILE_CHECK');
5419: fnd_message.set_token('PROFILE','OKC_EURO_DEFAULT_PRICELIST');
5420: FND_MSG_PUB.add;
5421: x_return_status := OKC_API.G_RET_STS_ERROR;
5422: RAISE G_EXCEPTION_HALT_VALIDATION;
5423: end if;
5424:
5425: --/Rule Migration/
5568: END IF;
5569:
5570: IF l_chrv_rec.authoring_org_id <> okc_context.get_okc_org_id OR
5571: l_chrv_rec.inv_organization_id <> okc_context.get_okc_organization_id THEN
5572: OKC_API.SET_MESSAGE('OKC','OKC_INCOMPATIBLE_ORG');
5573: x_return_status := OKC_API.G_RET_STS_ERROR;
5574: RAISE G_EXCEPTION_HALT_VALIDATION;
5575: END IF;
5576: */
5569:
5570: IF l_chrv_rec.authoring_org_id <> okc_context.get_okc_org_id OR
5571: l_chrv_rec.inv_organization_id <> okc_context.get_okc_organization_id THEN
5572: OKC_API.SET_MESSAGE('OKC','OKC_INCOMPATIBLE_ORG');
5573: x_return_status := OKC_API.G_RET_STS_ERROR;
5574: RAISE G_EXCEPTION_HALT_VALIDATION;
5575: END IF;
5576: */
5577:
5583: x_msg_data => x_msg_data,
5584: p_chrv_rec => l_chrv_rec,
5585: x_chrv_rec => x_chrv_rec);
5586:
5587: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5588: x_return_status := l_return_status;
5589: RAISE G_EXCEPTION_HALT_VALIDATION;
5590: END IF;
5591:
5606: x_msg_data => x_msg_data,
5607: p_chrv_rec => l_chrv_rec,
5608: p_to_chr_id => x_chr_id);
5609:
5610: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5611: x_return_status := l_return_status;
5612: RAISE G_EXCEPTION_HALT_VALIDATION;
5613: END IF;
5614:
5626:
5627: -- copy associated attachments
5628: l_from_version := Get_Major_Version(p_from_chr_id);
5629:
5630: IF (l_from_version = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5631: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5632: RAISE G_EXCEPTION_HALT_VALIDATION;
5633: END IF;
5634:
5627: -- copy associated attachments
5628: l_from_version := Get_Major_Version(p_from_chr_id);
5629:
5630: IF (l_from_version = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5631: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5632: RAISE G_EXCEPTION_HALT_VALIDATION;
5633: END IF;
5634:
5635: -- set attachement session variables
5677: x_msg_data => x_msg_data,
5678: p_from_chr_id => p_from_chr_id,
5679: p_to_chr_id => x_chrv_rec.id);
5680:
5681: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5682: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5683: x_return_status := l_return_status;
5684: RAISE G_EXCEPTION_HALT_VALIDATION;
5685: ELSE
5678: p_from_chr_id => p_from_chr_id,
5679: p_to_chr_id => x_chrv_rec.id);
5680:
5681: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5682: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5683: x_return_status := l_return_status;
5684: RAISE G_EXCEPTION_HALT_VALIDATION;
5685: ELSE
5686: x_return_status := l_return_status;
5695: x_msg_data => x_msg_data,
5696: p_from_chr_id => p_from_chr_id,
5697: p_to_chr_id => x_chrv_rec.id);
5698:
5699: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5700: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5701: x_return_status := l_return_status;
5702: RAISE G_EXCEPTION_HALT_VALIDATION;
5703: ELSE
5696: p_from_chr_id => p_from_chr_id,
5697: p_to_chr_id => x_chrv_rec.id);
5698:
5699: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5700: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5701: x_return_status := l_return_status;
5702: RAISE G_EXCEPTION_HALT_VALIDATION;
5703: ELSE
5704: x_return_status := l_return_status;
5713: x_msg_data => x_msg_data,
5714: p_from_chr_id => p_from_chr_id,
5715: p_to_chr_id => x_chrv_rec.id);
5716:
5717: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5718: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5719: x_return_status := l_return_status;
5720: RAISE G_EXCEPTION_HALT_VALIDATION;
5721: ELSE
5714: p_from_chr_id => p_from_chr_id,
5715: p_to_chr_id => x_chrv_rec.id);
5716:
5717: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5718: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5719: x_return_status := l_return_status;
5720: RAISE G_EXCEPTION_HALT_VALIDATION;
5721: ELSE
5722: x_return_status := l_return_status;
5741: p_to_chr_id => x_chrv_rec.id);
5742:
5743:
5744:
5745: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5746: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5747: x_return_status := l_return_status;
5748: RAISE G_EXCEPTION_HALT_VALIDATION;
5749: ELSE
5742:
5743:
5744:
5745: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5746: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5747: x_return_status := l_return_status;
5748: RAISE G_EXCEPTION_HALT_VALIDATION;
5749: ELSE
5750: x_return_status := l_return_status;
5775: p_chr_id => x_chrv_rec.id,
5776: x_gvev_id => l_gvev_id);
5777:
5778:
5779: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5780: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5781: x_return_status := l_return_status;
5782: RAISE G_EXCEPTION_HALT_VALIDATION;
5783: ELSE
5776: x_gvev_id => l_gvev_id);
5777:
5778:
5779: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5780: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5781: x_return_status := l_return_status;
5782: RAISE G_EXCEPTION_HALT_VALIDATION;
5783: ELSE
5784: x_return_status := l_return_status;
5800: p_cle_id => NULL,
5801: p_chr_id => x_chrv_rec.id,
5802: x_pav_id => l_pav_id);
5803:
5804: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5805: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5806: x_return_status := l_return_status;
5807: RAISE G_EXCEPTION_HALT_VALIDATION;
5808: ELSE
5801: p_chr_id => x_chrv_rec.id,
5802: x_pav_id => l_pav_id);
5803:
5804: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5805: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5806: x_return_status := l_return_status;
5807: RAISE G_EXCEPTION_HALT_VALIDATION;
5808: ELSE
5809: x_return_status := l_return_status;
5822: p_cle_id => NULL,
5823: p_chr_id => x_chrv_rec.id,
5824: x_pat_id => l_pat_id);
5825:
5826: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5827: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5828: x_return_status := l_return_status;
5829: RAISE G_EXCEPTION_HALT_VALIDATION;
5830: ELSE
5823: p_chr_id => x_chrv_rec.id,
5824: x_pat_id => l_pat_id);
5825:
5826: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5827: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5828: x_return_status := l_return_status;
5829: RAISE G_EXCEPTION_HALT_VALIDATION;
5830: ELSE
5831: x_return_status := l_return_status;
5839: x_msg_data => x_msg_data,
5840: p_paa_id => NULL,
5841: p_pat_id => l_c_patv.id);
5842:
5843: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5844: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5845: x_return_status := l_return_status;
5846: RAISE G_EXCEPTION_HALT_VALIDATION;
5847: ELSE
5840: p_paa_id => NULL,
5841: p_pat_id => l_c_patv.id);
5842:
5843: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5844: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5845: x_return_status := l_return_status;
5846: RAISE G_EXCEPTION_HALT_VALIDATION;
5847: ELSE
5848: x_return_status := l_return_status;
5863: p_cle_id => NULL,
5864: p_pat_id => l_pat_id,
5865: x_pac_id => l_pac_id);
5866:
5867: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5868: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5869: x_return_status := l_return_status;
5870: RAISE G_EXCEPTION_HALT_VALIDATION;
5871: ELSE
5864: p_pat_id => l_pat_id,
5865: x_pac_id => l_pac_id);
5866:
5867: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5868: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5869: x_return_status := l_return_status;
5870: RAISE G_EXCEPTION_HALT_VALIDATION;
5871: ELSE
5872: x_return_status := l_return_status;
5884: p_paa_id => l_c_paav.id,
5885: p_pat_id => x_patv_rec.id,
5886: );
5887:
5888: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5889: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5890: x_return_status := l_return_status;
5891: RAISE G_EXCEPTION_HALT_VALIDATION;
5892: ELSE
5885: p_pat_id => x_patv_rec.id,
5886: );
5887:
5888: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5889: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5890: x_return_status := l_return_status;
5891: RAISE G_EXCEPTION_HALT_VALIDATION;
5892: ELSE
5893: x_return_status := l_return_status;
5908: p_cle_id => NULL,
5909: p_chr_id => x_chrv_rec.id,
5910: x_scrv_id => l_scrv_id);
5911:
5912: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5913: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5914: x_return_status := l_return_status;
5915: RAISE G_EXCEPTION_HALT_VALIDATION;
5916: ELSE
5909: p_chr_id => x_chrv_rec.id,
5910: x_scrv_id => l_scrv_id);
5911:
5912: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5913: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
5914: x_return_status := l_return_status;
5915: RAISE G_EXCEPTION_HALT_VALIDATION;
5916: ELSE
5917: x_return_status := l_return_status;
5926: WHEN G_EXCEPTION_HALT_VALIDATION THEN
5927: NULL;
5928: WHEN OTHERS THEN
5929: -- store SQL error message on message stack for caller
5930: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
5931: -- notify caller of an UNEXPECTED error
5932: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5933:
5934: END copy_contract_header;
5928: WHEN OTHERS THEN
5929: -- store SQL error message on message stack for caller
5930: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
5931: -- notify caller of an UNEXPECTED error
5932: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
5933:
5934: END copy_contract_header;
5935:
5936: ----------------------------------------------------------------------------
5939: -- were not copied in copy_sections procedure
5940: ----------------------------------------------------------------------------
5941: PROCEDURE copy_other_sections(p_chr_id IN NUMBER, l_to_chr_id IN NUMBER) IS
5942:
5943: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
5944: l_section_id NUMBER;
5945: l_scn_id NUMBER;
5946: l_level NUMBER;
5947: l_api_version CONSTANT NUMBER := 1.0;
5981: p_to_cat_id => NULL,
5982: p_to_chr_id => l_to_chr_id,
5983: p_scn_id => l_scn_id);
5984:
5985: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
5986: --x_return_status := l_return_status;
5987: RAISE G_EXCEPTION_HALT_VALIDATION;
5988: END IF;
5989: END LOOP;
5994: WHEN G_EXCEPTION_HALT_VALIDATION THEN
5995: NULL;
5996: WHEN OTHERS THEN
5997: -- store SQL error message on message stack for caller
5998: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
5999: -- notify caller of an UNEXPECTED error
6000: --x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6001: END copy_other_sections;
6002:
5996: WHEN OTHERS THEN
5997: -- store SQL error message on message stack for caller
5998: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
5999: -- notify caller of an UNEXPECTED error
6000: --x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6001: END copy_other_sections;
6002:
6003: ----------------------------------------------------------------------------
6004: --Proceudre copy_contract. Copies the contract header and all its components.
6022: p_copy_latest_articles IN VARCHAR2 ,
6023: p_calling_mode IN VARCHAR2 ,
6024: x_chr_id OUT NOCOPY NUMBER) IS
6025:
6026: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6027: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6028: l_chr_id NUMBER;
6029: l_cle_id_out NUMBER;
6030: l_rgp_id NUMBER;
6023: p_calling_mode IN VARCHAR2 ,
6024: x_chr_id OUT NOCOPY NUMBER) IS
6025:
6026: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6027: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6028: l_chr_id NUMBER;
6029: l_cle_id_out NUMBER;
6030: l_rgp_id NUMBER;
6031: l_cat_id NUMBER;
6041: WHERE opn_code = 'COPY'
6042: AND cls_code = 'SERVICE';
6043:
6044: l_pdf_id NUMBER;
6045: l_cle_id NUMBER := OKC_API.G_MISS_NUM;
6046: --l_chr_id NUMBER;
6047: l_string VARCHAR2(32000);
6048: proc_string VARCHAR2(32000);
6049: -- Cursor created to get the PDF_ID for Class 'SERVICE' - Bug 2151523(1917514)
6157:
6158: IF (l_debug = 'Y') THEN
6159: OKC_DEBUG.log('1020 : G_COPY_HISTORY_YN = N', 2);
6160: END IF;
6161: OKC_API.SET_MESSAGE(G_APP_NAME,'OKC_VERSION_NUMBER_MISSING');
6162: X_return_status := OKC_API.G_RET_STS_ERROR;
6163: raise G_EXCEPTION_HALT_VALIDATION;
6164: END IF;
6165: ELSE
6158: IF (l_debug = 'Y') THEN
6159: OKC_DEBUG.log('1020 : G_COPY_HISTORY_YN = N', 2);
6160: END IF;
6161: OKC_API.SET_MESSAGE(G_APP_NAME,'OKC_VERSION_NUMBER_MISSING');
6162: X_return_status := OKC_API.G_RET_STS_ERROR;
6163: raise G_EXCEPTION_HALT_VALIDATION;
6164: END IF;
6165: ELSE
6166: G_FROM_VERSION_NUMBER := NULL;
6176: IF (l_debug = 'Y') THEN
6177: OKC_DEBUG.log('1040 : Inside If NOT l_result Then', 2);
6178: END IF;
6179: -- notify caller of an UNEXPECTED error
6180: x_return_status := OKC_API.G_RET_STS_ERROR;
6181: raise G_EXCEPTION_HALT_VALIDATION;
6182: End If;
6183:
6184: -- Intitialize globals.
6237: l_oks_copy := 'N'; -- Bugfix 2151523(1917514)
6238: IF (l_debug = 'Y') THEN
6239: OKC_DEBUG.log('1003 : After Procedure : Copy_contract_header ', 1);
6240: END IF;
6241: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6242: x_return_status := l_return_status;
6243: RAISE G_EXCEPTION_HALT_VALIDATION;
6244: END IF;
6245:
6264:
6265: IF (l_debug = 'Y') THEN
6266: OKC_DEBUG.log(' After Procedure : copy_events ' || l_return_status);
6267: END IF;
6268: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6269: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6270: x_return_status := l_return_status;
6271: RAISE G_EXCEPTION_HALT_VALIDATION;
6272: ELSE
6265: IF (l_debug = 'Y') THEN
6266: OKC_DEBUG.log(' After Procedure : copy_events ' || l_return_status);
6267: END IF;
6268: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6269: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6270: x_return_status := l_return_status;
6271: RAISE G_EXCEPTION_HALT_VALIDATION;
6272: ELSE
6273: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6269: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6270: x_return_status := l_return_status;
6271: RAISE G_EXCEPTION_HALT_VALIDATION;
6272: ELSE
6273: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6274: x_return_status := l_return_status;
6275: END IF;
6276: END IF;
6277: END IF;
6297:
6298: IF (l_debug = 'Y') THEN
6299: OKC_DEBUG.log(' After Procedure : copy_party_roles ' || l_return_status);
6300: END IF;
6301: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6302: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6303: x_return_status := l_return_status;
6304: RAISE G_EXCEPTION_HALT_VALIDATION;
6305: ELSE
6298: IF (l_debug = 'Y') THEN
6299: OKC_DEBUG.log(' After Procedure : copy_party_roles ' || l_return_status);
6300: END IF;
6301: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6302: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6303: x_return_status := l_return_status;
6304: RAISE G_EXCEPTION_HALT_VALIDATION;
6305: ELSE
6306: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6302: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6303: x_return_status := l_return_status;
6304: RAISE G_EXCEPTION_HALT_VALIDATION;
6305: ELSE
6306: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6307: x_return_status := l_return_status;
6308: END IF;
6309: END IF;
6310: END IF;
6338:
6339: IF (l_debug = 'Y') THEN
6340: OKC_DEBUG.log(' After Procedure : copy_rules ' || l_return_status);
6341: END IF;
6342: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6343: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6344: x_return_status := l_return_status;
6345: RAISE G_EXCEPTION_HALT_VALIDATION;
6346: ELSE
6339: IF (l_debug = 'Y') THEN
6340: OKC_DEBUG.log(' After Procedure : copy_rules ' || l_return_status);
6341: END IF;
6342: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6343: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6344: x_return_status := l_return_status;
6345: RAISE G_EXCEPTION_HALT_VALIDATION;
6346: ELSE
6347: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6343: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6344: x_return_status := l_return_status;
6345: RAISE G_EXCEPTION_HALT_VALIDATION;
6346: ELSE
6347: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6348: x_return_status := l_return_status;
6349: END IF;
6350: END IF;
6351: END IF;
6381:
6382: IF (l_debug = 'Y') THEN
6383: OKC_DEBUG.log(' After Procedure : copy_articles ' || l_return_status);
6384: END IF;
6385: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6386: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6387: x_return_status := l_return_status;
6388: RAISE G_EXCEPTION_HALT_VALIDATION;
6389: ELSE
6382: IF (l_debug = 'Y') THEN
6383: OKC_DEBUG.log(' After Procedure : copy_articles ' || l_return_status);
6384: END IF;
6385: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6386: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6387: x_return_status := l_return_status;
6388: RAISE G_EXCEPTION_HALT_VALIDATION;
6389: ELSE
6390: x_return_status := l_return_status;
6410:
6411: IF (l_debug = 'Y') THEN
6412: OKC_DEBUG.log(' After Procedure : copy_latest_articles : ' || l_return_status);
6413: END IF;
6414: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6415: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6416: x_return_status := l_return_status;
6417: RAISE G_EXCEPTION_HALT_VALIDATION;
6418: ELSE
6411: IF (l_debug = 'Y') THEN
6412: OKC_DEBUG.log(' After Procedure : copy_latest_articles : ' || l_return_status);
6413: END IF;
6414: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6415: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6416: x_return_status := l_return_status;
6417: RAISE G_EXCEPTION_HALT_VALIDATION;
6418: ELSE
6419: x_return_status := l_return_status;
6435: p_cle_id => NULL,
6436: p_chr_id => l_chr_id, -- the new generated contract header id
6437: x_cat_id => l_cat_id);
6438:
6439: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6440: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6441: x_return_status := l_return_status;
6442: RAISE G_EXCEPTION_HALT_VALIDATION;
6443: ELSE
6436: p_chr_id => l_chr_id, -- the new generated contract header id
6437: x_cat_id => l_cat_id);
6438:
6439: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6440: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6441: x_return_status := l_return_status;
6442: RAISE G_EXCEPTION_HALT_VALIDATION;
6443: ELSE
6444: x_return_status := l_return_status;
6471:
6472: IF (l_debug = 'Y') THEN
6473: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for source chr_id ' || l_return_status);
6474: END IF;
6475: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6476: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6477: x_return_status := l_return_status;
6478: RAISE G_EXCEPTION_HALT_VALIDATION;
6479: ELSE
6472: IF (l_debug = 'Y') THEN
6473: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for source chr_id ' || l_return_status);
6474: END IF;
6475: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6476: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6477: x_return_status := l_return_status;
6478: RAISE G_EXCEPTION_HALT_VALIDATION;
6479: ELSE
6480: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6476: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6477: x_return_status := l_return_status;
6478: RAISE G_EXCEPTION_HALT_VALIDATION;
6479: ELSE
6480: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6481: x_return_status := l_return_status;
6482: END IF;
6483: END IF;
6484: END IF;
6493:
6494: IF (l_debug = 'Y') THEN
6495: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for target chr_id ' || l_return_status);
6496: END IF;
6497: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6498: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6499: x_return_status := l_return_status;
6500: RAISE G_EXCEPTION_HALT_VALIDATION;
6501: ELSE
6494: IF (l_debug = 'Y') THEN
6495: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for target chr_id ' || l_return_status);
6496: END IF;
6497: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6498: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6499: x_return_status := l_return_status;
6500: RAISE G_EXCEPTION_HALT_VALIDATION;
6501: ELSE
6502: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6498: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6499: x_return_status := l_return_status;
6500: RAISE G_EXCEPTION_HALT_VALIDATION;
6501: ELSE
6502: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6503: x_return_status := l_return_status;
6504: END IF;
6505: END IF;
6506: END IF;
6545: END IF;
6546: IF (l_debug = 'Y') THEN
6547: OKC_DEBUG.log(' After Procedure : OKC_TERMS_COPY_GRP.copy_doc ' || l_return_status);
6548: END IF;
6549: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6550: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6551: x_return_status := l_return_status;
6552: RAISE G_EXCEPTION_HALT_VALIDATION;
6553: ELSE
6546: IF (l_debug = 'Y') THEN
6547: OKC_DEBUG.log(' After Procedure : OKC_TERMS_COPY_GRP.copy_doc ' || l_return_status);
6548: END IF;
6549: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6550: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6551: x_return_status := l_return_status;
6552: RAISE G_EXCEPTION_HALT_VALIDATION;
6553: ELSE
6554: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6550: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6551: x_return_status := l_return_status;
6552: RAISE G_EXCEPTION_HALT_VALIDATION;
6553: ELSE
6554: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
6555: x_return_status := l_return_status;
6556: END IF;
6557: END IF;
6558: END IF;
6587: IF (l_debug = 'Y') THEN
6588: OKC_DEBUG.log(' After Procedure : copy_contract_lines ' || l_return_status);
6589: END IF;
6590:
6591: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6592: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6593: -- bug 2667634 start , changes commented for bug 2774888
6594: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
6595: -- bug 2667634 end
6588: OKC_DEBUG.log(' After Procedure : copy_contract_lines ' || l_return_status);
6589: END IF;
6590:
6591: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6592: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6593: -- bug 2667634 start , changes commented for bug 2774888
6594: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
6595: -- bug 2667634 end
6596: x_return_status := l_return_status;
6590:
6591: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6592: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6593: -- bug 2667634 start , changes commented for bug 2774888
6594: -- IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) OR (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
6595: -- bug 2667634 end
6596: x_return_status := l_return_status;
6597: RAISE G_EXCEPTION_HALT_VALIDATION;
6598: ELSE
6616:
6617: OKC_CFG_PUB.COPY_CONFIG(p_dnz_chr_id => l_chr_id,
6618: x_return_status => l_return_status);
6619:
6620: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6621: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6622: x_return_status := l_return_status;
6623: RAISE G_EXCEPTION_HALT_VALIDATION;
6624: ELSE
6617: OKC_CFG_PUB.COPY_CONFIG(p_dnz_chr_id => l_chr_id,
6618: x_return_status => l_return_status);
6619:
6620: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6621: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
6622: x_return_status := l_return_status;
6623: RAISE G_EXCEPTION_HALT_VALIDATION;
6624: ELSE
6625: x_return_status := l_return_status;
6642:
6643: IF l_string is NOT NULL THEN
6644: proc_string := 'begin '||l_string || ' (:b1,:b2,:b3); end ;';
6645: EXECUTE IMMEDIATE proc_string using l_chr_id,l_cle_id, out l_return_status;
6646: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
6647: x_return_status := l_return_status;
6648: RAISE G_EXCEPTION_HALT_VALIDATION;
6649: ELSE
6650: x_return_status := l_return_status;
6675: NULL;
6676:
6677: WHEN OTHERS THEN
6678: -- store SQL error message on message stack for caller
6679: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6680: -- notify caller of an UNEXPECTED error
6681: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6682:
6683: ---Initialisation is not to create contract from History Tables
6677: WHEN OTHERS THEN
6678: -- store SQL error message on message stack for caller
6679: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6680: -- notify caller of an UNEXPECTED error
6681: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6682:
6683: ---Initialisation is not to create contract from History Tables
6684: G_COPY_HISTORY_YN := 'N';
6685: IF (l_debug = 'Y') THEN
6693: ----------------------------------------------------------------------------
6694: FUNCTION get_atnv_rec(p_atn_id IN NUMBER,
6695: x_atnv_rec OUT NOCOPY atnv_rec_type)
6696: RETURN VARCHAR2 IS
6697: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6698: l_no_data_found BOOLEAN := TRUE;
6699:
6700: CURSOR c_atnv_rec IS
6701: SELECT ID,
6727:
6728: l_no_data_found := c_atnv_rec%NOTFOUND;
6729: CLOSE c_atnv_rec;
6730: IF l_no_data_found THEN
6731: l_return_status := OKC_API.G_RET_STS_ERROR;
6732: return(l_return_status);
6733: ELSE
6734: return(l_return_status);
6735: END IF;
6735: END IF;
6736: EXCEPTION
6737: WHEN OTHERS THEN
6738: -- store SQL error message on message stack for caller
6739: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6740: -- notify caller of an UNEXPECTED error
6741: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6742: return(l_return_status);
6743:
6737: WHEN OTHERS THEN
6738: -- store SQL error message on message stack for caller
6739: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6740: -- notify caller of an UNEXPECTED error
6741: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6742: return(l_return_status);
6743:
6744: END get_atnv_rec;
6745:
6748: ----------------------------------------------------------------------------
6749: FUNCTION get_catv_rec(p_cat_id IN NUMBER,
6750: x_catv_rec OUT NOCOPY catv_rec_type)
6751: RETURN VARCHAR2 IS
6752: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6753: l_no_data_found BOOLEAN := TRUE;
6754: BEGIN
6755: x_catv_rec := OKC_K_ARTICLE_PUB.Get_Rec(
6756: p_id => p_cat_id,
6757: p_major_version => G_FROM_VERSION_NUMBER,
6758: x_no_data_found => l_no_data_found
6759: );
6760: IF l_no_data_found THEN
6761: l_return_status := OKC_API.G_RET_STS_ERROR;
6762: return(l_return_status);
6763: ELSE
6764: return(l_return_status);
6765: END IF;
6765: END IF;
6766: EXCEPTION
6767: WHEN OTHERS THEN
6768: -- store SQL error message on message stack for caller
6769: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6770: -- notify caller of an UNEXPECTED error
6771: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6772: return(l_return_status);
6773:
6767: WHEN OTHERS THEN
6768: -- store SQL error message on message stack for caller
6769: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6770: -- notify caller of an UNEXPECTED error
6771: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6772: return(l_return_status);
6773:
6774: END get_catv_rec;
6775:
6777: --Function to populate the contract items record to be copied.
6778: ----------------------------------------------------------------------------
6779: FUNCTION get_cimv_rec(p_cim_id IN NUMBER,
6780: x_cimv_rec OUT NOCOPY cimv_rec_type) RETURN VARCHAR2 IS
6781: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6782: l_no_data_found BOOLEAN := TRUE;
6783:
6784: CURSOR c_cimv_rec IS
6785: SELECT ID,
6815:
6816: l_no_data_found := c_cimv_rec%NOTFOUND;
6817: CLOSE c_cimv_rec;
6818: IF l_no_data_found THEN
6819: l_return_status := OKC_API.G_RET_STS_ERROR;
6820: return(l_return_status);
6821: ELSE
6822: return(l_return_status);
6823: END IF;
6823: END IF;
6824: EXCEPTION
6825: WHEN OTHERS THEN
6826: -- store SQL error message on message stack for caller
6827: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6828: -- notify caller of an UNEXPECTED error
6829: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6830: return(l_return_status);
6831:
6825: WHEN OTHERS THEN
6826: -- store SQL error message on message stack for caller
6827: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6828: -- notify caller of an UNEXPECTED error
6829: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6830: return(l_return_status);
6831:
6832: END get_cimv_rec;
6833: ----------------------------------------------------------------------------
6834: --Function to populate the contract access record to be copied.
6835: ----------------------------------------------------------------------------
6836: FUNCTION get_cacv_rec(p_cac_id IN NUMBER,
6837: x_cacv_rec OUT NOCOPY cacv_rec_type) RETURN VARCHAR2 IS
6838: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6839: l_no_data_found BOOLEAN := TRUE;
6840:
6841: CURSOR c_cacv_rec IS
6842: SELECT ID,
6858:
6859: l_no_data_found := c_cacv_rec%NOTFOUND;
6860: CLOSE c_cacv_rec;
6861: IF l_no_data_found THEN
6862: l_return_status := OKC_API.G_RET_STS_ERROR;
6863: return(l_return_status);
6864: ELSE
6865: return(l_return_status);
6866: END IF;
6866: END IF;
6867: EXCEPTION
6868: WHEN OTHERS THEN
6869: -- store SQL error message on message stack for caller
6870: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6871: -- notify caller of an UNEXPECTED error
6872: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6873: return(l_return_status);
6874:
6868: WHEN OTHERS THEN
6869: -- store SQL error message on message stack for caller
6870: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
6871: -- notify caller of an UNEXPECTED error
6872: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
6873: return(l_return_status);
6874:
6875: END get_cacv_rec;
6876: ----------------------------------------------------------------------------
6877: --Function to populate the contract party roles record to be copied.
6878: ----------------------------------------------------------------------------
6879: FUNCTION get_cplv_rec(p_cpl_id IN NUMBER,
6880: x_cplv_rec OUT NOCOPY cplv_rec_type) RETURN VARCHAR2 IS
6881: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
6882: l_no_data_found BOOLEAN := TRUE;
6883:
6884: CURSOR c_cplv_rec IS
6885: SELECT ID,
7006:
7007: l_no_data_found := c_cplv_rec%NOTFOUND;
7008: CLOSE c_cplv_rec;
7009: IF l_no_data_found THEN
7010: l_return_status := OKC_API.G_RET_STS_ERROR;
7011: return(l_return_status);
7012: ELSE
7013: return(l_return_status);
7014: END IF;
7014: END IF;
7015: EXCEPTION
7016: WHEN OTHERS THEN
7017: -- store SQL error message on message stack for caller
7018: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7019: -- notify caller of an UNEXPECTED error
7020: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7021: return(l_return_status);
7022:
7016: WHEN OTHERS THEN
7017: -- store SQL error message on message stack for caller
7018: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7019: -- notify caller of an UNEXPECTED error
7020: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7021: return(l_return_status);
7022:
7023: END get_cplv_rec;
7024: ----------------------------------------------------------------------------
7025: --Function to populate the contract process record to be copied.
7026: ----------------------------------------------------------------------------
7027: FUNCTION get_cpsv_rec(p_cps_id IN NUMBER,
7028: x_cpsv_rec OUT NOCOPY cpsv_rec_type) RETURN VARCHAR2 IS
7029: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7030: l_no_data_found BOOLEAN := TRUE;
7031:
7032: CURSOR c_cpsv_rec IS
7033: SELECT ID,
7084:
7085: l_no_data_found := c_cpsv_rec%NOTFOUND;
7086: CLOSE c_cpsv_rec;
7087: IF l_no_data_found THEN
7088: l_return_status := OKC_API.G_RET_STS_ERROR;
7089: return(l_return_status);
7090: ELSE
7091: return(l_return_status);
7092: END IF;
7092: END IF;
7093: EXCEPTION
7094: WHEN OTHERS THEN
7095: -- store SQL error message on message stack for caller
7096: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7097: -- notify caller of an UNEXPECTED error
7098: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7099: return(l_return_status);
7100:
7094: WHEN OTHERS THEN
7095: -- store SQL error message on message stack for caller
7096: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7097: -- notify caller of an UNEXPECTED error
7098: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7099: return(l_return_status);
7100:
7101: END get_cpsv_rec;
7102: ----------------------------------------------------------------------------
7103: --Function to populate the contract group record to be copied.
7104: ----------------------------------------------------------------------------
7105: FUNCTION get_cgcv_rec(p_cgc_id IN NUMBER,
7106: x_cgcv_rec OUT NOCOPY cgcv_rec_type) RETURN VARCHAR2 IS
7107: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7108: l_no_data_found BOOLEAN := TRUE;
7109:
7110: CURSOR c_cgcv_rec IS
7111: SELECT ID,
7124: x_cgcv_rec.INCLUDED_CGP_ID;
7125: l_no_data_found := c_cgcv_rec%NOTFOUND;
7126: CLOSE c_cgcv_rec;
7127: IF l_no_data_found THEN
7128: l_return_status := OKC_API.G_RET_STS_ERROR;
7129: return(l_return_status);
7130: ELSE
7131: return(l_return_status);
7132: END IF;
7132: END IF;
7133: EXCEPTION
7134: WHEN OTHERS THEN
7135: -- store SQL error message on message stack for caller
7136: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7137: -- notify caller of an UNEXPECTED error
7138: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7139: return(l_return_status);
7140:
7134: WHEN OTHERS THEN
7135: -- store SQL error message on message stack for caller
7136: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7137: -- notify caller of an UNEXPECTED error
7138: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7139: return(l_return_status);
7140:
7141: END get_cgcv_rec;
7142: ----------------------------------------------------------------------------
7143: --Function to populate the condition headers record to be copied.
7144: ----------------------------------------------------------------------------
7145: FUNCTION get_cnhv_rec(p_cnh_id IN NUMBER,
7146: x_cnhv_rec OUT NOCOPY cnhv_rec_type) RETURN VARCHAR2 IS
7147: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7148: l_no_data_found BOOLEAN := TRUE;
7149:
7150: CURSOR c_cnhv_rec IS
7151: SELECT ID,
7273:
7274: l_no_data_found := c_cnhv_rec%NOTFOUND;
7275: CLOSE c_cnhv_rec;
7276: IF l_no_data_found THEN
7277: l_return_status := OKC_API.G_RET_STS_ERROR;
7278: return(l_return_status);
7279: ELSE
7280: return(l_return_status);
7281: END IF;
7281: END IF;
7282: EXCEPTION
7283: WHEN OTHERS THEN
7284: -- store SQL error message on message stack for caller
7285: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7286: -- notify caller of an UNEXPECTED error
7287: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7288: return(l_return_status);
7289:
7283: WHEN OTHERS THEN
7284: -- store SQL error message on message stack for caller
7285: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7286: -- notify caller of an UNEXPECTED error
7287: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7288: return(l_return_status);
7289:
7290: END get_cnhv_rec;
7291: ----------------------------------------------------------------------------
7292: --Function to populate the condition lines record to be copied.
7293: ----------------------------------------------------------------------------
7294: FUNCTION get_cnlv_rec(p_cnl_id IN NUMBER,
7295: x_cnlv_rec OUT NOCOPY cnlv_rec_type) RETURN VARCHAR2 IS
7296: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7297: l_no_data_found BOOLEAN := TRUE;
7298:
7299: CURSOR c_cnlv_rec IS
7300: SELECT ID,
7419:
7420: l_no_data_found := c_cnlv_rec%NOTFOUND;
7421: CLOSE c_cnlv_rec;
7422: IF l_no_data_found THEN
7423: l_return_status := OKC_API.G_RET_STS_ERROR;
7424: return(l_return_status);
7425: ELSE
7426: return(l_return_status);
7427: END IF;
7427: END IF;
7428: EXCEPTION
7429: WHEN OTHERS THEN
7430: -- store SQL error message on message stack for caller
7431: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7432: -- notify caller of an UNEXPECTED error
7433: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7434: return(l_return_status);
7435:
7429: WHEN OTHERS THEN
7430: -- store SQL error message on message stack for caller
7431: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7432: -- notify caller of an UNEXPECTED error
7433: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7434: return(l_return_status);
7435:
7436: END get_cnlv_rec;
7437: ----------------------------------------------------------------------------
7440:
7441: FUNCTION get_ctcv_rec(p_ctc_id IN NUMBER,
7442: x_ctcv_rec OUT NOCOPY ctcv_rec_type) RETURN VARCHAR2 IS
7443:
7444: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7445: l_no_data_found BOOLEAN := TRUE;
7446:
7447: CURSOR c_ctcv_rec IS
7448: SELECT ID,
7546: x_ctcv_rec.PRIMARY_YN;
7547: l_no_data_found := c_ctcv_rec%NOTFOUND;
7548: CLOSE c_ctcv_rec;
7549: IF l_no_data_found THEN
7550: l_return_status := OKC_API.G_RET_STS_ERROR;
7551: return(l_return_status);
7552: ELSE
7553: return(l_return_status);
7554: END IF;
7554: END IF;
7555: EXCEPTION
7556: WHEN OTHERS THEN
7557: -- store SQL error message on message stack for caller
7558: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7559: -- notify caller of an UNEXPECTED error
7560: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7561: return(l_return_status);
7562:
7556: WHEN OTHERS THEN
7557: -- store SQL error message on message stack for caller
7558: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7559: -- notify caller of an UNEXPECTED error
7560: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7561: return(l_return_status);
7562:
7563: END get_ctcv_rec;
7564: ----------------------------------------------------------------------------
7566: ----------------------------------------------------------------------------
7567: FUNCTION get_rgpv_rec(p_rgp_id IN NUMBER,
7568: x_rgpv_rec OUT NOCOPY rgpv_rec_type)
7569: RETURN VARCHAR2 IS
7570: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7571: l_no_data_found BOOLEAN := TRUE;
7572:
7573: CURSOR c_rgpv_rec IS
7574: SELECT ID,
7663:
7664: l_no_data_found := c_rgpv_rec%NOTFOUND;
7665: CLOSE c_rgpv_rec;
7666: IF l_no_data_found THEN
7667: l_return_status := OKC_API.G_RET_STS_ERROR;
7668: return(l_return_status);
7669: ELSE
7670: return(l_return_status);
7671: END IF;
7671: END IF;
7672: EXCEPTION
7673: WHEN OTHERS THEN
7674: -- store SQL error message on message stack for caller
7675: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7676: -- notify caller of an UNEXPECTED error
7677: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7678: return(l_return_status);
7679: END get_rgpv_rec;
7673: WHEN OTHERS THEN
7674: -- store SQL error message on message stack for caller
7675: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7676: -- notify caller of an UNEXPECTED error
7677: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7678: return(l_return_status);
7679: END get_rgpv_rec;
7680:
7681: ----------------------------------------------------------------------------
7683: ----------------------------------------------------------------------------
7684: FUNCTION get_tvev_rec(p_tve_id IN NUMBER,
7685: x_tvev_rec OUT NOCOPY tvev_rec_type)
7686: RETURN VARCHAR2 IS
7687: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7688: l_no_data_found BOOLEAN := TRUE;
7689:
7690: CURSOR c_tvev_rec IS
7691: SELECT ID,
7786:
7787: l_no_data_found := c_tvev_rec%NOTFOUND;
7788: CLOSE c_tvev_rec;
7789: IF l_no_data_found THEN
7790: l_return_status := OKC_API.G_RET_STS_ERROR;
7791: return(l_return_status);
7792: ELSE
7793: return(l_return_status);
7794: END IF;
7794: END IF;
7795: EXCEPTION
7796: WHEN OTHERS THEN
7797: -- store SQL error message on message stack for caller
7798: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7799: -- notify caller of an UNEXPECTED error
7800: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7801: return(l_return_status);
7802: END get_tvev_rec;
7796: WHEN OTHERS THEN
7797: -- store SQL error message on message stack for caller
7798: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7799: -- notify caller of an UNEXPECTED error
7800: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7801: return(l_return_status);
7802: END get_tvev_rec;
7803:
7804:
7807: ----------------------------------------------------------------------------
7808: FUNCTION get_rulv_rec(p_rul_id IN NUMBER,
7809: x_rulv_rec OUT NOCOPY rulv_rec_type)
7810: RETURN VARCHAR2 IS
7811: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
7812: l_no_data_found BOOLEAN := TRUE;
7813:
7814: CURSOR c_rulv_rec IS
7815: SELECT ID,
7975: x_rulv_rec.RULE_INFORMATION15;
7976: l_no_data_found := c_rulv_rec%NOTFOUND;
7977: CLOSE c_rulv_rec;
7978: IF l_no_data_found THEN
7979: l_return_status := OKC_API.G_RET_STS_ERROR;
7980: return(l_return_status);
7981: ELSE
7982: return(l_return_status);
7983: END IF;
7983: END IF;
7984: EXCEPTION
7985: WHEN OTHERS THEN
7986: -- store SQL error message on message stack for caller
7987: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7988: -- notify caller of an UNEXPECTED error
7989: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7990: return(l_return_status);
7991: END get_rulv_rec;
7985: WHEN OTHERS THEN
7986: -- store SQL error message on message stack for caller
7987: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
7988: -- notify caller of an UNEXPECTED error
7989: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
7990: return(l_return_status);
7991: END get_rulv_rec;
7992:
7993: ----------------------------------------------------------------------------
7996: FUNCTION get_clev_rec(p_cle_id IN NUMBER,
7997: p_renew_ref_yn IN VARCHAR2, -- Added for bugfix 2307197
7998: x_clev_rec OUT NOCOPY clev_rec_type)
7999: RETURN VARCHAR2 IS
8000: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8001: l_no_data_found BOOLEAN := TRUE;
8002:
8003: CURSOR c_clev_rec IS
8004: SELECT ID,
8185:
8186: l_no_data_found := c_clev_rec%NOTFOUND;
8187: CLOSE c_clev_rec;
8188: IF l_no_data_found THEN
8189: l_return_status := OKC_API.G_RET_STS_ERROR;
8190: IF (l_debug = 'Y') THEN
8191: OKC_DEBUG.log('10000 : Exiting Procedure get_clev_rec ', 2);
8192: OKC_DEBUG.ReSet_Indentation;
8193: END IF;
8201: END IF;
8202: EXCEPTION
8203: WHEN OTHERS THEN
8204: -- store SQL error message on message stack for caller
8205: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8206: -- notify caller of an UNEXPECTED error
8207: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8208: IF (l_debug = 'Y') THEN
8209: OKC_DEBUG.log('40000 : Exiting Procedure get_clev_rec ', 2);
8203: WHEN OTHERS THEN
8204: -- store SQL error message on message stack for caller
8205: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8206: -- notify caller of an UNEXPECTED error
8207: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8208: IF (l_debug = 'Y') THEN
8209: OKC_DEBUG.log('40000 : Exiting Procedure get_clev_rec ', 2);
8210: OKC_DEBUG.ReSet_Indentation;
8211: END IF;
8217: ----------------------------------------------------------------------------
8218: FUNCTION get_chrv_rec(p_chr_id IN NUMBER,
8219: x_chrv_rec OUT NOCOPY chrv_rec_type)
8220: RETURN VARCHAR2 IS
8221: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8222: l_no_data_found BOOLEAN := TRUE;
8223:
8224: -- Bug 1922121: Compilation errors on ktst115. Problem occurred
8225: -- because application_id is defined as varchar2(240) in
8505:
8506: l_no_data_found := c_chrv_rec%NOTFOUND;
8507: CLOSE c_chrv_rec;
8508: IF l_no_data_found THEN
8509: l_return_status := OKC_API.G_RET_STS_ERROR;
8510: return(l_return_status);
8511: ELSE
8512: return(l_return_status);
8513: END IF;
8513: END IF;
8514: EXCEPTION
8515: WHEN OTHERS THEN
8516: -- store SQL error message on message stack for caller
8517: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8518: -- notify caller of an UNEXPECTED error
8519: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8520: return(l_return_status);
8521: END get_chrv_rec;
8515: WHEN OTHERS THEN
8516: -- store SQL error message on message stack for caller
8517: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8518: -- notify caller of an UNEXPECTED error
8519: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8520: return(l_return_status);
8521: END get_chrv_rec;
8522:
8523: ----------------------------------------------------------------------------
8526:
8527: FUNCTION get_ocev_rec(p_oce_id IN NUMBER,
8528: x_ocev_rec OUT NOCOPY ocev_rec_type) RETURN VARCHAR2 IS
8529:
8530: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8531: l_no_data_found BOOLEAN := TRUE;
8532:
8533: CURSOR c_ocev_rec IS
8534: SELECT ID,
8614:
8615: l_no_data_found := c_ocev_rec%NOTFOUND;
8616: CLOSE c_ocev_rec;
8617: IF l_no_data_found THEN
8618: l_return_status := OKC_API.G_RET_STS_ERROR;
8619: return(l_return_status);
8620: ELSE
8621: return(l_return_status);
8622: END IF;
8622: END IF;
8623: EXCEPTION
8624: WHEN OTHERS THEN
8625: -- store SQL error message on message stack for caller
8626: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8627: -- notify caller of an UNEXPECTED error
8628: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8629: return(l_return_status);
8630: END get_ocev_rec;
8624: WHEN OTHERS THEN
8625: -- store SQL error message on message stack for caller
8626: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8627: -- notify caller of an UNEXPECTED error
8628: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8629: return(l_return_status);
8630: END get_ocev_rec;
8631:
8632: ----------------------------------------------------------------------------
8634: ----------------------------------------------------------------------------
8635: FUNCTION get_oatv_rec(p_oat_id IN NUMBER,
8636: x_oatv_rec OUT NOCOPY oatv_rec_type) RETURN VARCHAR2 IS
8637:
8638: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8639: l_no_data_found BOOLEAN := TRUE;
8640:
8641: CURSOR c_oatv_rec IS
8642: SELECT ID,
8671:
8672: l_no_data_found := c_oatv_rec%NOTFOUND;
8673: CLOSE c_oatv_rec;
8674: IF l_no_data_found THEN
8675: l_return_status := OKC_API.G_RET_STS_ERROR;
8676: return(l_return_status);
8677: ELSE
8678: return(l_return_status);
8679: END IF;
8679: END IF;
8680: EXCEPTION
8681: WHEN OTHERS THEN
8682: -- store SQL error message on message stack for caller
8683: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8684: -- notify caller of an UNEXPECTED error
8685: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8686: return(l_return_status);
8687:
8681: WHEN OTHERS THEN
8682: -- store SQL error message on message stack for caller
8683: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8684: -- notify caller of an UNEXPECTED error
8685: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8686: return(l_return_status);
8687:
8688: END get_oatv_rec;
8689:
8693:
8694: FUNCTION get_scnv_rec(p_scn_id IN NUMBER,
8695: x_scnv_rec OUT NOCOPY scnv_rec_type) RETURN VARCHAR2 IS
8696:
8697: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8698: l_no_data_found BOOLEAN := TRUE;
8699:
8700: CURSOR c_scnv_rec IS
8701: SELECT ID,
8756:
8757: l_no_data_found := c_scnv_rec%NOTFOUND;
8758: CLOSE c_scnv_rec;
8759: IF l_no_data_found THEN
8760: l_return_status := OKC_API.G_RET_STS_ERROR;
8761: return(l_return_status);
8762: ELSE
8763: return(l_return_status);
8764: END IF;
8764: END IF;
8765: EXCEPTION
8766: WHEN OTHERS THEN
8767: -- store SQL error message on message stack for caller
8768: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8769: -- notify caller of an UNEXPECTED error
8770: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8771: return(l_return_status);
8772:
8766: WHEN OTHERS THEN
8767: -- store SQL error message on message stack for caller
8768: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8769: -- notify caller of an UNEXPECTED error
8770: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8771: return(l_return_status);
8772:
8773: END get_scnv_rec;
8774:
8778:
8779: FUNCTION get_sccv_rec(p_scc_id IN NUMBER,
8780: x_sccv_rec OUT NOCOPY sccv_rec_type) RETURN VARCHAR2 IS
8781:
8782: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8783: l_no_data_found BOOLEAN := TRUE;
8784:
8785: CURSOR c_sccv_rec IS
8786: SELECT ID,
8837:
8838: l_no_data_found := c_sccv_rec%NOTFOUND;
8839: CLOSE c_sccv_rec;
8840: IF l_no_data_found THEN
8841: l_return_status := OKC_API.G_RET_STS_ERROR;
8842: return(l_return_status);
8843: ELSE
8844: return(l_return_status);
8845: END IF;
8845: END IF;
8846: EXCEPTION
8847: WHEN OTHERS THEN
8848: -- store SQL error message on message stack for caller
8849: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8850: -- notify caller of an UNEXPECTED error
8851: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8852: return(l_return_status);
8853:
8847: WHEN OTHERS THEN
8848: -- store SQL error message on message stack for caller
8849: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
8850: -- notify caller of an UNEXPECTED error
8851: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
8852: return(l_return_status);
8853:
8854: END get_sccv_rec;
8855:
8858: ----------------------------------------------------------------------------
8859: FUNCTION get_patv_rec(p_pat_id IN NUMBER,
8860: x_patv_rec OUT NOCOPY patv_rec_type) RETURN VARCHAR2 IS
8861:
8862: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
8863: l_no_data_found BOOLEAN := TRUE;
8864:
8865: CURSOR c_patv_rec IS
8866: SELECT
9007:
9008: l_no_data_found := c_patv_rec%NOTFOUND;
9009: CLOSE c_patv_rec;
9010: IF l_no_data_found THEN
9011: l_return_status := OKC_API.G_RET_STS_ERROR;
9012: return(l_return_status);
9013: ELSE
9014: return(l_return_status);
9015: END IF;
9015: END IF;
9016: EXCEPTION
9017: WHEN OTHERS THEN
9018: -- store SQL error message on message stack for caller
9019: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9020: -- notify caller of an UNEXPECTED error
9021: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9022: return(l_return_status);
9023:
9017: WHEN OTHERS THEN
9018: -- store SQL error message on message stack for caller
9019: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9020: -- notify caller of an UNEXPECTED error
9021: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9022: return(l_return_status);
9023:
9024: END get_patv_rec;
9025: --------------------------------------------------------------------------------------------------
9026:
9027: FUNCTION get_pacv_rec(p_pac_id IN NUMBER,
9028: x_pacv_rec OUT NOCOPY pacv_rec_type) RETURN VARCHAR2 IS
9029:
9030: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
9031: l_no_data_found BOOLEAN := TRUE;
9032:
9033: CURSOR c_pacv_rec IS
9034: SELECT
9072: x_pacv_rec.OBJECT_VERSION_NUMBER;
9073: l_no_data_found := c_pacv_rec%NOTFOUND;
9074: CLOSE c_pacv_rec;
9075: IF l_no_data_found THEN
9076: l_return_status := OKC_API.G_RET_STS_ERROR;
9077: return(l_return_status);
9078: ELSE
9079: return(l_return_status);
9080: END IF;
9080: END IF;
9081: EXCEPTION
9082: WHEN OTHERS THEN
9083: -- store SQL error message on message stack for caller
9084: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9085: -- notify caller of an UNEXPECTED error
9086: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9087: return(l_return_status);
9088:
9082: WHEN OTHERS THEN
9083: -- store SQL error message on message stack for caller
9084: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9085: -- notify caller of an UNEXPECTED error
9086: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9087: return(l_return_status);
9088:
9089: END get_pacv_rec;
9090: ----------------------------------------------------------------------------------------------
9090: ----------------------------------------------------------------------------------------------
9091: FUNCTION get_paav_rec(p_paa_id IN NUMBER,
9092: x_paav_rec OUT NOCOPY paav_rec_type) RETURN VARCHAR2 IS
9093:
9094: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
9095: l_no_data_found BOOLEAN := TRUE;
9096:
9097: CURSOR c_paav_rec IS
9098: SELECT
9140: x_paav_rec.OBJECT_VERSION_NUMBER;
9141: l_no_data_found := c_paav_rec%NOTFOUND;
9142: CLOSE c_paav_rec;
9143: IF l_no_data_found THEN
9144: l_return_status := OKC_API.G_RET_STS_ERROR;
9145: return(l_return_status);
9146: ELSE
9147: return(l_return_status);
9148: END IF;
9148: END IF;
9149: EXCEPTION
9150: WHEN OTHERS THEN
9151: -- store SQL error message on message stack for caller
9152: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9153: -- notify caller of an UNEXPECTED error
9154: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9155: return(l_return_status);
9156:
9150: WHEN OTHERS THEN
9151: -- store SQL error message on message stack for caller
9152: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9153: -- notify caller of an UNEXPECTED error
9154: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9155: return(l_return_status);
9156:
9157: END get_paav_rec;
9158:
9160: -----------------------------------------------------------------------------------------------
9161: FUNCTION get_pavv_rec(p_pav_id IN NUMBER,
9162: x_pavv_rec OUT NOCOPY pavv_rec_type) RETURN VARCHAR2 IS
9163:
9164: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
9165: l_no_data_found BOOLEAN := TRUE;
9166:
9167: CURSOR c_pavv_rec IS
9168: SELECT ID,
9585:
9586: l_no_data_found := c_pavv_rec%NOTFOUND;
9587: CLOSE c_pavv_rec;
9588: IF l_no_data_found THEN
9589: l_return_status := OKC_API.G_RET_STS_ERROR;
9590: return(l_return_status);
9591: ELSE
9592: return(l_return_status);
9593: END IF;
9593: END IF;
9594: EXCEPTION
9595: WHEN OTHERS THEN
9596: -- store SQL error message on message stack for caller
9597: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9598: -- notify caller of an UNEXPECTED error
9599: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9600: return(l_return_status);
9601:
9595: WHEN OTHERS THEN
9596: -- store SQL error message on message stack for caller
9597: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
9598: -- notify caller of an UNEXPECTED error
9599: l_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
9600: return(l_return_status);
9601:
9602: END get_pavv_rec;
9603:
9742: p_to.sfwt_flag := p_from.sfwt_flag;
9743: p_to.description := p_from.description;
9744: p_to.short_description := p_from.short_description;
9745: p_to.comments := p_from.comments;
9746: IF p_from.tve_id_limited IS NULL OR p_from.tve_id_limited = OKC_API.G_MISS_NUM THEN
9747: p_to.limited_start_date := NULL;
9748: p_to.limited_end_date := NULL;
9749: ELSE
9750: OPEN c_start_end(p_from.tve_id_limited);
9926: OPEN c_cyl(p_from.id);
9927: FETCH c_cyl INTO p_to.uom_code,p_to.duration,p_to.active_yn;
9928: CLOSE c_cyl;
9929:
9930: IF p_from.tve_id_limited IS NULL OR p_from.tve_id_limited = OKC_API.G_MISS_NUM THEN
9931: p_to.limited_start_date := NULL;
9932: p_to.limited_end_date := NULL;
9933: ELSE
9934: OPEN c_start_end(p_from.tve_id_limited);
9971: x_isev_rel_rec isev_rel_rec_type;
9972: l_isev_ext_rec isev_ext_rec_type;
9973: x_isev_ext_rec isev_ext_rec_type;
9974: l_tve_type VARCHAR2(10);
9975: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
9976: l_cnh_id_out NUMBER;
9977: l_cnh_id_temp NUMBER;
9978: l_dnz_chr_id NUMBER;
9979: l_template_yn VARCHAR2(3);
10080: x_msg_data => x_msg_data,
10081: p_tavv_rec => l_tavv_rec,
10082: x_tavv_rec => x_tavv_rec);
10083:
10084: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10085: x_return_status := l_return_status;
10086: RAISE G_EXCEPTION_HALT_VALIDATION;
10087: END IF;
10088: x_tve_id := x_tavv_rec.id;
10110: p_chr_id => p_to_chr_id,
10111: p_to_template_yn => p_to_template_yn,
10112: x_cnh_id => l_cnh_id_out);
10113:
10114: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10115: x_return_status := l_return_status;
10116: RAISE G_EXCEPTION_HALT_VALIDATION;
10117: END IF;
10118:
10129: x_msg_data => x_msg_data,
10130: p_talv_evt_rec => l_talv_evt_rec,
10131: x_talv_evt_rec => x_talv_evt_rec);
10132:
10133: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10134: x_return_status := l_return_status;
10135: RAISE G_EXCEPTION_HALT_VALIDATION;
10136: END IF;
10137: x_tve_id := x_talv_evt_rec.id;
10150: x_msg_data => x_msg_data,
10151: p_tgdv_ext_rec => l_tgdv_ext_rec,
10152: x_tgdv_ext_rec => x_tgdv_ext_rec);
10153:
10154: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10155: x_return_status := l_return_status;
10156: RAISE G_EXCEPTION_HALT_VALIDATION;
10157: END IF;
10158: x_tve_id := x_tgdv_ext_rec.id;
10175: p_chr_id => p_to_chr_id,
10176: p_to_template_yn => p_to_template_yn,
10177: x_cnh_id => l_cnh_id_out);
10178:
10179: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10180: x_return_status := l_return_status;
10181: RAISE G_EXCEPTION_HALT_VALIDATION;
10182: END IF;
10183: l_tgnv_rec.cnh_id := l_cnh_id_out; -- the new event id generated is assigned to the time value
10193: x_msg_data => x_msg_data,
10194: p_tgnv_rec => l_tgnv_rec,
10195: x_tgnv_rec => x_tgnv_rec);
10196:
10197: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10198: x_return_status := l_return_status;
10199: RAISE G_EXCEPTION_HALT_VALIDATION;
10200: END IF;
10201: x_tve_id := x_tgnv_rec.id;
10250: x_msg_data => x_msg_data,
10251: p_isev_ext_rec => l_isev_ext_rec,
10252: x_isev_ext_rec => x_isev_ext_rec);
10253:
10254: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10255: x_return_status := l_return_status;
10256: RAISE G_EXCEPTION_HALT_VALIDATION;
10257: END IF;
10258: x_tve_id := x_isev_ext_rec.id;
10308: x_msg_data => x_msg_data,
10309: p_isev_rel_rec => l_isev_rel_rec,
10310: x_isev_rel_rec => x_isev_rel_rec);
10311:
10312: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10313: x_return_status := l_return_status;
10314: RAISE G_EXCEPTION_HALT_VALIDATION;
10315: END IF;
10316: x_tve_id := x_isev_rel_rec.id;
10329: x_msg_data => x_msg_data,
10330: p_igsv_ext_rec => l_igsv_ext_rec,
10331: x_igsv_ext_rec => x_igsv_ext_rec);
10332:
10333: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10334: x_return_status := l_return_status;
10335: RAISE G_EXCEPTION_HALT_VALIDATION;
10336: END IF;
10337: x_tve_id := x_igsv_ext_rec.id;
10347: x_msg_data => x_msg_data,
10348: p_cylv_ext_rec => l_cylv_ext_rec,
10349: x_cylv_ext_rec => x_cylv_ext_rec);
10350:
10351: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10352: x_return_status := l_return_status;
10353: RAISE G_EXCEPTION_HALT_VALIDATION;
10354: END IF;
10355: x_tve_id := x_cylv_ext_rec.id;
10360: WHEN G_EXCEPTION_HALT_VALIDATION THEN
10361: NULL;
10362: WHEN OTHERS THEN
10363: -- store SQL error message on message stack for caller
10364: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
10365: -- notify caller of an UNEXPECTED error
10366: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
10367:
10368: END copy_timevalues;
10362: WHEN OTHERS THEN
10363: -- store SQL error message on message stack for caller
10364: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
10365: -- notify caller of an UNEXPECTED error
10366: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
10367:
10368: END copy_timevalues;
10369:
10370: PROCEDURE copy_components(
10394: l_components_tbl api_components_tbl := p_components_tbl;
10395: l_lines_tbl api_lines_tbl := p_lines_tbl;
10396: l_published_line_ids_tbl OKS_COPY_CONTRACT_PVT.published_line_ids_tbl;
10397:
10398: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
10399: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
10400: l_cle_id_out NUMBER;
10401: l_chr_id NUMBER;
10402: l_cnh_id NUMBER;
10395: l_lines_tbl api_lines_tbl := p_lines_tbl;
10396: l_published_line_ids_tbl OKS_COPY_CONTRACT_PVT.published_line_ids_tbl;
10397:
10398: l_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
10399: l_old_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
10400: l_cle_id_out NUMBER;
10401: l_chr_id NUMBER;
10402: l_cnh_id NUMBER;
10403: l_rgp_id NUMBER;
10412: l_copy_sublines VARCHAR2(1) := 'F';
10413: l_generate_line_number VARCHAR2(1) := 'Y'; --Bug 2489856
10414: l_result BOOLEAN;
10415: --Bug:3668722
10416: l_cle_id_out20 NUMBER := OKC_API.G_MISS_NUM;
10417: l_cle_id_out21 NUMBER := OKC_API.G_MISS_NUM;
10418: l_c_lines_id NUMBER := OKC_API.G_MISS_NUM;
10419: l_c_lines_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
10420:
10413: l_generate_line_number VARCHAR2(1) := 'Y'; --Bug 2489856
10414: l_result BOOLEAN;
10415: --Bug:3668722
10416: l_cle_id_out20 NUMBER := OKC_API.G_MISS_NUM;
10417: l_cle_id_out21 NUMBER := OKC_API.G_MISS_NUM;
10418: l_c_lines_id NUMBER := OKC_API.G_MISS_NUM;
10419: l_c_lines_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
10420:
10421:
10414: l_result BOOLEAN;
10415: --Bug:3668722
10416: l_cle_id_out20 NUMBER := OKC_API.G_MISS_NUM;
10417: l_cle_id_out21 NUMBER := OKC_API.G_MISS_NUM;
10418: l_c_lines_id NUMBER := OKC_API.G_MISS_NUM;
10419: l_c_lines_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
10420:
10421:
10422: --11510
10415: --Bug:3668722
10416: l_cle_id_out20 NUMBER := OKC_API.G_MISS_NUM;
10417: l_cle_id_out21 NUMBER := OKC_API.G_MISS_NUM;
10418: l_c_lines_id NUMBER := OKC_API.G_MISS_NUM;
10419: l_c_lines_dnz_chr_id NUMBER := OKC_API.G_MISS_NUM;
10420:
10421:
10422: --11510
10423: l_source_doc_type VARCHAR2(60);
10450: WHERE opn_code = 'COPY'
10451: AND cls_code = 'SERVICE';
10452:
10453: l_pdf_id NUMBER;
10454: l_cle_id NUMBER := OKC_API.G_MISS_NUM; -- Bugfix 2151523(1917514) - Initializing
10455: --l_chr_id NUMBER;
10456: l_string VARCHAR2(32000);
10457: proc_string VARCHAR2(32000);
10458: -- Cursor created to get the PDF_ID for Class 'SERVICE' - Bug 1917514
10572: END IF;
10573: l_result := OKC_COPY_CONTRACT_PUB.IS_COPY_ALLOWED(p_from_chr_id, NULL);
10574: If NOT l_result Then
10575: -- notify caller of an UNEXPECTED error
10576: x_return_status := OKC_API.G_RET_STS_ERROR;
10577: raise G_EXCEPTION_HALT_VALIDATION;
10578: End If;
10579:
10580: -- Intitialize globals.
10625:
10626: l_oks_copy := 'N'; -- Bugfix 1917514
10627: -- Setting l_oks_copy to 'N' so that this procedure should not be called from
10628: -- Copy Line if it is already called from Copy Header
10629: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10630: x_return_status := l_return_status;
10631: RAISE G_EXCEPTION_HALT_VALIDATION;
10632: END IF;
10633: ELSE
10660: p_chr_id => l_chr_id,
10661: p_to_template_yn => p_to_template_yn,
10662: x_cnh_id => l_cnh_id);
10663:
10664: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10666: x_return_status := l_return_status;
10667: RAISE G_EXCEPTION_HALT_VALIDATION;
10668: ELSE
10661: p_to_template_yn => p_to_template_yn,
10662: x_cnh_id => l_cnh_id);
10663:
10664: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10666: x_return_status := l_return_status;
10667: RAISE G_EXCEPTION_HALT_VALIDATION;
10668: ELSE
10669: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10665: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10666: x_return_status := l_return_status;
10667: RAISE G_EXCEPTION_HALT_VALIDATION;
10668: ELSE
10669: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10670: x_return_status := l_return_status;
10671: END IF;
10672: END IF;
10673: END IF;
10699: p_chr_id => l_chr_id,
10700: p_rle_code => l_components_tbl(i).attribute1,
10701: x_cpl_id => l_cpl_id);
10702:
10703: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10704: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10705: x_return_status := l_return_status;
10706: RAISE G_EXCEPTION_HALT_VALIDATION;
10707: ELSE
10700: p_rle_code => l_components_tbl(i).attribute1,
10701: x_cpl_id => l_cpl_id);
10702:
10703: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10704: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10705: x_return_status := l_return_status;
10706: RAISE G_EXCEPTION_HALT_VALIDATION;
10707: ELSE
10708: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10704: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10705: x_return_status := l_return_status;
10706: RAISE G_EXCEPTION_HALT_VALIDATION;
10707: ELSE
10708: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10709: x_return_status := l_return_status;
10710: END IF;
10711: END IF;
10712: END IF;
10744: p_chr_id => l_chr_id,
10745: p_to_template_yn => p_to_template_yn,
10746: x_rgp_id => l_rgp_id);
10747:
10748: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10749: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10750: x_return_status := l_return_status;
10751: RAISE G_EXCEPTION_HALT_VALIDATION;
10752: ELSE
10745: p_to_template_yn => p_to_template_yn,
10746: x_rgp_id => l_rgp_id);
10747:
10748: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10749: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10750: x_return_status := l_return_status;
10751: RAISE G_EXCEPTION_HALT_VALIDATION;
10752: ELSE
10753: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10749: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10750: x_return_status := l_return_status;
10751: RAISE G_EXCEPTION_HALT_VALIDATION;
10752: ELSE
10753: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10754: x_return_status := l_return_status;
10755: END IF;
10756: END IF;
10757: END IF;
10784: p_cle_id => NULL,
10785: p_chr_id => l_chr_id,
10786: x_cat_id => l_cat_id);
10787:
10788: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10789: l_old_return_status := l_return_status;
10790: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10791: x_return_status := l_return_status;
10792: RAISE G_EXCEPTION_HALT_VALIDATION;
10786: x_cat_id => l_cat_id);
10787:
10788: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10789: l_old_return_status := l_return_status;
10790: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10791: x_return_status := l_return_status;
10792: RAISE G_EXCEPTION_HALT_VALIDATION;
10793: ELSE
10794: x_return_status := l_return_status;
10823: );
10824: IF (l_debug = 'Y') THEN
10825: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for source chr_id ' || l_return_status);
10826: END IF;
10827: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10828: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10829: x_return_status := l_return_status;
10830: RAISE G_EXCEPTION_HALT_VALIDATION;
10831: ELSE
10824: IF (l_debug = 'Y') THEN
10825: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for source chr_id ' || l_return_status);
10826: END IF;
10827: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10828: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10829: x_return_status := l_return_status;
10830: RAISE G_EXCEPTION_HALT_VALIDATION;
10831: ELSE
10832: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10828: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10829: x_return_status := l_return_status;
10830: RAISE G_EXCEPTION_HALT_VALIDATION;
10831: ELSE
10832: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10833: x_return_status := l_return_status;
10834: END IF;
10835: END IF;
10836: END IF;
10846:
10847: IF (l_debug = 'Y') THEN
10848: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for target chr_id ' || l_return_status);
10849: END IF;
10850: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10851: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10852: x_return_status := l_return_status;
10853: RAISE G_EXCEPTION_HALT_VALIDATION;
10854: ELSE
10847: IF (l_debug = 'Y') THEN
10848: OKC_DEBUG.log(' After Procedure : Get_Contract_Document_Type for target chr_id ' || l_return_status);
10849: END IF;
10850: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10851: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10852: x_return_status := l_return_status;
10853: RAISE G_EXCEPTION_HALT_VALIDATION;
10854: ELSE
10855: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10851: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10852: x_return_status := l_return_status;
10853: RAISE G_EXCEPTION_HALT_VALIDATION;
10854: ELSE
10855: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10856: x_return_status := l_return_status;
10857: END IF;
10858: END IF;
10859: END IF;
10879: );
10880: IF (l_debug = 'Y') THEN
10881: OKC_DEBUG.log(' After Procedure : OKC_TERMS_COPY_GRP.copy_doc ' || l_return_status);
10882: END IF;
10883: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10885: x_return_status := l_return_status;
10886: RAISE G_EXCEPTION_HALT_VALIDATION;
10887: ELSE
10880: IF (l_debug = 'Y') THEN
10881: OKC_DEBUG.log(' After Procedure : OKC_TERMS_COPY_GRP.copy_doc ' || l_return_status);
10882: END IF;
10883: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10885: x_return_status := l_return_status;
10886: RAISE G_EXCEPTION_HALT_VALIDATION;
10887: ELSE
10888: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10884: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
10885: x_return_status := l_return_status;
10886: RAISE G_EXCEPTION_HALT_VALIDATION;
10887: ELSE
10888: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10889: x_return_status := l_return_status;
10890: END IF;
10891: END IF;
10892: END IF;
10976: OKC_DEBUG.log('650 : x_msg_count : '||x_msg_count);
10977: OKC_DEBUG.log('650 : x_msg_data : '||x_msg_data);
10978: END IF;
10979: -- If any error happens it exits the loop or if it is a warning it still continues.
10980: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10981: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
10982: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10983: x_return_status := OKC_API.G_RET_STS_WARNING;
10984: END IF;
10977: OKC_DEBUG.log('650 : x_msg_data : '||x_msg_data);
10978: END IF;
10979: -- If any error happens it exits the loop or if it is a warning it still continues.
10980: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10981: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
10982: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10983: x_return_status := OKC_API.G_RET_STS_WARNING;
10984: END IF;
10985: ELSE
10978: END IF;
10979: -- If any error happens it exits the loop or if it is a warning it still continues.
10980: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10981: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
10982: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10983: x_return_status := OKC_API.G_RET_STS_WARNING;
10984: END IF;
10985: ELSE
10986: x_return_status := l_return_status;
10979: -- If any error happens it exits the loop or if it is a warning it still continues.
10980: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
10981: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
10982: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
10983: x_return_status := OKC_API.G_RET_STS_WARNING;
10984: END IF;
10985: ELSE
10986: x_return_status := l_return_status;
10987: RAISE G_EXCEPTION_HALT_VALIDATION;
10991: IF(l_lines_tbl(j).lse_id=19 ) then
10992: OPEN c_lines(l_from_cle_id);
10993: FETCH c_lines INTO l_c_lines_id,l_c_lines_dnz_chr_id;
10994: CLOSE c_lines;
10995: IF(l_c_lines_id <> OKC_API.G_MISS_NUM) THEN
10996: copy_contract_line (
10997: p_api_version => p_api_version,
10998: p_init_msg_list => p_init_msg_list,
10999: x_return_status => l_return_status,
11013: IF (l_debug = 'Y') THEN
11014: OKC_DEBUG.log('660 :after copy_contract_line');
11015: END IF;
11016: -- If any error happens it exits the loop or if it is a warning it still continues.
11017: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11018: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11019: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11020: x_return_status := OKC_API.G_RET_STS_WARNING;
11021: END IF;
11014: OKC_DEBUG.log('660 :after copy_contract_line');
11015: END IF;
11016: -- If any error happens it exits the loop or if it is a warning it still continues.
11017: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11018: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11019: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11020: x_return_status := OKC_API.G_RET_STS_WARNING;
11021: END IF;
11022: ELSE
11015: END IF;
11016: -- If any error happens it exits the loop or if it is a warning it still continues.
11017: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11018: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11019: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11020: x_return_status := OKC_API.G_RET_STS_WARNING;
11021: END IF;
11022: ELSE
11023: x_return_status := l_return_status;
11016: -- If any error happens it exits the loop or if it is a warning it still continues.
11017: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11018: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11019: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11020: x_return_status := OKC_API.G_RET_STS_WARNING;
11021: END IF;
11022: ELSE
11023: x_return_status := l_return_status;
11024: RAISE G_EXCEPTION_HALT_VALIDATION;
11045: IF (l_debug = 'Y') THEN
11046: OKC_DEBUG.log('670 :after copy_contract_lines');
11047: END IF;
11048: -- If any error happens it exits the loop or if it is a warning it still continues.
11049: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11050: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11051: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11052: x_return_status := OKC_API.G_RET_STS_WARNING;
11053: END IF;
11046: OKC_DEBUG.log('670 :after copy_contract_lines');
11047: END IF;
11048: -- If any error happens it exits the loop or if it is a warning it still continues.
11049: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11050: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11051: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11052: x_return_status := OKC_API.G_RET_STS_WARNING;
11053: END IF;
11054: ELSE
11047: END IF;
11048: -- If any error happens it exits the loop or if it is a warning it still continues.
11049: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11050: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11051: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11052: x_return_status := OKC_API.G_RET_STS_WARNING;
11053: END IF;
11054: ELSE
11055: x_return_status := l_return_status;
11048: -- If any error happens it exits the loop or if it is a warning it still continues.
11049: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11050: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11051: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11052: x_return_status := OKC_API.G_RET_STS_WARNING;
11053: END IF;
11054: ELSE
11055: x_return_status := l_return_status;
11056: RAISE G_EXCEPTION_HALT_VALIDATION;
11082: END IF;
11083:
11084: l_copy_sublines := 'F';
11085: -- If any error happens it exits the loop or if it is a warning it still continues.
11086: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11087: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11088: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11089: x_return_status := OKC_API.G_RET_STS_WARNING;
11090: END IF;
11083:
11084: l_copy_sublines := 'F';
11085: -- If any error happens it exits the loop or if it is a warning it still continues.
11086: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11087: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11088: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11089: x_return_status := OKC_API.G_RET_STS_WARNING;
11090: END IF;
11091: ELSE
11084: l_copy_sublines := 'F';
11085: -- If any error happens it exits the loop or if it is a warning it still continues.
11086: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11087: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11088: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11089: x_return_status := OKC_API.G_RET_STS_WARNING;
11090: END IF;
11091: ELSE
11092: x_return_status := l_return_status;
11085: -- If any error happens it exits the loop or if it is a warning it still continues.
11086: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11087: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11088: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11089: x_return_status := OKC_API.G_RET_STS_WARNING;
11090: END IF;
11091: ELSE
11092: x_return_status := l_return_status;
11093: RAISE G_EXCEPTION_HALT_VALIDATION;
11122: OKC_DEBUG.log('850 : x_return_status : '||l_return_status);
11123: END IF;
11124:
11125:
11126: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11127: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11128: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11129: x_return_status := OKC_API.G_RET_STS_WARNING;
11130: END IF;
11123: END IF;
11124:
11125:
11126: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11127: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11128: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11129: x_return_status := OKC_API.G_RET_STS_WARNING;
11130: END IF;
11131: ELSE
11124:
11125:
11126: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11127: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11128: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11129: x_return_status := OKC_API.G_RET_STS_WARNING;
11130: END IF;
11131: ELSE
11132: x_return_status := l_return_status;
11125:
11126: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11127: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11128: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11129: x_return_status := OKC_API.G_RET_STS_WARNING;
11130: END IF;
11131: ELSE
11132: x_return_status := l_return_status;
11133: RAISE G_EXCEPTION_HALT_VALIDATION;
11162: OKC_DEBUG.log('950 : x_return_status : '||l_return_status);
11163: END IF;
11164:
11165:
11166: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11167: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11168: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11169: x_return_status := OKC_API.G_RET_STS_WARNING;
11170: END IF;
11163: END IF;
11164:
11165:
11166: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11167: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11168: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11169: x_return_status := OKC_API.G_RET_STS_WARNING;
11170: END IF;
11171: ELSE
11164:
11165:
11166: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11167: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11168: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11169: x_return_status := OKC_API.G_RET_STS_WARNING;
11170: END IF;
11171: ELSE
11172: x_return_status := l_return_status;
11165:
11166: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11167: IF (l_return_status = OKC_API.G_RET_STS_WARNING) THEN
11168: IF l_old_return_status <> OKC_API.G_RET_STS_ERROR THEN -- do not overwrite error with warning.
11169: x_return_status := OKC_API.G_RET_STS_WARNING;
11170: END IF;
11171: ELSE
11172: x_return_status := l_return_status;
11173: RAISE G_EXCEPTION_HALT_VALIDATION;
11193:
11194: OKC_CFG_PUB.COPY_CONFIG(p_dnz_chr_id => l_chr_id,
11195: x_return_status => l_return_status);
11196:
11197: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11198: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
11199: x_return_status := l_return_status;
11200: RAISE G_EXCEPTION_HALT_VALIDATION;
11201: ELSE
11194: OKC_CFG_PUB.COPY_CONFIG(p_dnz_chr_id => l_chr_id,
11195: x_return_status => l_return_status);
11196:
11197: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
11198: IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
11199: x_return_status := l_return_status;
11200: RAISE G_EXCEPTION_HALT_VALIDATION;
11201: ELSE
11202: x_return_status := l_return_status;
11233:
11234: IF l_string is NOT NULL THEN
11235: proc_string := 'begin '||l_string || ' (:b1,:b2,:b3); end ;';
11236: EXECUTE IMMEDIATE proc_string using l_chr_id,l_cle_id, out l_return_status;
11237: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN -- Bugfix 2151523(1917514) - modified IF
11238: x_return_status := l_return_status;
11239: RAISE G_EXCEPTION_HALT_VALIDATION;
11240: ELSE
11241: --for Bug#3101222 -Return status below is not properly initialized.
11285: END IF;
11286: x_chr_id := l_to_chr_id;
11287: x_return_status := l_return_status;
11288:
11289: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN -- Bugfix 2151523(1917514) - modified IF
11290: x_return_status := l_return_status;
11291: RAISE G_EXCEPTION_HALT_VALIDATION;
11292: END IF;
11293: -- End
11306: END IF;
11307: NULL;
11308: WHEN OTHERS THEN
11309: -- store SQL error message on message stack for caller
11310: OKC_API.set_message(G_APP_NAME, G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
11311: IF (l_debug = 'Y') THEN
11312: OKC_DEBUG.log('30000 : SQLCODE : '||SQLCODE);
11313: OKC_DEBUG.log('30000 : SQLERRM : '||SQLERRM);
11314: OKC_DEBUG.log('30000 : Exiting Procedure OKC_COPY_CONTRACT_PVT.copy_components ', 2);
11314: OKC_DEBUG.log('30000 : Exiting Procedure OKC_COPY_CONTRACT_PVT.copy_components ', 2);
11315: OKC_DEBUG.ReSet_Indentation;
11316: END IF;
11317: -- notify caller of an UNEXPECTED error
11318: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
11319:
11320: END copy_components;
11321:
11322: -- Bug 2950549 - Added procedure add_concurent : This procedure will make a call-- to the concurrent program and insert records in OKC_CONC_requests table.
11438: ARGUMENT12 => 'N', /*P_Copy_Entire_K_YN*/
11439: ARGUMENT13 => p_include_cancelled_lines,
11440: ARGUMENT14 => p_include_terminated_lines);
11441: IF l_request_id > 0 THEN
11442: OKC_API.SET_MESSAGE(p_app_name => g_app_name,
11443: p_msg_name => 'OKC_COPY_SUBMIT_S',
11444: p_token1 => 'TOKEN1',
11445: p_token1_value => l_request_id);
11446: END IF;
11469: l_lines_tbl api_lines_tbl;
11470: l_published_line_ids_tbl OKS_COPY_CONTRACT_PVT.published_line_ids_tbl;
11471:
11472: l_api_version CONSTANT NUMBER := 1;
11473: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
11474: l_init_msg_list VARCHAR2(1) := 'T';
11475: x_msg_count NUMBER := OKC_API.G_MISS_NUM;
11476: x_msg_data VARCHAR2(2000) := OKC_API.G_MISS_CHAR;
11477: l_chr_id NUMBER;
11471:
11472: l_api_version CONSTANT NUMBER := 1;
11473: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
11474: l_init_msg_list VARCHAR2(1) := 'T';
11475: x_msg_count NUMBER := OKC_API.G_MISS_NUM;
11476: x_msg_data VARCHAR2(2000) := OKC_API.G_MISS_CHAR;
11477: l_chr_id NUMBER;
11478: CURSOR cur_select_records IS SELECT
11479: SOURCE_ID ID,
11472: l_api_version CONSTANT NUMBER := 1;
11473: x_return_status VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
11474: l_init_msg_list VARCHAR2(1) := 'T';
11475: x_msg_count NUMBER := OKC_API.G_MISS_NUM;
11476: x_msg_data VARCHAR2(2000) := OKC_API.G_MISS_CHAR;
11477: l_chr_id NUMBER;
11478: CURSOR cur_select_records IS SELECT
11479: SOURCE_ID ID,
11480: TARGET_CHR_ID TO_K,
11549: ||'Return Status='||x_return_status
11550: ||'New Chr Id='||l_chr_id);
11551: END IF;
11552:
11553: If x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
11554: FOR i in 1..fnd_msg_pub.count_msg LOOP
11555: l_msg_stack := fnd_msg_pub.get(p_msg_index => i
11556: ,p_encoded => 'F');
11557: FND_FILE.PUT_LINE (FND_FILE.LOG,l_msg_stack);
11653: ||'p_contract_number='||p_contract_number
11654: ||'Return Status='||x_return_status);
11655: END IF;
11656:
11657: IF x_return_status <> OKC_API.G_RET_STS_SUCCESS THEN
11658: FOR i in 1..fnd_msg_pub.count_msg LOOP
11659: l_msg_stack := fnd_msg_pub.get(p_msg_index => i
11660: ,p_encoded => 'F');
11661: FND_FILE.PUT_LINE (FND_FILE.LOG,l_msg_stack);
12046: x_msg_data => l_msg_data,
12047: p_clev_rec => l_clev_rec ,
12048: x_clev_rec => x_clev_rec);
12049:
12050: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12051: RAISE G_EXCEPTION_HALT_VALIDATION;
12052: END IF;
12053:
12054: IF (p_lse_id =1) OR (p_lse_id = 14) OR (p_lse_id = 19) THEN
12079: okc_debug.log('1150: After Update Coverage ' || l_return_status);
12080: END IF;
12081:
12082:
12083: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12084: RAISE G_EXCEPTION_HALT_VALIDATION;
12085: END IF;
12086:
12087: -- Update PM Schedules.
12103:
12104: END IF;
12105: CLOSE check_pm_sch_csr;
12106:
12107: /* IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12108: RAISE G_EXCEPTION_HALT_VALIDATION;
12109: END IF; */
12110: END IF;
12111:
12113:
12114: IF (p_lse_id = 46) THEN
12115:
12116: OKS_SUBSCRIPTION_PUB.RECREATE_SCHEDULE(p_api_version => l_api_version,
12117: p_init_msg_list => OKC_API.G_FALSE,
12118: x_return_status => l_return_status,
12119: x_msg_count => l_msg_count,
12120: x_msg_data => l_msg_data,
12121: p_cle_id => p_cle_id,
12124: IF (l_debug = 'Y') THEN
12125: okc_debug.log('1170: After Sucbscription recreate ' || l_return_status);
12126: END IF;
12127:
12128: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12129: RAISE G_EXCEPTION_HALT_VALIDATION;
12130: END IF;
12131: END IF;
12132:
12208: p_tavv_tbl => l_p_tavv_tbl,
12209: x_tavv_tbl => l_x_tavv_tbl) ;
12210:
12211: If l_return_status <> 'S' then
12212: OKC_API.set_message(G_APP_NAME, G_REQUIRED_VALUE, G_COL_NAME_TOKEN, 'Create TPA Value ');
12213: Raise G_EXCEPTION_HALT_VALIDATION;
12214: End If;
12215:
12216: RETURN(l_x_tavv_tbl(1).id);
12262:
12263: IF (l_debug = 'Y') THEN
12264: okc_debug.log('1020: After OKC_CONTRACT_PUB.update_contract_header call ' || l_return_status);
12265: END IF;
12266: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12267: RAISE G_EXCEPTION_HALT_VALIDATION;
12268: END IF;
12269:
12270: -- Delete Header billing schedule bug# 4188236
12301: l_khrv_tbl_in.delete;
12302: END IF;
12303: CLOSE get_estimation_date;
12304:
12305: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12306: RAISE G_EXCEPTION_HALT_VALIDATION;
12307: END IF;
12308: -- Delete all security restriction for this contract.
12309: FOR l_access_rec IN get_access_level(p_chr_id) LOOP
12313: x_msg_count => l_msg_count,
12314: x_msg_data => l_msg_data,
12315: p_cacv_rec => cacv_rec);
12316:
12317: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12318: RAISE G_EXCEPTION_HALT_VALIDATION;
12319: END IF;
12320: END LOOP;
12321:
12332: x_msg_count => l_msg_count,
12333: x_msg_data => l_msg_data,
12334: x_return_status => l_return_status );
12335:
12336: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12337: RAISE G_EXCEPTION_HALT_VALIDATION;
12338: END IF;
12339:
12340: END LOOP;
12355: x_duration => l_hdr_duration,
12356: x_timeunit => l_hdr_timeunit,
12357: x_return_status => l_return_status);
12358:
12359: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12360: RAISE G_EXCEPTION_HALT_VALIDATION;
12361: END IF;
12362:
12363: IF (l_debug = 'Y') THEN
12382: x_msg_data => l_msg_data,
12383: p_chrv_rec => l_chrv_rec,
12384: x_chrv_rec => x_chrv_rec);
12385:
12386: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12387: RAISE G_EXCEPTION_HALT_VALIDATION;
12388: END IF;
12389:
12390: IF (l_debug = 'Y') THEN
12445: p_validate_yn => 'N');
12446:
12447:
12448:
12449: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12450: RAISE G_EXCEPTION_HALT_VALIDATION;
12451: END IF;
12452: l_khrv_tbl_in.delete;
12453:
12465: x_msg_count => l_msg_count,
12466: x_msg_data => l_msg_data,
12467: p_cacv_rec => cacv_rec);
12468:
12469: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12470: RAISE G_EXCEPTION_HALT_VALIDATION;
12471: END IF;
12472:
12473: IF (l_debug = 'Y') THEN
12487: x_duration => l_line_duration,
12488: x_timeunit => l_line_timeunit,
12489: x_return_status => l_return_status);
12490:
12491: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12492: RAISE G_EXCEPTION_HALT_VALIDATION;
12493: END IF;
12494:
12495: IF (l_debug = 'Y') THEN
12536: x_msg_count => l_msg_count,
12537: x_msg_data => l_msg_data,
12538: x_return_status => l_return_status );
12539:
12540: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12541: RAISE G_EXCEPTION_HALT_VALIDATION;
12542: END IF;
12543:
12544: END LOOP;
12572: IF (l_debug = 'Y') THEN
12573: okc_debug.log('1190: After QP Call ' || l_return_status);
12574: END IF;
12575:
12576: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12577: RAISE G_EXCEPTION_HALT_VALIDATION;
12578: END IF;
12579:
12580: --npalepu added on 27-FEB-2007 for bug # 5671352
12614: p_validate_yn => 'N'
12615: );
12616:
12617: x_return_status := l_return_status;
12618: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12619: RAISE G_EXCEPTION_HALT_VALIDATION;
12620: END IF;
12621:
12622: --updating contract header tax amount
12643: x_khrv_tbl => l_khrv_tax_tbl_out,
12644: p_validate_yn => 'N');
12645:
12646: x_return_status := l_return_status;
12647: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12648: RAISE G_EXCEPTION_HALT_VALIDATION;
12649: END IF;
12650: --end 5671352
12651:
12694: IF (l_debug = 'Y') THEN
12695: okc_debug.log('1200: After deleting SLL ' || l_return_status);
12696: END IF;
12697:
12698: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12699: RAISE G_EXCEPTION_HALT_VALIDATION;
12700: END IF;
12701:
12702: -- l_timevalue_id := Create_Timevalue(topline_rec.start_date,topline_rec.dnz_chr_id);
12722: , x_duration => l_duration
12723: , x_timeunit => l_timeunit
12724: , x_return_status => x_return_status);
12725:
12726: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12727: RAISE G_EXCEPTION_HALT_VALIDATION;
12728: END IF;
12729:
12730: l_sll_tbl(1).cle_id := topline_rec.id;
12761: IF (l_debug = 'Y') THEN
12762: okc_debug.log('1210: After Creating Billing Schedule ' || l_return_status);
12763: END IF;
12764:
12765: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) Then
12766: RAISE G_EXCEPTION_HALT_VALIDATION;
12767: END IF; */
12768:
12769: --check for template duration and new contract duration or matching or not
12768:
12769: --check for template duration and new contract duration or matching or not
12770: oks_copy_contract_pvt.chk_line_effectivity(topline_rec.id,l_duration_match, x_return_status);
12771:
12772: IF (x_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12773: RAISE G_EXCEPTION_HALT_VALIDATION;
12774: END IF;
12775:
12776: IF l_duration_match = 'T' THEN
12829: IF (l_debug = 'Y') THEN
12830: okc_debug.log('1210: After Creating Billing Schedule ' || l_return_status);
12831: END IF;
12832:
12833: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) Then
12834: RAISE G_EXCEPTION_HALT_VALIDATION;
12835: END IF;
12836:
12837: END IF; -- l_duration_match check
12860: END IF;
12861:
12862: END IF;
12863:
12864: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) Then
12865: RAISE G_EXCEPTION_HALT_VALIDATION;
12866: END IF;
12867:
12868: -- Reset the flags.
12887: x_return_status => l_return_status,
12888: x_msg_count => l_msg_count,
12889: x_msg_data => l_msg_data);
12890:
12891: IF (l_return_status <> OKC_API.G_RET_STS_SUCCESS) THEN
12892: RAISE G_EXCEPTION_HALT_VALIDATION;
12893: END IF;
12894: END LOOP;
12895: --end npalepu
12919: okc_debug.Reset_Indentation;
12920: END IF;
12921:
12922: WHEN OTHERS THEN
12923: x_return_status := OKC_API.G_RET_STS_UNEXP_ERROR;
12924: IF get_estimation_date%ISOPEN THEN
12925: CLOSE get_estimation_date;
12926: END IF;
12927: IF (l_debug = 'Y') THEN
12927: IF (l_debug = 'Y') THEN
12928: okc_debug.log('1230: Unexpected Error');
12929: okc_debug.Reset_Indentation;
12930: END IF;
12931: OKC_API.set_message
12932: (G_APP_NAME,G_UNEXPECTED_ERROR,G_SQLCODE_TOKEN,SQLCODE,G_SQLERRM_TOKEN,SQLERRM);
12933:
12934: END UPDATE_TEMPLATE_CONTRACT ;
12935: