30: l_api_updating boolean;
31: l_valid varchar2(1);
32: --
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: open csr_get_element_info;
36: fetch csr_get_element_info
37: into p_template_id
38: , p_input_currency_code;
36: fetch csr_get_element_info
37: into p_template_id
38: , p_input_currency_code;
39: close csr_get_element_info;
40: hr_utility.set_location(' Leaving:'||l_proc, 15);
41: End get_element_info;
42: -- ----------------------------------------------------------------------------
43: -- |---------------------------< get_template_info >--------------------------|
44: -- ----------------------------------------------------------------------------
61: l_proc varchar2(72) := g_package||'get_template_info';
62:
63: --
64: Begin
65: hr_utility.set_location('Entering:'||l_proc, 5);
66:
67: open csr_get_template_info;
68:
69: fetch csr_get_template_info
76: if p_business_group_id is not null then
77: p_legislation_code := hr_api.return_legislation_code(p_business_group_id);
78: end if;
79:
80: hr_utility.set_location(' Leaving:'||l_proc, 15);
81: End get_template_info;
82: -- ----------------------------------------------------------------------------
83: -- |-----------------------< chk_non_updateable_args >------------------------|
84: -- ----------------------------------------------------------------------------
109: l_argument varchar2(30);
110: l_disallow varchar2(1);
111: --
112: Begin
113: hr_utility.set_location('Entering:'||l_proc, 5);
114: l_api_updating := pay_siv_shd.api_updating
115: (p_input_value_id => p_rec.input_value_id
116: ,p_object_version_number => p_rec.object_version_number
117: );
115: (p_input_value_id => p_rec.input_value_id
116: ,p_object_version_number => p_rec.object_version_number
117: );
118: if not l_api_updating then
119: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
120: hr_utility.set_message_token('PROCEDURE', l_proc);
121: hr_utility.set_message_token('STEP', '10');
122: hr_utility.raise_error;
123: end if;
116: ,p_object_version_number => p_rec.object_version_number
117: );
118: if not l_api_updating then
119: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
120: hr_utility.set_message_token('PROCEDURE', l_proc);
121: hr_utility.set_message_token('STEP', '10');
122: hr_utility.raise_error;
123: end if;
124: --
117: );
118: if not l_api_updating then
119: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
120: hr_utility.set_message_token('PROCEDURE', l_proc);
121: hr_utility.set_message_token('STEP', '10');
122: hr_utility.raise_error;
123: end if;
124: --
125: hr_utility.set_location(l_proc, 15);
118: if not l_api_updating then
119: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
120: hr_utility.set_message_token('PROCEDURE', l_proc);
121: hr_utility.set_message_token('STEP', '10');
122: hr_utility.raise_error;
123: end if;
124: --
125: hr_utility.set_location(l_proc, 15);
126: --
121: hr_utility.set_message_token('STEP', '10');
122: hr_utility.raise_error;
123: end if;
124: --
125: hr_utility.set_location(l_proc, 15);
126: --
127: -- Check that the update is actually allowed.
128: --
129: open csr_disallow_update;
128: --
129: open csr_disallow_update;
130: fetch csr_disallow_update into l_disallow;
131: if csr_disallow_update%found then
132: hr_utility.set_location(l_proc, 20);
133: close csr_disallow_update;
134: fnd_message.set_name('PAY', 'PAY_50121_SIV_CORE_ROW_EXISTS');
135: fnd_message.raise_error;
136: end if;
163: raise l_error;
164: end if;
165: close csr_disallow_uom;
166: end if;
167: hr_utility.set_location('Leaving:'||l_proc, 25);
168: exception
169: when l_error then
170: hr_utility.set_location('Leaving:'||l_proc, 30);
171: hr_api.argument_changed_error
166: end if;
167: hr_utility.set_location('Leaving:'||l_proc, 25);
168: exception
169: when l_error then
170: hr_utility.set_location('Leaving:'||l_proc, 30);
171: hr_api.argument_changed_error
172: (p_api_name => l_proc
173: ,p_argument => l_argument);
174: when others then
171: hr_api.argument_changed_error
172: (p_api_name => l_proc
173: ,p_argument => l_argument);
174: when others then
175: hr_utility.set_location('Leaving:'||l_proc, 35);
176: raise;
177: End chk_non_updateable_args;
178: -- ----------------------------------------------------------------------------
179: -- |--------------------------< chk_element_type_id >-------------------------|
205: l_count number;
206: l_max_input_values constant number := 15;
207: --
208: Begin
209: hr_utility.set_location('Entering:'||l_proc, 5);
210: --
211: -- Check that the element type is not null.
212: --
213: hr_api.mandatory_arg_error
220: --
221: open csr_element_type_exists;
222: fetch csr_element_type_exists into l_exists;
223: if csr_element_type_exists%notfound then
224: hr_utility.set_location(' Leaving:'||l_proc, 10);
225: close csr_element_type_exists;
226: fnd_message.set_name('PAY', 'PAY_50095_ETM_INVALID_ELE_TYPE');
227: fnd_message.raise_error;
228: end if;
233: open csr_input_value_count;
234: fetch csr_input_value_count into l_count;
235: if p_exclusion_rule_id is null and
236: l_count >= l_max_input_values then
237: hr_utility.set_location(' Leaving:'||l_proc, 15);
238: close csr_input_value_count;
239: fnd_message.set_name('PAY', 'PAY_50122_SIV_TOO_MANY_INPUTS');
240: fnd_message.set_token('MAX', l_max_input_values);
241: fnd_message.raise_error;
240: fnd_message.set_token('MAX', l_max_input_values);
241: fnd_message.raise_error;
242: end if;
243: close csr_input_value_count;
244: hr_utility.set_location(' Leaving:'||l_proc, 20);
245: exception
246: when others then
247: if csr_input_value_count%isopen then
248: close csr_input_value_count;
263: l_proc varchar2(72) := g_package||'chk_display_sequence';
264: l_api_updating boolean;
265: --
266: Begin
267: hr_utility.set_location('Entering:'||l_proc, 5);
268: l_api_updating := pay_siv_shd.api_updating
269: (p_input_value_id => p_input_value_id
270: ,p_object_version_number => p_object_version_number
271: );
281: ,p_argument => 'p_display_sequence'
282: ,p_argument_value => p_display_sequence
283: );
284: end if;
285: hr_utility.set_location(' Leaving:'||l_proc, 15);
286: End chk_display_sequence;
287: -- ----------------------------------------------------------------------------
288: -- |-----------------------------< chk_lookups >------------------------------|
289: -- ----------------------------------------------------------------------------
350: end if;
351: end chk_lookup;
352: --
353: Begin
354: hr_utility.set_location('Entering:'||l_proc, 5);
355: l_api_updating := pay_siv_shd.api_updating
356: (p_input_value_id => p_input_value_id
357: ,p_object_version_number => p_object_version_number
358: );
425: ,p_mandatory => false
426: ,p_updatable => true
427: ,p_api_updating => l_api_updating
428: );
429: hr_utility.set_location(' Leaving:'||l_proc, 15);
430: End chk_lookups;
431: -- ----------------------------------------------------------------------------
432: -- |--------------------------------< chk_name >------------------------------|
433: -- ----------------------------------------------------------------------------
454: l_output varchar2(2000);
455: l_rgeflg varchar2(2000);
456: --
457: Begin
458: hr_utility.set_location('Entering:'||l_proc, 5);
459: l_api_updating := pay_siv_shd.api_updating
460: (p_input_value_id => p_input_value_id
461: ,p_object_version_number => p_object_version_number
462: );
490: ,rgeflg => l_rgeflg
491: ,curcode => null
492: );
493: end if;
494: hr_utility.set_location(' Leaving:'||l_proc, 20);
495: End chk_name;
496: -- ----------------------------------------------------------------------------
497: -- |---------------------------< chk_lookup_type >----------------------------|
498: -- ----------------------------------------------------------------------------
522: l_uom_changed boolean;
523: l_chk_default boolean;
524: --
525: Begin
526: hr_utility.set_location('Entering:'||l_proc, 5);
527: l_api_updating := pay_siv_shd.api_updating
528: (p_input_value_id => p_input_value_id
529: ,p_object_version_number => p_object_version_number
530: );
547: --
548: -- UOM must be 'C' if lookup type is used for validation.
549: --
550: if p_uom <> 'C' then
551: hr_utility.set_location(' Leaving:'||l_proc, 10);
552: fnd_message.set_name('PAY', 'PAY_50132_SIV_BAD_LOOKUP_UOM');
553: fnd_message.set_token('UOM', 'C');
554: fnd_message.raise_error;
555: end if;
558: --
559: open csr_lookup_type_valid;
560: fetch csr_lookup_type_valid into l_valid;
561: if csr_lookup_type_valid%notfound then
562: hr_utility.set_location(' Leaving:'||l_proc, 15);
563: close csr_lookup_type_valid;
564: fnd_message.set_name('PAY', 'PAY_50133_SIV_BAD_LOOKUP_TYPE');
565: fnd_message.set_token('LOOKUP_TYPE', p_lookup_type);
566: fnd_message.raise_error;
586: ,p_lookup_type => p_lookup_type
587: ,p_lookup_code => p_default_value
588: )
589: then
590: hr_utility.set_location(' Leaving:'||l_proc, 20);
591: fnd_message.set_name('PAY', 'HR_52966_INVALID_LOOKUP');
592: fnd_message.set_token('LOOKUP_TYPE', p_lookup_type);
593: fnd_message.set_token('COLUMN', 'DEFAULT_VALUE');
594: fnd_message.raise_error;
593: fnd_message.set_token('COLUMN', 'DEFAULT_VALUE');
594: fnd_message.raise_error;
595: end if;
596: end if;
597: hr_utility.set_location(' Leaving:'||l_proc, 25);
598: End chk_lookup_type;
599: -- ----------------------------------------------------------------------------
600: -- |------------------------------< chk_values >------------------------------|
601: -- ----------------------------------------------------------------------------
643: l_uom_updated boolean := false;
644: l_do_checks boolean;
645: --
646: Begin
647: hr_utility.set_location('Entering:'||l_proc, 5);
648: --
649: -- Check against the lookup type (which should have already been
650: -- validated against the default value).
651: --
654: -- The maximum and minimum values must both be null if lookup type
655: -- is not null.
656: --
657: if p_max_value is not null or p_min_value is not null then
658: hr_utility.set_location('Leaving:'||l_proc, 10);
659: fnd_message.set_name('PAY', 'PAY_50134_SIV_LOOKUP_AND_RANGE');
660: fnd_message.raise_error;
661: end if;
662: --
663: -- The formula_id and input_validation_formula must both be null if
664: -- lookup type is not null.
665: --
666: if p_formula_id is not null or p_input_validation_formula is not null then
667: hr_utility.set_location('Leaving:'||l_proc, 15);
668: fnd_message.set_name('PAY', 'PAY_33184_SIV_VALID_COMB');
669: fnd_message.raise_error;
670: end if;
671: --
669: fnd_message.raise_error;
670: end if;
671: --
672: --
673: hr_utility.set_location('Leaving:'||l_proc, 20);
674: return;
675: end if;
676: --
677: if p_formula_id is not null then
679: -- The maximum and minimum values must both be null if formula id
680: -- is not null.
681: --
682: if p_max_value is not null or p_min_value is not null then
683: hr_utility.set_location('Leaving:'||l_proc, 25);
684: fnd_message.set_name('PAY', 'PAY_33184_SIV_VALID_COMB');
685: fnd_message.raise_error;
686: end if;
687: --
687: --
688: -- The input validation formula must be null when formula id is not null
689: --
690: if p_input_validation_formula is not null then
691: hr_utility.set_location('Leaving:'||l_proc, 30);
692: fnd_message.set_name('PAY', 'PAY_33184_SIV_VALID_COMB');
693: fnd_message.raise_error;
694: end if;
695: --
694: end if;
695: --
696: --
697:
698: hr_utility.set_location('Leaving:'||l_proc, 35);
699: return;
700:
701: end if;
702: --
705: -- The maximum and minimum values must both be null if input validation formula
706: -- is not null.
707: --
708: if p_max_value is not null or p_min_value is not null then
709: hr_utility.set_location('Leaving:'||l_proc, 40);
710: fnd_message.set_name('PAY', 'PAY_33184_SIV_VALID_COMB');
711: fnd_message.raise_error;
712: end if;
713:
710: fnd_message.set_name('PAY', 'PAY_33184_SIV_VALID_COMB');
711: fnd_message.raise_error;
712: end if;
713:
714: hr_utility.set_location('Leaving:'||l_proc, 45);
715: return;
716:
717: end if;
718: --
777: --
778: -- Nothing's changed so return.
779: --
780: if not l_do_checks then
781: hr_utility.set_location('Leaving:'||l_proc, 50);
782: return;
783: end if;
784: -------------
785: -- Minimum/Maximum/Default Value Checks:
861: if l_rgeflg = 'F' then
862: --
863: -- Range check failed.
864: --
865: hr_utility.set_location('Leaving:'||l_proc, 55);
866: fnd_message.set_name('PAY', 'PAY_50135_SIV_BAD_RANGE_VALUES');
867: fnd_message.raise_error;
868: end if;
869: hr_utility.set_location(' Leaving:'||l_proc, 60);
865: hr_utility.set_location('Leaving:'||l_proc, 55);
866: fnd_message.set_name('PAY', 'PAY_50135_SIV_BAD_RANGE_VALUES');
867: fnd_message.raise_error;
868: end if;
869: hr_utility.set_location(' Leaving:'||l_proc, 60);
870: End chk_values;
871: -- ----------------------------------------------------------------------------
872: -- |-----------------------< chk_default_value_column >-----------------------|
873: -- ----------------------------------------------------------------------------
912: l_clash varchar2(1);
913: l_inconsistent varchar2(1);
914: --
915: Begin
916: hr_utility.set_location('Entering:'||l_proc, 5);
917: l_api_updating := pay_siv_shd.api_updating
918: (p_input_value_id => p_input_value_id
919: ,p_object_version_number => p_object_version_number
920: );
944: -- All exceptions are due to the name being in the incorrect
945: -- format.
946: --
947: when others then
948: hr_utility.set_location(' Leaving:'||l_proc, 10);
949: fnd_message.set_name('PAY', 'PAY_50130_ETM_BAD_FLEX_COLUMN');
950: fnd_message.set_token('FLEXFIELD_COLUMN', p_default_value_column);
951: fnd_message.raise_error;
952: end;
956: --
957: open csr_default_value_clash;
958: fetch csr_default_value_clash into l_clash;
959: if csr_default_value_clash%found then
960: hr_utility.set_location(' Leaving:'||l_proc, 15);
961: close csr_default_value_clash;
962: fnd_message.set_name('PAY', 'PAY_50131_TER_SIV_CLASH');
963: fnd_message.raise_error;
964: end if;
969: --
970: open csr_inconsistent_def_val;
971: fetch csr_inconsistent_def_val into l_inconsistent;
972: if csr_inconsistent_def_val%found then
973: hr_utility.set_location(' Leaving:'||l_proc, 20);
974: close csr_inconsistent_def_val;
975: fnd_message.set_name('PAY', 'PAY_50136_SIV_DEFVAL_DIFF_UOMS');
976: fnd_message.raise_error;
977: end if;
977: end if;
978: close csr_inconsistent_def_val;
979: end if;
980: end if;
981: hr_utility.set_location(' Leaving:'||l_proc, 25);
982: End chk_default_value_column;
983: -- ----------------------------------------------------------------------------
984: -- |-------------------------< chk_exclusion_rule_id >------------------------|
985: -- ----------------------------------------------------------------------------
1002: l_api_updating boolean;
1003: l_valid varchar2(1);
1004: --
1005: Begin
1006: hr_utility.set_location('Entering:'||l_proc, 5);
1007: l_api_updating := pay_siv_shd.api_updating
1008: (p_input_value_id => p_input_value_id
1009: ,p_object_version_number => p_object_version_number
1010: );
1015: if p_exclusion_rule_id is not null then
1016: open csr_exclusion_rule_id_valid;
1017: fetch csr_exclusion_rule_id_valid into l_valid;
1018: if csr_exclusion_rule_id_valid%notfound then
1019: hr_utility.set_location('Leaving:'||l_proc, 10);
1020: close csr_exclusion_rule_id_valid;
1021: fnd_message.set_name('PAY', 'PAY_50100_ETM_INVALID_EXC_RULE');
1022: fnd_message.raise_error;
1023: end if;
1023: end if;
1024: close csr_exclusion_rule_id_valid;
1025: end if;
1026: end if;
1027: hr_utility.set_location(' Leaving:'||l_proc, 15);
1028: End chk_exclusion_rule_id;
1029: -- ----------------------------------------------------------------------------
1030: -- |------------------------------< chk_delete >------------------------------|
1031: -- ----------------------------------------------------------------------------
1060: l_error exception;
1061: l_exists varchar2(1);
1062: --
1063: Begin
1064: hr_utility.set_location('Entering:'||l_proc, 5);
1065: --
1066: open csr_core_objects;
1067: fetch csr_core_objects into l_exists;
1068: if csr_core_objects%found then
1065: --
1066: open csr_core_objects;
1067: fetch csr_core_objects into l_exists;
1068: if csr_core_objects%found then
1069: hr_utility.set_location(' Leaving:'||l_proc, 10);
1070: close csr_core_objects;
1071: raise l_error;
1072: end if;
1073: close csr_core_objects;
1074: --
1075: open csr_balance_feeds;
1076: fetch csr_balance_feeds into l_exists;
1077: if csr_balance_feeds%found then
1078: hr_utility.set_location(' Leaving:'||l_proc, 15);
1079: close csr_balance_feeds;
1080: raise l_error;
1081: end if;
1082: close csr_balance_feeds;
1083: --
1084: open csr_formula_rules;
1085: fetch csr_formula_rules into l_exists;
1086: if csr_formula_rules%found then
1087: hr_utility.set_location(' Leaving:'||l_proc, 20);
1088: close csr_formula_rules;
1089: raise l_error;
1090: end if;
1091: close csr_formula_rules;
1092: --
1093: open csr_iterative_rules;
1094: fetch csr_iterative_rules into l_exists;
1095: if csr_iterative_rules%found then
1096: hr_utility.set_location(' Leaving:'||l_proc, 25);
1097: close csr_iterative_rules;
1098: raise l_error;
1099: end if;
1100: close csr_iterative_rules;
1097: close csr_iterative_rules;
1098: raise l_error;
1099: end if;
1100: close csr_iterative_rules;
1101: hr_utility.set_location(' Leaving:'||l_proc, 30);
1102: exception
1103: when l_error then
1104: fnd_message.set_name('PAY', 'PAY_50123_SIV_INVALID_DELETE');
1105: fnd_message.raise_error;
1103: when l_error then
1104: fnd_message.set_name('PAY', 'PAY_50123_SIV_INVALID_DELETE');
1105: fnd_message.raise_error;
1106: when others then
1107: hr_utility.set_location(' Leaving:'||l_proc, 35);
1108: raise;
1109: End chk_delete;
1110: -- ----------------------------------------------------------------------------
1111: -- |--------------------------< chk_formula_id >------------------------------|
1159: l_valid varchar2(1);
1160: --
1161: Begin
1162:
1163: hr_utility.set_location('Entering:'||l_proc, 5);
1164:
1165: l_api_updating := pay_siv_shd.api_updating
1166: (p_input_value_id => p_input_value_id
1167: ,p_object_version_number => p_object_version_number
1179: open csr_T_formula_valid;
1180: fetch csr_T_formula_valid into l_valid;
1181:
1182: if csr_T_formula_valid%notfound then
1183: hr_utility.set_location(' Leaving:'||l_proc, 10);
1184: close csr_T_formula_valid;
1185: fnd_message.set_name('PAY', 'PAY_33185_SIV_BAD_FORMULA');
1186: fnd_message.raise_error;
1187: end if;
1193: open csr_U_formula_valid;
1194: fetch csr_U_formula_valid into l_valid;
1195:
1196: if csr_U_formula_valid%notfound then
1197: hr_utility.set_location(' Leaving:'||l_proc, 15);
1198: close csr_U_formula_valid;
1199: fnd_message.set_name('PAY', 'PAY_33185_SIV_BAD_FORMULA');
1200: fnd_message.raise_error;
1201: end if;
1206: end if;
1207:
1208: end if;
1209:
1210: hr_utility.set_location(' Leaving:'||l_proc, 20);
1211:
1212: End chk_formula_id;
1213: --
1214: -- ----------------------------------------------------------------------------
1228: l_template_type pay_element_templates.template_type%type;
1229:
1230: --
1231: Begin
1232: hr_utility.set_location('Entering:'||l_proc, 5);
1233: --
1234: -- Call all supporting business operations
1235: --
1236: chk_element_type_id
1323: ,p_input_value_id => p_rec.input_value_id
1324: ,p_object_version_number => p_rec.object_version_number
1325: );
1326: --
1327: hr_utility.set_location(' Leaving:'||l_proc, 10);
1328: End insert_validate;
1329: --
1330: -- ----------------------------------------------------------------------------
1331: -- |---------------------------< update_validate >----------------------------|
1344: l_template_type pay_element_templates.template_type%type;
1345:
1346: --
1347: Begin
1348: hr_utility.set_location('Entering:'||l_proc, 5);
1349: --
1350: -- Call all supporting business operations
1351: --
1352: get_element_info
1436: ,p_input_value_id => p_rec.input_value_id
1437: ,p_object_version_number => p_rec.object_version_number
1438: );
1439: --
1440: hr_utility.set_location(' Leaving:'||l_proc, 10);
1441: End update_validate;
1442: --
1443: -- ----------------------------------------------------------------------------
1444: -- |---------------------------< delete_validate >----------------------------|
1447: --
1448: l_proc varchar2(72) := g_package||'delete_validate';
1449: --
1450: Begin
1451: hr_utility.set_location('Entering:'||l_proc, 5);
1452: --
1453: -- Call all supporting business operations
1454: --
1455: chk_delete(p_rec.input_value_id);
1453: -- Call all supporting business operations
1454: --
1455: chk_delete(p_rec.input_value_id);
1456: --
1457: hr_utility.set_location(' Leaving:'||l_proc, 10);
1458: End delete_validate;
1459: --
1460: end pay_siv_bus;