621: -- on startup = 'BEGIN'( First time called from form)
622: -- other values depend on what meesages have been returned to the client
623: -- and the re-entry point on return from the client.
624: --
625: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',5);
626: --
627: /* BEGIN OF WWBUG 1975359 */
628: open c1;
629: --
642: /* BEGIN OF WWBUG 1975359 */
643: --
644: if p_status = 'BEGIN' then
645: --
646: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',10);
647: -- Test to see if the hire_date_has changed
648: -- Providing Person type has not and it is emp.
649: -- Or that it has changed to EMP
650: --
661: -- get the period_of_service_id
662: -- 303729 if person is a supervisor
663: -- test whether change to hire_date would invalidate this action
664: --
665: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',15);
666: --
667: if ((p_hire_date <> p_s_hire_date)
668: and (p_system_person_type = p_s_system_person_type))
669: then
669: then
670: per_people12_pkg.check_not_supervisor(p_person_id
671: ,p_hire_date
672: ,p_s_hire_date);
673: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',20);
674: end if;
675: begin
676: select pps.period_of_service_id
677: into l_period_of_service_id
678: from per_periods_of_service pps
679: where pps.person_id = p_person_id
680: and pps.date_start = p_s_hire_date;
681: --
682: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',25);
683: exception
684: when no_data_found then
685: --
686: -- If no data found and a previous hire date existed
686: -- If no data found and a previous hire date existed
687: -- then raise an error;
688: --
689: if p_s_hire_date is not null then
690: hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
691: hr_utility.set_message_token('PROCEDURE','Update_row');
692: hr_utility.raise_error;
693: end if;
694: end;
687: -- then raise an error;
688: --
689: if p_s_hire_date is not null then
690: hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
691: hr_utility.set_message_token('PROCEDURE','Update_row');
692: hr_utility.raise_error;
693: end if;
694: end;
695: --
688: --
689: if p_s_hire_date is not null then
690: hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
691: hr_utility.set_message_token('PROCEDURE','Update_row');
692: hr_utility.raise_error;
693: end if;
694: end;
695: --
696: -- check the integrity of the date change.
695: --
696: -- check the integrity of the date change.
697: -- Date may come in between a person type change.
698: --
699: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',30);
700: hr_date_chk.check_hire_ref_int(p_person_id
701: ,p_business_group_id
702: ,l_period_of_service_id
703: ,p_s_hire_date
705: ,p_hire_date);
706: -- VT 12/05/96 bug #418637
707: -- check the existence of the recurring element entries
708: --
709: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',35);
710: per_people12_pkg.check_recur_ent(p_person_id,p_hire_date,
711: p_s_hire_date,l_warn_ee);
712: end if;
713: --
717: -- a global version of session date to update the rows (not good)
718: --
719: -- VT 08/13/96
720: if p_session_date <> p_effective_start_date then
721: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',40);
722: per_people9_pkg.update_old_person_row(p_person_id =>p_person_id
723: ,p_session_date => p_session_date
724: ,p_effective_start_date=>p_effective_start_date);
725: end if;
736: -- if p_current_employee_flag = 'Y' and
737: -- p_current_applicant_flag is null and
738: -- p_employee_number is not null then
739: -- null;
740: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',45);
741: -- else
742: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',50);
743: -- hr_person.generate_number(p_current_employee_flag
744: -- ,p_current_applicant_flag
738: -- p_employee_number is not null then
739: -- null;
740: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',45);
741: -- else
742: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',50);
743: -- hr_person.generate_number(p_current_employee_flag
744: -- ,p_current_applicant_flag
745: -- ,null --p_current_npw_flag
746: -- ,p_national_identifier
762: , p_current_employee => p_current_employee_flag
763: , p_current_applicant => p_current_applicant_flag
764: , p_current_npw => null --p_current_npw_flag
765: );
766: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',55);
767: -- VT 12/05/96 bug #418637
768: if l_warn_ee = 'Y' then
769: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',60);
770: p_status := 'RECUR_ENT_CHK'; -- Set status to next reentry point.
765: );
766: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',55);
767: -- VT 12/05/96 bug #418637
768: if l_warn_ee = 'Y' then
769: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',60);
770: p_status := 'RECUR_ENT_CHK'; -- Set status to next reentry point.
771: else
772: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',65);
773: p_status := 'VACANCY_CHECK'; -- Set status to next possible reentry point.
768: if l_warn_ee = 'Y' then
769: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',60);
770: p_status := 'RECUR_ENT_CHK'; -- Set status to next reentry point.
771: else
772: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',65);
773: p_status := 'VACANCY_CHECK'; -- Set status to next possible reentry point.
774: end if;
775: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',70);
776:
771: else
772: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',65);
773: p_status := 'VACANCY_CHECK'; -- Set status to next possible reentry point.
774: end if;
775: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',70);
776:
777: --Start of fix for Bug 2167668
778:
779: IF p_start_date > p_hold_applicant_date_until THEN
776:
777: --Start of fix for Bug 2167668
778:
779: IF p_start_date > p_hold_applicant_date_until THEN
780: hr_utility.set_message('800', 'PER_289796_HOLD_UNTIL_DATE');
781: hr_utility.set_message_token('HOLD_DATE', p_start_date );
782: hr_utility.raise_error;
783: END IF;
784:
777: --Start of fix for Bug 2167668
778:
779: IF p_start_date > p_hold_applicant_date_until THEN
780: hr_utility.set_message('800', 'PER_289796_HOLD_UNTIL_DATE');
781: hr_utility.set_message_token('HOLD_DATE', p_start_date );
782: hr_utility.raise_error;
783: END IF;
784:
785: -- End of fix for Bug 2167668
778:
779: IF p_start_date > p_hold_applicant_date_until THEN
780: hr_utility.set_message('800', 'PER_289796_HOLD_UNTIL_DATE');
781: hr_utility.set_message_token('HOLD_DATE', p_start_date );
782: hr_utility.raise_error;
783: END IF;
784:
785: -- End of fix for Bug 2167668
786: end if; -- End the First in section
786: end if; -- End the First in section
787: --
788: -- VT 12/05/96 bug #418637
789: if p_status = 'RECUR_ENT_CHK' then
790: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',75);
791: return;
792: end if; -- End of RECUR_ENT_CHK
793: --
794: --
804: and p_s_system_person_type = 'EMP')
805: or (p_system_person_type = 'EX_EMP_APL'
806: and p_s_system_person_type = 'EX_EMP') then
807: --
808: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',80);
809: NULL;
810: -- 3652025 >> this process is replaced by call to
811: -- hr_applicant_internal.create_applicant_anytime() procedure.
812: -- called directly from PERWSEPI.pld
825: --
826: --per_people3_pkg.check_future_apl(p_person_id => p_person_id
827: -- ,p_hire_date => greatest(p_hire_date
828: --,p_effective_start_date));
829: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',85);
830: --
831: -- Insert the default applicant row and applicant
832: -- assignment.
833: --
846: -- ,p_last_update_login => p_last_update_login
847: -- ,p_created_by => p_created_by
848: -- ,p_creation_date => p_creation_date);
849: --
850: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',90);
851: --
852: -- PTU Changes
853:
854: --hr_per_type_usage_internal.maintain_person_type_usage
856: -- ,p_person_id => p_person_id
857: -- ,p_person_type_id => p_person_type_id
858: -- );
859: --
860: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',92);
861: -- PTU Changes
862: -- <<
863: -- Has the Person type changed to become that of an employee
864: -- when the previous type is not a current applicant?
867: and ( p_s_system_person_type = 'OTHER'
868: or p_s_system_person_type = 'EX_EMP'
869: or p_s_system_person_type = 'EX_APL')) then /* Bug 523924 */
870: -- or p_s_system_person_type = 'EX_EMP')) then
871: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',95);
872: --
873: -- Ensure no future person_type_changes.
874: --
875: if hr_person.chk_future_person_type(p_s_system_person_type
884: end if;
885: --
886: if p_s_system_person_type = 'EX_EMP'
887: then
888: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',100);
889: --
890: -- Bug 3154253 stars here.
891: -- Passed earlier of p_ession_date and p_hire_date
892: -- (p_effective_start_date) to the check_hire procedure.
891: -- Passed earlier of p_ession_date and p_hire_date
892: -- (p_effective_start_date) to the check_hire procedure.
893: --
894: if p_session_date < p_effective_start_date then
895: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',101);
896: per_people12_pkg.check_rehire(p_person_id, p_session_date);
897: else
898: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',102);
899: per_people12_pkg.check_rehire(p_person_id, p_hire_date);
894: if p_session_date < p_effective_start_date then
895: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',101);
896: per_people12_pkg.check_rehire(p_person_id, p_session_date);
897: else
898: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',102);
899: per_people12_pkg.check_rehire(p_person_id, p_hire_date);
900: end if;
901: --
902: -- bug 3154253 ends here.
900: end if;
901: --
902: -- bug 3154253 ends here.
903: --
904: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',105);
905: end if;
906: per_people12_pkg.check_future_changes(p_person_id
907: ,p_effective_start_date);
908: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',110);
904: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',105);
905: end if;
906: per_people12_pkg.check_future_changes(p_person_id
907: ,p_effective_start_date);
908: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',110);
909: --
910: -- Ensure there are no future applicant assignments
911: --
912: /* per_people3_pkg.check_future_apl(p_person_id => p_person_id
923: per_people3_pkg.check_future_apl(p_person_id => p_person_id
924: ,p_hire_date => greatest(p_hire_date,p_effective_start_date));
925: end if;
926:
927: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',115);
928: --
929: -- Insert the default period_of service and assignment
930: -- rows.
931: --
946: ,p_created_by => p_created_by
947: ,p_creation_date => p_creation_date
948: ,p_adjusted_svc_date => p_adjusted_svc_date);
949: --
950: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',120);
951:
952: -- PTU Changes
953:
954: l_back2back := per_periods_of_service_pkg_v2.IsBackToBackContract
956: if p_s_system_person_type in ('EX_EMP','EX_EMP_APL') -- Bug 3637893
957: and p_system_person_type = 'EMP'
958: -- and p_session_date = p_effective_start_date then
959: and l_back2back then
960: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',1201);
961: hr_per_type_usage_internal.maintain_person_type_usage
962: (p_effective_date => p_effective_start_date
963: ,p_person_id => p_person_id
964: ,p_person_type_id => p_person_type_id
969: (p_effective_date => p_effective_start_date
970: ,p_person_id => p_person_id
971: ,p_person_type_id => p_person_type_id
972: );
973: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',1202);
974: end if;
975:
976: -- PTU Changes
977:
974: end if;
975:
976: -- PTU Changes
977:
978: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',121);
979:
980: -- Has the Person become an Employee or Employee applicant from being an
981: -- applicant or employee applicant?
982: --
985: or (p_system_person_type = 'EMP_APL'
986: and p_s_system_person_type in ('APL','EX_EMP_APL')) /* Bug 732598 */
987: or (p_system_person_type = 'EMP'
988: and p_s_system_person_type = 'EMP_APL')) then
989: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',125);
990: --
991: -- Ensure no future person_type_changes.
992: --
993: if hr_person.chk_future_person_type(p_s_system_person_type
994: ,p_person_id
995: ,p_business_group_id
996: ,p_effective_start_date) then
997: fnd_message.set_name('PAY','HR_7193_PER_FUT_TYPE_EXISTS');
998: hr_utility.raise_error;
999: end if;
1000: --
1001: -- Ensure there are no future applicant assignments
1002: --
1014: per_people3_pkg.check_future_apl(p_person_id => p_person_id
1015: ,p_hire_date => greatest(p_hire_date,p_effective_start_date));
1016: end if;
1017:
1018: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',130);
1019: --
1020: -- Check if the person have open term_assignment records. These can be
1021: -- found by checking if the person have a periods_of_service with
1022: -- no FPD and a value for ATD. Bug 2881076
1026: -- Check that the change is valid.
1027: --
1028: if p_status = 'VACANCY_CHECK' then
1029: loop
1030: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',135);
1031: exit when p_status = 'BOOKINGS_EXIST';
1032: --
1033: -- Check each vacancy,if it is oversubscribed
1034: -- l_fire_warning = 'Y', return to client
1035: -- displaying relevant message.
1036: -- on return l_vacancy_id starts the cursor at the
1037: -- relevant point.
1038: --
1039: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',140);
1040: per_people3_pkg.vacancy_chk(p_person_id => p_person_id
1041: ,p_fire_warning => l_fire_warning
1042: ,p_vacancy_id => p_vacancy_id
1043: -- **** Start new code for bug 2264569 ****************
1044: ,p_table => p_tab -- #2381925
1045: -- **** End new code for bug 2264569 *****************
1046: );
1047: if l_fire_warning = 'Y' then
1048: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',145);
1049: return;
1050: elsif l_fire_warning = 'N' then
1051: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',150);
1052: p_status := 'BOOKINGS_EXIST'; -- Set next possible re-entry point.
1047: if l_fire_warning = 'Y' then
1048: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',145);
1049: return;
1050: elsif l_fire_warning = 'N' then
1051: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',150);
1052: p_status := 'BOOKINGS_EXIST'; -- Set next possible re-entry point.
1053: end if;
1054: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',155);
1055: end loop;
1050: elsif l_fire_warning = 'N' then
1051: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',150);
1052: p_status := 'BOOKINGS_EXIST'; -- Set next possible re-entry point.
1053: end if;
1054: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',155);
1055: end loop;
1056: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',160);
1057: end if; -- End of VACANCY_CHECK
1058: --
1052: p_status := 'BOOKINGS_EXIST'; -- Set next possible re-entry point.
1053: end if;
1054: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',155);
1055: end loop;
1056: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',160);
1057: end if; -- End of VACANCY_CHECK
1058: --
1059: if p_status = 'BOOKINGS_EXIST' then
1060: -- VT 09/18/96 #288087, #380280 , #2172590
1060: -- VT 09/18/96 #288087, #380280 , #2172590
1061: if (per_people3_pkg.chk_events_exist(p_person_id =>p_person_id
1062: ,p_business_group_id =>p_business_group_id
1063: ,p_hire_date => greatest(p_hire_date,p_session_date))) then
1064: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',165);
1065: return;
1066: else
1067: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',170);
1068: -- **** Start commented code for bug 2264569 *************************
1063: ,p_hire_date => greatest(p_hire_date,p_session_date))) then
1064: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',165);
1065: return;
1066: else
1067: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',170);
1068: -- **** Start commented code for bug 2264569 *************************
1069: --p_status := 'GET_APPLS'; -- Set next possible re-entry point.
1070: -- **** End commented code for bug 2264569 ***************************
1071: -- **** Start new code for bug 2264569 ***************************
1071: -- **** Start new code for bug 2264569 ***************************
1072: p_status := 'CHOOSE_VAC'; -- Set next possible re-entry point.
1073: -- **** End new code for bug 2264569 *********************************
1074: end if;
1075: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',175);
1076: end if;
1077: if p_status = 'END_BOOKINGS' then
1078: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',180);
1079: hrhirapl.end_bookings(p_person_id
1074: end if;
1075: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',175);
1076: end if;
1077: if p_status = 'END_BOOKINGS' then
1078: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',180);
1079: hrhirapl.end_bookings(p_person_id
1080: , p_business_group_id
1081: , p_hire_date);
1082: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',185);
1078: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',180);
1079: hrhirapl.end_bookings(p_person_id
1080: , p_business_group_id
1081: , p_hire_date);
1082: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',185);
1083: --
1084: -- **** START commented code for bug 2264569 *************************** --
1085: --p_status := 'GET_APPLS'; -- Set next possible re-entry point.
1086: -- **** End commented code for bug 2264569 ************************
1098: -- if p_status='GET_APPLS' then
1099: --
1100: -- Get all the accepted applicants
1101: --
1102: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',190);
1103: -- per_people3_pkg.get_accepted_appls(p_person_id => p_person_id
1104: -- ,p_num_accepted_appls => l_num_accepted_appls
1105: -- ,p_new_primary_id =>p_new_primary_id);
1106: --
1105: -- ,p_new_primary_id =>p_new_primary_id);
1106: --
1107: -- Get all current applicant assignments.
1108: --
1109: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',195);
1110: -- per_people3_pkg.get_all_current_appls(p_person_id => p_person_id
1111: -- ,p_num_appls => l_num_appls);
1112: --
1113: -- if p_system_person_type = 'EMP_APL' then
1110: -- per_people3_pkg.get_all_current_appls(p_person_id => p_person_id
1111: -- ,p_num_appls => l_num_appls);
1112: --
1113: -- if p_system_person_type = 'EMP_APL' then
1114: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',200);
1115: --
1116: -- If we have got this far then there must be > 0 Accepted
1117: -- applications,therefore check p_system_person_type if EMP_APL
1118: -- and number of accepted is equal to number of current assignments
1119: -- then there is an error. Otherwise go around end_accepted
1120: -- to multiple contracts.
1121: --
1122: -- if l_num_accepted_appls = l_num_appls then
1123: -- hr_utility.set_message('801','HR_6791_EMP_APL_NO_ASG');
1124: -- hr_utility.raise_error;
1125: -- else
1126: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',205);
1127: -- p_status := 'MULTIPLE_CONTRACTS';-- Set next re-entry point.
1120: -- to multiple contracts.
1121: --
1122: -- if l_num_accepted_appls = l_num_appls then
1123: -- hr_utility.set_message('801','HR_6791_EMP_APL_NO_ASG');
1124: -- hr_utility.raise_error;
1125: -- else
1126: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',205);
1127: -- p_status := 'MULTIPLE_CONTRACTS';-- Set next re-entry point.
1128: -- end if;
1122: -- if l_num_accepted_appls = l_num_appls then
1123: -- hr_utility.set_message('801','HR_6791_EMP_APL_NO_ASG');
1124: -- hr_utility.raise_error;
1125: -- else
1126: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',205);
1127: -- p_status := 'MULTIPLE_CONTRACTS';-- Set next re-entry point.
1128: -- end if;
1129: -- --
1130: -- Number of accepted does not equal number of current then
1128: -- end if;
1129: -- --
1130: -- Number of accepted does not equal number of current then
1131: -- end_accepted.
1132: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',210);
1133: --
1134: -- elsif l_num_accepted_appls <> l_num_appls then
1135: -- hr_utility.set_message('801','HR_EMP_UNACCEPTED_APPL');
1136: -- p_status := 'END_UNACCEPTED'; -- next code re-entry,
1131: -- end_accepted.
1132: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',210);
1133: --
1134: -- elsif l_num_accepted_appls <> l_num_appls then
1135: -- hr_utility.set_message('801','HR_EMP_UNACCEPTED_APPL');
1136: -- p_status := 'END_UNACCEPTED'; -- next code re-entry,
1137: -- return;
1138: -- --
1139: -- Otherwise ignore end_accepted.
1138: -- --
1139: -- Otherwise ignore end_accepted.
1140: --
1141: -- else
1142: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',215);
1143: -- p_status := 'MULTIPLE_CONTRACTS'; -- next code re-entry.
1144: -- end if;
1145: -- end if; -- End of GET_APPLS
1146: --
1147: -- if p_status = 'END_UNACCEPTED' then
1148: --
1149: -- End the unaccepted assignments.
1150: --
1151: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',220);
1152: -- hrhirapl.end_unaccepted_app_assign(p_person_id
1153: -- ,p_business_group_id
1154: -- ,p_legislation_code
1155: -- ,p_session_date);
1152: -- hrhirapl.end_unaccepted_app_assign(p_person_id
1153: -- ,p_business_group_id
1154: -- ,p_legislation_code
1155: -- ,p_session_date);
1156: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',225);
1157: -- p_status := 'MULTIPLE_CONTRACTS';
1158: -- end if; -- End of END_UNACCEPTED
1159: -- --
1160: -- -- Test to see if multiple contracts are a possibility.
1158: -- end if; -- End of END_UNACCEPTED
1159: -- --
1160: -- -- Test to see if multiple contracts are a possibility.
1161: -- --
1162: --hr_utility.set_location('update_row - b4 MULTIPLE_CONTRACTS',1);
1163: -- if p_status = 'MULTIPLE_CONTRACTS' then -- MULTIPLE_CONTRACTS
1164: -- if l_num_accepted_appls >1 then
1165: -- hr_utility.set_message('801','HR_EMP_MULTIPLE_CONTRACTS');
1166: -- return;
1161: -- --
1162: --hr_utility.set_location('update_row - b4 MULTIPLE_CONTRACTS',1);
1163: -- if p_status = 'MULTIPLE_CONTRACTS' then -- MULTIPLE_CONTRACTS
1164: -- if l_num_accepted_appls >1 then
1165: -- hr_utility.set_message('801','HR_EMP_MULTIPLE_CONTRACTS');
1166: -- return;
1167: -- else
1168: -- p_status := 'CHOOSE_VAC'; -- next code re-entry.
1169: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',230);
1165: -- hr_utility.set_message('801','HR_EMP_MULTIPLE_CONTRACTS');
1166: -- return;
1167: -- else
1168: -- p_status := 'CHOOSE_VAC'; -- next code re-entry.
1169: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',230);
1170: -- end if;
1171: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',235);
1172: -- end if; -- End of MULTIPLE_CONTRACTS
1173: --
1167: -- else
1168: -- p_status := 'CHOOSE_VAC'; -- next code re-entry.
1169: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',230);
1170: -- end if;
1171: --hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',235);
1172: -- end if; -- End of MULTIPLE_CONTRACTS
1173: --
1174: -- **** END commented code for bug 2264569 ****************************
1175: --
1175: --
1176: -- Choose whether to change the Primary assignment
1177: -- and which vacancy is to be the primary if so.
1178: --
1179: hr_utility.set_location('update_row - b4 CHOOSE_VAC',1);
1180: if p_status = 'CHOOSE_VAC' then
1181: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',240);
1182: return;
1183: end if; --End of CHOOSE_VAC
1177: -- and which vacancy is to be the primary if so.
1178: --
1179: hr_utility.set_location('update_row - b4 CHOOSE_VAC',1);
1180: if p_status = 'CHOOSE_VAC' then
1181: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',240);
1182: return;
1183: end if; --End of CHOOSE_VAC
1184: --
1185: -- Can now hire the Person
1185: -- Can now hire the Person
1186: -- Note HIRE status can only be set from client form
1187: -- as interaction is generally required.
1188: --
1189: hr_utility.set_location('update_row - b4 HIRE',1);
1190: -- +-------------------------------------------------------------------+
1191: -- +--------- BEGIN: Hire process -------------------------------------+
1192: -- +-------------------------------------------------------------------+
1193: if p_status = 'HIRE' then
1190: -- +-------------------------------------------------------------------+
1191: -- +--------- BEGIN: Hire process -------------------------------------+
1192: -- +-------------------------------------------------------------------+
1193: if p_status = 'HIRE' then
1194: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',245);
1195:
1196: -- bug fix 2824664:
1197: if p_update_primary = 'Y'
1198: and future_pactid_exists(p_person_id, p_effective_start_date)
1196: -- bug fix 2824664:
1197: if p_update_primary = 'Y'
1198: and future_pactid_exists(p_person_id, p_effective_start_date)
1199: then
1200: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',246);
1201: fnd_message.set_name('PAY','HR_6591_ASS_ACTIONS_EXIST');
1202: hr_utility.raise_error;
1203: end if;
1204: -- end bug fix 2824664
1198: and future_pactid_exists(p_person_id, p_effective_start_date)
1199: then
1200: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',246);
1201: fnd_message.set_name('PAY','HR_6591_ASS_ACTIONS_EXIST');
1202: hr_utility.raise_error;
1203: end if;
1204: -- end bug fix 2824664
1205: --
1206: -- If new is Emp and old was Emp_apl
1207: -- then l_emp_emp_apl is set to Y
1208: --
1209: if p_system_person_type = 'EMP'
1210: and p_s_system_person_type = 'EMP_APL' then
1211: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',250);
1212: l_employ_emp_apl := 'Y';
1213: else
1214: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',255);
1215: l_employ_emp_apl := 'N';
1210: and p_s_system_person_type = 'EMP_APL' then
1211: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',250);
1212: l_employ_emp_apl := 'Y';
1213: else
1214: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',255);
1215: l_employ_emp_apl := 'N';
1216: end if;
1217: --
1218: -- Run the employ_applicant stored procedure
1216: end if;
1217: --
1218: -- Run the employ_applicant stored procedure
1219: --
1220: hr_utility.set_location('update_row - b4 hrhirapl',1);
1221: -- **** Start new code for bug 2264569 *****************************
1222: -- End date chosen unaccepted applicant assignments
1223: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',257);
1224: hrhirapl.end_unaccepted_app_assign(p_person_id
1219: --
1220: hr_utility.set_location('update_row - b4 hrhirapl',1);
1221: -- **** Start new code for bug 2264569 *****************************
1222: -- End date chosen unaccepted applicant assignments
1223: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',257);
1224: hrhirapl.end_unaccepted_app_assign(p_person_id
1225: ,p_business_group_id
1226: ,p_legislation_code
1227: ,p_session_date
1225: ,p_business_group_id
1226: ,p_legislation_code
1227: ,p_session_date
1228: ,p_tab);
1229: hr_utility.set_location('update_row - b4 hrhirapl',2);
1230:
1231: -- **** End new code for bug 2264569 *****************************
1232:
1233: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',259);
1229: hr_utility.set_location('update_row - b4 hrhirapl',2);
1230:
1231: -- **** End new code for bug 2264569 *****************************
1232:
1233: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',259);
1234: hrhirapl.employ_applicant(p_person_id
1235: ,p_business_group_id
1236: ,p_legislation_code
1237: ,p_new_primary_id
1250: -- **** Start new code for bug 2264569 ******
1251: ,p_tab
1252: -- **** End new code for bug 2264569 *******
1253: );
1254: hr_utility.set_location('update_row - after hrhirapl',2);
1255: hr_utility.set_location('manage PTU records',3);
1256: if p_system_person_type = 'EMP' then
1257: --
1258: -- PTU : Following Code has been added
1251: ,p_tab
1252: -- **** End new code for bug 2264569 *******
1253: );
1254: hr_utility.set_location('update_row - after hrhirapl',2);
1255: hr_utility.set_location('manage PTU records',3);
1256: if p_system_person_type = 'EMP' then
1257: --
1258: -- PTU : Following Code has been added
1259: -- hr_per_type_usage_internal.maintain_ptu(
1263: --
1264: -- **** START new code for bug 2264569 ******************************************
1265: -- Update the system person type to EMP_APL if user is keeping active APPLS.
1266: if hr_employee_applicant_api.retain_exists(p_tab) then
1267: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',260);
1268: p_system_person_type := 'EMP_APL';
1269: open c_apl_flag(p_system_person_type);
1270: fetch c_apl_flag into p_current_applicant_flag;
1271: close c_apl_flag;
1268: p_system_person_type := 'EMP_APL';
1269: open c_apl_flag(p_system_person_type);
1270: fetch c_apl_flag into p_current_applicant_flag;
1271: close c_apl_flag;
1272: hr_utility.trace(' current applicant_flag : '||p_current_applicant_flag);
1273: end if;
1274: -- **** END new code for bug 2264569 *******************************************
1275:
1276: -- Bug 3637893 Starts
1285: if p_s_system_person_type in ('EX_EMP','EX_EMP_APL')
1286: and p_system_person_type = 'EMP'
1287: -- and p_session_date = p_effective_start_date then
1288: and l_back2back then
1289: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',1211);
1290: hr_per_type_usage_internal.maintain_person_type_usage
1291: (p_effective_date => p_effective_start_date
1292: ,p_person_id => p_person_id
1293: ,p_person_type_id => p_person_type_id
1298: (p_effective_date => p_effective_start_date
1299: ,p_person_id => p_person_id
1300: ,p_person_type_id => p_person_type_id
1301: );
1302: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',1212);
1303: end if;
1304: -- Bug 3637893 Ends
1305: --
1306: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',260);
1302: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',1212);
1303: end if;
1304: -- Bug 3637893 Ends
1305: --
1306: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',260);
1307: -- **** Start new code for bug 2264569 **********************************
1308: if NOT hr_employee_applicant_api.retain_exists(p_tab) then
1309: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',262);
1310: -- **** End new code for bug 2264569 **********************************
1305: --
1306: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',260);
1307: -- **** Start new code for bug 2264569 **********************************
1308: if NOT hr_employee_applicant_api.retain_exists(p_tab) then
1309: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',262);
1310: -- **** End new code for bug 2264569 **********************************
1311: hr_per_type_usage_internal.maintain_person_type_usage
1312: (p_effective_date => p_effective_start_date
1313: ,p_person_id => p_person_id
1324: end if; -- End of hire
1325: -- +-------------------------------------------------------------------+
1326: -- +----------- END: Hire process -------------------------------------+
1327: -- +-------------------------------------------------------------------+
1328: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',265);
1329: end if; -- End of HIRE.
1330: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',270);
1331: end if; -- Of Person type change checks.
1332: --
1326: -- +----------- END: Hire process -------------------------------------+
1327: -- +-------------------------------------------------------------------+
1328: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',265);
1329: end if; -- End of HIRE.
1330: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',270);
1331: end if; -- Of Person type change checks.
1332: --
1333: -- changed p_rowid => null to p_rowid => p_rowid
1334: --
1404: close c1;
1405:
1406: end if;
1407:
1408: hr_utility.set_location('update_row - b4 update',1);
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1405:
1406: end if;
1407:
1408: hr_utility.set_location('update_row - b4 update',1);
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1413: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||hr_person_type_usage_info.get_default_person_type_id(
1406: end if;
1407:
1408: hr_utility.set_location('update_row - b4 update',1);
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1413: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||hr_person_type_usage_info.get_default_person_type_id(
1414: p_business_group_id,p_system_person_type),272);
1407:
1408: hr_utility.set_location('update_row - b4 update',1);
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1413: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||hr_person_type_usage_info.get_default_person_type_id(
1414: p_business_group_id,p_system_person_type),272);
1415:
1408: hr_utility.set_location('update_row - b4 update',1);
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1413: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||hr_person_type_usage_info.get_default_person_type_id(
1414: p_business_group_id,p_system_person_type),272);
1415:
1416: -- Bug 6196362 Starts.
1409: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',272);
1410: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_person_type_id,272);
1411: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_s_system_person_type,272);
1412: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||p_system_person_type,272);
1413: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1 '||hr_person_type_usage_info.get_default_person_type_id(
1414: p_business_group_id,p_system_person_type),272);
1415:
1416: -- Bug 6196362 Starts.
1417: -- update per_people_f ppf
1567: ,ppf.local_name = p_local_name
1568: where ppf.rowid = p_rowid;
1569: --
1570: if sql%rowcount <1 then
1571: hr_utility.set_message(801,'HR_6001_ALL_MANDATORY_FIELD');
1572: hr_utility.set_message_token('MISSING_FIELD','rowid is'||p_rowid);
1573: hr_utility.raise_error;
1574: end if;
1575: --
1568: where ppf.rowid = p_rowid;
1569: --
1570: if sql%rowcount <1 then
1571: hr_utility.set_message(801,'HR_6001_ALL_MANDATORY_FIELD');
1572: hr_utility.set_message_token('MISSING_FIELD','rowid is'||p_rowid);
1573: hr_utility.raise_error;
1574: end if;
1575: --
1576:
1569: --
1570: if sql%rowcount <1 then
1571: hr_utility.set_message(801,'HR_6001_ALL_MANDATORY_FIELD');
1572: hr_utility.set_message_token('MISSING_FIELD','rowid is'||p_rowid);
1573: hr_utility.raise_error;
1574: end if;
1575: --
1576:
1577: -- Start of Fix #2447513
1574: end if;
1575: --
1576:
1577: -- Start of Fix #2447513
1578: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',275);
1579: --End of Fix
1580:
1581: -- Tests required post-update
1582: --
1589: close c_person;
1590: --
1591: per_hrtca_merge.update_tca_person(p_Rec => l_person);
1592: --
1593: hr_utility.set_location('update_row - after update',1);
1594: --
1595: /* END OF WWBUG 1975359 */
1596: --
1597: -- HR/WF Synchronization call
1604: -- Has the Date of Birth changed?
1605: --
1606: if p_date_of_birth is null and
1607: p_s_date_of_birth is not null then
1608: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',280);
1609: per_people12_pkg.check_birth_date(p_person_id);
1610: end if;
1611: if p_date_of_birth <> p_s_date_of_birth then
1612: --
1613: -- Run the assignment_link_usages and Element_entry
1614: -- code for Change of Personal qualifying conditions.
1615: --
1616: --
1617: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',282);
1618: per_people3_pkg.run_alu_ee(p_alu_mode => 'CHANGE_PQC'
1619: ,p_business_group_id=>p_business_group_id
1620: ,p_person_id =>p_person_id
1621: ,p_old_start =>p_s_hire_date
1620: ,p_person_id =>p_person_id
1621: ,p_old_start =>p_s_hire_date
1622: ,p_start_date => p_last_update_date
1623: );
1624: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',285);
1625: end if;
1626: --
1627: hr_utility.set_location('update_row - after update',2);
1628: --
1623: );
1624: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',285);
1625: end if;
1626: --
1627: hr_utility.set_location('update_row - after update',2);
1628: --
1629: -- test if hire_date has changed. and system person type has not.
1630: --
1631: if (((p_current_employee_flag = 'Y')
1641: and Hr_General2.is_person_type(p_person_id, 'EMP',p_s_hire_date) --#2472146
1642: ) then
1643: --
1644: -- Update the period of service for the employee
1645: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',290);
1646: --
1647: per_people3_pkg.update_period(p_person_id =>p_person_id
1648: ,p_hire_date => p_s_hire_date
1649: ,p_new_hire_date =>p_hire_date
1648: ,p_hire_date => p_s_hire_date
1649: ,p_new_hire_date =>p_hire_date
1650: ,p_adjusted_svc_date => p_adjusted_svc_date);
1651: --
1652: hr_utility.set_location('update_row - after update',3);
1653: --
1654: -- Update the hire records i.e
1655: -- assignment etc.
1656: --
1659: if (((p_current_employee_flag = 'Y')
1660: and (p_hire_date <> p_s_hire_date)
1661: and (p_system_person_type = p_s_system_person_type))) then
1662: /*--- End changes for the bug 5907880 */
1663: hr_utility.set_location('update_row - after update',4);
1664: hr_date_chk.update_hire_records(p_person_id
1665: ,p_applicant_number
1666: ,p_hire_date
1667: ,p_s_hire_date
1668: ,p_last_updated_by
1669: ,p_last_update_login);
1670: End if;
1671: --
1672: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',295);
1673: -- Commented, as this action is being done in
1674: -- hr_change_start_date_api.update_pay_proposal (pehirapi.pkb)
1675: -- open get_pay_proposal;
1676: -- fetch get_pay_proposal into v_dummy;
1694: -- raise NO_DATA_FOUND;
1695: -- end if;
1696: -- exception
1697: -- when NO_DATA_FOUND then
1698: -- hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
1699: -- hr_utility.set_message_token('PROCEDURE','Update_row');
1700: -- hr_utility.set_message_token('STEP','4');
1701: -- hr_utility.raise_error;
1702: -- end;
1695: -- end if;
1696: -- exception
1697: -- when NO_DATA_FOUND then
1698: -- hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
1699: -- hr_utility.set_message_token('PROCEDURE','Update_row');
1700: -- hr_utility.set_message_token('STEP','4');
1701: -- hr_utility.raise_error;
1702: -- end;
1703: -- else
1696: -- exception
1697: -- when NO_DATA_FOUND then
1698: -- hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
1699: -- hr_utility.set_message_token('PROCEDURE','Update_row');
1700: -- hr_utility.set_message_token('STEP','4');
1701: -- hr_utility.raise_error;
1702: -- end;
1703: -- else
1704: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',300);
1697: -- when NO_DATA_FOUND then
1698: -- hr_utility.set_message('801','HR_6153_ALL_PROCEDURE_FAIL');
1699: -- hr_utility.set_message_token('PROCEDURE','Update_row');
1700: -- hr_utility.set_message_token('STEP','4');
1701: -- hr_utility.raise_error;
1702: -- end;
1703: -- else
1704: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',300);
1705: -- close get_pay_proposal;
1700: -- hr_utility.set_message_token('STEP','4');
1701: -- hr_utility.raise_error;
1702: -- end;
1703: -- else
1704: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',300);
1705: -- close get_pay_proposal;
1706: -- end if;
1707: hr_utility.set_location('update_row - after update',5);
1708: --
1703: -- else
1704: -- hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',300);
1705: -- close get_pay_proposal;
1706: -- end if;
1707: hr_utility.set_location('update_row - after update',5);
1708: --
1709: -- Update PTU records to reflect hire date change.
1710: --
1711: -- PTU changes: following has been added
1721: ,p_old_date_start => p_s_hire_date
1722: ,p_person_id => p_person_id
1723: ,p_system_person_type => 'EMP'
1724: );
1725: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',305);
1726: --
1727: -- PTU : end of changes
1728: --
1729: --
1735: ,p_person_id =>p_person_id
1736: ,p_old_start =>p_s_hire_date
1737: ,p_start_date => p_hire_date);
1738: --
1739: hr_utility.set_location('PER_PEOPLE12_PKG.update_row1',310);
1740: --
1741: end if;
1742: --
1743: -- 1766066, contact start date enh. start
1763: p_action => 'UPDATE');
1764: --*/
1765: --
1766: p_status := 'END'; -- Status required to end update loop on server
1767: hr_utility.set_location('Leaving PER_PEOPLE12_PKG.update_row1',315);
1768: --
1769: end update_row1;
1770: --
1771: procedure check_future_changes(p_person_id NUMBER
1879: -- 115.67 (END)
1880: --
1881: begin
1882: l_proc := 'per_people12_pkg.check_rehire';
1883: hr_utility.set_location('Entering '||l_proc,5);
1884: --
1885: -- 115.67 (START)
1886: --
1887: --
1896: ,l_rule_value
1897: ,l_rule_found
1898: );
1899: --
1900: hr_utility.set_location(l_proc,10);
1901: --
1902: -- 115.67 (END)
1903: --
1904: --
1909: if old_pps_exists%FOUND
1910: then
1911: close old_pps_exists;
1912: --
1913: hr_utility.set_location(l_proc,15);
1914: --
1915: -- if yes then check last PPS
1916: -- has had it's FPD closed down and that the FPD + 1
1917: -- is less than current hire date
1930: --
1931: -- 115.67 (START)
1932: --
1933: --
1934: hr_utility.set_location(l_proc,20);
1935: --
1936: if (not(l_rule_found)
1937: OR
1938: (l_rule_found AND nvl(l_rule_value,'N') = 'N'))
1939: then
1940: --
1941: -- old behaviour as rehire before fpd is not enabled
1942: --
1943: hr_utility.set_location(l_proc,25);
1944: --
1945: -- 115.67 (END)
1946: --
1947: close pps_not_ended;
1945: -- 115.67 (END)
1946: --
1947: close pps_not_ended;
1948: if v_dummy_fpd is null then
1949: hr_utility.set_message('800','HR_51032_EMP_PREV_FPD_OPEN');
1950: else
1951: hr_utility.set_message('800','PER_289308_FUTURE_ENDED_FPD');
1952: end if;
1953: hr_utility.raise_error;
1947: close pps_not_ended;
1948: if v_dummy_fpd is null then
1949: hr_utility.set_message('800','HR_51032_EMP_PREV_FPD_OPEN');
1950: else
1951: hr_utility.set_message('800','PER_289308_FUTURE_ENDED_FPD');
1952: end if;
1953: hr_utility.raise_error;
1954: --
1955: -- 115.67 (START)
1949: hr_utility.set_message('800','HR_51032_EMP_PREV_FPD_OPEN');
1950: else
1951: hr_utility.set_message('800','PER_289308_FUTURE_ENDED_FPD');
1952: end if;
1953: hr_utility.raise_error;
1954: --
1955: -- 115.67 (START)
1956: --
1957: else
1955: -- 115.67 (START)
1956: --
1957: else
1958: --
1959: hr_utility.set_location(l_proc,30);
1960: --
1961: -- Rehire before FPD allowed
1962: --
1963: if v_dummy_fpd is null then
1961: -- Rehire before FPD allowed
1962: --
1963: if v_dummy_fpd is null then
1964: close pps_not_ended;
1965: hr_utility.set_message('800','HR_449756_FPD_PREV_PDS');
1966: hr_utility.raise_error;
1967: end if;
1968: if v_dummy_lspd >= p_start_date then
1969: close pps_not_ended;
1962: --
1963: if v_dummy_fpd is null then
1964: close pps_not_ended;
1965: hr_utility.set_message('800','HR_449756_FPD_PREV_PDS');
1966: hr_utility.raise_error;
1967: end if;
1968: if v_dummy_lspd >= p_start_date then
1969: close pps_not_ended;
1970: hr_utility.set_message('800','HR_449759_REHIRE_AFTER_LSPD');
1966: hr_utility.raise_error;
1967: end if;
1968: if v_dummy_lspd >= p_start_date then
1969: close pps_not_ended;
1970: hr_utility.set_message('800','HR_449759_REHIRE_AFTER_LSPD');
1971: hr_utility.raise_error;
1972: end if;
1973: end if;
1974: --
1967: end if;
1968: if v_dummy_lspd >= p_start_date then
1969: close pps_not_ended;
1970: hr_utility.set_message('800','HR_449759_REHIRE_AFTER_LSPD');
1971: hr_utility.raise_error;
1972: end if;
1973: end if;
1974: --
1975: -- 115.67 (END)
1978: close pps_not_ended;
1979: else
1980: close old_pps_exists;
1981: end if;
1982: hr_utility.set_location('Leaving '||l_proc,50);
1983: end;
1984: --
1985: procedure check_birth_date(p_person_id NUMBER)
1986: is
2004: --
2005: if get_payroll%FOUND
2006: then
2007: close get_payroll;
2008: hr_utility.set_message('801','HR_7950_PPM_NULL_DOB');
2009: hr_utility.raise_error;
2010: else
2011: close get_payroll;
2012: end if;
2005: if get_payroll%FOUND
2006: then
2007: close get_payroll;
2008: hr_utility.set_message('801','HR_7950_PPM_NULL_DOB');
2009: hr_utility.raise_error;
2010: else
2011: close get_payroll;
2012: end if;
2013: end;
2105: l_ptu_nextval number;
2106: l_object_version_number number;
2107: --
2108: begin
2109: hr_utility.set_location('Entering '||l_proc,1);
2110: hr_utility.set_location('person_id: '||p_person_id,2);
2111: open csr_per_exists(p_person_id, p_cov_date_start);
2112: fetch csr_per_exists into l_dummy;
2113: if csr_per_exists%found then
2106: l_object_version_number number;
2107: --
2108: begin
2109: hr_utility.set_location('Entering '||l_proc,1);
2110: hr_utility.set_location('person_id: '||p_person_id,2);
2111: open csr_per_exists(p_person_id, p_cov_date_start);
2112: fetch csr_per_exists into l_dummy;
2113: if csr_per_exists%found then
2114: hr_utility.set_location(l_proc,5);
2110: hr_utility.set_location('person_id: '||p_person_id,2);
2111: open csr_per_exists(p_person_id, p_cov_date_start);
2112: fetch csr_per_exists into l_dummy;
2113: if csr_per_exists%found then
2114: hr_utility.set_location(l_proc,5);
2115: close csr_per_exists; --no need to create precursor row since person exists as of cov.s.d.
2116: else
2117: hr_utility.set_location(l_proc,10);
2118: close csr_per_exists;
2113: if csr_per_exists%found then
2114: hr_utility.set_location(l_proc,5);
2115: close csr_per_exists; --no need to create precursor row since person exists as of cov.s.d.
2116: else
2117: hr_utility.set_location(l_proc,10);
2118: close csr_per_exists;
2119: --
2120: open csr_per_details(p_person_id);
2121: fetch csr_per_details into l_per_rec; -- fetch once to get earliest record only
2133: where address_id = l_address_id.address_id;
2134: end loop;
2135: --
2136: if l_system_person_type = 'OTHER' then --first DT record is "OTHER" so simply extend back
2137: hr_utility.set_location(l_proc,15);
2138: update per_all_people_f
2139: set effective_start_date = p_cov_date_start,
2140: start_date = p_cov_date_start
2141: where person_id = p_person_id
2155: and ptu.person_type_id in (select ppt.person_type_id
2156: from per_person_types ppt
2157: where ppt.system_person_type = 'OTHER');
2158: else
2159: hr_utility.set_location(l_proc,20);
2160: -- now change some of the fields before inserting precursor row
2161: l_per_rec.applicant_number := null;
2162: l_per_rec.employee_number := null;
2163: l_per_rec.current_employee_flag := null;
2374: );
2375: --
2376: end if;
2377: end if;
2378: hr_utility.set_location('Leaving '||l_proc,25);
2379: end ins_or_upd_precursor_row;
2380: --
2381: --
2382: PROCEDURE maintain_coverage
2413: l_pds_date_start date;
2414: --
2415: begin
2416: if p_type = 'EMP' then
2417: hr_utility.set_location(l_proc,5);
2418: open csr_last_hire_date(p_person_id);
2419: fetch csr_last_hire_date into l_pds_date_start;
2420: close csr_last_hire_date;
2421: --
2426: l_cov_date_start := l_cov_rec.date_start;
2427: else
2428: l_cov_date_start := l_pds_date_start;
2429: end if;
2430: hr_utility.set_location(l_proc,15);
2431: ins_or_upd_precursor_row(l_cov_rec.contact_person_id, l_cov_date_start);
2432: end loop;
2433: elsif p_type = 'CONT' then
2434: hr_utility.set_location(l_proc,20);
2430: hr_utility.set_location(l_proc,15);
2431: ins_or_upd_precursor_row(l_cov_rec.contact_person_id, l_cov_date_start);
2432: end loop;
2433: elsif p_type = 'CONT' then
2434: hr_utility.set_location(l_proc,20);
2435: for l_cov_rec1 --person_id, date_start
2436: in csr_get_person(p_person_id)
2437: loop
2438: open csr_last_hire_date(l_cov_rec1.person_id);
2443: l_cov_date_start := l_cov_rec1.date_start;
2444: else
2445: l_cov_date_start := l_pds_date_start;
2446: end if;
2447: hr_utility.set_location(l_proc,30);
2448: ins_or_upd_precursor_row(p_person_id, l_cov_date_start);
2449: end loop;
2450: end if;
2451: hr_utility.set_location('Leaving '||l_proc,40);
2447: hr_utility.set_location(l_proc,30);
2448: ins_or_upd_precursor_row(p_person_id, l_cov_date_start);
2449: end loop;
2450: end if;
2451: hr_utility.set_location('Leaving '||l_proc,40);
2452: end maintain_coverage;
2453: --
2454: --
2455: END PER_PEOPLE12_PKG;