3: --
4: -- Package Variables
5: --
6: g_package varchar2(33) := ' per_person_type_usage_internal.';
7: g_debug boolean := hr_utility.debug_enabled;
8: g_old_ben_ptu_ler_rec ben_ptu_ler.g_ptu_ler_rec;
9: --
10: -- ----------------------------------------------------------------------------
11: -- |------------------------< create_person_type_usage >----------------------|
76: begin
77: --
78: if g_debug then
79: l_proc := g_package||'create_person_type_usage';
80: hr_utility.set_location('Entering:'|| l_proc, 10);
81: end if;
82: --
83: -- Issue a savepoint if operating in validation only mode
84: --
86: savepoint create_person_type_usage;
87: end if;
88: --
89: if g_debug then
90: hr_utility.set_location(l_proc, 20);
91: end if;
92: --
93: -- Process Logic
94: --
135: );
136: --
137: --
138: if g_debug then
139: hr_utility.set_location(l_proc, 60);
140: end if;
141: ------------------------------------------------
142: -- BEGIN TCA_UNMERGE CHANGES
143: --
166: p_effective_end_date := l_effective_end_date;
167: p_object_version_number := l_object_version_number;
168: --
169: if g_debug then
170: hr_utility.set_location(' Leaving:'||l_proc, 70);
171: end if;
172: --
173: exception
174: --
187: p_effective_start_date := null;
188: p_effective_end_date := null;
189: p_object_version_number := null;
190: if g_debug then
191: hr_utility.set_location(' Leaving:'||l_proc, 80);
192: end if;
193: --
194: end create_person_type_usage;
195: -- ----------------------------------------------------------------------------
216: begin
217: --
218: if g_debug then
219: l_proc := g_package||'delete_person_type_usage';
220: hr_utility.set_location('Entering:'|| l_proc, 10);
221: end if;
222: --
223: -- Issue a savepoint if operating in validation only mode
224: --
226: savepoint delete_person_type_usage;
227: end if;
228: --
229: if g_debug then
230: hr_utility.set_location(l_proc, 20);
231: end if;
232: --
233: -- Process Logic
234: --
246: );
247: --
248: --
249: if g_debug then
250: hr_utility.set_location(l_proc, 60);
251: end if;
252: --
253: -- When in validation only mode raise the Validate_Enabled exception
254: --
259: p_effective_end_date := l_effective_end_date;
260: p_object_version_number := l_object_version_number;
261: --
262: if g_debug then
263: hr_utility.set_location(' Leaving:'||l_proc, 70);
264: end if;
265: --
266: exception
267: --
338: begin
339: --
340: if g_debug then
341: l_proc := g_package||'update_person_type_usage';
342: hr_utility.set_location('Entering:'|| l_proc, 10);
343: end if;
344: --
345: -- Issue a savepoint if operating in validation only mode
346: --
348: savepoint update_person_type_usage;
349: end if;
350: --
351: if g_debug then
352: hr_utility.set_location(l_proc, 20);
353: end if;
354: --
355: -- Process Logic
356: --
397: );
398: --
399: --
400: if g_debug then
401: hr_utility.set_location(l_proc, 60);
402: end if;
403: --
404: -- When in validation only mode raise the Validate_Enabled exception
405: --
413: p_effective_end_date := l_effective_end_date;
414: p_object_version_number := l_object_version_number;
415: --
416: if g_debug then
417: hr_utility.set_location(' Leaving:'||l_proc, 70);
418: end if;
419: --
420: exception
421: --
433: p_effective_start_date := null;
434: p_effective_end_date := null;
435: p_object_version_number := p_object_version_number;
436: if g_debug then
437: hr_utility.set_location(' Leaving:'||l_proc, 80);
438: end if;
439: --
440: end update_person_type_usage;
441: --
632: system_type(2):='APL';
633: system_type(3):='CWK';
634: --
635: if g_debug then
636: hr_utility.set_location('Entering:'|| l_proc, 10);
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
633: system_type(3):='CWK';
634: --
635: if g_debug then
636: hr_utility.set_location('Entering:'|| l_proc, 10);
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
641: hr_utility.set_location('p_datetrack_delete_mode = '||p_datetrack_delete_mode,15);
634: --
635: if g_debug then
636: hr_utility.set_location('Entering:'|| l_proc, 10);
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
641: hr_utility.set_location('p_datetrack_delete_mode = '||p_datetrack_delete_mode,15);
642: end if;
635: if g_debug then
636: hr_utility.set_location('Entering:'|| l_proc, 10);
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
641: hr_utility.set_location('p_datetrack_delete_mode = '||p_datetrack_delete_mode,15);
642: end if;
643: --
636: hr_utility.set_location('Entering:'|| l_proc, 10);
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
641: hr_utility.set_location('p_datetrack_delete_mode = '||p_datetrack_delete_mode,15);
642: end if;
643: --
644: -- For deletes
637: hr_utility.set_location('p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
638: hr_utility.set_location('p_person_id = '||p_person_id,12);
639: hr_utility.set_location('p_person_type_id = '||p_person_type_id,13);
640: hr_utility.set_location('p_datetrack_update_mode = '||p_datetrack_update_mode,14);
641: hr_utility.set_location('p_datetrack_delete_mode = '||p_datetrack_delete_mode,15);
642: end if;
643: --
644: -- For deletes
645: --
645: --
646: if (p_datetrack_delete_mode is not null) then
647: --
648: if g_debug then
649: hr_utility.set_location(l_proc, 10);
650: end if;
651: --
652: -- Find matching person type usage record, and delete
653: --
659: fetch csr_delete_person_type_usages into l_delete_person_type_usage;
660: if (csr_delete_person_type_usages%notfound) then
661: --
662: if g_debug then
663: hr_utility.set_location(l_proc, 20);
664: end if;
665: --
666: close csr_delete_person_type_usages;
667: fnd_message.set_name('PAY','HR_6153_ALL_PROCEDURE_FAIL');
670: fnd_message.raise_error;
671: else
672: --
673: if g_debug then
674: hr_utility.set_location(l_proc, 30);
675: end if;
676: --
677: close csr_delete_person_type_usages;
678: --
701: --
702: elsif (p_datetrack_update_mode is not null) then
703: --
704: if g_debug then
705: hr_utility.set_location(l_proc, 40);
706: end if;
707: --
708: -- Determine system person type of person type parameter
709: --
713: fetch csr_person_types into l_person_type;
714: if (csr_person_types%notfound) then
715: --
716: if g_debug then
717: hr_utility.set_location(l_proc, 50);
718: end if;
719: --
720: close csr_person_types;
721: fnd_message.set_name('PAY','HR_6153_ALL_PROCEDURE_FAIL');
724: fnd_message.raise_error;
725: else
726: --
727: if g_debug then
728: hr_utility.set_location(l_proc, 60);
729: end if;
730: --
731: close csr_person_types;
732: --
743: -- Added close
744: close csr_update_person_type_usages;
745: --
746: if g_debug then
747: hr_utility.set_location(l_proc, 70);
748: end if;
749: --
750: -- There is an existing record, so update with new person type
751: --
771: --
772: else
773: --
774: if g_debug then
775: hr_utility.set_location(l_proc, 80);
776: end if;
777: -- Added close;
778: close csr_update_person_type_usages;
779: --
780: -- There is not an existing record, so create a new one
781: --
782: --
783: if g_debug then
784: hr_utility.set_location(l_proc, 81);
785: end if;
786:
787: -- But before creating a new PTU record do the following
788: -- If SPT is EMP,APL,CWK, then delete any existing OTHER PTU record
790:
791: IF l_person_type.system_person_type in ( 'EMP','APL','CWK' ) THEN
792:
793: if g_debug then
794: hr_utility.set_location(l_proc, 82);
795: end if;
796: --
797: -- Find existing record corresponding to system person type
798: --
807: -- Added close
808: close csr_update_person_type_usages;
809: --
810: if g_debug then
811: hr_utility.set_location(l_proc, 83);
812: end if;
813: --
814: benefits_person_type_usage_b
815: (p_effective_date => p_effective_date - 1
817: );
818: --
819:
820: if g_debug then
821: hr_utility.set_location(l_proc, 84);
822: end if;
823:
824: delete_person_type_usage
825: (p_person_type_usage_id => l_update_person_type_usage1.person_type_usage_id
835: ,p_person_type_usage_id => l_update_person_type_usage1.person_type_usage_id
836: );
837: --
838: if g_debug then
839: hr_utility.set_location(l_proc, 85);
840: end if;
841:
842: end if;
843: ELSIF l_person_type.system_person_type = 'OTHER' THEN
842: end if;
843: ELSIF l_person_type.system_person_type = 'OTHER' THEN
844: --
845: if g_debug then
846: hr_utility.set_location(l_proc, 86);
847: end if;
848: --
849: /*
850: ** New code since CWK
879: ,p_person_type_usage_id => l_person_type_usage_id
880: );
881: --
882: if g_debug then
883: hr_utility.set_location(l_proc, 93);
884: end if;
885: create_person_type_usage
886: (p_person_id => p_person_id
887: ,p_person_type_id => p_person_type_id
892: ,p_effective_end_date => l_effective_end_date
893: );
894: --
895: if g_debug then
896: hr_utility.set_location(l_proc, 94);
897: end if;
898: benefits_person_type_usage_a
899: (p_effective_date => p_effective_date
900: ,p_person_type_usage_id => l_person_type_usage_id
899: (p_effective_date => p_effective_date
900: ,p_person_type_usage_id => l_person_type_usage_id
901: );
902: if g_debug then
903: hr_utility.set_location(l_proc, 95);
904: end if;
905: --
906: END IF;
907: if g_debug then
904: end if;
905: --
906: END IF;
907: if g_debug then
908: hr_utility.set_location(l_proc, 96);
909: end if;
910: end if;
911: --
912: if g_debug then
909: end if;
910: end if;
911: --
912: if g_debug then
913: hr_utility.set_location(l_proc, 97);
914: end if;
915: end if;
916: --
917: if g_debug then
914: end if;
915: end if;
916: --
917: if g_debug then
918: hr_utility.set_location(l_proc, 98);
919: end if;
920: end if;
921: --
922: ------------------------------------------------
933: --
934: -- END TCA_UNMERGE CHANGES
935: ------------------------------------------------
936: if g_debug then
937: hr_utility.set_location(' Leaving:'||l_proc, 1000);
938: end if;
939: --
940: end maintain_person_type_usage;
941: --
1036: --
1037: begin
1038: --
1039: if g_debug then
1040: hr_utility.set_location('Entering:'|| l_proc, 10);
1041: hr_utility.set_location('cancel_person_type_usage.p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
1042: hr_utility.set_location('cancel_person_type_usage.p_person_id = '||to_char(p_person_id),11);
1043: hr_utility.set_location('cancel_person_type_usage.p_system_person_type = '||p_system_person_type,11);
1044: end if;
1037: begin
1038: --
1039: if g_debug then
1040: hr_utility.set_location('Entering:'|| l_proc, 10);
1041: hr_utility.set_location('cancel_person_type_usage.p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
1042: hr_utility.set_location('cancel_person_type_usage.p_person_id = '||to_char(p_person_id),11);
1043: hr_utility.set_location('cancel_person_type_usage.p_system_person_type = '||p_system_person_type,11);
1044: end if;
1045: --
1038: --
1039: if g_debug then
1040: hr_utility.set_location('Entering:'|| l_proc, 10);
1041: hr_utility.set_location('cancel_person_type_usage.p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
1042: hr_utility.set_location('cancel_person_type_usage.p_person_id = '||to_char(p_person_id),11);
1043: hr_utility.set_location('cancel_person_type_usage.p_system_person_type = '||p_system_person_type,11);
1044: end if;
1045: --
1046: begin
1039: if g_debug then
1040: hr_utility.set_location('Entering:'|| l_proc, 10);
1041: hr_utility.set_location('cancel_person_type_usage.p_effective_date = '||to_char(p_effective_date,'DD-MON-YYYY'),11);
1042: hr_utility.set_location('cancel_person_type_usage.p_person_id = '||to_char(p_person_id),11);
1043: hr_utility.set_location('cancel_person_type_usage.p_system_person_type = '||p_system_person_type,11);
1044: end if;
1045: --
1046: begin
1047: select ptu.person_type_usage_id into c_person_type_usage_id
1051: and ppt.system_person_type = p_system_person_type
1052: and p_effective_date between ptu.effective_start_date and ptu.effective_end_date
1053: and ptu.person_id = p_person_id;
1054: if g_debug then
1055: hr_utility.set_location('cancel_person_type_usage.c_person_type_usage_id = '||to_char(c_person_type_usage_id),12);
1056: end if;
1057: exception
1058: when no_data_found then
1059: fnd_message.set_name('PAY','HR_6153_ALL_PROCEDURE_FAIL');
1079: -- Search backwards through the person type usage records for the start of
1080: -- this system person type
1081: --
1082: if g_debug then
1083: hr_utility.set_location('cancel_person_type_usage.c_backwards = '||c_backwards,14);
1084: end if;
1085:
1086: for currec in csr_person_type_usages
1087: (p_effective_date => p_effective_date
1088: ,p_person_id => p_person_id
1089: ,p_search_type => c_backwards) loop
1090:
1091: if g_debug then
1092: hr_utility.set_location('csr_person_type_usages',15);
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1089: ,p_search_type => c_backwards) loop
1090:
1091: if g_debug then
1092: hr_utility.set_location('csr_person_type_usages',15);
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1097: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),15);
1090:
1091: if g_debug then
1092: hr_utility.set_location('csr_person_type_usages',15);
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1097: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),15);
1098: end if;
1091: if g_debug then
1092: hr_utility.set_location('csr_person_type_usages',15);
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1097: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),15);
1098: end if;
1099: --
1092: hr_utility.set_location('csr_person_type_usages',15);
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1097: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),15);
1098: end if;
1099: --
1100: --bug 2449091: back2back contracts dont have a change in SPT, so add extra check to stop at
1093: hr_utility.set_location('person_type_usage_id = '||currec.person_type_usage_id,15);
1094: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),15);
1095: hr_utility.set_location('system_person_type = '||currec.system_person_type,15);
1096: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),15);
1097: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),15);
1098: end if;
1099: --
1100: --bug 2449091: back2back contracts dont have a change in SPT, so add extra check to stop at
1101: --change of period of service or placement (but only for backwards search)
1104: OR (p_system_person_type in ('EMP','CWK')
1105: AND currec.effective_start_date = l_date_start));
1106: --
1107: if g_debug then
1108: hr_utility.set_location(l_proc, 15);
1109: end if;
1110: l_person_type_usage_id := currec.person_type_usage_id;
1111: l_object_version_number := currec.object_version_number;
1112: l_system_person_type := currec.system_person_type;
1115:
1116: end loop;
1117: --
1118: if g_debug then
1119: hr_utility.set_location(l_proc, 20);
1120: end if;
1121: --
1122: -- Search forwards through the person type usage records for the end of this
1123: -- system person type
1127: ,p_person_id => p_person_id
1128: ,p_search_type => c_forwards) loop
1129:
1130: if g_debug then
1131: hr_utility.set_location('csr_person_type_usages',16);
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1128: ,p_search_type => c_forwards) loop
1129:
1130: if g_debug then
1131: hr_utility.set_location('csr_person_type_usages',16);
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1136: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),16);
1129:
1130: if g_debug then
1131: hr_utility.set_location('csr_person_type_usages',16);
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1136: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),16);
1137: end if;
1130: if g_debug then
1131: hr_utility.set_location('csr_person_type_usages',16);
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1136: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),16);
1137: end if;
1138:
1131: hr_utility.set_location('csr_person_type_usages',16);
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1136: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),16);
1137: end if;
1138:
1139: EXIT WHEN currec.system_person_type <> p_system_person_type;
1132: hr_utility.set_location('person_type_usage_id = '||to_char(currec.person_type_usage_id),16);
1133: hr_utility.set_location('object_version_number = '||to_char(currec.object_version_number),16);
1134: hr_utility.set_location('system_person_type = '||currec.system_person_type,16);
1135: hr_utility.set_location('effective_start_date = '||to_char(currec.effective_start_date),16);
1136: hr_utility.set_location('effective_end_date = '||to_char(currec.effective_end_date),16);
1137: end if;
1138:
1139: EXIT WHEN currec.system_person_type <> p_system_person_type;
1140:
1138:
1139: EXIT WHEN currec.system_person_type <> p_system_person_type;
1140:
1141: if g_debug then
1142: hr_utility.set_location(l_proc, 25);
1143: end if;
1144: l_person_type_usage_id := currec.person_type_usage_id;
1145: l_object_version_number := currec.object_version_number;
1146: l_system_person_type := currec.system_person_type;
1148:
1149: end loop;
1150: --
1151: if g_debug then
1152: hr_utility.set_location(l_proc, 30);
1153: hr_utility.set_location(l_proc||':'||to_char(l_effective_start_date,'DD-MON-YYYY'), 99);
1154: hr_utility.set_location(l_proc||':'||to_char(l_effective_end_date,'DD-MON-YYYY'), 99);
1155: hr_utility.set_location(l_proc||':'||to_char(l_person_type_usage_id),99);
1156: end if;
1149: end loop;
1150: --
1151: if g_debug then
1152: hr_utility.set_location(l_proc, 30);
1153: hr_utility.set_location(l_proc||':'||to_char(l_effective_start_date,'DD-MON-YYYY'), 99);
1154: hr_utility.set_location(l_proc||':'||to_char(l_effective_end_date,'DD-MON-YYYY'), 99);
1155: hr_utility.set_location(l_proc||':'||to_char(l_person_type_usage_id),99);
1156: end if;
1157: -- Ensure the person type usage identifier and effective dates have all been set
1150: --
1151: if g_debug then
1152: hr_utility.set_location(l_proc, 30);
1153: hr_utility.set_location(l_proc||':'||to_char(l_effective_start_date,'DD-MON-YYYY'), 99);
1154: hr_utility.set_location(l_proc||':'||to_char(l_effective_end_date,'DD-MON-YYYY'), 99);
1155: hr_utility.set_location(l_proc||':'||to_char(l_person_type_usage_id),99);
1156: end if;
1157: -- Ensure the person type usage identifier and effective dates have all been set
1158: --
1151: if g_debug then
1152: hr_utility.set_location(l_proc, 30);
1153: hr_utility.set_location(l_proc||':'||to_char(l_effective_start_date,'DD-MON-YYYY'), 99);
1154: hr_utility.set_location(l_proc||':'||to_char(l_effective_end_date,'DD-MON-YYYY'), 99);
1155: hr_utility.set_location(l_proc||':'||to_char(l_person_type_usage_id),99);
1156: end if;
1157: -- Ensure the person type usage identifier and effective dates have all been set
1158: --
1159: if ((l_person_type_usage_id is not null)
1159: if ((l_person_type_usage_id is not null)
1160: and (l_effective_start_date is not null) and (l_effective_end_date is not null)) then
1161: --
1162: if g_debug then
1163: hr_utility.set_location(l_proc, 40);
1164: end if;
1165: --
1166: benefits_person_type_usage_b
1167: (p_effective_date => p_effective_date
1205:
1206: l_object_version_number1 := csr_ptu_rec.object_version_number;
1207:
1208: if g_debug then
1209: hr_utility.set_location('csr_ptu_rec',16);
1210: hr_utility.set_location('person_type_usage_id = '||to_char(csr_ptu_rec.person_type_usage_id),16);
1211: hr_utility.set_location('effective_end_date = '||to_char(csr_ptu_rec.effective_end_date,'DD-MON-YYYY'),16);
1212: end if;
1213: --
1206: l_object_version_number1 := csr_ptu_rec.object_version_number;
1207:
1208: if g_debug then
1209: hr_utility.set_location('csr_ptu_rec',16);
1210: hr_utility.set_location('person_type_usage_id = '||to_char(csr_ptu_rec.person_type_usage_id),16);
1211: hr_utility.set_location('effective_end_date = '||to_char(csr_ptu_rec.effective_end_date,'DD-MON-YYYY'),16);
1212: end if;
1213: --
1214: hr_per_type_usage_internal.delete_person_type_usage
1207:
1208: if g_debug then
1209: hr_utility.set_location('csr_ptu_rec',16);
1210: hr_utility.set_location('person_type_usage_id = '||to_char(csr_ptu_rec.person_type_usage_id),16);
1211: hr_utility.set_location('effective_end_date = '||to_char(csr_ptu_rec.effective_end_date,'DD-MON-YYYY'),16);
1212: end if;
1213: --
1214: hr_per_type_usage_internal.delete_person_type_usage
1215: (p_person_type_usage_id => csr_ptu_rec.person_type_usage_id
1220: ,p_effective_end_date => l_effective_end_date1
1221: );
1222:
1223: if g_debug then
1224: hr_utility.set_location('l_object_version_number1 = '||to_char(l_object_version_number1),16);
1225: hr_utility.set_location('l_effective_start_date1 = '||to_char(l_effective_start_date1,'DD-MON-YYYY'),16);
1226: hr_utility.set_location('l_effective_end_date1 = '||to_char(l_effective_end_date1,'DD-MON-YYYY'),16);
1227: end if;
1228:
1221: );
1222:
1223: if g_debug then
1224: hr_utility.set_location('l_object_version_number1 = '||to_char(l_object_version_number1),16);
1225: hr_utility.set_location('l_effective_start_date1 = '||to_char(l_effective_start_date1,'DD-MON-YYYY'),16);
1226: hr_utility.set_location('l_effective_end_date1 = '||to_char(l_effective_end_date1,'DD-MON-YYYY'),16);
1227: end if;
1228:
1229: end loop;
1222:
1223: if g_debug then
1224: hr_utility.set_location('l_object_version_number1 = '||to_char(l_object_version_number1),16);
1225: hr_utility.set_location('l_effective_start_date1 = '||to_char(l_effective_start_date1,'DD-MON-YYYY'),16);
1226: hr_utility.set_location('l_effective_end_date1 = '||to_char(l_effective_end_date1,'DD-MON-YYYY'),16);
1227: end if;
1228:
1229: end loop;
1230:
1251: --
1252: end if;
1253: --
1254: if g_debug then
1255: hr_utility.set_location(' Leaving:'||l_proc, 1000);
1256: end if;
1257: --
1258: end cancel_person_type_usage;
1259: --
1369: --
1370: begin
1371: if g_debug then
1372: l_proc := 'change_hire_date_ptu';
1373: hr_utility.set_location(' Entering:'||l_proc, 10);
1374: end if;
1375: /*
1376: ** Get the person type usage record valid on the old date_start
1377: ** with correct type -
1432: end if;
1433: end if;
1434: --
1435: if g_debug then
1436: hr_utility.set_location(l_proc, 20);
1437: end if;
1438: --
1439: open csr_prev_other_row;
1440: fetch csr_prev_other_row into l_prev_other_row;
1484: --
1485: end if;
1486: --
1487: if g_debug then
1488: hr_utility.set_location(l_proc, 30);
1489: end if;
1490: --
1491: if l_rows_found then
1492: --
1510: end if;
1511: close get_ptu;
1512: --
1513: if g_debug then
1514: hr_utility.set_location(' Leaving:'||l_proc, 100);
1515: end if;
1516: end change_hire_date_ptu;
1517: --
1518: end hr_per_type_usage_internal;