1: package body ECE_RULES_PKG AS
2: -- $Header: ECERULEB.pls 120.4.12010000.2 2008/11/24 17:21:59 akemiset ship $
3:
4: translator_code VARCHAR2(30);
5:
24:
25: BEGIN
26:
27: if ec_debug.G_debug_level >= 2 then
28: ec_debug.push ('ECE_RULES_PKG.UPDATE_STATUS');
29: ec_debug.pl (3, 'p_transaction_type', p_transaction_type);
30: ec_debug.pl (3, 'p_level', p_level);
31: ec_debug.pl (3, 'p_valid_rule', p_valid_rule);
32: ec_debug.pl (3, 'p_action', p_action);
118:
119: if ec_debug.G_debug_level >= 2 then
120: ec_debug.pl (3, 'Updated status',
121: ec_utils.g_ext_levels(p_level).status);
122: ec_debug.pop ('ECE_RULES_PKG.UPDATE_STATUS');
123: end if;
124:
125: EXCEPTION
126: WHEN OTHERS then
125: EXCEPTION
126: WHEN OTHERS then
127: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
128: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
129: ec_debug.pop ('ECE_RULES_PKG.UPDATE_STATUS');
130: raise fnd_api.g_exc_unexpected_error;
131:
132: END Update_Status;
133:
183: violation_level = l_violation_level;
184:
185: BEGIN
186: if ec_debug.G_debug_level >= 2 then
187: ec_debug.push ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
188: ec_debug.pl (3, 'p_transaction_type', p_transaction_type);
189: ec_debug.pl (3, 'p_address_type', p_address_type);
190: ec_debug.pl (3, 'p_stage_id', p_stage_id);
191: ec_debug.pl (3, 'p_document_id', p_document_id);
302: -- Standard call to get message count and if count is 1, get message info.
303: fnd_msg_pub.count_and_get(p_count => x_msg_count,
304: p_data => x_msg_data);
305: if ec_debug.G_debug_level >= 2 then
306: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
307: end if;
308:
309: EXCEPTION
310: WHEN fnd_api.g_exc_error then
310: WHEN fnd_api.g_exc_error then
311: x_return_status := fnd_api.g_ret_sts_error;
312: fnd_msg_pub.count_and_get (p_count => x_msg_count,
313: p_data => x_msg_data);
314: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
315:
316: WHEN fnd_api.g_exc_unexpected_error then
317: x_return_status := fnd_api.g_ret_sts_error;
318: fnd_msg_pub.count_and_get (p_count => x_msg_count,
316: WHEN fnd_api.g_exc_unexpected_error then
317: x_return_status := fnd_api.g_ret_sts_error;
318: fnd_msg_pub.count_and_get (p_count => x_msg_count,
319: p_data => x_msg_data);
320: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
321:
322: WHEN no_process_rule_info then
323: if (c_rule_info%ISOPEN) then
324: close c_rule_info;
326: ec_debug.pl (0, 'EC', 'ECE_NO_PROCESS_RULE',
327: 'TRANSACTION_TYPE', p_transaction_type,
328: 'RULE_TYPE', l_rule_type);
329: x_return_status := fnd_api.g_ret_sts_error;
330: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
331:
332: WHEN OTHERS THEN
333: if (c_rule_info%ISOPEN) then
334: close c_rule_info;
343: fnd_msg_pub.add_exc_msg(g_file_name, g_pkg_name, l_api_name);
344: end if;
345: fnd_msg_pub.count_and_get (p_count => x_msg_count,
346: p_data => x_msg_data);
347: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_PROCESS_RULES');
348:
349: END Validate_Process_Rules;
350:
351:
428: --rownum = 1;
429:
430: BEGIN
431: if ec_debug.G_debug_level >= 2 then
432: ec_debug.push ('ECE_RULES_PKG.VALIDATE_TRADING_PARTNER');
433: ec_debug.pl (3, 'p_transaction_type', p_transaction_type);
434: ec_debug.pl (3, 'p_address_type', p_address_type);
435: ec_debug.pl (3, 'p_level', p_level);
436: ec_debug.pl (3, 'p_map_id', p_map_id);
579:
580: if ec_debug.G_debug_level >= 2 then
581: ec_debug.pl (3, 'x_msg_text', x_msg_text);
582: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
583: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_TRADING_PARTNER');
584: end if;
585:
586: EXCEPTION
587: WHEN OTHERS THEN
599: end if;
600:
601: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL',xProgress);
602: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
603: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_TRADING_PARTNER');
604: raise fnd_api.g_exc_unexpected_error;
605:
606: END Validate_Trading_Partner;
607:
626: rownum = 1;
627:
628: BEGIN
629: if ec_debug.G_debug_level >= 2 then
630: ec_debug.push ('ECE_RULES_PKG.VALIDATE_TEST_PROD');
631: ec_debug.pl (3, 'p_tp_detail_id', p_tp_detail_id);
632: ec_debug.pl (3, 'p_level', p_level);
633: end if;
634:
669:
670: if ec_debug.G_debug_level >= 2 then
671: ec_debug.pl (3, 'x_msg_text', x_msg_text);
672: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
673: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_TEST_PROD');
674: end if;
675: EXCEPTION
676: WHEN no_row_selected then
677: if (c_test_flag%ISOPEN) then
680: ec_debug.pl (0, 'EC', 'ECE_NO_ROW_SELECTED',
681: 'PROGRESS_LEVEL', xProgress,
682: 'INFO', 'TEST_FLAG',
683: 'TABLE_NAME', 'ECE_TP_DETAILS');
684: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_TEST_PROD');
685: raise fnd_api.g_exc_error;
686:
687: WHEN OTHERS THEN
688: if (c_test_flag%ISOPEN) then
689: close c_test_flag;
690: end if;
691: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
692: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
693: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_TEST_PROD');
694: raise fnd_api.g_exc_unexpected_error;
695:
696: END Validate_Test_Prod;
697:
754: violation_level = l_violation_level; */
755:
756: BEGIN
757: if ec_debug.G_debug_level >= 2 then
758: ec_debug.push ('ECE_RULES_PKG.VALIDATE_COLUMN_RULES');
759: ec_debug.pl (3, 'p_transaction_type', p_transaction_type);
760: ec_debug.pl (3, 'p_stage_id', p_stage_id);
761: ec_debug.pl (3, 'p_document_id', p_document_id);
762: ec_debug.pl (3, 'p_document_number', p_document_number);
960: p_data => x_msg_data);
961:
962: if ec_debug.G_debug_level = 3 then
963: ec_debug.pl (3, 'x_return_status', x_return_status);
964: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_COLUMN_RULES');
965: end if;
966:
967: EXCEPTION
968: WHEN fnd_api.g_exc_error then
976: -- end if;
977: x_return_status := fnd_api.g_ret_sts_error;
978: fnd_msg_pub.count_and_get (p_count => x_msg_count,
979: p_data => x_msg_data);
980: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_COLUMN_RULES');
981:
982: WHEN fnd_api.g_exc_unexpected_error then
983: /* Bug 2708573
984: if (c_col_rule_info%ISOPEN) then
991: end if; */
992: x_return_status := fnd_api.g_ret_sts_error;
993: fnd_msg_pub.count_and_get (p_count => x_msg_count,
994: p_data => x_msg_data);
995: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_COLUMN_RULES');
996:
997: WHEN OTHERS THEN
998: /* Bug 2708573
999: if (c_col_rule_info%ISOPEN) then
1011: fnd_msg_pub.add_exc_msg(g_file_name, g_pkg_name, l_api_name);
1012: end if;
1013: fnd_msg_pub.count_and_get (p_count => x_msg_count,
1014: p_data => x_msg_data);
1015: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_COLUMN_RULES');
1016:
1017: END Validate_Column_Rules;
1018:
1019:
1027: xProgress VARCHAR2(80);
1028:
1029: BEGIN
1030: if ec_debug.G_debug_level >= 2 then
1031: ec_debug.push ('ECE_RULES_PKG.VALUE_REQUIRED_RULE');
1032: ec_debug.pl (3, 'p_column_name', p_column_name);
1033: ec_debug.pl (3, 'p_column_value', p_column_value);
1034: end if;
1035:
1048:
1049: if ec_debug.G_debug_level >= 2 then
1050: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1051: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1052: ec_debug.pop ('ECE_RULES_PKG.VALUE_REQUIRED_RULE');
1053: end if;
1054:
1055: EXCEPTION
1056: WHEN OTHERS THEN
1055: EXCEPTION
1056: WHEN OTHERS THEN
1057: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1058: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1059: ec_debug.pop ('ECE_RULES_PKG.VALUE_REQUIRED_RULE');
1060: raise fnd_api.g_exc_unexpected_error;
1061:
1062: END Value_Required_Rule;
1063:
1087:
1088: BEGIN
1089:
1090: if ec_debug.G_debug_level >= 2 then
1091: ec_debug.push ('ECE_RULES_PKG.SIMPLE_LOOKUP_RULE');
1092: ec_debug.pl (3, 'p_column_name', p_column_name);
1093: ec_debug.pl (3, 'p_column_value', p_column_value);
1094: ec_debug.pl (3, 'p_rule_id', p_rule_id);
1095: end if;
1176:
1177: if ec_debug.G_debug_level >= 2 then
1178: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1179: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1180: ec_debug.pop ('ECE_RULES_PKG.SIMPLE_LOOKUP_RULE');
1181: end if;
1182:
1183: EXCEPTION
1184: WHEN OTHERS THEN
1189: dbms_sql.close_cursor (l_sel_c);
1190: end if;
1191: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1192: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1193: ec_debug.pop ('ECE_RULES_PKG.SIMPLE_LOOKUP_RULE');
1194: raise fnd_api.g_exc_unexpected_error;
1195:
1196: END Simple_Lookup_Rule;
1197:
1226: where flex_value_set_name = l_valueset_name;
1227:
1228: BEGIN
1229: if ec_debug.G_debug_level >= 2 then
1230: ec_debug.push ('ECE_RULES_PKG.VALUESET_RULE');
1231: ec_debug.pl (3, 'p_column_name', p_column_name);
1232: ec_debug.pl (3, 'p_column_value', p_column_value);
1233: ec_debug.pl (3, 'p_rule_id', p_rule_id);
1234: end if;
1309:
1310: if ec_debug.G_debug_level >= 2 then
1311: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1312: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1313: ec_debug.pop ('ECE_RULES_PKG.VALUESET_RULE');
1314: end if;
1315:
1316: EXCEPTION
1317: WHEN no_value_set then
1322: close c_flex_valueset_id;
1323: end if;
1324: ec_debug.pl (0, 'EC', 'ECE_VALUESET_NOT_FOUND',
1325: 'VALUESET', l_valueset_name);
1326: ec_debug.pop ('ECE_RULES_PKG.VALUESET_RULE');
1327: raise fnd_api.g_exc_error;
1328:
1329: WHEN OTHERS THEN
1330: if (c_valueset%ISOPEN) then
1334: close c_flex_valueset_id;
1335: end if;
1336: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1337: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1338: ec_debug.pop ('ECE_RULES_PKG.VALUESET_RULE');
1339: raise fnd_api.g_exc_unexpected_error;
1340:
1341: END Valueset_Rule;
1342:
1372: order by null_dependency_detail_id;
1373:
1374: BEGIN
1375: if ec_debug.G_debug_level >= 2 then
1376: ec_debug.push ('ECE_RULES_PKG.NULL_DEPENDENCY_RULE');
1377: ec_debug.pl (3, 'p_column_name', p_column_name);
1378: ec_debug.pl (3, 'p_column_value', p_column_value);
1379: ec_debug.pl (3, 'p_rule_id', p_rule_id);
1380: ec_debug.pl (3, 'p_level', p_level);
1477:
1478: if ec_debug.G_debug_level >= 2 then
1479: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1480: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1481: ec_debug.pop ('ECE_RULES_PKG.NULL_DEPENDENCY_RULE');
1482: end if;
1483:
1484: EXCEPTION
1485: WHEN OTHERS THEN
1490: close c_null_dependency_detail;
1491: end if;
1492: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1493: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1494: ec_debug.pop ('ECE_RULES_PKG.NULL_DEPENDENCY_RULE');
1495: raise fnd_api.g_exc_unexpected_error;
1496:
1497: END Null_Dependency_Rule;
1498:
1521: value = p_column_value;
1522:
1523: BEGIN
1524: if ec_debug.G_debug_level >= 2 then
1525: ec_debug.push ('ECE_RULES_PKG.PREDEFINED_LIST_RULE');
1526: ec_debug.pl (3, 'p_column_name', p_column_name);
1527: ec_debug.pl (3, 'p_column_value', p_column_value);
1528: ec_debug.pl (3, 'p_rule_id', p_rule_id);
1529: end if;
1579:
1580: if ec_debug.G_debug_level >= 2 then
1581: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1582: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1583: ec_debug.pop ('ECE_RULES_PKG.PREDEFINED_LIST_RULE');
1584: end if;
1585:
1586: EXCEPTION
1587: WHEN OTHERS THEN
1592: close c_list_count;
1593: end if;
1594: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1595: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1596: ec_debug.pop ('ECE_RULES_PKG.PREDEFINED_LIST_RULE');
1597: raise fnd_api.g_exc_unexpected_error;
1598:
1599: END Predefined_List_Rule;
1600:
1622: where column_rule_id = p_rule_id;
1623:
1624: BEGIN
1625: if ec_debug.G_debug_level >= 2 then
1626: ec_debug.push ('ECE_RULES_PKG.NULL_DEFAULT_RULE');
1627: ec_debug.pl (3, 'p_column_name', p_column_name);
1628: ec_debug.pl (3, 'p_column_value', p_column_value);
1629: ec_debug.pl (3, 'p_rule_id', p_rule_id);
1630: ec_debug.pl (3, 'p_level', p_level);
1692:
1693: if ec_debug.G_debug_level >= 2 then
1694: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1695: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1696: ec_debug.pop ('ECE_RULES_PKG.NULL_DEFAULT_RULE');
1697: end if;
1698:
1699: EXCEPTION
1700: WHEN OTHERS THEN
1702: close c_null_default;
1703: end if;
1704: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1705: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1706: ec_debug.pop ('ECE_RULES_PKG.NULL_DEFAULT_RULE');
1707: raise fnd_api.g_exc_unexpected_error;
1708:
1709: END Null_Default_Rule;
1710:
1721: l_temp_date DATE;
1722:
1723: BEGIN
1724: if ec_debug.G_debug_level >= 2 then
1725: ec_debug.push ('ECE_RULES_PKG.DATATYPE_CHECKING_RULE');
1726: ec_debug.pl (3, 'p_column_datatype', p_column_datatype);
1727: ec_debug.pl (3, 'p_column_name', p_column_name);
1728: ec_debug.pl (3, 'p_column_value', p_column_value);
1729: end if;
1763:
1764: if ec_debug.G_debug_level >= 2 then
1765: ec_debug.pl (3, 'x_valid_rule', x_valid_rule);
1766: ec_debug.pl (3, 'x_msg_text', x_msg_text);
1767: ec_debug.pop ('ECE_RULES_PKG.DATATYPE_CHECKING_RULE');
1768: end if;
1769:
1770: EXCEPTION
1771: WHEN OTHERS THEN
1770: EXCEPTION
1771: WHEN OTHERS THEN
1772: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
1773: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
1774: ec_debug.pop ('ECE_RULES_PKG.DATATYPE_CHECKING_RULE');
1775: raise fnd_api.g_exc_unexpected_error;
1776:
1777: END Datatype_Checking_Rule;
1778:
1880: /* Bug 2151462 - commented out the debug messages and code that is not reqd. for
1881: ** Address derivation
1882: */
1883: if ec_debug.G_debug_level >= 2 then
1884: ec_debug.push ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
1885:
1886: xProgress := 'ECERULEB-130-1000';
1887:
1888: ec_debug.pl (3,'p_org_id_pos', p_org_id_pos);
1904: ec_debug.pl (3,'p_region1_pos', p_region1_pos);
1905: ec_debug.pl (3,'p_region2_pos', p_region2_pos);
1906: ec_debug.pl (3,'p_region3_pos', p_region3_pos);
1907: end if;
1908: ECE_RULES_PKG.G_PARTY_NAME := null;
1909: ECE_RULES_PKG.G_PARTY_NUMBER := null;
1910: -- get address information if it exists in the pl/sql table.
1911: if (p_org_id_pos is not null) then
1912: xProgress := 'ECERULEB-130-1010';
1905: ec_debug.pl (3,'p_region2_pos', p_region2_pos);
1906: ec_debug.pl (3,'p_region3_pos', p_region3_pos);
1907: end if;
1908: ECE_RULES_PKG.G_PARTY_NAME := null;
1909: ECE_RULES_PKG.G_PARTY_NUMBER := null;
1910: -- get address information if it exists in the pl/sql table.
1911: if (p_org_id_pos is not null) then
1912: xProgress := 'ECERULEB-130-1010';
1913: l_org_id := ec_utils.g_file_tbl (p_org_id_pos).value;
1935: bug2151462*/
1936:
1937: if (p_tp_translator_code_pos is not null) then
1938: xProgress := 'ECERULEB-130-1040';
1939: ECE_RULES_PKG.G_PARTY_NUMBER := ec_utils.g_file_tbl (p_tp_translator_code_pos).value;
1940: end if;
1941:
1942: IF (p_tp_location_name_pos IS NOT NULL) THEN
1943: xProgress := 'ECERULEB-130-1045';
1940: end if;
1941:
1942: IF (p_tp_location_name_pos IS NOT NULL) THEN
1943: xProgress := 'ECERULEB-130-1045';
1944: ECE_RULES_PKG.G_PARTY_NAME := ec_utils.g_file_tbl(p_tp_location_name_pos).value;
1945: END IF;
1946:
1947: if (p_addr1_pos is not null) then
1948: xProgress := 'ECERULEB-130-1050';
2049: ec_debug.pl (3, 'l_addr4', l_addr4);
2050: ec_debug.pl (3, 'l_addr_alt', l_addr_alt);
2051: ec_debug.pl (3, 'l_city', l_city);
2052: ec_debug.pl (3, 'l_zip', l_zip);
2053: ec_debug.pl (3, 'party_name', ece_rules_pkg.g_party_name);
2054: ec_debug.pl (3, 'party_number', ece_rules_pkg.g_party_number);
2055: end if;
2056:
2057: /* hgandiko1
2050: ec_debug.pl (3, 'l_addr_alt', l_addr_alt);
2051: ec_debug.pl (3, 'l_city', l_city);
2052: ec_debug.pl (3, 'l_zip', l_zip);
2053: ec_debug.pl (3, 'party_name', ece_rules_pkg.g_party_name);
2054: ec_debug.pl (3, 'party_number', ece_rules_pkg.g_party_number);
2055: end if;
2056:
2057: /* hgandiko1
2058: ec_debug.pl (3, 'l_tp_translator_code', l_tp_translator_code);
2124: (nvl(upper(g_address_tbl(k).address_line2),' ')= nvl(UPPER(l_addr2),' ')) AND
2125: (nvl(upper(g_address_tbl(k).address_line3),' ')= nvl(UPPER(l_addr3),' ')) AND
2126: (nvl(upper(g_address_tbl(k).city),' ')= nvl(UPPER(l_city),' ')) AND
2127: (nvl(upper(g_address_tbl(k).zip),' ')= nvl(UPPER(l_zip),' ')) AND
2128: (nvl(upper(g_address_tbl(k).tp_location_name),' ')= nvl(UPPER(ece_rules_pkg.g_party_name),' ')) AND
2129: (nvl(upper(g_address_tbl(k).tp_translator_code),' ')= nvl(UPPER(ece_rules_pkg.g_party_number),' '))
2130: THEN
2131:
2132: if (l_org_id is null) OR (nvl(l_org_id,-99) = g_address_tbl(k).org_id) --3608171
2125: (nvl(upper(g_address_tbl(k).address_line3),' ')= nvl(UPPER(l_addr3),' ')) AND
2126: (nvl(upper(g_address_tbl(k).city),' ')= nvl(UPPER(l_city),' ')) AND
2127: (nvl(upper(g_address_tbl(k).zip),' ')= nvl(UPPER(l_zip),' ')) AND
2128: (nvl(upper(g_address_tbl(k).tp_location_name),' ')= nvl(UPPER(ece_rules_pkg.g_party_name),' ')) AND
2129: (nvl(upper(g_address_tbl(k).tp_translator_code),' ')= nvl(UPPER(ece_rules_pkg.g_party_number),' '))
2130: THEN
2131:
2132: if (l_org_id is null) OR (nvl(l_org_id,-99) = g_address_tbl(k).org_id) --3608171
2133: then
2548: g_process_rule, l_document_number, l_msg_text);
2549:
2550: xProgress := 'ECERULEB-130-1590';
2551: if ec_debug.G_debug_level >= 2 then
2552: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
2553: end if;
2554:
2555: EXCEPTION
2556: WHEN addr_unexp_error then
2555: EXCEPTION
2556: WHEN addr_unexp_error then
2557: ec_debug.pl (0, 'EC', 'ECE_ADDR_UNEXP_ERROR',
2558: 'ADDRESS', p_address);
2559: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
2560: raise ec_utils.program_exit;
2561:
2562: WHEN stack_variable_not_found then
2563: ec_debug.pl (0, 'EC', 'ECE_VARIABLE_NOT_ON_STACK',
2561:
2562: WHEN stack_variable_not_found then
2563: ec_debug.pl (0, 'EC', 'ECE_VARIABLE_NOT_ON_STACK',
2564: 'VARIABLE_NAME', 'I_ADDRESS_TYPE');
2565: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
2566: raise ec_utils.program_exit;
2567:
2568: WHEN no_addr_rule_info then
2569: if (c_addr_rule%ISOPEN) then
2571: end if;
2572: ec_debug.pl (0, 'EC', 'ECE_NO_PROCESS_RULE',
2573: 'TRANSACTION_TYPE', l_transaction_type,
2574: 'RULE_TYPE', l_rule_type);
2575: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
2576: raise ec_utils.program_exit;
2577:
2578: WHEN OTHERS THEN
2579: if (c_addr_rule%ISOPEN) then
2580: close c_addr_rule;
2581: end if;
2582: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
2583: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
2584: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_GET_ADDRESS_INFO');
2585: raise ec_utils.program_exit;
2586:
2587: END Validate_Get_Address_Info;
2588:
2617: BEGIN
2618:
2619: xProgress := 'ECERULEB-140-1000';
2620: if ec_debug.G_debug_level >= 2 then
2621: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SHIP_TO_ADDRESS');
2622: end if;
2623: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
2624:
2625: if (l_action_code <> g_disabled and l_ignore_flag = 'N') then
2747: end if;
2748:
2749: xProgress := 'ECERULEB-140-1160';
2750: if ec_debug.G_debug_level >= 2 then
2751: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_ADDRESS');
2752: end if;
2753:
2754: EXCEPTION
2755: WHEN ec_utils.program_exit then
2752: end if;
2753:
2754: EXCEPTION
2755: WHEN ec_utils.program_exit then
2756: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_ADDRESS');
2757: raise;
2758:
2759: WHEN OTHERS THEN
2760: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
2758:
2759: WHEN OTHERS THEN
2760: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
2761: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
2762: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_ADDRESS');
2763: raise ec_utils.program_exit;
2764:
2765: END Validate_Ship_To_Address;
2766:
2795: BEGIN
2796:
2797: xProgress := 'ECERULEB-150-1000';
2798: if ec_debug.G_debug_level >= 2 then
2799: ec_debug.push ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2800: end if;
2801:
2802: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
2803:
2922: end if;
2923:
2924: xProgress := 'ECERULEB-150-1160';
2925: if ec_debug.G_debug_level >= 2 then
2926: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2927: end if;
2928: EXCEPTION
2929: WHEN ec_utils.program_exit then
2930: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2926: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2927: end if;
2928: EXCEPTION
2929: WHEN ec_utils.program_exit then
2930: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2931: raise;
2932:
2933: WHEN OTHERS THEN
2934: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
2932:
2933: WHEN OTHERS THEN
2934: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
2935: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
2936: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_ADDRESS');
2937: raise ec_utils.program_exit;
2938:
2939: END Validate_Bill_To_Address;
2940:
2969: BEGIN
2970:
2971: xProgress := 'ECERULEB-230-1000';
2972: if ec_debug.G_debug_level >= 2 then
2973: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SOLD_TO_ADDRESS');
2974: end if;
2975:
2976: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
2977:
3100: end if;
3101:
3102: xProgress := 'ECERULEB-230-1160';
3103: if ec_debug.G_debug_level >= 2 then
3104: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SOLD_TO_ADDRESS');
3105: end if;
3106:
3107: EXCEPTION
3108: WHEN ec_utils.program_exit then
3105: end if;
3106:
3107: EXCEPTION
3108: WHEN ec_utils.program_exit then
3109: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SOLD_TO_ADDRESS');
3110: raise;
3111:
3112: WHEN OTHERS THEN
3113: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3111:
3112: WHEN OTHERS THEN
3113: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3114: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3115: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SOLD_TO_ADDRESS');
3116: raise ec_utils.program_exit;
3117:
3118: END Validate_Sold_To_Address;
3119:
3147: BEGIN
3148:
3149: xProgress := 'ECERULEB-160-1000';
3150: if ec_debug.G_debug_level >= 2 then
3151: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_ADDRESS');
3152: end if;
3153:
3154: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3155:
3265: end if;
3266:
3267: xProgress := 'ECERULEB-160-1160';
3268: if ec_debug.G_debug_level >= 2 then
3269: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_ADDRESS');
3270: end if;
3271:
3272: EXCEPTION
3273: WHEN ec_utils.program_exit then
3270: end if;
3271:
3272: EXCEPTION
3273: WHEN ec_utils.program_exit then
3274: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_ADDRESS');
3275: raise;
3276:
3277: WHEN OTHERS THEN
3278: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3276:
3277: WHEN OTHERS THEN
3278: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3279: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3280: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_ADDRESS');
3281: raise ec_utils.program_exit;
3282:
3283: END Validate_Ship_From_Address;
3284:
3313: BEGIN
3314:
3315: xProgress := 'ECERULEB-170-1000';
3316: if ec_debug.G_debug_level >= 2 then
3317: ec_debug.push ('ECE_RULES_PKG.VALIDATE_BILL_FROM_ADDRESS');
3318: end if;
3319:
3320: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3321:
3431: end if;
3432:
3433: xProgress := 'ECERULEB-170-1160';
3434: if ec_debug.G_debug_level >= 2 then
3435: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_ADDRESS');
3436: end if;
3437:
3438: EXCEPTION
3439: WHEN ec_utils.program_exit then
3436: end if;
3437:
3438: EXCEPTION
3439: WHEN ec_utils.program_exit then
3440: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_ADDRESS');
3441: raise;
3442:
3443: WHEN OTHERS THEN
3444: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3442:
3443: WHEN OTHERS THEN
3444: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3445: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3446: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_ADDRESS');
3447: raise ec_utils.program_exit;
3448:
3449: END Validate_Bill_From_Address;
3450:
3479: BEGIN
3480:
3481: xProgress := 'ECERULEB-240-1000';
3482: if ec_debug.G_debug_level >= 2 then
3483: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INTRMD_ADD');
3484: end if;
3485:
3486: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3487:
3596: end if;
3597:
3598: xProgress := 'ECERULEB-240-1160';
3599: if ec_debug.G_debug_level >= 2 then
3600: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INTRMD_ADD');
3601: end if;
3602:
3603: EXCEPTION
3604: WHEN ec_utils.program_exit then
3601: end if;
3602:
3603: EXCEPTION
3604: WHEN ec_utils.program_exit then
3605: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INTRMD_ADD');
3606: raise;
3607:
3608: WHEN OTHERS THEN
3609: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3607:
3608: WHEN OTHERS THEN
3609: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3610: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3611: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INTRMD_ADD');
3612: raise ec_utils.program_exit;
3613:
3614: END Validate_Ship_To_Intrmd_Add;
3615:
3643: BEGIN
3644:
3645: xProgress := 'ECERULEB-180-1000';
3646: if ec_debug.G_debug_level >= 2 then
3647: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INT_ADDRESS');
3648: end if;
3649:
3650: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3651:
3749: end if;
3750:
3751: xProgress := 'ECERULEB-180-1160';
3752: if ec_debug.G_debug_level >= 2 then
3753: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INT_ADDRESS');
3754: end if;
3755:
3756: EXCEPTION
3757: WHEN ec_utils.program_exit then
3754: end if;
3755:
3756: EXCEPTION
3757: WHEN ec_utils.program_exit then
3758: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INT_ADDRESS');
3759: raise;
3760:
3761: WHEN OTHERS THEN
3762: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3760:
3761: WHEN OTHERS THEN
3762: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3763: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3764: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_TO_INT_ADDRESS');
3765: raise ec_utils.program_exit;
3766:
3767: END Validate_Ship_To_Int_Address;
3768:
3797: BEGIN
3798:
3799: xProgress := 'ECERULEB-190-1000';
3800: if ec_debug.G_debug_level >= 2 then
3801: ec_debug.push ('ECE_RULES_PKG.VALIDATE_BILL_TO_INT_ADDRESS');
3802: end if;
3803:
3804: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3805:
3903: end if;
3904:
3905: xProgress := 'ECERULEB-190-1160';
3906: if ec_debug.G_debug_level >= 2 then
3907: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_INT_ADDRESS');
3908: end if;
3909:
3910: EXCEPTION
3911: WHEN ec_utils.program_exit then
3908: end if;
3909:
3910: EXCEPTION
3911: WHEN ec_utils.program_exit then
3912: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_INT_ADDRESS');
3913: raise;
3914:
3915: WHEN OTHERS THEN
3916: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3914:
3915: WHEN OTHERS THEN
3916: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
3917: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
3918: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_TO_INT_ADDRESS');
3919: raise ec_utils.program_exit;
3920:
3921: END Validate_Bill_To_Int_Address;
3922:
3952:
3953: xProgress := 'ECERULEB-200-1000';
3954:
3955: if ec_debug.G_debug_level >= 2 then
3956: ec_debug.push ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
3957: end if;
3958:
3959: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
3960:
4069: end if;
4070:
4071: xProgress := 'ECERULEB-200-1160';
4072: if ec_debug.G_debug_level >= 2 then
4073: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
4074: end if;
4075: EXCEPTION
4076: WHEN ec_utils.program_exit then
4077: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
4073: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
4074: end if;
4075: EXCEPTION
4076: WHEN ec_utils.program_exit then
4077: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
4078: raise;
4079:
4080: WHEN OTHERS THEN
4081: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
4079:
4080: WHEN OTHERS THEN
4081: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
4082: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
4083: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_SHIP_FROM_INT_ADDRESS');
4084: raise ec_utils.program_exit;
4085:
4086: END Validate_Ship_From_Int_Address;
4087:
4116: BEGIN
4117:
4118: xProgress := 'ECERULEB-210-1000';
4119: if ec_debug.G_debug_level >= 2 then
4120: ec_debug.push ('ECE_RULES_PKG.VALIDATE_BILL_FROM_INT_ADDRESS');
4121: end if;
4122:
4123: Get_Action_Ignore_Flag (l_action_code, l_ignore_flag);
4124:
4223: end if;
4224:
4225: xProgress := 'ECERULEB-210-1160';
4226: if ec_debug.G_debug_level >= 2 then
4227: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_INT_ADDRESS');
4228: end if;
4229:
4230: EXCEPTION
4231: WHEN ec_utils.program_exit then
4228: end if;
4229:
4230: EXCEPTION
4231: WHEN ec_utils.program_exit then
4232: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_INT_ADDRESS');
4233: raise;
4234:
4235: WHEN OTHERS THEN
4236: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
4234:
4235: WHEN OTHERS THEN
4236: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
4237: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
4238: ec_debug.pop ('ECE_RULES_PKG.VALIDATE_BILL_FROM_INT_ADDRESS');
4239: raise ec_utils.program_exit;
4240:
4241: END Validate_Bill_From_Int_Address;
4242:
4317: violation_level = l_violation_level;
4318:
4319: BEGIN
4320: if ec_debug.G_debug_level >= 2 then
4321: ec_debug.push ('ECE_RULES_PKG.GET_ACTION_IGNORE_FLAG');
4322: ec_debug.pl (3, 'g_transaction_type', ec_utils.g_transaction_type);
4323: ec_debug.pl (3, 'g_document_id', ec_utils.g_document_id);
4324: end if;
4325:
4351:
4352: if ec_debug.G_debug_level >= 2 then
4353: ec_debug.pl (3, 'ignore_flag', x_ignore_flag);
4354:
4355: ec_debug.pop ('ECE_RULES_PKG.GET_ACTION_IGNORE_FLAG');
4356: end if;
4357:
4358: EXCEPTION
4359: WHEN no_process_rule_info then
4362: end if;
4363: ec_debug.pl (0, 'EC', 'ECE_NO_PROCESS_RULE',
4364: 'TRANSACTION_TYPE', ec_utils.g_transaction_type,
4365: 'RULE_TYPE', l_rule_type);
4366: ec_debug.pop ('ECE_RULES_PKG.GET_ACTION_IGNORE_FLAG');
4367: raise ec_utils.program_exit;
4368:
4369: WHEN OTHERS THEN
4370: if (c_rule_info%ISOPEN) then
4374: close c_ignore_flag;
4375: end if;
4376: ec_debug.pl (0, 'EC', 'ECE_PROGRAM_ERROR','PROGRESS_LEVEL', xProgress);
4377: ec_debug.pl (0, 'EC', 'ECE_ERROR_MESSAGE', 'ERROR_MESSAGE', SQLERRM);
4378: ec_debug.pop ('ECE_RULES_PKG.GET_ACTION_IGNORE_FLAG');
4379: raise ec_utils.program_exit;
4380:
4381: END Get_Action_Ignore_Flag;
4382:
4380:
4381: END Get_Action_Ignore_Flag;
4382:
4383:
4384: END ECE_RULES_PKG;