305:
306:
307: Begin
308:
309: hr_utility.trace('LD1 Entering assignment_updates PROC');
310:
311: hr_utility.trace('LD1 p_old_payroll_id = '||p_old_payroll_id);
312: hr_utility.trace('LD1 p_new_payroll_id = '||p_new_payroll_id);
313:
307: Begin
308:
309: hr_utility.trace('LD1 Entering assignment_updates PROC');
310:
311: hr_utility.trace('LD1 p_old_payroll_id = '||p_old_payroll_id);
312: hr_utility.trace('LD1 p_new_payroll_id = '||p_new_payroll_id);
313:
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
308:
309: hr_utility.trace('LD1 Entering assignment_updates PROC');
310:
311: hr_utility.trace('LD1 p_old_payroll_id = '||p_old_payroll_id);
312: hr_utility.trace('LD1 p_new_payroll_id = '||p_new_payroll_id);
313:
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
316:
310:
311: hr_utility.trace('LD1 p_old_payroll_id = '||p_old_payroll_id);
312: hr_utility.trace('LD1 p_new_payroll_id = '||p_new_payroll_id);
313:
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
316:
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
311: hr_utility.trace('LD1 p_old_payroll_id = '||p_old_payroll_id);
312: hr_utility.trace('LD1 p_new_payroll_id = '||p_new_payroll_id);
313:
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
316:
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
313:
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
316:
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
314: hr_utility.trace('LD1 p_old_organization_id = '|| p_old_organization_id);
315: hr_utility.trace('LD1 p_new_organization_id = '|| p_new_organization_id);
316:
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
316:
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
317: hr_utility.trace('LD1 p_old_asg_status_type_id = '|| p_old_asg_status_type_id);
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
318: hr_utility.trace ('LD1 p_new_asg_status_type_id = '|| p_new_asg_status_type_id);
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
319:
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
327: hr_utility.trace ('LD1 p_new_grade_id = '|| p_new_grade_id );
320: hr_utility.trace ('LD1 p_new_assignment_id = '|| p_new_assignment_id);
321: hr_utility.trace ('LD1 p_new_period_of_service_id = '|| p_new_period_of_service_id);
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
327: hr_utility.trace ('LD1 p_new_grade_id = '|| p_new_grade_id );
328:
322: hr_utility.trace ('LD1 p_new_effective_end_date = '|| p_new_effective_end_date);
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
327: hr_utility.trace ('LD1 p_new_grade_id = '|| p_new_grade_id );
328:
329: hr_utility.trace ('LD1 use_ld_enc = '|| use_ld_enc);
330:
323: hr_utility.trace ('LD1 p_new_primary_flag = '|| p_new_primary_flag);
324: hr_utility.trace ('LD1 p_new_person_id = '|| p_new_person_id );
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
327: hr_utility.trace ('LD1 p_new_grade_id = '|| p_new_grade_id );
328:
329: hr_utility.trace ('LD1 use_ld_enc = '|| use_ld_enc);
330:
331:
325:
326: hr_utility.trace ('LD1 p_old_grade_id = '|| p_old_grade_id );
327: hr_utility.trace ('LD1 p_new_grade_id = '|| p_new_grade_id );
328:
329: hr_utility.trace ('LD1 use_ld_enc = '|| use_ld_enc);
330:
331:
332:
333: IF ( use_ld_enc = 'Y' ) THEN
421: and award_id is not null
422: and effective_date > p_new_effective_end_date; --- added date check for 3413373
423:
424:
425: hr_utility.trace ('LD2 STATUS : A l_count1 = '||l_count1);
426:
427:
428: select count(*)
429: into l_count2
432: and person_id = p_new_person_id
433: and award_id is not null
434: and effective_date > p_new_effective_end_date; --bug 5977888
435:
436: hr_utility.trace ('LD2 STATUS : N l_count2 = '||l_count2);
437:
438: IF l_count2 > 0
439:
440: THEN
438: IF l_count2 > 0
439:
440: THEN
441:
442: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
443: hr_utility.raise_error;
444:
445: END IF;
446:
439:
440: THEN
441:
442: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
443: hr_utility.raise_error;
444:
445: END IF;
446:
447: IF l_count1 > 0
447: IF l_count1 > 0
448:
449: THEN
450:
451: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_TERM');
452: hr_utility.raise_error;
453:
454: END IF;
455:
448:
449: THEN
450:
451: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_TERM');
452: hr_utility.raise_error;
453:
454: END IF;
455:
456: END IF;
487: WHERE paf.assignment_id = p_new_assignment_id) -- Introduced for bug fix 3263333 */
488: AND period_of_service_id = p_new_period_of_service_id ----replaced p_new_asg_status_type_id and also replaced <> with =
489: AND p_new_effective_end_date = actual_termination_date;
490:
491: hr_utility.trace ('LD3 p_actual_date = '||p_actual_date);
492:
493: IF (p_actual_date IS NOT NULL ) THEN
494:
495: select count(*)
500: and award_id is not null
501: and effective_date > p_new_effective_end_date; --- added date check for 3413373
502:
503:
504: hr_utility.trace ('LD3 STATUS : A l_count1 = '||l_count1);
505:
506: select count(*)
507: into l_count2
508: from psp_enc_summary_lines
510: and person_id = p_new_person_id
511: and award_id is not null
512: and effective_date > p_new_effective_end_date; --bug 5977888
513:
514: hr_utility.trace ('LD3 STATUS : N l_count2 = '||l_count2);
515:
516:
517: IF l_count2 > 0
518:
517: IF l_count2 > 0
518:
519: THEN
520:
521: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
522: hr_utility.raise_error;
523:
524: END IF;
525:
518:
519: THEN
520:
521: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
522: hr_utility.raise_error;
523:
524: END IF;
525:
526:
527: IF l_count1 > 0
528:
529: THEN
530:
531: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_TERM');
532: hr_utility.raise_error;
533:
534: END IF;
535:
528:
529: THEN
530:
531: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_TERM');
532: hr_utility.raise_error;
533:
534: END IF;
535:
536:
627: if multiple date tracked records existed before. */
628:
629:
630:
631: hr_utility.trace('LD10 Entering assignment_deletes PROC');
632: hr_utility.trace('LD10 p_old_payroll_id = '||p_old_payroll_id);
633:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
628:
629:
630:
631: hr_utility.trace('LD10 Entering assignment_deletes PROC');
632: hr_utility.trace('LD10 p_old_payroll_id = '||p_old_payroll_id);
633:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
636:
630:
631: hr_utility.trace('LD10 Entering assignment_deletes PROC');
632: hr_utility.trace('LD10 p_old_payroll_id = '||p_old_payroll_id);
633:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
636:
637: hr_utility.trace ('LD10 p_old_effective_start_date = '|| p_old_effective_start_date);
638: hr_utility.trace ('LD10 p_old_person_id = '|| p_old_person_id );
631: hr_utility.trace('LD10 Entering assignment_deletes PROC');
632: hr_utility.trace('LD10 p_old_payroll_id = '||p_old_payroll_id);
633:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
636:
637: hr_utility.trace ('LD10 p_old_effective_start_date = '|| p_old_effective_start_date);
638: hr_utility.trace ('LD10 p_old_person_id = '|| p_old_person_id );
639:
633:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
636:
637: hr_utility.trace ('LD10 p_old_effective_start_date = '|| p_old_effective_start_date);
638: hr_utility.trace ('LD10 p_old_person_id = '|| p_old_person_id );
639:
640: hr_utility.trace ('LD10 use_ld_enc = '|| use_ld_enc);
641:
634: hr_utility.trace ('LD10 p_new_assignment_id = '|| p_new_assignment_id);
635: hr_utility.trace ('LD10 p_old_assignment_id = '|| p_old_assignment_id);
636:
637: hr_utility.trace ('LD10 p_old_effective_start_date = '|| p_old_effective_start_date);
638: hr_utility.trace ('LD10 p_old_person_id = '|| p_old_person_id );
639:
640: hr_utility.trace ('LD10 use_ld_enc = '|| use_ld_enc);
641:
642:
636:
637: hr_utility.trace ('LD10 p_old_effective_start_date = '|| p_old_effective_start_date);
638: hr_utility.trace ('LD10 p_old_person_id = '|| p_old_person_id );
639:
640: hr_utility.trace ('LD10 use_ld_enc = '|| use_ld_enc);
641:
642:
643:
644:
653: open chk_asg_count;
654: fetch chk_asg_count into l_count ;
655: close chk_asg_count;
656:
657: hr_utility.trace ('LD10 l_count = '|| l_count );
658:
659: IF l_count =0 THEN
660:
661: select count(*)
665: and person_id = p_old_person_id
666: and award_id is not null
667: and effective_date > p_old_effective_start_date;
668:
669: hr_utility.trace ('LD10 l_count1 = '|| l_count1);
670:
671: IF l_count1 > 0 THEN
672:
673: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_DELETE');
669: hr_utility.trace ('LD10 l_count1 = '|| l_count1);
670:
671: IF l_count1 > 0 THEN
672:
673: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_DELETE');
674: hr_utility.raise_error;
675: END IF;
676:
677: select count(*)
670:
671: IF l_count1 > 0 THEN
672:
673: hr_utility.set_message(8403,'PSP_ENC_LIQ_BEFORE_DELETE');
674: hr_utility.raise_error;
675: END IF;
676:
677: select count(*)
678: into l_count2
681: AND person_id = p_old_person_id
682: and award_id is not null
683: and effective_date > p_old_effective_start_date;
684:
685: hr_utility.trace ('LD10 l_count2 = '|| l_count2 );
686:
687: IF l_count2 > 0 THEN
688: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
689: hr_utility.raise_error;
684:
685: hr_utility.trace ('LD10 l_count2 = '|| l_count2 );
686:
687: IF l_count2 > 0 THEN
688: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
689: hr_utility.raise_error;
690: END IF;
691:
692:
685: hr_utility.trace ('LD10 l_count2 = '|| l_count2 );
686:
687: IF l_count2 > 0 THEN
688: hr_utility.set_message(8403,'PSP_ENC_EMP_DELETE');
689: hr_utility.raise_error;
690: END IF;
691:
692:
693: END IF ;