35: PAY_BALANCE_TYPES
36: PAY_BALANCE_CLASSIFCIATIONS
37: PAY_DEFINED_BALANCES
38: --
39: Uses : hr_utility
40: Used By : n/a
41: --
42: Test List
43: ---------
145: */
146: --
147: BEGIN
148: --
149: hr_utility.set_location('ins_application_ownership', 1);
150: --
151: if p_input_value_id is null then
152: -- We want the balance feed to inherit the ownership of the balance type
153: --
161: AND ao.key_value = to_char(p_balance_type_id);
162: --
163: elsif p_balance_type_id is null then
164: --
165: hr_utility.set_location('ins_application_ownership', 2);
166: --
167: INSERT INTO hr_application_ownerships
168: (KEY_NAME,PRODUCT_NAME,KEY_VALUE)
169: SELECT 'BALANCE_FEED_ID',
751: --
752: -- When payroll element created, pay value input value created, create feeds
753: -- for all balances associated with primary classification.
754: --
755: hr_utility.set_location('ins_balance_feed', 1);
756: --
757: IF p_option = 'INS_PAY_PAY_VALUE' THEN
758: --
759: hr_utility.set_location('INS_PAY_PAY_VALUE', 1);
755: hr_utility.set_location('ins_balance_feed', 1);
756: --
757: IF p_option = 'INS_PAY_PAY_VALUE' THEN
758: --
759: hr_utility.set_location('INS_PAY_PAY_VALUE', 1);
760: --
761: IF (p_input_value_id is not NULL AND
762: p_primary_classification_id is not NULL AND
763: p_session_date is not NULL AND
765: p_mode is not NULL) THEN
766: --
767: -- Lock all relevant records.
768: --
769: hr_utility.set_location('INS_PAY_PAY_VALUE', 2);
770: --
771: FOR lock_rec IN cur_get_pay_pay_value LOOP
772: NULL;
773: END LOOP;
773: END LOOP;
774: --
775: -- Check for overlap.
776: --
777: hr_utility.set_location('INS_PAY_PAY_VALUE', 3);
778: --
779: OPEN cur_check_pay_pay_value;
780: FETCH cur_check_pay_pay_value INTO v_feed;
781: --
779: OPEN cur_check_pay_pay_value;
780: FETCH cur_check_pay_pay_value INTO v_feed;
781: --
782: IF cur_check_pay_pay_value%FOUND THEN
783: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
784: hr_utility.raise_error;
785: --
786: END IF;
787: CLOSE cur_check_pay_pay_value;
780: FETCH cur_check_pay_pay_value INTO v_feed;
781: --
782: IF cur_check_pay_pay_value%FOUND THEN
783: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
784: hr_utility.raise_error;
785: --
786: END IF;
787: CLOSE cur_check_pay_pay_value;
788: --
785: --
786: END IF;
787: CLOSE cur_check_pay_pay_value;
788: --
789: hr_utility.set_location('INS_PAY_PAY_VALUE', 4);
790: --
791: FOR get_rec IN cur_get_pay_pay_value LOOP
792: --
793: INSERT INTO pay_balance_feeds_f
829: END LOOP;
830: --
831: ELSE
832: --
833: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
834: hr_utility.raise_error;
835: --
836: END IF;
837: --
830: --
831: ELSE
832: --
833: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
834: hr_utility.raise_error;
835: --
836: END IF;
837: --
838: -- When pay value input value created for personnel element, create feeds
839: -- for primary and sub classifications for associated balances.
840: --
841: ELSIF p_option = 'INS_PER_PAY_VALUE' THEN
842: --
843: hr_utility.set_location('INS_PER_PAY_VALUE', 1);
844: --
845: IF (p_input_value_id is not NULL AND
846: p_primary_classification_id is not NULL AND
847: p_session_date is not NULL AND
851: -- Insert against primary classifications
852: --
853: -- Lock all relevant records.
854: --
855: hr_utility.set_location('INS_PER_PAY_VALUE', 2);
856: --
857: FOR lock_rec IN cur_get_per_pay_value_prim LOOP
858: NULL;
859: END LOOP;
859: END LOOP;
860: --
861: -- Check for overlap.
862: --
863: hr_utility.set_location('INS_PER_PAY_VALUE', 3);
864: --
865: OPEN cur_check_per_pay_value_prim;
866: FETCH cur_check_per_pay_value_prim INTO v_feed;
867: --
865: OPEN cur_check_per_pay_value_prim;
866: FETCH cur_check_per_pay_value_prim INTO v_feed;
867: --
868: IF cur_check_per_pay_value_prim%FOUND THEN
869: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
870: hr_utility.raise_error;
871: --
872: END IF;
873: CLOSE cur_check_per_pay_value_prim;
866: FETCH cur_check_per_pay_value_prim INTO v_feed;
867: --
868: IF cur_check_per_pay_value_prim%FOUND THEN
869: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
870: hr_utility.raise_error;
871: --
872: END IF;
873: CLOSE cur_check_per_pay_value_prim;
874: --
871: --
872: END IF;
873: CLOSE cur_check_per_pay_value_prim;
874: --
875: hr_utility.set_location('INS_PER_PAY_VALUE', 4);
876: --
877: FOR get_rec IN cur_get_per_pay_value_prim LOOP
878: --
879: INSERT INTO pay_balance_feeds_f
919: -- Insert against sub classifications
920: --
921: -- Lock all relevant records.
922: --
923: hr_utility.set_location('INS_PER_PAY_VALUE', 5);
924: --
925: FOR lock_rec IN cur_get_per_pay_value_sub LOOP
926: NULL;
927: END LOOP;
927: END LOOP;
928: --
929: -- Check for overlap.
930: --
931: hr_utility.set_location('INS_PER_PAY_VALUE', 6);
932: --
933: OPEN cur_check_per_pay_value_sub;
934: FETCH cur_check_per_pay_value_sub INTO v_feed;
935: --
933: OPEN cur_check_per_pay_value_sub;
934: FETCH cur_check_per_pay_value_sub INTO v_feed;
935: --
936: IF cur_check_per_pay_value_sub%FOUND THEN
937: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
938: hr_utility.raise_error;
939: --
940: END IF;
941: CLOSE cur_check_per_pay_value_sub;
934: FETCH cur_check_per_pay_value_sub INTO v_feed;
935: --
936: IF cur_check_per_pay_value_sub%FOUND THEN
937: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
938: hr_utility.raise_error;
939: --
940: END IF;
941: CLOSE cur_check_per_pay_value_sub;
942: --
939: --
940: END IF;
941: CLOSE cur_check_per_pay_value_sub;
942: --
943: hr_utility.set_location('INS_PER_PAY_VALUE', 7);
944: --
945: FOR get_rec IN cur_get_per_pay_value_sub LOOP
946: --
947: INSERT INTO pay_balance_feeds_f
983: END LOOP;
984: --
985: ELSE
986: --
987: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
988: hr_utility.raise_error;
989: --
990: END IF;
991: --
984: --
985: ELSE
986: --
987: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
988: hr_utility.raise_error;
989: --
990: END IF;
991: --
992: -- Manually create a balance feed against primary clasification and selected
993: -- balance.
994: --
995: ELSIF p_option = 'INS_MANUAL_FEED' THEN
996: --
997: hr_utility.set_location('INS_MANUAL_FEED', 1);
998: --
999: IF (p_input_value_id is not NULL AND
1000: p_balance_type_id is not NULL AND
1001: p_scale is not NULL AND
1002: p_mode is not NULL) THEN
1003: --
1004: -- Lock all relevant records.
1005: --
1006: hr_utility.set_location('INS_MANUAL_FEED', 2);
1007: --
1008: FOR lock_rec IN cur_lock_manual_feed LOOP
1009: NULL;
1010: END LOOP;
1010: END LOOP;
1011: --
1012: -- Check for overlap.
1013: --
1014: hr_utility.set_location('INS_MANUAL_FEED', 3);
1015: --
1016: OPEN cur_check_manual_feed;
1017: FETCH cur_check_manual_feed INTO v_feed;
1018: --
1016: OPEN cur_check_manual_feed;
1017: FETCH cur_check_manual_feed INTO v_feed;
1018: --
1019: IF cur_check_manual_feed%FOUND THEN
1020: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1021: hr_utility.raise_error;
1022: --
1023: END IF;
1024: CLOSE cur_check_manual_feed;
1017: FETCH cur_check_manual_feed INTO v_feed;
1018: --
1019: IF cur_check_manual_feed%FOUND THEN
1020: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1021: hr_utility.raise_error;
1022: --
1023: END IF;
1024: CLOSE cur_check_manual_feed;
1025: --
1024: CLOSE cur_check_manual_feed;
1025: --
1026: IF p_session_date is not NULL THEN
1027: --
1028: hr_utility.set_location('INS_MANUAL_FEED', 4);
1029: --
1030: SELECT pay_balance_feeds_s.nextval
1031: INTO v_sequence
1032: FROM sys.dual;
1085: END IF;
1086: --
1087: ELSE
1088: --
1089: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1090: hr_utility.raise_error;
1091: --
1092: END IF;
1093: --
1086: --
1087: ELSE
1088: --
1089: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1090: hr_utility.raise_error;
1091: --
1092: END IF;
1093: --
1094: -- On adding sub classication rule to an element, create balance feeds for
1095: -- the pay value against all balances feed by classification.
1096: --
1097: ELSIF p_option = 'INS_SUB_CLASS_RULE' THEN
1098: --
1099: hr_utility.set_location('INS_SUB_CLASS_RULE', 1);
1100: --
1101: IF (p_sub_classification_rule_id is not NULL AND
1102: p_session_date is not NULL AND
1103: p_legislation_code is not NULL AND
1106: v_pay_value := hr_input_values.get_pay_value_name(p_legislation_code);
1107: --
1108: -- Lock all relevant records.
1109: --
1110: hr_utility.set_location('INS_SUB_CLASS_RULE', 2);
1111: --
1112: FOR lock_rec IN cur_lock_sub_class_rule LOOP
1113: NULL;
1114: END LOOP;
1112: FOR lock_rec IN cur_lock_sub_class_rule LOOP
1113: NULL;
1114: END LOOP;
1115: --
1116: hr_utility.set_location('INS_SUB_CLASS_RULE', 3);
1117: --
1118: OPEN cur_check_sub_class_rule;
1119: FETCH cur_check_sub_class_rule INTO v_feed;
1120: --
1118: OPEN cur_check_sub_class_rule;
1119: FETCH cur_check_sub_class_rule INTO v_feed;
1120: --
1121: IF cur_check_sub_class_rule%FOUND THEN
1122: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1123: hr_utility.raise_error;
1124: --
1125: END IF;
1126: CLOSE cur_check_sub_class_rule;
1119: FETCH cur_check_sub_class_rule INTO v_feed;
1120: --
1121: IF cur_check_sub_class_rule%FOUND THEN
1122: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1123: hr_utility.raise_error;
1124: --
1125: END IF;
1126: CLOSE cur_check_sub_class_rule;
1127: --
1124: --
1125: END IF;
1126: CLOSE cur_check_sub_class_rule;
1127: --
1128: hr_utility.set_location('INS_SUB_CLASS_RULE', 4);
1129: --
1130: FOR iv_rec IN cur_iv_sub_class_rule LOOP
1131: --
1132: hr_utility.set_location('INS_SUB_CLASS_RULE', 5);
1128: hr_utility.set_location('INS_SUB_CLASS_RULE', 4);
1129: --
1130: FOR iv_rec IN cur_iv_sub_class_rule LOOP
1131: --
1132: hr_utility.set_location('INS_SUB_CLASS_RULE', 5);
1133: --
1134: FOR bt_rec IN cur_bt_sub_class_rule
1135: (iv_rec.a_uom, iv_rec.a_output_currency_code) LOOP
1136: --
1133: --
1134: FOR bt_rec IN cur_bt_sub_class_rule
1135: (iv_rec.a_uom, iv_rec.a_output_currency_code) LOOP
1136: --
1137: hr_utility.set_location('INS_SUB_CLASS_RULE', 6);
1138: --
1139: INSERT INTO pay_balance_feeds_f
1140: (balance_feed_id,
1141: effective_start_date,
1178: END LOOP;
1179: --
1180: ELSE
1181: --
1182: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1183: hr_utility.raise_error;
1184: --
1185: END IF;
1186: --
1179: --
1180: ELSE
1181: --
1182: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1183: hr_utility.raise_error;
1184: --
1185: END IF;
1186: --
1187: -- When balance classification created feeds for all elements with pay value
1188: -- input values associated with classification (primary or sub).
1189: --
1190: ELSIF p_option = 'INS_PRIMARY_BAL_CLASS' THEN
1191: --
1192: hr_utility.set_location('INS_PRIMARY_BAL_CLASS', 1);
1193: --
1194: IF (p_primary_classification_id is not NULL AND
1195: p_balance_type_id is not NULL AND
1196: p_scale is not NULL AND
1201: v_pay_value := hr_input_values.get_pay_value_name(p_legislation_code);
1202: --
1203: -- Lock all relevant records.
1204: --
1205: hr_utility.set_location('INS_PRIMARY_BAL_CLASS', 2);
1206: --
1207: FOR lock_rec IN cur_lock_primary_bal_class LOOP
1208: NULL;
1209: END LOOP;
1207: FOR lock_rec IN cur_lock_primary_bal_class LOOP
1208: NULL;
1209: END LOOP;
1210: --
1211: hr_utility.set_location('INS_PRIMARY_BAL_CLASS', 3);
1212: --
1213: OPEN cur_check_primary_bal_class;
1214: FETCH cur_check_primary_bal_class INTO v_feed;
1215: --
1213: OPEN cur_check_primary_bal_class;
1214: FETCH cur_check_primary_bal_class INTO v_feed;
1215: --
1216: IF cur_check_primary_bal_class%FOUND THEN
1217: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1218: hr_utility.raise_error;
1219: --
1220: END IF;
1221: CLOSE cur_check_primary_bal_class;
1214: FETCH cur_check_primary_bal_class INTO v_feed;
1215: --
1216: IF cur_check_primary_bal_class%FOUND THEN
1217: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1218: hr_utility.raise_error;
1219: --
1220: END IF;
1221: CLOSE cur_check_primary_bal_class;
1222: --
1219: --
1220: END IF;
1221: CLOSE cur_check_primary_bal_class;
1222: --
1223: hr_utility.set_location('INS_PRIMARY_BAL_CLASS', 4);
1224: --
1225: <
1226: FOR iv_rec IN cur_iv_primary_bal_class LOOP
1227: --
1272: END LOOP bal_loop;
1273: --
1274: ELSE
1275: --
1276: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1277: hr_utility.raise_error;
1278: --
1279: END IF;
1280: --
1273: --
1274: ELSE
1275: --
1276: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1277: hr_utility.raise_error;
1278: --
1279: END IF;
1280: --
1281: ELSIF p_option = 'INS_SUB_BAL_CLASS' THEN
1279: END IF;
1280: --
1281: ELSIF p_option = 'INS_SUB_BAL_CLASS' THEN
1282: --
1283: hr_utility.set_location('INS_SUB_BAL_CLASS', 1);
1284: --
1285: IF (p_sub_classification_id is not NULL AND
1286: p_balance_type_id is not NULL AND
1287: p_scale is not NULL AND
1293: l_new_end_date := NULL;
1294: --
1295: -- Lock all relevant records.
1296: --
1297: hr_utility.set_location('INS_SUB_BAL_CLASS', 2);
1298: --
1299: FOR lock_rec IN cur_lock_sub_bal_class LOOP
1300: NULL;
1301: END LOOP;
1299: FOR lock_rec IN cur_lock_sub_bal_class LOOP
1300: NULL;
1301: END LOOP;
1302: --
1303: hr_utility.set_location('INS_SUB_BAL_CLASS', 3);
1304: --
1305: for feed_rec in cur_check_sub_bal_class loop
1306: --
1307: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1303: hr_utility.set_location('INS_SUB_BAL_CLASS', 3);
1304: --
1305: for feed_rec in cur_check_sub_bal_class loop
1306: --
1307: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1308: hr_utility.raise_error;
1309: --
1310: end loop;
1311: --
1304: --
1305: for feed_rec in cur_check_sub_bal_class loop
1306: --
1307: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1308: hr_utility.raise_error;
1309: --
1310: end loop;
1311: --
1312: hr_utility.set_location('INS_SUB_BAL_CLASS', 4);
1308: hr_utility.raise_error;
1309: --
1310: end loop;
1311: --
1312: hr_utility.set_location('INS_SUB_BAL_CLASS', 4);
1313: --
1314: FOR iv_rec IN cur_iv_sub_bal_class LOOP
1315: --
1316: SELECT pay_balance_feeds_s.nextval
1358: END LOOP;
1359: --
1360: ELSE
1361: --
1362: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1363: hr_utility.raise_error;
1364: --
1365: END IF;
1366: --
1359: --
1360: ELSE
1361: --
1362: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1363: hr_utility.raise_error;
1364: --
1365: END IF;
1366: --
1367: -- This is very similar to INS_MANUAL_FEED, except the data mode (i.e. generic
1369: -- null BG and user data has null LEG_CODE and not null BG), is determined
1370: -- by the data mode of the balance_type_id rather than the input_valud_id.
1371: --
1372: ELSIF p_option = 'INS_PRIMARY_BALANCE_FEED' THEN
1373: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 1);
1374: --
1375: IF (p_input_value_id is not NULL AND
1376: p_balance_type_id is not NULL AND
1377: p_scale is not NULL AND
1378: p_mode is not NULL) THEN
1379: --
1380: -- Lock all relevant records.
1381: --
1382: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 2);
1383: --
1384: FOR lock_rec IN cur_lock_manual_feed LOOP
1385: NULL;
1386: END LOOP;
1386: END LOOP;
1387: --
1388: -- Check for overlap.
1389: --
1390: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 3);
1391: --
1392: OPEN cur_check_manual_feed;
1393: FETCH cur_check_manual_feed INTO v_feed;
1394: --
1392: OPEN cur_check_manual_feed;
1393: FETCH cur_check_manual_feed INTO v_feed;
1394: --
1395: IF cur_check_manual_feed%FOUND THEN
1396: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1397: hr_utility.raise_error;
1398: --
1399: END IF;
1400: CLOSE cur_check_manual_feed;
1393: FETCH cur_check_manual_feed INTO v_feed;
1394: --
1395: IF cur_check_manual_feed%FOUND THEN
1396: hr_utility.set_message (801,'HR_6185_BAL_FEED_EXISTS');
1397: hr_utility.raise_error;
1398: --
1399: END IF;
1400: CLOSE cur_check_manual_feed;
1401: --
1400: CLOSE cur_check_manual_feed;
1401: --
1402: IF p_session_date is not NULL THEN
1403: --
1404: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 4);
1405: --
1406: SELECT pay_balance_feeds_s.nextval
1407: INTO v_sequence
1408: FROM sys.dual;
1406: SELECT pay_balance_feeds_s.nextval
1407: INTO v_sequence
1408: FROM sys.dual;
1409: --
1410: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 5);
1411: --
1412: INSERT INTO pay_balance_feeds_f
1413: (balance_feed_id,
1414: effective_start_date,
1454: , bt.business_group_id, bt.legislation_code
1455: , bt.legislation_subgroup, bt.last_updated_by
1456: , bt.last_update_login, bt.created_by;
1457: --
1458: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 6);
1459: --
1460: IF p_mode <> 'USER' THEN
1461: ins_application_ownership(v_sequence,
1462: NULL,
1461: ins_application_ownership(v_sequence,
1462: NULL,
1463: p_balance_type_id);
1464: END IF;
1465: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 7);
1466: --
1467: END IF;
1468: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 8);
1469: --
1464: END IF;
1465: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 7);
1466: --
1467: END IF;
1468: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 8);
1469: --
1470: ELSE
1471: --
1472: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 9);
1468: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 8);
1469: --
1470: ELSE
1471: --
1472: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 9);
1473: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1474: hr_utility.raise_error;
1475: --
1476: END IF;
1469: --
1470: ELSE
1471: --
1472: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 9);
1473: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1474: hr_utility.raise_error;
1475: --
1476: END IF;
1477: --
1470: ELSE
1471: --
1472: hr_utility.set_location('INS_PRIMARY_BALANCE_FEED', 9);
1473: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1474: hr_utility.raise_error;
1475: --
1476: END IF;
1477: --
1478: END IF;
1500: v_pay_value varchar2(80);
1501: --
1502: BEGIN
1503: --
1504: hr_utility.set_location('upd_balance_feed', 1);
1505: --
1506: IF p_option = 'UPD_MANUAL_FEED' THEN
1507: --
1508: hr_utility.set_location('UPD_MANUAL_FEED', 1);
1504: hr_utility.set_location('upd_balance_feed', 1);
1505: --
1506: IF p_option = 'UPD_MANUAL_FEED' THEN
1507: --
1508: hr_utility.set_location('UPD_MANUAL_FEED', 1);
1509: --
1510: IF (p_balance_feed_id is not NULL AND
1511: p_scale is not NULL) THEN
1512: --
1515: WHERE balance_feed_id = p_balance_feed_id;
1516: --
1517: ELSE
1518: --
1519: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1520: hr_utility.raise_error;
1521: --
1522: END IF;
1523: --
1516: --
1517: ELSE
1518: --
1519: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1520: hr_utility.raise_error;
1521: --
1522: END IF;
1523: --
1524: ELSIF p_option = 'UPD_PRIMARY_BAL_CLASS' THEN
1522: END IF;
1523: --
1524: ELSIF p_option = 'UPD_PRIMARY_BAL_CLASS' THEN
1525: --
1526: hr_utility.set_location('UPD_PRIMARY_BAL_CLASS', 1);
1527: --
1528: IF (p_primary_classification_id is not NULL AND
1529: p_balance_type_id is not NULL AND
1530: p_scale is not NULL AND
1545: AND iv.name = 'Pay Value');
1546: --
1547: ELSE
1548: --
1549: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1550: hr_utility.raise_error;
1551: --
1552: END IF;
1553: --
1546: --
1547: ELSE
1548: --
1549: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1550: hr_utility.raise_error;
1551: --
1552: END IF;
1553: --
1554: ELSIF p_option = 'UPD_SUB_BAL_CLASS' THEN
1552: END IF;
1553: --
1554: ELSIF p_option = 'UPD_SUB_BAL_CLASS' THEN
1555: --
1556: hr_utility.set_location('UPD_SUB_BAL_CLASS', 1);
1557: --
1558: IF (p_sub_classification_id is not NULL AND
1559: p_balance_type_id is not NULL AND
1560: p_scale is not NULL AND
1579: <= scr.effective_end_date);
1580: --
1581: ELSE
1582: --
1583: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1584: hr_utility.raise_error;
1585: --
1586: END IF;
1587: --
1580: --
1581: ELSE
1582: --
1583: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1584: hr_utility.raise_error;
1585: --
1586: END IF;
1587: --
1588: END IF;
1623: when NO_DATA_FOUND then NULL;
1624: end;
1625: --
1626: if l_balance_name is not NULL then
1627: hr_utility.set_message(801, 'PAY_6608_BAL_NO_BF_DEL');
1628: hr_utility.set_message_token('BALANCE', l_balance_name);
1629: hr_utility.raise_error;
1630: end if;
1631: --
1624: end;
1625: --
1626: if l_balance_name is not NULL then
1627: hr_utility.set_message(801, 'PAY_6608_BAL_NO_BF_DEL');
1628: hr_utility.set_message_token('BALANCE', l_balance_name);
1629: hr_utility.raise_error;
1630: end if;
1631: --
1632: end chk_del_balance_feed;
1625: --
1626: if l_balance_name is not NULL then
1627: hr_utility.set_message(801, 'PAY_6608_BAL_NO_BF_DEL');
1628: hr_utility.set_message_token('BALANCE', l_balance_name);
1629: hr_utility.raise_error;
1630: end if;
1631: --
1632: end chk_del_balance_feed;
1633: --
1656: v_pay_value varchar(80);
1657: --
1658: BEGIN
1659: --
1660: hr_utility.set_location('del_balance_feed', 1);
1661: --
1662: IF p_option = 'DEL_MANUAL_FEED' THEN
1663: --
1664: hr_utility.set_location('DEL_MANUAL_FEED', 1);
1660: hr_utility.set_location('del_balance_feed', 1);
1661: --
1662: IF p_option = 'DEL_MANUAL_FEED' THEN
1663: --
1664: hr_utility.set_location('DEL_MANUAL_FEED', 1);
1665: --
1666: IF p_balance_feed_id is not NULL THEN
1667: IF p_delete_mode = 'ZAP' THEN
1668: --
1703: AND effective_start_date > p_session_date;
1704: --
1705: ELSE
1706: --
1707: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1708: hr_utility.raise_error;
1709: --
1710: END IF;
1711: --
1704: --
1705: ELSE
1706: --
1707: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1708: hr_utility.raise_error;
1709: --
1710: END IF;
1711: --
1712: ELSE
1710: END IF;
1711: --
1712: ELSE
1713: --
1714: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1715: hr_utility.raise_error;
1716: --
1717: END IF;
1718: --
1711: --
1712: ELSE
1713: --
1714: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1715: hr_utility.raise_error;
1716: --
1717: END IF;
1718: --
1719: ELSIF p_option = 'DEL_INPUT_VALUE' THEN
1717: END IF;
1718: --
1719: ELSIF p_option = 'DEL_INPUT_VALUE' THEN
1720: --
1721: hr_utility.set_location('DEL_INPUT_VALUE', 1);
1722: --
1723: IF p_input_value_id is not NULL THEN
1724: IF p_delete_mode = 'ZAP' THEN
1725: --
1751: ELSIF (p_delete_mode = 'DELETE_NEXT_CHANGE' AND
1752: p_effective_end_date is not NULL AND
1753: p_session_date is not NULL) then
1754: --
1755: hr_utility.trace(to_char(p_effective_end_date));
1756: hr_utility.trace(to_char(p_input_value_id));
1757: hr_utility.trace(to_char(p_session_date));
1758: --
1759: UPDATE pay_balance_feeds_f
1752: p_effective_end_date is not NULL AND
1753: p_session_date is not NULL) then
1754: --
1755: hr_utility.trace(to_char(p_effective_end_date));
1756: hr_utility.trace(to_char(p_input_value_id));
1757: hr_utility.trace(to_char(p_session_date));
1758: --
1759: UPDATE pay_balance_feeds_f
1760: SET effective_end_date = p_effective_end_date
1753: p_session_date is not NULL) then
1754: --
1755: hr_utility.trace(to_char(p_effective_end_date));
1756: hr_utility.trace(to_char(p_input_value_id));
1757: hr_utility.trace(to_char(p_session_date));
1758: --
1759: UPDATE pay_balance_feeds_f
1760: SET effective_end_date = p_effective_end_date
1761: WHERE input_value_id = p_input_value_id
1767: AND effective_start_date > p_session_date;
1768: --
1769: ELSE
1770: --
1771: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1772: hr_utility.raise_error;
1773: --
1774: END IF;
1775: --
1768: --
1769: ELSE
1770: --
1771: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1772: hr_utility.raise_error;
1773: --
1774: END IF;
1775: --
1776: ELSE
1774: END IF;
1775: --
1776: ELSE
1777: --
1778: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1779: hr_utility.raise_error;
1780: --
1781: END IF;
1782: --
1775: --
1776: ELSE
1777: --
1778: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1779: hr_utility.raise_error;
1780: --
1781: END IF;
1782: --
1783: ELSIF p_option = 'DEL_SUB_CLASS_RULE' THEN
1781: END IF;
1782: --
1783: ELSIF p_option = 'DEL_SUB_CLASS_RULE' THEN
1784: --
1785: hr_utility.set_location('DEL_SUB_CLASS_RULE', 1);
1786: --
1787: IF (p_element_type_id is not NULL AND
1788: p_sub_classification_id is not NULL AND
1789: p_legislation_code is not NULL) THEN
1895: AND effective_start_date > p_session_date;
1896: --
1897: ELSE
1898: --
1899: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1900: hr_utility.raise_error;
1901: --
1902: END IF;
1903: --
1896: --
1897: ELSE
1898: --
1899: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1900: hr_utility.raise_error;
1901: --
1902: END IF;
1903: --
1904: ELSE
1902: END IF;
1903: --
1904: ELSE
1905: --
1906: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1907: hr_utility.raise_error;
1908: --
1909: END IF;
1910: --
1903: --
1904: ELSE
1905: --
1906: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1907: hr_utility.raise_error;
1908: --
1909: END IF;
1910: --
1911: ELSIF p_option = 'DEL_PRIMARY_BAL_CLASS' THEN
1909: END IF;
1910: --
1911: ELSIF p_option = 'DEL_PRIMARY_BAL_CLASS' THEN
1912: --
1913: hr_utility.set_location('DEL_PRIMARY_BAL_CLASS', 1);
1914: --
1915: IF (p_primary_classification_id is not NULL AND
1916: p_balance_type_id is not NULL AND
1917: p_legislation_code is not NULL) THEN
1948: AND iv.name = 'Pay Value');
1949: --
1950: ELSE
1951: --
1952: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1953: hr_utility.raise_error;
1954: --
1955: END IF;
1956: --
1949: --
1950: ELSE
1951: --
1952: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1953: hr_utility.raise_error;
1954: --
1955: END IF;
1956: --
1957: ELSE
1955: END IF;
1956: --
1957: ELSE
1958: --
1959: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1960: hr_utility.raise_error;
1961: --
1962: END IF;
1963: --
1956: --
1957: ELSE
1958: --
1959: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
1960: hr_utility.raise_error;
1961: --
1962: END IF;
1963: --
1964: ELSIF p_option = 'DEL_SUB_BAL_CLASS' THEN
1962: END IF;
1963: --
1964: ELSIF p_option = 'DEL_SUB_BAL_CLASS' THEN
1965: --
1966: hr_utility.set_location('DEL_SUB_BAL_CLASS', 1);
1967: --
1968: IF (p_sub_classification_id is not NULL AND
1969: p_balance_type_id is not NULL AND
1970: p_legislation_code is not NULL) THEN
2009: <= scr.effective_end_date);
2010: --
2011: ELSE
2012: --
2013: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2014: hr_utility.raise_error;
2015: --
2016: END IF;
2017: --
2010: --
2011: ELSE
2012: --
2013: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2014: hr_utility.raise_error;
2015: --
2016: END IF;
2017: --
2018: ELSE
2016: END IF;
2017: --
2018: ELSE
2019: --
2020: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2021: hr_utility.raise_error;
2022: --
2023: END IF;
2024: --
2017: --
2018: ELSE
2019: --
2020: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2021: hr_utility.raise_error;
2022: --
2023: END IF;
2024: --
2025: ELSE
2023: END IF;
2024: --
2025: ELSE
2026: --
2027: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2028: hr_utility.raise_error;
2029: --
2030: END IF;
2031: --
2024: --
2025: ELSE
2026: --
2027: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2028: hr_utility.raise_error;
2029: --
2030: END IF;
2031: --
2032: END del_balance_feed;
2052: where db.balance_type_id = p_bal_type;
2053: --
2054: BEGIN
2055: --
2056: hr_utility.set_location('del_balance_type_cascade', 1);
2057: --
2058: IF p_balance_type_id is not NULL THEN
2059: --
2060: for each_def_bal in get_def_bals(p_balance_type_id) loop
2086: WHERE balance_type_id = p_balance_type_id;
2087: --
2088: ELSE
2089: --
2090: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2091: hr_utility.raise_error;
2092: --
2093: END IF;
2094: --
2087: --
2088: ELSE
2089: --
2090: hr_utility.set_message (801,'PAY_6541_PRO_INVALID_ARGS');
2091: hr_utility.raise_error;
2092: --
2093: END IF;
2094: --
2095: END del_balance_type_cascade;
2132: --
2133: if p_session_date between subcr_rec.start_date and
2134: subcr_rec.end_date then
2135: --
2136: hr_utility.set_message(801,'PAY_6602_ELEMENT_NO_DUP_SUBCR');
2137: hr_utility.raise_error;
2138: --
2139: else
2140: l_greatest_date := subcr_rec.start_date - 1;
2133: if p_session_date between subcr_rec.start_date and
2134: subcr_rec.end_date then
2135: --
2136: hr_utility.set_message(801,'PAY_6602_ELEMENT_NO_DUP_SUBCR');
2137: hr_utility.raise_error;
2138: --
2139: else
2140: l_greatest_date := subcr_rec.start_date - 1;
2141: exit;
2196: --
2197: if p_session_date between bf_rec.start_date and
2198: bf_rec.end_date then
2199: --
2200: hr_utility.set_message(801,'HR_6185_BAL_FEED_EXISTS');
2201: hr_utility.raise_error;
2202: --
2203: else
2204: l_greatest_date := bf_rec.start_date - 1;
2197: if p_session_date between bf_rec.start_date and
2198: bf_rec.end_date then
2199: --
2200: hr_utility.set_message(801,'HR_6185_BAL_FEED_EXISTS');
2201: hr_utility.raise_error;
2202: --
2203: else
2204: l_greatest_date := bf_rec.start_date - 1;
2205: exit;