36: l_proc varchar2(72) := g_package||'set_security_group_id';
37: --
38: begin
39: --
40: hr_utility.set_location('Entering:'|| l_proc, 10);
41: --
42: -- Ensure that all the mandatory parameter are not null
43: --
44: hr_api.mandatory_arg_error
67: hr_api.set_security_group_id
68: (p_security_group_id => l_security_group_id
69: );
70: --
71: hr_utility.set_location(' Leaving:'|| l_proc, 20);
72: --
73: end set_security_group_id;
74: --
75: -- ---------------------------------------------------------------------------
96: l_proc varchar2(72) := g_package||'return_legislation_code';
97: --
98: Begin
99: --
100: hr_utility.set_location('Entering:'|| l_proc, 10);
101: --
102: -- Ensure that all the mandatory parameter are not null
103: --
104: hr_api.mandatory_arg_error
114: -- call to this function. Just return the value in the global
115: -- variable.
116: --
117: l_legislation_code := pay_bth_bus.g_legislation_code;
118: hr_utility.set_location(l_proc, 20);
119: else
120: --
121: -- The ID is different to the last call to this function
122: -- or this is the first call to this function.
131: close csr_leg_code;
132: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
133: fnd_message.raise_error;
134: end if;
135: hr_utility.set_location(l_proc,30);
136: --
137: -- Set the global variables so the values are
138: -- available for the next call to this function.
139: --
140: close csr_leg_code;
141: pay_bth_bus.g_batch_id := p_batch_id;
142: pay_bth_bus.g_legislation_code := l_legislation_code;
143: end if;
144: hr_utility.set_location(' Leaving:'|| l_proc, 40);
145: return l_legislation_code;
146: end return_legislation_code;
147: --
148: -- ----------------------------------------------------------------------------
181: l_argument varchar2(30);
182: --
183: Begin
184: --
185: hr_utility.set_location(l_proc, 5);
186: --
187: -- Only proceed with the validation if a row exists for the current
188: -- record in the HR Schema.
189: --
196: fnd_message.set_token('STEP ', '5');
197: fnd_message.raise_error;
198: END IF;
199: --
200: hr_utility.set_location(l_proc, 10);
201: --
202: if nvl(p_rec.business_group_id, hr_api.g_number) <>
203: pay_bth_shd.g_old_rec.business_group_id then
204: l_argument := 'business_group_id';
204: l_argument := 'business_group_id';
205: raise l_error;
206: end if;
207: --
208: hr_utility.set_location(l_proc, 20);
209: --
210: EXCEPTION
211: WHEN l_error THEN
212: hr_api.argument_changed_error
305: --
306: l_proc varchar2(72) := g_package||'chk_batch_name';
307: --
308: begin
309: hr_utility.set_location('Entering:'||l_proc, 1);
310: --
311: -- Check mandatory batch_name exists
312: --
313: hr_api.mandatory_arg_error
315: ,p_argument => 'batch_name'
316: ,p_argument_value => p_batch_name
317: );
318: --
319: hr_utility.set_location(' Leaving:'||l_proc, 15);
320: --
321: end chk_batch_name;
322: --
323: -- ---------------------------------------------------------------------------
363: l_proc varchar2(72) := g_package||'chk_batch_status';
364: l_api_updating boolean;
365: --
366: begin
367: hr_utility.set_location('Entering:'||l_proc, 1);
368: --
369: -- Check mandatory batch_name exists
370: --
371: hr_api.mandatory_arg_error
381: ,p_argument => 'session_date'
382: ,p_argument_value => p_session_date
383: );
384: --
385: hr_utility.set_location(l_proc, 10);
386: --
387: l_api_updating := pay_bth_shd.api_updating
388: (p_batch_id => p_batch_id,
389: p_object_version_number => p_object_version_number
387: l_api_updating := pay_bth_shd.api_updating
388: (p_batch_id => p_batch_id,
389: p_object_version_number => p_object_version_number
390: );
391: hr_utility.set_location(l_proc,20);
392: --
393: -- Only proceed with SQL validation if absolutely necessary
394: --
395: if ((l_api_updating and
396: nvl(pay_bth_shd.g_old_rec.batch_status,hr_api.g_varchar2) <>
397: nvl(p_batch_status,hr_api.g_varchar2))
398: or (NOT l_api_updating)) then
399: --
400: hr_utility.set_location(l_proc,30);
401: --
402: -- Validate against the hr_lookup.
403: --
404: if hr_api.not_exists_in_hr_lookups
409: end if;
410: --
411: end if;
412: --
413: hr_utility.set_location(' Leaving:'||l_proc, 40);
414: --
415: end chk_batch_status;
416: --
417: -- ---------------------------------------------------------------------------
457: l_proc varchar2(72) := g_package||'chk_action_if_exists';
458: l_api_updating boolean;
459: --
460: begin
461: hr_utility.set_location('Entering:'||l_proc, 1);
462: --
463: -- Check mandatory session_date exists
464: --
465: hr_api.mandatory_arg_error
467: ,p_argument => 'session_date'
468: ,p_argument_value => p_session_date
469: );
470: --
471: hr_utility.set_location(l_proc, 10);
472: --
473: l_api_updating := pay_bth_shd.api_updating
474: (p_batch_id => p_batch_id,
475: p_object_version_number => p_object_version_number
473: l_api_updating := pay_bth_shd.api_updating
474: (p_batch_id => p_batch_id,
475: p_object_version_number => p_object_version_number
476: );
477: hr_utility.set_location(l_proc,20);
478: --
479: -- Only proceed with SQL validation if absolutely necessary
480: --
481: if ((l_api_updating and
482: nvl(pay_bth_shd.g_old_rec.action_if_exists,hr_api.g_varchar2) <>
483: nvl(p_action_if_exists,hr_api.g_varchar2))
484: or (NOT l_api_updating)) then
485: --
486: hr_utility.set_location(l_proc,30);
487: --
488: if (p_action_if_exists is not null) then
489: --
490: hr_utility.set_location(l_proc,35);
486: hr_utility.set_location(l_proc,30);
487: --
488: if (p_action_if_exists is not null) then
489: --
490: hr_utility.set_location(l_proc,35);
491: --
492: -- Validate against the hr_lookup.
493: --
494: if hr_api.not_exists_in_hr_lookups
501: end if;
502: --
503: end if;
504: --
505: hr_utility.set_location(' Leaving:'||l_proc, 40);
506: --
507: end chk_action_if_exists;
508: --
509: -- ---------------------------------------------------------------------------
549: l_proc varchar2(72) := g_package||'chk_purge_after_transfer';
550: l_api_updating boolean;
551: --
552: begin
553: hr_utility.set_location('Entering:'||l_proc, 1);
554: --
555: -- Check mandatory session_date exists
556: --
557: hr_api.mandatory_arg_error
559: ,p_argument => 'session_date'
560: ,p_argument_value => p_session_date
561: );
562: --
563: hr_utility.set_location(l_proc, 10);
564: --
565: l_api_updating := pay_bth_shd.api_updating
566: (p_batch_id => p_batch_id,
567: p_object_version_number => p_object_version_number
565: l_api_updating := pay_bth_shd.api_updating
566: (p_batch_id => p_batch_id,
567: p_object_version_number => p_object_version_number
568: );
569: hr_utility.set_location(l_proc,20);
570: --
571: -- Only proceed with SQL validation if absolutely necessary
572: --
573: if ((l_api_updating and
574: nvl(pay_bth_shd.g_old_rec.purge_after_transfer,hr_api.g_varchar2) <>
575: nvl(p_purge_after_transfer,hr_api.g_varchar2))
576: or (NOT l_api_updating)) then
577: --
578: hr_utility.set_location(l_proc,30);
579: --
580: if (p_purge_after_transfer is not null) then
581: --
582: hr_utility.set_location(l_proc,35);
578: hr_utility.set_location(l_proc,30);
579: --
580: if (p_purge_after_transfer is not null) then
581: --
582: hr_utility.set_location(l_proc,35);
583: --
584: -- Validate against the hr_lookup.
585: --
586: if hr_api.not_exists_in_hr_lookups
593: end if;
594: --
595: end if;
596: --
597: hr_utility.set_location(' Leaving:'||l_proc, 40);
598: --
599: end chk_purge_after_transfer;
600: --
601: -- ---------------------------------------------------------------------------
641: l_proc varchar2(72) := g_package||'chk_reject_if_future_changes';
642: l_api_updating boolean;
643: --
644: begin
645: hr_utility.set_location('Entering:'||l_proc, 1);
646: --
647: -- Check mandatory session_date exists
648: --
649: hr_api.mandatory_arg_error
651: ,p_argument => 'session_date'
652: ,p_argument_value => p_session_date
653: );
654: --
655: hr_utility.set_location(l_proc, 10);
656: --
657: l_api_updating := pay_bth_shd.api_updating
658: (p_batch_id => p_batch_id,
659: p_object_version_number => p_object_version_number
657: l_api_updating := pay_bth_shd.api_updating
658: (p_batch_id => p_batch_id,
659: p_object_version_number => p_object_version_number
660: );
661: hr_utility.set_location(l_proc,20);
662: --
663: -- Only proceed with SQL validation if absolutely necessary
664: --
665: if ((l_api_updating and
666: nvl(pay_bth_shd.g_old_rec.reject_if_future_changes,hr_api.g_varchar2) <>
667: nvl(p_reject_if_future_changes,hr_api.g_varchar2))
668: or (NOT l_api_updating)) then
669: --
670: hr_utility.set_location(l_proc,30);
671: --
672: if (p_reject_if_future_changes is not null) then
673: --
674: hr_utility.set_location(l_proc,35);
670: hr_utility.set_location(l_proc,30);
671: --
672: if (p_reject_if_future_changes is not null) then
673: --
674: hr_utility.set_location(l_proc,35);
675: --
676: -- Validate against the hr_lookup.
677: --
678: if hr_api.not_exists_in_hr_lookups
685: end if;
686: --
687: end if;
688: --
689: hr_utility.set_location(' Leaving:'||l_proc, 40);
690: --
691: end chk_reject_if_future_changes;
692: --
693: -- ---------------------------------------------------------------------------
733: l_proc varchar2(72) := g_package||'chk_reject_if_results_exists';
734: l_api_updating boolean;
735: --
736: begin
737: hr_utility.set_location('Entering:'||l_proc, 1);
738: --
739: -- Check mandatory session_date exists
740: --
741: hr_api.mandatory_arg_error
743: ,p_argument => 'session_date'
744: ,p_argument_value => p_session_date
745: );
746: --
747: hr_utility.set_location(l_proc, 10);
748: --
749: l_api_updating := pay_bth_shd.api_updating
750: (p_batch_id => p_batch_id,
751: p_object_version_number => p_object_version_number
749: l_api_updating := pay_bth_shd.api_updating
750: (p_batch_id => p_batch_id,
751: p_object_version_number => p_object_version_number
752: );
753: hr_utility.set_location(l_proc,20);
754: --
755: -- Only proceed with SQL validation if absolutely necessary
756: --
757: if ((l_api_updating and
758: nvl(pay_bth_shd.g_old_rec.reject_if_results_exists,hr_api.g_varchar2) <>
759: nvl(p_reject_if_results_exists,hr_api.g_varchar2))
760: or (NOT l_api_updating)) then
761: --
762: hr_utility.set_location(l_proc,30);
763: --
764: if (p_reject_if_results_exists is not null) then
765: --
766: hr_utility.set_location(l_proc,35);
762: hr_utility.set_location(l_proc,30);
763: --
764: if (p_reject_if_results_exists is not null) then
765: --
766: hr_utility.set_location(l_proc,35);
767: --
768: -- Validate against the hr_lookup.
769: --
770: if hr_api.not_exists_in_hr_lookups
777: end if;
778: --
779: end if;
780: --
781: hr_utility.set_location(' Leaving:'||l_proc, 40);
782: --
783: end chk_reject_if_results_exists;
784: --
785: -- ---------------------------------------------------------------------------
825: l_proc varchar2(72) := g_package||'chk_purge_after_rollback';
826: l_api_updating boolean;
827: --
828: begin
829: hr_utility.set_location('Entering:'||l_proc, 1);
830: --
831: -- Check mandatory session_date exists
832: --
833: hr_api.mandatory_arg_error
835: ,p_argument => 'session_date'
836: ,p_argument_value => p_session_date
837: );
838: --
839: hr_utility.set_location(l_proc, 10);
840: --
841: l_api_updating := pay_bth_shd.api_updating
842: (p_batch_id => p_batch_id,
843: p_object_version_number => p_object_version_number
841: l_api_updating := pay_bth_shd.api_updating
842: (p_batch_id => p_batch_id,
843: p_object_version_number => p_object_version_number
844: );
845: hr_utility.set_location(l_proc,20);
846: --
847: -- Only proceed with SQL validation if absolutely necessary
848: --
849: if ((l_api_updating and
850: nvl(pay_bth_shd.g_old_rec.purge_after_rollback,hr_api.g_varchar2) <>
851: nvl(p_purge_after_rollback,hr_api.g_varchar2))
852: or (NOT l_api_updating)) then
853: --
854: hr_utility.set_location(l_proc,30);
855: --
856: if (p_purge_after_rollback is not null) then
857: --
858: hr_utility.set_location(l_proc,35);
854: hr_utility.set_location(l_proc,30);
855: --
856: if (p_purge_after_rollback is not null) then
857: --
858: hr_utility.set_location(l_proc,35);
859: --
860: -- Validate against the hr_lookup.
861: --
862: if hr_api.not_exists_in_hr_lookups
869: end if;
870: --
871: end if;
872: --
873: hr_utility.set_location(' Leaving:'||l_proc, 40);
874: --
875: end chk_purge_after_rollback;
876: --
877: -- ---------------------------------------------------------------------------
918: l_proc varchar2(72) := g_package||'chk_date_effective_changes';
919: l_api_updating boolean;
920: --
921: begin
922: hr_utility.set_location('Entering:'||l_proc, 1);
923: --
924: -- Check mandatory session_date exists
925: --
926: hr_api.mandatory_arg_error
928: ,p_argument => 'session_date'
929: ,p_argument_value => p_session_date
930: );
931: --
932: hr_utility.set_location(l_proc, 10);
933: --
934: l_api_updating := pay_bth_shd.api_updating
935: (p_batch_id => p_batch_id,
936: p_object_version_number => p_object_version_number
934: l_api_updating := pay_bth_shd.api_updating
935: (p_batch_id => p_batch_id,
936: p_object_version_number => p_object_version_number
937: );
938: hr_utility.set_location(l_proc,20);
939: --
940: -- Only proceed with SQL validation if absolutely necessary
941: --
942: if ((l_api_updating and
943: nvl(pay_bth_shd.g_old_rec.date_effective_changes,hr_api.g_varchar2) <>
944: nvl(p_date_effective_changes,hr_api.g_varchar2))
945: or (NOT l_api_updating)) then
946: --
947: hr_utility.set_location(l_proc,30);
948: --
949: if (p_date_effective_changes is not null) then
950: --
951: hr_utility.set_location(l_proc,35);
947: hr_utility.set_location(l_proc,30);
948: --
949: if (p_date_effective_changes is not null) then
950: --
951: hr_utility.set_location(l_proc,35);
952: --
953: -- Validate against the hr_lookup.
954: --
955: if hr_api.not_exists_in_hr_lookups
970: pay_bth_shd.constraint_error('PAY_BCH_DATE_EFFECTIVE_CHA_CHK');
971: --
972: end if;
973: --
974: hr_utility.set_location(' Leaving:'||l_proc, 40);
975: --
976: end chk_date_effective_changes;
977: --
978: -- ---------------------------------------------------------------------------
1030: where pml.source_id = p_batch_id
1031: and pml.source_type = 'H';
1032: --
1033: begin
1034: hr_utility.set_location('Entering:'||l_proc, 1);
1035: --
1036: -- Check mandatory batch_id exists
1037: --
1038: hr_api.mandatory_arg_error
1040: ,p_argument => 'batch_id'
1041: ,p_argument_value => p_batch_id
1042: );
1043: --
1044: hr_utility.set_location('Entering:'||l_proc, 10);
1045: --
1046: open csr_batch_lines_exists;
1047: --
1048: fetch csr_batch_lines_exists into l_exists;
1057: End If;
1058: --
1059: close csr_batch_lines_exists;
1060: --
1061: hr_utility.set_location(l_proc, 20);
1062: --
1063: open csr_batch_ctl_totals_exists;
1064: --
1065: fetch csr_batch_ctl_totals_exists into l_exists;
1074: End If;
1075: --
1076: close csr_batch_ctl_totals_exists;
1077: --
1078: hr_utility.set_location(l_proc, 30);
1079: --
1080: open csr_message_lines;
1081: --
1082: fetch csr_message_lines into l_exists;
1091: End If;
1092: --
1093: close csr_message_lines;
1094: --
1095: hr_utility.set_location(' Leaving:'||l_proc, 40);
1096: --
1097: end chk_delete;
1098: --
1099: -- ----------------------------------------------------------------------------
1106: --
1107: l_proc varchar2(72) := g_package||'insert_validate';
1108: --
1109: Begin
1110: hr_utility.set_location('Entering:'||l_proc, 5);
1111: --
1112: -- Call all supporting business operations
1113: --
1114: hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
1112: -- Call all supporting business operations
1113: --
1114: hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
1115: --
1116: hr_utility.set_location(l_proc, 20);
1117: --
1118: chk_batch_name(p_batch_name => p_rec.batch_name);
1119: --
1120: hr_utility.set_location(l_proc, 30);
1116: hr_utility.set_location(l_proc, 20);
1117: --
1118: chk_batch_name(p_batch_name => p_rec.batch_name);
1119: --
1120: hr_utility.set_location(l_proc, 30);
1121: --
1122: chk_batch_status(p_batch_status => p_rec.batch_status
1123: ,p_session_date => p_session_date
1124: ,p_batch_id => p_rec.batch_id
1123: ,p_session_date => p_session_date
1124: ,p_batch_id => p_rec.batch_id
1125: ,p_object_version_number => p_rec.object_version_number);
1126: --
1127: hr_utility.set_location(l_proc, 40);
1128: --
1129: chk_action_if_exists(p_action_if_exists => p_rec.action_if_exists
1130: ,p_session_date => p_session_date
1131: ,p_batch_id => p_rec.batch_id
1130: ,p_session_date => p_session_date
1131: ,p_batch_id => p_rec.batch_id
1132: ,p_object_version_number => p_rec.object_version_number);
1133: --
1134: hr_utility.set_location(l_proc, 50);
1135: --
1136: chk_purge_after_transfer(p_purge_after_transfer => p_rec.purge_after_transfer
1137: ,p_session_date => p_session_date
1138: ,p_batch_id => p_rec.batch_id
1137: ,p_session_date => p_session_date
1138: ,p_batch_id => p_rec.batch_id
1139: ,p_object_version_number => p_rec.object_version_number);
1140: --
1141: hr_utility.set_location(l_proc, 60);
1142: --
1143: chk_reject_if_future_changes(p_reject_if_future_changes => p_rec.reject_if_future_changes
1144: ,p_session_date => p_session_date
1145: ,p_batch_id => p_rec.batch_id
1144: ,p_session_date => p_session_date
1145: ,p_batch_id => p_rec.batch_id
1146: ,p_object_version_number => p_rec.object_version_number);
1147: --
1148: hr_utility.set_location(l_proc, 70);
1149: --
1150: chk_date_effective_changes(p_date_effective_changes => p_rec.date_effective_changes
1151: ,p_session_date => p_session_date
1152: ,p_batch_id => p_rec.batch_id
1153: ,p_object_version_number => p_rec.object_version_number
1154: ,p_reject_if_future_changes => p_rec.reject_if_future_changes
1155: ,p_action_if_exists => p_rec.action_if_exists);
1156: --
1157: hr_utility.set_location(' Leaving:'||l_proc, 80);
1158: End insert_validate;
1159: --
1160: -- ----------------------------------------------------------------------------
1161: -- |---------------------------< update_validate >----------------------------|
1167: --
1168: l_proc varchar2(72) := g_package||'update_validate';
1169: --
1170: Begin
1171: hr_utility.set_location('Entering:'||l_proc, 5);
1172: --
1173: -- Call all supporting business operations
1174: --
1175: hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
1177: chk_non_updateable_args
1178: (p_rec => p_rec
1179: );
1180: --
1181: hr_utility.set_location(l_proc, 20);
1182: --
1183: --
1184: chk_transferred_status(p_batch_id => p_rec.batch_id);
1185: --
1182: --
1183: --
1184: chk_transferred_status(p_batch_id => p_rec.batch_id);
1185: --
1186: hr_utility.set_location(l_proc, 25);
1187: --
1188: chk_batch_name(p_batch_name => p_rec.batch_name);
1189: --
1190: hr_utility.set_location(l_proc, 30);
1186: hr_utility.set_location(l_proc, 25);
1187: --
1188: chk_batch_name(p_batch_name => p_rec.batch_name);
1189: --
1190: hr_utility.set_location(l_proc, 30);
1191: --
1192: chk_batch_status(p_batch_status => p_rec.batch_status
1193: ,p_session_date => p_session_date
1194: ,p_batch_id => p_rec.batch_id
1193: ,p_session_date => p_session_date
1194: ,p_batch_id => p_rec.batch_id
1195: ,p_object_version_number => p_rec.object_version_number);
1196: --
1197: hr_utility.set_location(l_proc, 40);
1198: --
1199: chk_action_if_exists(p_action_if_exists => p_rec.action_if_exists
1200: ,p_session_date => p_session_date
1201: ,p_batch_id => p_rec.batch_id
1200: ,p_session_date => p_session_date
1201: ,p_batch_id => p_rec.batch_id
1202: ,p_object_version_number => p_rec.object_version_number);
1203: --
1204: hr_utility.set_location(l_proc, 50);
1205: --
1206: chk_purge_after_transfer(p_purge_after_transfer => p_rec.purge_after_transfer
1207: ,p_session_date => p_session_date
1208: ,p_batch_id => p_rec.batch_id
1207: ,p_session_date => p_session_date
1208: ,p_batch_id => p_rec.batch_id
1209: ,p_object_version_number => p_rec.object_version_number);
1210: --
1211: hr_utility.set_location(l_proc, 60);
1212: --
1213: chk_reject_if_future_changes(p_reject_if_future_changes => p_rec.reject_if_future_changes
1214: ,p_session_date => p_session_date
1215: ,p_batch_id => p_rec.batch_id
1214: ,p_session_date => p_session_date
1215: ,p_batch_id => p_rec.batch_id
1216: ,p_object_version_number => p_rec.object_version_number);
1217: --
1218: hr_utility.set_location(l_proc, 70);
1219: --
1220: chk_date_effective_changes(p_date_effective_changes => p_rec.date_effective_changes
1221: ,p_session_date => p_session_date
1222: ,p_batch_id => p_rec.batch_id
1223: ,p_object_version_number => p_rec.object_version_number
1224: ,p_reject_if_future_changes => p_rec.reject_if_future_changes
1225: ,p_action_if_exists => p_rec.action_if_exists);
1226: --
1227: hr_utility.set_location(' Leaving:'||l_proc, 80);
1228: End update_validate;
1229: --
1230: -- ----------------------------------------------------------------------------
1231: -- |---------------------------< delete_validate >----------------------------|
1236: --
1237: l_proc varchar2(72) := g_package||'delete_validate';
1238: --
1239: Begin
1240: hr_utility.set_location('Entering:'||l_proc, 5);
1241: --
1242: -- Call all supporting business operations
1243: --
1244: --
1245: if payplnk.g_payplnk_call <> true then
1246: chk_transferred_status(p_batch_id => p_rec.batch_id);
1247: end if;
1248: --
1249: hr_utility.set_location(l_proc, 8);
1250: --
1251: chk_delete(p_batch_id => p_rec.batch_id);
1252: --
1253: hr_utility.set_location(' Leaving:'||l_proc, 10);
1249: hr_utility.set_location(l_proc, 8);
1250: --
1251: chk_delete(p_batch_id => p_rec.batch_id);
1252: --
1253: hr_utility.set_location(' Leaving:'||l_proc, 10);
1254: End delete_validate;
1255: --
1256: end pay_bth_bus;