67: END IF;
68:
69: p_reporting_date := GREATEST(p_reporting_date,trunc(p_effective_date));
70:
71: hr_utility.set_location('.......... p_reporting_date IS '||p_reporting_date,10);
72: hr_utility.set_location('.......... l_last_app_ext IS '||l_last_app_ext,10);
73:
74: RETURN 0;
75:
68:
69: p_reporting_date := GREATEST(p_reporting_date,trunc(p_effective_date));
70:
71: hr_utility.set_location('.......... p_reporting_date IS '||p_reporting_date,10);
72: hr_utility.set_location('.......... l_last_app_ext IS '||l_last_app_ext,10);
73:
74: RETURN 0;
75:
76: EXCEPTION
149: p_reporting_date := add_months(TRUNC(l_last_app_ext),1);
150: END IF;
151: END IF;
152: CLOSE c_ppa_dt;
153: hr_utility.set_location('.......... p_reporting_date IS '||p_reporting_date,10);
154: hr_utility.set_location('.......... l_pa_eff_dt IS '||l_pa_eff_dt,10);
155: hr_utility.set_location('.......... l_last_app_ext IS '||l_last_app_ext,10);
156:
157:
150: END IF;
151: END IF;
152: CLOSE c_ppa_dt;
153: hr_utility.set_location('.......... p_reporting_date IS '||p_reporting_date,10);
154: hr_utility.set_location('.......... l_pa_eff_dt IS '||l_pa_eff_dt,10);
155: hr_utility.set_location('.......... l_last_app_ext IS '||l_last_app_ext,10);
156:
157:
158: RETURN 0;
151: END IF;
152: CLOSE c_ppa_dt;
153: hr_utility.set_location('.......... p_reporting_date IS '||p_reporting_date,10);
154: hr_utility.set_location('.......... l_pa_eff_dt IS '||l_pa_eff_dt,10);
155: hr_utility.set_location('.......... l_last_app_ext IS '||l_last_app_ext,10);
156:
157:
158: RETURN 0;
159:
559: -- to the Start Date
560: --
561: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
562: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
563: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
564: hr_utility.raise_error;
565: END IF;
566:
567: --
560: --
561: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
562: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
563: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
564: hr_utility.raise_error;
565: END IF;
566:
567: --
568: -- Check to see that the start and end dates entered are between the
595: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
596: < l_min_st_dt
597: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
598: > l_max_end_dt THEN
599: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
600: hr_utility.raise_error;
601: END IF;
602:
603: l_counter := 0;
596: < l_min_st_dt
597: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
598: > l_max_end_dt THEN
599: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
600: hr_utility.raise_error;
601: END IF;
602:
603: l_counter := 0;
604: /*
633: IF fnd_date.canonical_to_date(p_org_information1)
634: < l_min_schm_st
635: OR fnd_date.canonical_to_date(nvl(p_org_information2,'4712/12/31'))
636: > l_max_schm_end THEN
637: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
638: hr_utility.raise_error;
639: END IF;
640: */
641: l_counter := 0;
634: < l_min_schm_st
635: OR fnd_date.canonical_to_date(nvl(p_org_information2,'4712/12/31'))
636: > l_max_schm_end THEN
637: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
638: hr_utility.raise_error;
639: END IF;
640: */
641: l_counter := 0;
642:
667: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
668: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
669: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
670: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
671: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
672: hr_utility.raise_error;
673: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
674: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
675: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
668: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
669: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
670: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
671: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
672: hr_utility.raise_error;
673: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
674: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
675: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
676: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
673: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
674: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
675: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
676: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
677: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
678: hr_utility.raise_error;
679: END IF;
680:
681: -- Store the Min Start Date and Max End Date
674: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
675: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
676: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
677: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
678: hr_utility.raise_error;
679: END IF;
680:
681: -- Store the Min Start Date and Max End Date
682: IF l_counter = 0 THEN
705: -- Check to see if the records are in continuous order
706: -- and there are no gaps (no longer need to chk since gaps are allowed now)
707: /*IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
708: > l_max_end_date + 1 THEN
709: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
710: hr_utility.raise_error;
711: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
712: < l_min_start_date - 1 THEN
713: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
706: -- and there are no gaps (no longer need to chk since gaps are allowed now)
707: /*IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
708: > l_max_end_date + 1 THEN
709: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
710: hr_utility.raise_error;
711: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
712: < l_min_start_date - 1 THEN
713: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
714: hr_utility.raise_error;
709: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
710: hr_utility.raise_error;
711: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
712: < l_min_start_date - 1 THEN
713: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
714: hr_utility.raise_error;
715: END IF;*/
716:
717: --Check to see if the start and end dates encompasses all other rows
710: hr_utility.raise_error;
711: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
712: < l_min_start_date - 1 THEN
713: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
714: hr_utility.raise_error;
715: END IF;*/
716:
717: --Check to see if the start and end dates encompasses all other rows
718: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
718: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
719: <= l_min_start_date AND
720: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
721: >= l_max_end_date THEN
722: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
723: hr_utility.raise_error;
724: END IF;
725:
726: --Check to see that there is only one pension type of a particular sub
719: <= l_min_start_date AND
720: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
721: >= l_max_end_date THEN
722: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
723: hr_utility.raise_error;
724: END IF;
725:
726: --Check to see that there is only one pension type of a particular sub
727: --category and conversion rule on a particular date
725:
726: --Check to see that there is only one pension type of a particular sub
727: --category and conversion rule on a particular date
728:
729: hr_utility.set_location('name'||p_org_information3,7);
730: -- find the pension sub category for the current pension type row
731: OPEN cur_get_pen_sub_cat(p_org_information3);
732: FETCH cur_get_pen_sub_cat INTO l_pen_sub_cat1
733: ,l_thresh_conv_rule1
733: ,l_thresh_conv_rule1
734: ,l_contrib_conv_rule1
735: ,l_basis_method1;
736: CLOSE cur_get_pen_sub_cat;
737: hr_utility.set_location('Current sub category'||l_pen_sub_cat1,10);
738: -- now loop through the rows of all overlapping pension type rows
739: --if a row with the same sub category exists , raise an error
740: FOR temp_rec1 in cur_get_overlap_rows
741: LOOP
744: ,l_thresh_conv_rule2
745: ,l_contrib_conv_rule2
746: ,l_basis_method2;
747: CLOSE cur_get_pen_sub_cat;
748: hr_utility.set_location('pension subcategory'||l_pen_sub_cat2,20);
749: IF l_pen_sub_cat1 = l_pen_sub_cat2
750: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
751: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
752: AND l_basis_method1 = l_basis_method2 THEN
750: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
751: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
752: AND l_basis_method1 = l_basis_method2 THEN
753:
754: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
755: hr_utility.raise_error;
756:
757: END IF;
758:
751: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
752: AND l_basis_method1 = l_basis_method2 THEN
753:
754: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
755: hr_utility.raise_error;
756:
757: END IF;
758:
759: END LOOP;
758:
759: END LOOP;
760: /*--validate that the end date should be greater than or equal to the eff date
761: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
762: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
763: hr_utility.raise_error;
764: END IF; */
765: --hr_utility.trace_off;
766: --call the procedure to fire insert of the change events in the
759: END LOOP;
760: /*--validate that the end date should be greater than or equal to the eff date
761: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
762: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
763: hr_utility.raise_error;
764: END IF; */
765: --hr_utility.trace_off;
766: --call the procedure to fire insert of the change events in the
767: --ben_ext_chg_evt_log table
761: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
762: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
763: hr_utility.raise_error;
764: END IF; */
765: --hr_utility.trace_off;
766: --call the procedure to fire insert of the change events in the
767: --ben_ext_chg_evt_log table
768: pqp_nl_ext_functions.create_org_pt_ins_chg_evt
769: (p_organization_id => p_organization_id
786: -- to the Start Date
787: --
788: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
789: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
790: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
791: hr_utility.raise_error;
792: END IF;
793:
794: --
787: --
788: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
789: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
790: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
791: hr_utility.raise_error;
792: END IF;
793:
794: --
795: -- Check to see that the start and end dates entered are between the
822: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
823: < l_min_st_dt
824: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
825: > l_max_end_dt THEN
826: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
827: hr_utility.raise_error;
828: END IF;
829:
830: l_counter := 0;
823: < l_min_st_dt
824: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
825: > l_max_end_dt THEN
826: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
827: hr_utility.raise_error;
828: END IF;
829:
830: l_counter := 0;
831:
856: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
857: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
858: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
859: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
860: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
861: hr_utility.raise_error;
862: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
863: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
864: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
857: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
858: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
859: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
860: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
861: hr_utility.raise_error;
862: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
863: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
864: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
865: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
862: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
863: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
864: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
865: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
866: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
867: hr_utility.raise_error;
868: END IF;
869:
870: -- Store the Min Start Date and Max End Date
863: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
864: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
865: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
866: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
867: hr_utility.raise_error;
868: END IF;
869:
870: -- Store the Min Start Date and Max End Date
871: IF l_counter = 0 THEN
895: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
896: <= l_min_start_date AND
897: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
898: >= l_max_end_date THEN
899: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
900: hr_utility.raise_error;
901: END IF;
902:
903: --validate that if the total contribution percentage has been entered
896: <= l_min_start_date AND
897: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
898: >= l_max_end_date THEN
899: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
900: hr_utility.raise_error;
901: END IF;
902:
903: --validate that if the total contribution percentage has been entered
904: -- then it should be atleast equal to the employee contribution percentage
904: -- then it should be atleast equal to the employee contribution percentage
905: IF p_org_information5 IS NOT NULL THEN
906: IF fnd_number.canonical_to_number(nvl(p_org_information5,'0'))
907: < fnd_number.canonical_to_number(nvl(p_org_information4,'0')) THEN
908: hr_utility.set_message(8303,'PQP_230215_PGGM_INV_CONTRIB');
909: hr_utility.raise_error;
910: END IF;
911: END IF;
912:
905: IF p_org_information5 IS NOT NULL THEN
906: IF fnd_number.canonical_to_number(nvl(p_org_information5,'0'))
907: < fnd_number.canonical_to_number(nvl(p_org_information4,'0')) THEN
908: hr_utility.set_message(8303,'PQP_230215_PGGM_INV_CONTRIB');
909: hr_utility.raise_error;
910: END IF;
911: END IF;
912:
913: ELSIF p_org_information_context = 'PQP_NL_PGGM_INFO' THEN
922: -- to the Start Date
923: --
924: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
925: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
926: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
927: hr_utility.raise_error;
928: END IF;
929:
930: l_counter := 0;
923: --
924: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
925: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
926: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
927: hr_utility.raise_error;
928: END IF;
929:
930: l_counter := 0;
931:
956: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
957: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
958: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
959: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
960: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
961: hr_utility.raise_error;
962: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
963: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
964: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
957: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
958: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
959: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
960: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
961: hr_utility.raise_error;
962: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
963: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
964: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
965: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
962: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
963: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
964: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
965: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
966: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
967: hr_utility.raise_error;
968: END IF;
969:
970: -- Store the Min Start Date and Max End Date
963: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
964: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
965: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
966: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
967: hr_utility.raise_error;
968: END IF;
969:
970: -- Store the Min Start Date and Max End Date
971: IF l_counter = 0 THEN
995: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
996: <= l_min_start_date AND
997: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
998: >= l_max_end_date THEN
999: hr_utility.set_message(8303,'PQP_230219_OVERLAP_ROWS');
1000: hr_utility.raise_error;
1001: END IF;
1002:
1003: --if the EIT context is Dutch ABP Provider
996: <= l_min_start_date AND
997: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
998: >= l_max_end_date THEN
999: hr_utility.set_message(8303,'PQP_230219_OVERLAP_ROWS');
1000: hr_utility.raise_error;
1001: END IF;
1002:
1003: --if the EIT context is Dutch ABP Provider
1004: ELSIF p_org_information_context = 'PQP_ABP_PROVIDER' THEN
1169: FETCH c_get_eff_date INTO l_eff_date;
1170: CLOSE c_get_eff_date;
1171:
1172: IF p_org_information_context = 'PQP_NL_ABP_PT' THEN
1173: hr_utility.set_location('in update',10);
1174: --check to see if the pension type has been changed. If so, throw an error
1175: IF p_org_information3 <> p_org_information3_o THEN
1176: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1177: hr_utility.raise_error;
1172: IF p_org_information_context = 'PQP_NL_ABP_PT' THEN
1173: hr_utility.set_location('in update',10);
1174: --check to see if the pension type has been changed. If so, throw an error
1175: IF p_org_information3 <> p_org_information3_o THEN
1176: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1177: hr_utility.raise_error;
1178: END IF;
1179: -- Check if the End Date is Less than or equal
1180: -- to the Start Date
1173: hr_utility.set_location('in update',10);
1174: --check to see if the pension type has been changed. If so, throw an error
1175: IF p_org_information3 <> p_org_information3_o THEN
1176: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1177: hr_utility.raise_error;
1178: END IF;
1179: -- Check if the End Date is Less than or equal
1180: -- to the Start Date
1181: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1179: -- Check if the End Date is Less than or equal
1180: -- to the Start Date
1181: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1182: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1183: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1184: hr_utility.raise_error;
1185: END IF;
1186:
1187: -- check to see that the start and end dates entered are between the
1180: -- to the Start Date
1181: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1182: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1183: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1184: hr_utility.raise_error;
1185: END IF;
1186:
1187: -- check to see that the start and end dates entered are between the
1188: -- min start date and max end date of the pension type
1213: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1214: < l_min_st_dt
1215: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1216: > l_max_end_dt THEN
1217: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
1218: hr_utility.raise_error;
1219: END IF;
1220:
1221: l_counter := 0;
1214: < l_min_st_dt
1215: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1216: > l_max_end_dt THEN
1217: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
1218: hr_utility.raise_error;
1219: END IF;
1220:
1221: l_counter := 0;
1222: /*
1251: IF fnd_date.canonical_to_date(p_org_information1)
1252: < l_min_schm_st
1253: OR fnd_date.canonical_to_date(nvl(p_org_information2,'4712/12/31'))
1254: > l_max_schm_end THEN
1255: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
1256: hr_utility.raise_error;
1257: END IF;
1258: */
1259: l_counter := 0;
1252: < l_min_schm_st
1253: OR fnd_date.canonical_to_date(nvl(p_org_information2,'4712/12/31'))
1254: > l_max_schm_end THEN
1255: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
1256: hr_utility.raise_error;
1257: END IF;
1258: */
1259: l_counter := 0;
1260:
1285: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
1286: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1287: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1288: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1289: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1290: hr_utility.raise_error;
1291: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1292: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1293: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1286: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1287: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1288: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1289: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1290: hr_utility.raise_error;
1291: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1292: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1293: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1294: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1291: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1292: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1293: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1294: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1295: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1296: hr_utility.raise_error;
1297: END IF;
1298:
1299: END LOOP;
1292: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1293: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1294: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1295: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1296: hr_utility.raise_error;
1297: END IF;
1298:
1299: END LOOP;
1300:
1299: END LOOP;
1300:
1301: FOR temp_rec1 IN cur_abp_pt
1302: LOOP
1303: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1304: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1305: -- Store the Min Start Date and Max End Date
1306: IF l_counter = 0 THEN
1307: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1300:
1301: FOR temp_rec1 IN cur_abp_pt
1302: LOOP
1303: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1304: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1305: -- Store the Min Start Date and Max End Date
1306: IF l_counter = 0 THEN
1307: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1308: ,1,10),'YYYY/MM/DD'));
1322: END IF;
1323: END IF;
1324: l_counter := l_counter + 1;
1325: END LOOP;
1326: --hr_utility.trace_off;
1327:
1328: -- Check to see if the records are in continuous order
1329: -- and there are no gaps (no longer need to chk since gaps are allowed)
1330: /*IF trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD'))
1332:
1333: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1334: > trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1335:
1336: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
1337: hr_utility.raise_error;
1338:
1339: ELSIF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1340: < trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1333: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1334: > trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1335:
1336: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
1337: hr_utility.raise_error;
1338:
1339: ELSIF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1340: < trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1341:
1338:
1339: ELSIF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1340: < trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1341:
1342: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1343: hr_utility.raise_error;
1344:
1345: END IF;
1346:
1339: ELSIF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1340: < trunc(to_date(substr(p_org_information1_o,1,10),'YYYY/MM/DD')) THEN
1341:
1342: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1343: hr_utility.raise_error;
1344:
1345: END IF;
1346:
1347: ELSIF trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD'))
1349:
1350: IF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1351: < trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1352:
1353: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
1354: hr_utility.raise_error;
1355:
1356: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1357: > trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1350: IF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1351: < trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1352:
1353: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
1354: hr_utility.raise_error;
1355:
1356: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1357: > trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1358:
1355:
1356: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1357: > trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1358:
1359: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1360: hr_utility.raise_error;
1361:
1362: END IF;
1363:
1356: ELSIF trunc(to_date(substr(p_org_information2,1,10),'YYYY/MM/DD'))
1357: > trunc(to_date(substr(p_org_information2_o,1,10),'YYYY/MM/DD')) THEN
1358:
1359: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1360: hr_utility.raise_error;
1361:
1362: END IF;
1363:
1364: END IF;*/
1370: <= l_min_start_date AND
1371: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1372: >= l_max_end_date THEN
1373:
1374: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1375: hr_utility.raise_error;
1376:
1377: END IF;
1378:
1371: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1372: >= l_max_end_date THEN
1373:
1374: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1375: hr_utility.raise_error;
1376:
1377: END IF;
1378:
1379: END IF;
1380:
1381: --Check to see that there is only one pension type of a particular sub
1382: --category on a particular date
1383:
1384: hr_utility.set_location('name'||p_org_information3,7);
1385: -- find the pension sub category for the current pension type row
1386: OPEN cur_get_pen_sub_cat(p_org_information3);
1387: FETCH cur_get_pen_sub_cat INTO l_pen_sub_cat1
1388: ,l_thresh_conv_rule1
1388: ,l_thresh_conv_rule1
1389: ,l_contrib_conv_rule1
1390: ,l_basis_method1;
1391: CLOSE cur_get_pen_sub_cat;
1392: hr_utility.set_location('Current sub category'||l_pen_sub_cat1,10);
1393: -- now loop through the rows of all overlapping pension type rows
1394: --if a row with the same sub category exists , raise an error
1395: FOR temp_rec1 in cur_get_overlap_rows
1396: LOOP
1399: ,l_thresh_conv_rule2
1400: ,l_contrib_conv_rule2
1401: ,l_basis_method2;
1402: CLOSE cur_get_pen_sub_cat;
1403: hr_utility.set_location('pension subcategory'||l_pen_sub_cat2,20);
1404: IF l_pen_sub_cat1 = l_pen_sub_cat2
1405: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
1406: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
1407: AND l_basis_method1 = l_basis_method2 THEN
1405: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
1406: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
1407: AND l_basis_method1 = l_basis_method2 THEN
1408:
1409: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
1410: hr_utility.raise_error;
1411:
1412: END IF;
1413: --hr_utility.trace_off;
1406: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
1407: AND l_basis_method1 = l_basis_method2 THEN
1408:
1409: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
1410: hr_utility.raise_error;
1411:
1412: END IF;
1413: --hr_utility.trace_off;
1414: END LOOP;
1409: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
1410: hr_utility.raise_error;
1411:
1412: END IF;
1413: --hr_utility.trace_off;
1414: END LOOP;
1415: hr_utility.set_location('now chking for run results',40);
1416: --check to see if any payroll has been run where enrollment comes from
1417: --this EIT row, if so do not allow an update of this row.
1411:
1412: END IF;
1413: --hr_utility.trace_off;
1414: END LOOP;
1415: hr_utility.set_location('now chking for run results',40);
1416: --check to see if any payroll has been run where enrollment comes from
1417: --this EIT row, if so do not allow an update of this row.
1418: -- also store the last date when payroll has been run so that the end date
1419: -- can be updated to a date after that.
1418: -- also store the last date when payroll has been run so that the end date
1419: -- can be updated to a date after that.
1420: FOR csr_row IN c_run_results_exist
1421: LOOP
1422: hr_utility.set_location('calling get part org',50);
1423: get_participation_org(p_assignment_id => csr_row.assignment_id
1424: ,p_date_earned => csr_row.date_earned
1425: ,p_pension_type_id => fnd_number.canonical_to_number(p_org_information3_o)
1426: ,p_asg_or_org => l_asg_or_org
1436: l_date_earned := csr_row.date_earned;
1437: END IF;
1438:
1439: END IF;
1440: hr_utility.set_location('came back from partn org',60);
1441: END LOOP;
1442: hr_utility.set_location('nw chk if upd is allowd or not',70);
1443:
1444: --allow an update of pension type only if the update is allowed
1438:
1439: END IF;
1440: hr_utility.set_location('came back from partn org',60);
1441: END LOOP;
1442: hr_utility.set_location('nw chk if upd is allowd or not',70);
1443:
1444: --allow an update of pension type only if the update is allowed
1445: IF l_allow_update = 0 THEN
1446: IF p_org_information3 <> p_org_information3_o THEN
1443:
1444: --allow an update of pension type only if the update is allowed
1445: IF l_allow_update = 0 THEN
1446: IF p_org_information3 <> p_org_information3_o THEN
1447: hr_utility.set_message(8303,'PQP_230101_UPD_NOT_ALLOWED');
1448: hr_utility.raise_error;
1449: END IF;
1450: END IF;
1451:
1444: --allow an update of pension type only if the update is allowed
1445: IF l_allow_update = 0 THEN
1446: IF p_org_information3 <> p_org_information3_o THEN
1447: hr_utility.set_message(8303,'PQP_230101_UPD_NOT_ALLOWED');
1448: hr_utility.raise_error;
1449: END IF;
1450: END IF;
1451:
1452: /* ELSIF fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1452: /* ELSIF fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1453: <> fnd_date.canonical_to_date(nvl(p_org_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1454: IF l_eff_date <= l_date_earned OR fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1455: <= l_date_earned THEN
1456: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
1457: hr_utility.raise_error;
1458: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1459: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1460: hr_utility.raise_error;
1453: <> fnd_date.canonical_to_date(nvl(p_org_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1454: IF l_eff_date <= l_date_earned OR fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1455: <= l_date_earned THEN
1456: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
1457: hr_utility.raise_error;
1458: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1459: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1460: hr_utility.raise_error;
1461: END IF;
1455: <= l_date_earned THEN
1456: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
1457: hr_utility.raise_error;
1458: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1459: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1460: hr_utility.raise_error;
1461: END IF;
1462: END IF;
1463: ELSIF l_allow_update = 1 THEN
1456: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
1457: hr_utility.raise_error;
1458: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
1459: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1460: hr_utility.raise_error;
1461: END IF;
1462: END IF;
1463: ELSIF l_allow_update = 1 THEN
1464: IF (fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1463: ELSIF l_allow_update = 1 THEN
1464: IF (fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1465: <> fnd_date.canonical_to_date(nvl(p_org_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))))
1466: AND (l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))) THEN
1467: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1468: hr_utility.raise_error;
1469: END IF;
1470: END IF; */
1471: hr_utility.set_location('calling insert process',20);
1464: IF (fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
1465: <> fnd_date.canonical_to_date(nvl(p_org_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))))
1466: AND (l_eff_date > fnd_date.canonical_to_date(nvl(p_org_information2,fnd_date.date_to_canonical(hr_api.g_eot)))) THEN
1467: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1468: hr_utility.raise_error;
1469: END IF;
1470: END IF; */
1471: hr_utility.set_location('calling insert process',20);
1472: --call the procedure to fire insert of the change events in the
1467: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
1468: hr_utility.raise_error;
1469: END IF;
1470: END IF; */
1471: hr_utility.set_location('calling insert process',20);
1472: --call the procedure to fire insert of the change events in the
1473: --ben_ext_chg_evt_log table
1474: pqp_nl_ext_functions.create_org_pt_upd_chg_evt
1475: (p_organization_id => p_organization_id
1482: ,p_org_information3_o => p_org_information3_o
1483: ,p_org_information6_o => p_org_information6_o
1484: ,p_effective_date => l_eff_date
1485: );
1486: hr_utility.set_location('leaving',30);
1487:
1488: --context is PGGM PT
1489: ELSIF p_org_information_context = 'PQP_NL_PGGM_PT' THEN
1490: hr_utility.set_location('in update',10);
1486: hr_utility.set_location('leaving',30);
1487:
1488: --context is PGGM PT
1489: ELSIF p_org_information_context = 'PQP_NL_PGGM_PT' THEN
1490: hr_utility.set_location('in update',10);
1491: --check to see if the pension type has been changed. If so, throw an error
1492: IF p_org_information3 <> p_org_information3_o THEN
1493: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1494: hr_utility.raise_error;
1489: ELSIF p_org_information_context = 'PQP_NL_PGGM_PT' THEN
1490: hr_utility.set_location('in update',10);
1491: --check to see if the pension type has been changed. If so, throw an error
1492: IF p_org_information3 <> p_org_information3_o THEN
1493: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1494: hr_utility.raise_error;
1495: END IF;
1496: -- Check if the End Date is Less than or equal
1497: -- to the Start Date
1490: hr_utility.set_location('in update',10);
1491: --check to see if the pension type has been changed. If so, throw an error
1492: IF p_org_information3 <> p_org_information3_o THEN
1493: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
1494: hr_utility.raise_error;
1495: END IF;
1496: -- Check if the End Date is Less than or equal
1497: -- to the Start Date
1498: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1496: -- Check if the End Date is Less than or equal
1497: -- to the Start Date
1498: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1499: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1500: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1501: hr_utility.raise_error;
1502: END IF;
1503:
1504: -- check to see that the start and end dates entered are between the
1497: -- to the Start Date
1498: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1499: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1500: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1501: hr_utility.raise_error;
1502: END IF;
1503:
1504: -- check to see that the start and end dates entered are between the
1505: -- min start date and max end date of the pension type
1530: IF trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD'))
1531: < l_min_st_dt
1532: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1533: > l_max_end_dt THEN
1534: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
1535: hr_utility.raise_error;
1536: END IF;
1537:
1538: l_counter := 0;
1531: < l_min_st_dt
1532: OR trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1533: > l_max_end_dt THEN
1534: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
1535: hr_utility.raise_error;
1536: END IF;
1537:
1538: l_counter := 0;
1539:
1564: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
1565: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1566: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1567: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1568: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1569: hr_utility.raise_error;
1570: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1571: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1572: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1565: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1566: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1567: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1568: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1569: hr_utility.raise_error;
1570: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1571: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1572: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1573: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1570: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1571: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1572: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1573: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1574: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1575: hr_utility.raise_error;
1576: END IF;
1577:
1578: END LOOP;
1571: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1572: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1573: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1574: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
1575: hr_utility.raise_error;
1576: END IF;
1577:
1578: END LOOP;
1579:
1578: END LOOP;
1579:
1580: FOR temp_rec1 IN cur_pggm_pt
1581: LOOP
1582: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1583: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1584: -- Store the Min Start Date and Max End Date
1585: IF l_counter = 0 THEN
1586: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1579:
1580: FOR temp_rec1 IN cur_pggm_pt
1581: LOOP
1582: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1583: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1584: -- Store the Min Start Date and Max End Date
1585: IF l_counter = 0 THEN
1586: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1587: ,1,10),'YYYY/MM/DD'));
1610: <= l_min_start_date AND
1611: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1612: >= l_max_end_date THEN
1613:
1614: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1615: hr_utility.raise_error;
1616:
1617: END IF;
1618:
1611: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1612: >= l_max_end_date THEN
1613:
1614: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
1615: hr_utility.raise_error;
1616:
1617: END IF;
1618:
1619: END IF;
1622: -- then it should be atleast equal to the employee contribution percentage
1623: IF p_org_information5 IS NOT NULL THEN
1624: IF fnd_number.canonical_to_number(nvl(p_org_information5,'0'))
1625: < fnd_number.canonical_to_number(nvl(p_org_information4,'0')) THEN
1626: hr_utility.set_message(8303,'PQP_230215_PGGM_INV_CONTRIB');
1627: hr_utility.raise_error;
1628: END IF;
1629: END IF;
1630:
1623: IF p_org_information5 IS NOT NULL THEN
1624: IF fnd_number.canonical_to_number(nvl(p_org_information5,'0'))
1625: < fnd_number.canonical_to_number(nvl(p_org_information4,'0')) THEN
1626: hr_utility.set_message(8303,'PQP_230215_PGGM_INV_CONTRIB');
1627: hr_utility.raise_error;
1628: END IF;
1629: END IF;
1630:
1631: hr_utility.set_location('leaving',30);
1627: hr_utility.raise_error;
1628: END IF;
1629: END IF;
1630:
1631: hr_utility.set_location('leaving',30);
1632:
1633: --context is PGGM INFO
1634: ELSIF p_org_information_context = 'PQP_NL_PGGM_INFO' THEN
1635: hr_utility.set_location('in update',10);
1631: hr_utility.set_location('leaving',30);
1632:
1633: --context is PGGM INFO
1634: ELSIF p_org_information_context = 'PQP_NL_PGGM_INFO' THEN
1635: hr_utility.set_location('in update',10);
1636: -- Check if the End Date is Less than or equal
1637: -- to the Start Date
1638: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1639: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1636: -- Check if the End Date is Less than or equal
1637: -- to the Start Date
1638: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1639: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1640: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1641: hr_utility.raise_error;
1642: END IF;
1643:
1644: l_counter := 0;
1637: -- to the Start Date
1638: IF trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1639: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) THEN
1640: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1641: hr_utility.raise_error;
1642: END IF;
1643:
1644: l_counter := 0;
1645:
1670: IF (trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) >=
1671: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1672: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1673: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1674: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
1675: hr_utility.raise_error;
1676: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1677: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1678: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1671: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1672: trunc(to_date(substr(p_org_information1,1,10),'YYYY/MM/DD')) <=
1673: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1674: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
1675: hr_utility.raise_error;
1676: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1677: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1678: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1679: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1676: ELSIF (trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
1677: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1678: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1679: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1680: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
1681: hr_utility.raise_error;
1682: END IF;
1683:
1684: END LOOP;
1677: trunc(to_date(substr(temp_rec.org_information1,1,10),'YYYY/MM/DD')) AND
1678: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
1679: trunc(to_date(substr(temp_rec.org_information2,1,10),'YYYY/MM/DD'))) THEN
1680: hr_utility.set_message(8303, 'PQP_230219_OVERLAP_ROWS');
1681: hr_utility.raise_error;
1682: END IF;
1683:
1684: END LOOP;
1685:
1684: END LOOP;
1685:
1686: FOR temp_rec1 IN cur_pggm_info
1687: LOOP
1688: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1689: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1690: -- Store the Min Start Date and Max End Date
1691: IF l_counter = 0 THEN
1692: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1685:
1686: FOR temp_rec1 IN cur_pggm_info
1687: LOOP
1688: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
1689: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
1690: -- Store the Min Start Date and Max End Date
1691: IF l_counter = 0 THEN
1692: l_min_start_date := trunc(to_date(substr(temp_rec1.org_information1
1693: ,1,10),'YYYY/MM/DD'));
1716: <= l_min_start_date AND
1717: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1718: >= l_max_end_date THEN
1719:
1720: hr_utility.set_message(8303,'PQP_230219_OVERLAP_ROWS');
1721: hr_utility.raise_error;
1722:
1723: END IF;
1724:
1717: trunc(to_date(substr(nvl(p_org_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
1718: >= l_max_end_date THEN
1719:
1720: hr_utility.set_message(8303,'PQP_230219_OVERLAP_ROWS');
1721: hr_utility.raise_error;
1722:
1723: END IF;
1724:
1725: END IF;
1723: END IF;
1724:
1725: END IF;
1726:
1727: hr_utility.set_location('leaving',30);
1728:
1729: --if the EIT context is PQP_ABP_PROVIDER then
1730: ELSIF p_org_information_context = 'PQP_ABP_PROVIDER' THEN
1731: --call the procedure to handle validations for After Update
1970: l_error_message VARCHAR2(100);
1971: l_ret_val NUMBER;
1972:
1973: BEGIN
1974: hr_utility.set_location('entered chkdupasginfo'||p_information_type,5);
1975: Open c_get_person_id;
1976: Fetch c_get_person_id INTO l_person_id;
1977: CLOSE c_get_person_id;
1978: hr_utility.set_location('person id : '||l_person_id,7);
1974: hr_utility.set_location('entered chkdupasginfo'||p_information_type,5);
1975: Open c_get_person_id;
1976: Fetch c_get_person_id INTO l_person_id;
1977: CLOSE c_get_person_id;
1978: hr_utility.set_location('person id : '||l_person_id,7);
1979:
1980: --fetch the effective date first
1981: OPEN c_get_eff_date;
1982: FETCH c_get_eff_date INTO l_eff_date;
1980: --fetch the effective date first
1981: OPEN c_get_eff_date;
1982: FETCH c_get_eff_date INTO l_eff_date;
1983: CLOSE c_get_eff_date;
1984: hr_utility.set_location('eff date : '||l_eff_date,9);
1985:
1986: IF p_information_type = 'NL_ABP_PI' THEN
1987:
1988: -- Check if the End Date is Less than or equal
1988: -- Check if the End Date is Less than or equal
1989: -- to the Start Date
1990: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1991: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
1992: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1993: hr_utility.raise_error;
1994: END IF;
1995:
1996: -- check to see that the start and end dates entered are between the
1989: -- to the Start Date
1990: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
1991: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
1992: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
1993: hr_utility.raise_error;
1994: END IF;
1995:
1996: -- check to see that the start and end dates entered are between the
1997: -- min start date and max end date of the pension type
2022: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2023: < l_min_st_dt
2024: OR trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2025: > l_max_end_dt THEN
2026: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
2027: hr_utility.raise_error;
2028: END IF;
2029:
2030: l_counter := 0;
2023: < l_min_st_dt
2024: OR trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2025: > l_max_end_dt THEN
2026: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
2027: hr_utility.raise_error;
2028: END IF;
2029:
2030: l_counter := 0;
2031: /*
2060: IF fnd_date.canonical_to_date(p_aei_information1)
2061: < l_min_schm_st
2062: OR fnd_date.canonical_to_date(nvl(p_aei_information2,'4712/12/31'))
2063: > l_max_schm_end THEN
2064: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
2065: hr_utility.raise_error;
2066: END IF;
2067: */
2068: l_counter := 0;
2061: < l_min_schm_st
2062: OR fnd_date.canonical_to_date(nvl(p_aei_information2,'4712/12/31'))
2063: > l_max_schm_end THEN
2064: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
2065: hr_utility.raise_error;
2066: END IF;
2067: */
2068: l_counter := 0;
2069:
2094: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
2095: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2096: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2097: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2098: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
2099: hr_utility.raise_error;
2100: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2101: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2102: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2095: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2096: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2097: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2098: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
2099: hr_utility.raise_error;
2100: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2101: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2102: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2103: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2100: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2101: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2102: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2103: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2104: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
2105: hr_utility.raise_error;
2106: END IF;
2107:
2108: -- Store the Min Start Date and Max End Date
2101: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2102: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2103: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2104: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
2105: hr_utility.raise_error;
2106: END IF;
2107:
2108: -- Store the Min Start Date and Max End Date
2109: IF l_counter = 0 THEN
2132: -- Check to see if the records are in continuous order
2133: -- and there are no gaps (no longer need to chk since gaps are allowed)
2134: /*IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2135: > l_max_end_date + 1 THEN
2136: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2137: hr_utility.raise_error;
2138: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
2139: < l_min_start_date - 1 THEN
2140: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2133: -- and there are no gaps (no longer need to chk since gaps are allowed)
2134: /*IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2135: > l_max_end_date + 1 THEN
2136: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2137: hr_utility.raise_error;
2138: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
2139: < l_min_start_date - 1 THEN
2140: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2141: hr_utility.raise_error;
2136: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2137: hr_utility.raise_error;
2138: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
2139: < l_min_start_date - 1 THEN
2140: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2141: hr_utility.raise_error;
2142: END IF;*/
2143:
2144: --Check to see if the start and end dates encompasses all other rows
2137: hr_utility.raise_error;
2138: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
2139: < l_min_start_date - 1 THEN
2140: hr_utility.set_message(8303, 'PQP_230042_GAP_EXIST_IN_PT_ROW');
2141: hr_utility.raise_error;
2142: END IF;*/
2143:
2144: --Check to see if the start and end dates encompasses all other rows
2145: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2145: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2146: <= l_min_start_date AND
2147: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2148: >= l_max_end_date THEN
2149: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
2150: hr_utility.raise_error;
2151: END IF;
2152:
2153: --Check to see that there is only one pension type of a particular sub
2146: <= l_min_start_date AND
2147: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2148: >= l_max_end_date THEN
2149: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
2150: hr_utility.raise_error;
2151: END IF;
2152:
2153: --Check to see that there is only one pension type of a particular sub
2154: --category and conversion rule on a particular date
2152:
2153: --Check to see that there is only one pension type of a particular sub
2154: --category and conversion rule on a particular date
2155:
2156: hr_utility.set_location('name'||p_aei_information3,7);
2157: -- find the pension sub category for the current pension type row
2158: OPEN cur_get_pen_sub_cat(p_aei_information3);
2159: FETCH cur_get_pen_sub_cat INTO l_pen_sub_cat1
2160: ,l_thresh_conv_rule1
2160: ,l_thresh_conv_rule1
2161: ,l_contrib_conv_rule1
2162: ,l_basis_method1;
2163: CLOSE cur_get_pen_sub_cat;
2164: hr_utility.set_location('Current sub category'||l_pen_sub_cat1,10);
2165: -- now loop through the rows of all overlapping pension type rows
2166: --if a row with the same sub category exists , raise an error
2167: FOR temp_rec1 in cur_get_overlap_rows
2168: LOOP
2171: ,l_thresh_conv_rule2
2172: ,l_contrib_conv_rule2
2173: ,l_basis_method2;
2174: CLOSE cur_get_pen_sub_cat;
2175: hr_utility.set_location('pension subcategory'||l_pen_sub_cat2,20);
2176: IF l_pen_sub_cat1 = l_pen_sub_cat2
2177: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
2178: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
2179: AND l_basis_method1 = l_basis_method2 THEN
2177: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
2178: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
2179: AND l_basis_method1 = l_basis_method2 THEN
2180:
2181: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
2182: hr_utility.raise_error;
2183:
2184: END IF;
2185:
2178: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
2179: AND l_basis_method1 = l_basis_method2 THEN
2180:
2181: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
2182: hr_utility.raise_error;
2183:
2184: END IF;
2185:
2186: END LOOP;
2187:
2188: -- if the contribution method is PE the value should be between 0 and 999.999
2189: IF nvl(p_aei_information13,'PE') = 'PE' THEN
2190: IF fnd_number.canonical_to_number(nvl(p_aei_information14,'0')) > 999.999 THEN
2191: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
2192: hr_utility.raise_error;
2193: END IF;
2194: END IF;
2195:
2188: -- if the contribution method is PE the value should be between 0 and 999.999
2189: IF nvl(p_aei_information13,'PE') = 'PE' THEN
2190: IF fnd_number.canonical_to_number(nvl(p_aei_information14,'0')) > 999.999 THEN
2191: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
2192: hr_utility.raise_error;
2193: END IF;
2194: END IF;
2195:
2196: -- if the contribution method is PE the value should be between 0 and 999.999
2195:
2196: -- if the contribution method is PE the value should be between 0 and 999.999
2197: IF nvl(p_aei_information15,'PE') = 'PE' THEN
2198: IF fnd_number.canonical_to_number(nvl(p_aei_information16,'0')) > 999.999 THEN
2199: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
2200: hr_utility.raise_error;
2201: END IF;
2202: END IF;
2203:
2196: -- if the contribution method is PE the value should be between 0 and 999.999
2197: IF nvl(p_aei_information15,'PE') = 'PE' THEN
2198: IF fnd_number.canonical_to_number(nvl(p_aei_information16,'0')) > 999.999 THEN
2199: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
2200: hr_utility.raise_error;
2201: END IF;
2202: END IF;
2203:
2204: --validate that the Date From is equal to or greater than the hire date
2205: OPEN c_get_hire_date(l_eff_date);
2206: FETCH c_get_hire_date INTO l_hire_date;
2207: CLOSE c_get_hire_date;
2208: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2209: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2210: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2211: hr_utility.raise_error;
2212: END IF;
2213:
2206: FETCH c_get_hire_date INTO l_hire_date;
2207: CLOSE c_get_hire_date;
2208: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2209: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2210: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2211: hr_utility.raise_error;
2212: END IF;
2213:
2214: --validate that if the override value is entered , the reason is also entered
2207: CLOSE c_get_hire_date;
2208: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2209: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2210: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2211: hr_utility.raise_error;
2212: END IF;
2213:
2214: --validate that if the override value is entered , the reason is also entered
2215: IF ((p_aei_information7 IS NOT NULL) AND (p_aei_information8 IS NULL)
2216: OR (p_aei_information9 IS NOT NULL) AND (p_aei_information10 IS NULL)
2217: OR (p_aei_information11 IS NOT NULL) AND (p_aei_information12 IS NULL)
2218: OR (p_aei_information20 IS NOT NULL) AND (p_aei_information21 IS NULL)
2219: ) THEN
2220: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
2221: hr_utility.raise_error;
2222: END IF;
2223:
2224: --validate that only one among Pension Salary,Basis or Contribution is overridden
2217: OR (p_aei_information11 IS NOT NULL) AND (p_aei_information12 IS NULL)
2218: OR (p_aei_information20 IS NOT NULL) AND (p_aei_information21 IS NULL)
2219: ) THEN
2220: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
2221: hr_utility.raise_error;
2222: END IF;
2223:
2224: --validate that only one among Pension Salary,Basis or Contribution is overridden
2225: IF NOT (((p_aei_information7 IS NOT NULL)
2240: ((p_aei_information7 IS NULL)
2241: AND (p_aei_information9 IS NULL)
2242: AND ((p_aei_information11 IS NULL) AND (p_aei_information20 IS NULL))
2243: )) THEN
2244: hr_utility.set_message(8303,'PQP_230057_INVALID_OVERRIDES');
2245: hr_utility.raise_error;
2246: END IF;
2247:
2248: --validate that if the override is entered for contribution value, then
2241: AND (p_aei_information9 IS NULL)
2242: AND ((p_aei_information11 IS NULL) AND (p_aei_information20 IS NULL))
2243: )) THEN
2244: hr_utility.set_message(8303,'PQP_230057_INVALID_OVERRIDES');
2245: hr_utility.raise_error;
2246: END IF;
2247:
2248: --validate that if the override is entered for contribution value, then
2249: -- the contribution type is also entered
2251: OR (p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
2252: OR (p_aei_information15 IS NOT NULL AND p_aei_information16 IS NULL)
2253: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
2254: ) THEN
2255: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
2256: hr_utility.raise_error;
2257: END IF;*/
2258:
2259: --this validation has now changed as follows
2252: OR (p_aei_information15 IS NOT NULL AND p_aei_information16 IS NULL)
2253: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
2254: ) THEN
2255: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
2256: hr_utility.raise_error;
2257: END IF;*/
2258:
2259: --this validation has now changed as follows
2260: --the following combinations would occur
2272:
2273: IF ((p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
2274: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
2275: ) THEN
2276: hr_utility.set_message(8303,'PQP_230140_INV_CONTRIBUTION');
2277: hr_utility.raise_error;
2278: END IF;
2279:
2280: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
2273: IF ((p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
2274: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
2275: ) THEN
2276: hr_utility.set_message(8303,'PQP_230140_INV_CONTRIBUTION');
2277: hr_utility.raise_error;
2278: END IF;
2279:
2280: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
2281: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
2279:
2280: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
2281: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
2282: ) THEN
2283: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
2284: hr_utility.raise_error;
2285: END IF;
2286:
2287: --validate that if an end date is entered, then end reason should also be entered
2280: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
2281: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
2282: ) THEN
2283: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
2284: hr_utility.raise_error;
2285: END IF;
2286:
2287: --validate that if an end date is entered, then end reason should also be entered
2288: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
2285: END IF;
2286:
2287: --validate that if an end date is entered, then end reason should also be entered
2288: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
2289: hr_utility.set_message(8303,'PQP_230103_ENTER_END_REASON');
2290: hr_utility.raise_error;
2291: END IF;
2292:
2293: /*--validate that the eff date is lesser or equal to the end date
2286:
2287: --validate that if an end date is entered, then end reason should also be entered
2288: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
2289: hr_utility.set_message(8303,'PQP_230103_ENTER_END_REASON');
2290: hr_utility.raise_error;
2291: END IF;
2292:
2293: /*--validate that the eff date is lesser or equal to the end date
2294: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
2291: END IF;
2292:
2293: /*--validate that the eff date is lesser or equal to the end date
2294: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
2295: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
2296: hr_utility.raise_error;
2297: END IF; */
2298:
2299: --
2292:
2293: /*--validate that the eff date is lesser or equal to the end date
2294: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
2295: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
2296: hr_utility.raise_error;
2297: END IF; */
2298:
2299: --
2300: -- Derive the next abp reporting date
2342: -- Check if the End Date is Less than or equal
2343: -- to the Start Date
2344: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2345: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2346: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2347: hr_utility.raise_error;
2348: END IF;
2349:
2350: l_counter := 0;
2343: -- to the Start Date
2344: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2345: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2346: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2347: hr_utility.raise_error;
2348: END IF;
2349:
2350: l_counter := 0;
2351:
2376: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
2377: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2378: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2379: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2380: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2381: hr_utility.raise_error;
2382: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2383: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2384: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2377: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2378: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2379: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2380: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2381: hr_utility.raise_error;
2382: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2383: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2384: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2385: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2382: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2383: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2384: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2385: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2386: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2387: hr_utility.raise_error;
2388: END IF;
2389:
2390: -- Store the Min Start Date and Max End Date
2383: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2384: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2385: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2386: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2387: hr_utility.raise_error;
2388: END IF;
2389:
2390: -- Store the Min Start Date and Max End Date
2391: IF l_counter = 0 THEN
2415: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2416: <= l_min_start_date AND
2417: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2418: >= l_max_end_date THEN
2419: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
2420: hr_utility.raise_error;
2421: END IF;
2422:
2423: --validate that the Date From is equal to or greater than the hire date
2416: <= l_min_start_date AND
2417: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2418: >= l_max_end_date THEN
2419: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
2420: hr_utility.raise_error;
2421: END IF;
2422:
2423: --validate that the Date From is equal to or greater than the hire date
2424: OPEN c_get_hire_date(l_eff_date);
2424: OPEN c_get_hire_date(l_eff_date);
2425: FETCH c_get_hire_date INTO l_hire_date;
2426: CLOSE c_get_hire_date;
2427: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2428: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2429: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2430: hr_utility.raise_error;
2431: END IF;
2432:
2425: FETCH c_get_hire_date INTO l_hire_date;
2426: CLOSE c_get_hire_date;
2427: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2428: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2429: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2430: hr_utility.raise_error;
2431: END IF;
2432:
2433: --validate that if the override value is entered , the reason is also entered
2426: CLOSE c_get_hire_date;
2427: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2428: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2429: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2430: hr_utility.raise_error;
2431: END IF;
2432:
2433: --validate that if the override value is entered , the reason is also entered
2434: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
2433: --validate that if the override value is entered , the reason is also entered
2434: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
2435: OR (p_aei_information8 IS NOT NULL) AND (p_aei_information9 IS NULL)
2436: ) THEN
2437: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
2438: hr_utility.raise_error;
2439: END IF;
2440:
2441: --validate that only one among Pension Salary,Basis or Contribution is overridden
2434: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
2435: OR (p_aei_information8 IS NOT NULL) AND (p_aei_information9 IS NULL)
2436: ) THEN
2437: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
2438: hr_utility.raise_error;
2439: END IF;
2440:
2441: --validate that only one among Pension Salary,Basis or Contribution is overridden
2442: IF NOT (((p_aei_information6 IS NOT NULL)
2450: ((p_aei_information6 IS NULL)
2451: AND (p_aei_information8 IS NULL)
2452: )
2453: ) THEN
2454: hr_utility.set_message(8303,'PQP_230135_INV_EIT_OVERRIDES');
2455: hr_utility.raise_error;
2456: END IF;
2457:
2458: /*--validate that the eff date is lesser or equal to the end date
2451: AND (p_aei_information8 IS NULL)
2452: )
2453: ) THEN
2454: hr_utility.set_message(8303,'PQP_230135_INV_EIT_OVERRIDES');
2455: hr_utility.raise_error;
2456: END IF;
2457:
2458: /*--validate that the eff date is lesser or equal to the end date
2459: IF l_eff_date > trunc(fnd_date.canonical_to_date(
2457:
2458: /*--validate that the eff date is lesser or equal to the end date
2459: IF l_eff_date > trunc(fnd_date.canonical_to_date(
2460: nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot)))) THEN
2461: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
2462: hr_utility.raise_error;
2463: END IF;*/
2464:
2465: --validations for the salary override rows
2458: /*--validate that the eff date is lesser or equal to the end date
2459: IF l_eff_date > trunc(fnd_date.canonical_to_date(
2460: nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot)))) THEN
2461: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
2462: hr_utility.raise_error;
2463: END IF;*/
2464:
2465: --validations for the salary override rows
2466: IF p_aei_information6 IS NOT NULL THEN
2466: IF p_aei_information6 IS NOT NULL THEN
2467:
2468: --ensure that the end date is also entered
2469: IF p_aei_information2 IS NULL THEN
2470: hr_utility.set_message(8303,'PQP_230155_ENTER_END_DATE');
2471: hr_utility.raise_error;
2472: END IF;
2473:
2474: --ensure that the start date and end date are in the same year
2467:
2468: --ensure that the end date is also entered
2469: IF p_aei_information2 IS NULL THEN
2470: hr_utility.set_message(8303,'PQP_230155_ENTER_END_DATE');
2471: hr_utility.raise_error;
2472: END IF;
2473:
2474: --ensure that the start date and end date are in the same year
2475: IF NOT ((l_start_year = l_curr_year)
2474: --ensure that the start date and end date are in the same year
2475: IF NOT ((l_start_year = l_curr_year)
2476: AND (l_end_year = l_curr_year)
2477: ) THEN
2478: hr_utility.set_message(8303,'PQP_230156_ENTER_CURR_YEAR');
2479: hr_utility.raise_error;
2480: END IF;
2481:
2482: --find the minimum and maximum start and end dates
2475: IF NOT ((l_start_year = l_curr_year)
2476: AND (l_end_year = l_curr_year)
2477: ) THEN
2478: hr_utility.set_message(8303,'PQP_230156_ENTER_CURR_YEAR');
2479: hr_utility.raise_error;
2480: END IF;
2481:
2482: --find the minimum and maximum start and end dates
2483: l_counter := 0;
2503: -- and there are no gaps
2504: IF l_min_sal_start IS NOT NULL AND l_max_sal_end IS NOT NULL THEN
2505: IF trunc(fnd_date.canonical_to_date(p_aei_information1))
2506: > l_max_sal_end + 1 THEN
2507: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2508: hr_utility.raise_error;
2509: ELSIF trunc(fnd_date.canonical_to_date(p_aei_information2))
2510: < l_min_sal_start - 1 THEN
2511: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2504: IF l_min_sal_start IS NOT NULL AND l_max_sal_end IS NOT NULL THEN
2505: IF trunc(fnd_date.canonical_to_date(p_aei_information1))
2506: > l_max_sal_end + 1 THEN
2507: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2508: hr_utility.raise_error;
2509: ELSIF trunc(fnd_date.canonical_to_date(p_aei_information2))
2510: < l_min_sal_start - 1 THEN
2511: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2512: hr_utility.raise_error;
2507: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2508: hr_utility.raise_error;
2509: ELSIF trunc(fnd_date.canonical_to_date(p_aei_information2))
2510: < l_min_sal_start - 1 THEN
2511: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2512: hr_utility.raise_error;
2513: END IF;
2514: END IF;
2515:
2508: hr_utility.raise_error;
2509: ELSIF trunc(fnd_date.canonical_to_date(p_aei_information2))
2510: < l_min_sal_start - 1 THEN
2511: hr_utility.set_message(8303, 'PQP_230157_GAP_IN_SAL_ROW');
2512: hr_utility.raise_error;
2513: END IF;
2514: END IF;
2515:
2516: IF nvl(l_min_sal_start,fnd_date.canonical_to_date(p_aei_information1))
2520:
2521: --verify that the minimum date is correct date of the year
2522: IF (nvl(l_min_sal_start,fnd_date.canonical_to_date(p_aei_information1))
2523: <> get_valid_start_date(p_assignment_id,l_eff_date,l_error_status,l_error_message)) THEN
2524: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
2525: hr_utility.raise_error;
2526: Else
2527: IF (l_error_status = trim(to_char(1,'9'))) Then
2528: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
2521: --verify that the minimum date is correct date of the year
2522: IF (nvl(l_min_sal_start,fnd_date.canonical_to_date(p_aei_information1))
2523: <> get_valid_start_date(p_assignment_id,l_eff_date,l_error_status,l_error_message)) THEN
2524: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
2525: hr_utility.raise_error;
2526: Else
2527: IF (l_error_status = trim(to_char(1,'9'))) Then
2528: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
2529: hr_utility.raise_error;
2524: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
2525: hr_utility.raise_error;
2526: Else
2527: IF (l_error_status = trim(to_char(1,'9'))) Then
2528: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
2529: hr_utility.raise_error;
2530: End IF;
2531: END IF;
2532:
2525: hr_utility.raise_error;
2526: Else
2527: IF (l_error_status = trim(to_char(1,'9'))) Then
2528: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
2529: hr_utility.raise_error;
2530: End IF;
2531: END IF;
2532:
2533: END IF; /*End of check if salary has been overridden*/
2575:
2576: --if the information context is Saving Schemes Additional Contribution Informaiton,then
2577: --perform the required validations
2578: ELSIF p_information_type = 'NL_SAV_INFO' THEN
2579: hr_utility.set_location('chking for sav eit',10);
2580: --validate that there is no other EIT row with the same savings type
2581: --and period number combination
2582: OPEN cur_sav_asg_info;
2583: FETCH cur_sav_asg_info INTO l_asg_sav_info_exists;
2582: OPEN cur_sav_asg_info;
2583: FETCH cur_sav_asg_info INTO l_asg_sav_info_exists;
2584: IF cur_sav_asg_info%FOUND THEN
2585: CLOSE cur_sav_asg_info;
2586: hr_utility.set_location('found same sav info',20);
2587: hr_utility.set_message(8303,'PQP_230141_SAV_INFO_EXISTS');
2588: hr_utility.raise_error;
2589: ELSE
2590: CLOSE cur_sav_asg_info;
2583: FETCH cur_sav_asg_info INTO l_asg_sav_info_exists;
2584: IF cur_sav_asg_info%FOUND THEN
2585: CLOSE cur_sav_asg_info;
2586: hr_utility.set_location('found same sav info',20);
2587: hr_utility.set_message(8303,'PQP_230141_SAV_INFO_EXISTS');
2588: hr_utility.raise_error;
2589: ELSE
2590: CLOSE cur_sav_asg_info;
2591: END IF;
2584: IF cur_sav_asg_info%FOUND THEN
2585: CLOSE cur_sav_asg_info;
2586: hr_utility.set_location('found same sav info',20);
2587: hr_utility.set_message(8303,'PQP_230141_SAV_INFO_EXISTS');
2588: hr_utility.raise_error;
2589: ELSE
2590: CLOSE cur_sav_asg_info;
2591: END IF;
2592:
2595: OPEN cur_periods_per_yr(c_eff_date => l_eff_date);
2596: FETCH cur_periods_per_yr INTO l_periods_per_yr;
2597: IF cur_periods_per_yr%FOUND THEN
2598: CLOSE cur_periods_per_yr;
2599: hr_utility.set_location('found period number'||l_periods_per_yr,30);
2600: IF fnd_number.canonical_to_number(p_aei_information2) > l_periods_per_yr THEN
2601: hr_utility.set_message(8303,'PQP_230142_INV_PERIOD_NUMBER');
2602: hr_utility.raise_error;
2603: END IF;
2597: IF cur_periods_per_yr%FOUND THEN
2598: CLOSE cur_periods_per_yr;
2599: hr_utility.set_location('found period number'||l_periods_per_yr,30);
2600: IF fnd_number.canonical_to_number(p_aei_information2) > l_periods_per_yr THEN
2601: hr_utility.set_message(8303,'PQP_230142_INV_PERIOD_NUMBER');
2602: hr_utility.raise_error;
2603: END IF;
2604: ELSE
2605: CLOSE cur_periods_per_yr;
2598: CLOSE cur_periods_per_yr;
2599: hr_utility.set_location('found period number'||l_periods_per_yr,30);
2600: IF fnd_number.canonical_to_number(p_aei_information2) > l_periods_per_yr THEN
2601: hr_utility.set_message(8303,'PQP_230142_INV_PERIOD_NUMBER');
2602: hr_utility.raise_error;
2603: END IF;
2604: ELSE
2605: CLOSE cur_periods_per_yr;
2606: END IF;
2606: END IF;
2607:
2608: --validate that the amount entered is > 0
2609: IF fnd_number.canonical_to_number(p_aei_information3) <= 0 THEN
2610: hr_utility.set_message(8303,'PQP_230149_INV_ADDNL_AMT');
2611: hr_utility.raise_error;
2612: END IF;
2613:
2614:
2607:
2608: --validate that the amount entered is > 0
2609: IF fnd_number.canonical_to_number(p_aei_information3) <= 0 THEN
2610: hr_utility.set_message(8303,'PQP_230149_INV_ADDNL_AMT');
2611: hr_utility.raise_error;
2612: END IF;
2613:
2614:
2615: ELSIF p_information_type = 'NL_ADDL_CALC' THEN
2622: -- Check if the End Date is Less than or equal
2623: -- to the Start Date
2624: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2625: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2626: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2627: hr_utility.raise_error;
2628: END IF;
2629:
2630: l_counter := 0;
2623: -- to the Start Date
2624: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2625: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2626: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2627: hr_utility.raise_error;
2628: END IF;
2629:
2630: l_counter := 0;
2631:
2656: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
2657: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2658: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2659: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2660: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2661: hr_utility.raise_error;
2662: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2663: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2664: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2657: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2658: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
2659: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2660: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2661: hr_utility.raise_error;
2662: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2663: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2664: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2665: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2662: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
2663: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2664: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2665: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2666: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2667: hr_utility.raise_error;
2668: END IF;
2669:
2670: -- Store the Min Start Date and Max End Date
2663: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
2664: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
2665: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
2666: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
2667: hr_utility.raise_error;
2668: END IF;
2669:
2670: -- Store the Min Start Date and Max End Date
2671: IF l_counter = 0 THEN
2695: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
2696: <= l_min_start_date AND
2697: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2698: >= l_max_end_date THEN
2699: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
2700: hr_utility.raise_error;
2701: END IF;
2702:
2703: --validate that the Date From is equal to or greater than the hire date
2696: <= l_min_start_date AND
2697: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
2698: >= l_max_end_date THEN
2699: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
2700: hr_utility.raise_error;
2701: END IF;
2702:
2703: --validate that the Date From is equal to or greater than the hire date
2704: OPEN c_get_hire_date(l_eff_date);
2705: FETCH c_get_hire_date INTO l_hire_date;
2706: CLOSE c_get_hire_date;
2707:
2708: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2709: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2710: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2711: hr_utility.raise_error;
2712: END IF;
2713:
2706: CLOSE c_get_hire_date;
2707:
2708: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2709: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2710: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2711: hr_utility.raise_error;
2712: END IF;
2713:
2714:
2707:
2708: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2709: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
2710: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
2711: hr_utility.raise_error;
2712: END IF;
2713:
2714:
2715: END IF;
2966: IF p_information_type = 'NL_ABP_PI' THEN
2967:
2968: --check to see if the pension type has been changed. If so, throw an error
2969: IF p_aei_information3 <> p_aei_information3_o THEN
2970: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
2971: hr_utility.raise_error;
2972: END IF;
2973: -- Check if the End Date is Less than or equal
2974: -- to the Start Date
2967:
2968: --check to see if the pension type has been changed. If so, throw an error
2969: IF p_aei_information3 <> p_aei_information3_o THEN
2970: hr_utility.set_message(8303,'PQP_230100_PT_UPD_NOT_ALLOWED');
2971: hr_utility.raise_error;
2972: END IF;
2973: -- Check if the End Date is Less than or equal
2974: -- to the Start Date
2975: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2973: -- Check if the End Date is Less than or equal
2974: -- to the Start Date
2975: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2976: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2977: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2978: hr_utility.raise_error;
2979: END IF;
2980:
2981: -- check to see that the start and end dates entered are between the
2974: -- to the Start Date
2975: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
2976: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
2977: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
2978: hr_utility.raise_error;
2979: END IF;
2980:
2981: -- check to see that the start and end dates entered are between the
2982: -- min start date and max end date of the pension type
3007: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3008: < l_min_st_dt
3009: OR trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3010: > l_max_end_dt THEN
3011: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
3012: hr_utility.raise_error;
3013: END IF;
3014:
3015: l_counter := 0;
3008: < l_min_st_dt
3009: OR trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3010: > l_max_end_dt THEN
3011: hr_utility.set_message(8303,'PQP_230047_INV_ST_END_DATES');
3012: hr_utility.raise_error;
3013: END IF;
3014:
3015: l_counter := 0;
3016: /*
3045: IF fnd_date.canonical_to_date(p_aei_information1)
3046: < l_min_schm_st
3047: OR fnd_date.canonical_to_date(nvl(p_aei_information2,'4712/12/31'))
3048: > l_max_schm_end THEN
3049: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
3050: hr_utility.raise_error;
3051: END IF;
3052: */
3053: l_counter := 0;
3046: < l_min_schm_st
3047: OR fnd_date.canonical_to_date(nvl(p_aei_information2,'4712/12/31'))
3048: > l_max_schm_end THEN
3049: hr_utility.set_message(8303,'PQP_230070_INV_SCHM_DATES');
3050: hr_utility.raise_error;
3051: END IF;
3052: */
3053: l_counter := 0;
3054:
3079: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
3080: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3081: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3082: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3083: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
3084: hr_utility.raise_error;
3085: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3086: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3087: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3080: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3081: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3082: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3083: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
3084: hr_utility.raise_error;
3085: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3086: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3087: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3088: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3085: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3086: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3087: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3088: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3089: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
3090: hr_utility.raise_error;
3091: END IF;
3092:
3093: END LOOP;
3086: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3087: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3088: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3089: hr_utility.set_message(8303, 'PQP_230041_OVERLAP_PT_ROWS');
3090: hr_utility.raise_error;
3091: END IF;
3092:
3093: END LOOP;
3094:
3093: END LOOP;
3094:
3095: FOR temp_rec1 IN cur_abp_asg_info
3096: LOOP
3097: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3098: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3099: -- Store the Min Start Date and Max End Date
3100: IF l_counter = 0 THEN
3101: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3094:
3095: FOR temp_rec1 IN cur_abp_asg_info
3096: LOOP
3097: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3098: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3099: -- Store the Min Start Date and Max End Date
3100: IF l_counter = 0 THEN
3101: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3102: ,1,10),'YYYY/MM/DD'));
3117: END IF;
3118: END IF;
3119: l_counter := l_counter + 1;
3120: END LOOP;
3121: --hr_utility.trace_off;
3122:
3123: -- Check to see if the records are in continuous order
3124: -- and there are no gaps (no longer need to chk since gaps are allowed)
3125: /*IF trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD'))
3127:
3128: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3129: > trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3130:
3131: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
3132: hr_utility.raise_error;
3133:
3134: ELSIF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3135: < trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3128: IF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3129: > trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3130:
3131: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
3132: hr_utility.raise_error;
3133:
3134: ELSIF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3135: < trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3136:
3133:
3134: ELSIF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3135: < trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3136:
3137: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3138: hr_utility.raise_error;
3139:
3140: END IF;
3141:
3134: ELSIF trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD'))
3135: < trunc(to_date(substr(p_aei_information1_o,1,10),'YYYY/MM/DD')) THEN
3136:
3137: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3138: hr_utility.raise_error;
3139:
3140: END IF;
3141:
3142: ELSIF trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD'))
3144:
3145: IF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3146: < trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3147:
3148: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
3149: hr_utility.raise_error;
3150:
3151: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3152: > trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3145: IF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3146: < trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3147:
3148: hr_utility.set_message(8303,'PQP_230042_GAP_EXIST_IN_PT_ROW');
3149: hr_utility.raise_error;
3150:
3151: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3152: > trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3153:
3150:
3151: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3152: > trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3153:
3154: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3155: hr_utility.raise_error;
3156:
3157: END IF;
3158:
3151: ELSIF trunc(to_date(substr(p_aei_information2,1,10),'YYYY/MM/DD'))
3152: > trunc(to_date(substr(p_aei_information2_o,1,10),'YYYY/MM/DD')) THEN
3153:
3154: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3155: hr_utility.raise_error;
3156:
3157: END IF;
3158:
3159: END IF;*/
3165: <= l_min_start_date AND
3166: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3167: >= l_max_end_date THEN
3168:
3169: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3170: hr_utility.raise_error;
3171:
3172: END IF;
3173:
3166: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3167: >= l_max_end_date THEN
3168:
3169: hr_utility.set_message(8303,'PQP_230041_OVERLAP_PT_ROWS');
3170: hr_utility.raise_error;
3171:
3172: END IF;
3173:
3174: END IF;
3175:
3176: --Check to see that there is only one pension type of a particular sub
3177: --category on a particular date
3178:
3179: hr_utility.set_location('name'||p_aei_information3,7);
3180: -- find the pension sub category for the current pension type row
3181: OPEN cur_get_pen_sub_cat(p_aei_information3);
3182: FETCH cur_get_pen_sub_cat INTO l_pen_sub_cat1
3183: ,l_thresh_conv_rule1
3183: ,l_thresh_conv_rule1
3184: ,l_contrib_conv_rule1
3185: ,l_basis_method1;
3186: CLOSE cur_get_pen_sub_cat;
3187: hr_utility.set_location('Current sub category'||l_pen_sub_cat1,10);
3188: -- now loop through the rows of all overlapping pension type rows
3189: --if a row with the same sub category exists , raise an error
3190: FOR temp_rec1 in cur_get_overlap_rows
3191: LOOP
3194: ,l_thresh_conv_rule2
3195: ,l_contrib_conv_rule2
3196: ,l_basis_method2;
3197: CLOSE cur_get_pen_sub_cat;
3198: hr_utility.set_location('pension subcategory'||l_pen_sub_cat2,20);
3199: IF l_pen_sub_cat1 = l_pen_sub_cat2
3200: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
3201: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
3202: AND l_basis_method1 = l_basis_method2 THEN
3200: AND l_thresh_conv_rule1 = l_thresh_conv_rule2
3201: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
3202: AND l_basis_method1 = l_basis_method2 THEN
3203:
3204: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
3205: hr_utility.raise_error;
3206:
3207: END IF;
3208: --hr_utility.trace_off;
3201: AND l_contrib_conv_rule1 = l_contrib_conv_rule2
3202: AND l_basis_method1 = l_basis_method2 THEN
3203:
3204: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
3205: hr_utility.raise_error;
3206:
3207: END IF;
3208: --hr_utility.trace_off;
3209: END LOOP;
3204: hr_utility.set_message(8303,'PQP_230046_SAME_SUB_CAT_ERR');
3205: hr_utility.raise_error;
3206:
3207: END IF;
3208: --hr_utility.trace_off;
3209: END LOOP;
3210:
3211: -- if the contribution method is PE the value should be between 0 and 999.999
3212: IF nvl(p_aei_information13,'PE') = 'PE' THEN
3210:
3211: -- if the contribution method is PE the value should be between 0 and 999.999
3212: IF nvl(p_aei_information13,'PE') = 'PE' THEN
3213: IF fnd_number.canonical_to_number(nvl(p_aei_information14,'0')) > 999.999 THEN
3214: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
3215: hr_utility.raise_error;
3216: END IF;
3217: END IF;
3218:
3211: -- if the contribution method is PE the value should be between 0 and 999.999
3212: IF nvl(p_aei_information13,'PE') = 'PE' THEN
3213: IF fnd_number.canonical_to_number(nvl(p_aei_information14,'0')) > 999.999 THEN
3214: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
3215: hr_utility.raise_error;
3216: END IF;
3217: END IF;
3218:
3219: -- if the contribution method is PE the value should be between 0 and 999.999
3218:
3219: -- if the contribution method is PE the value should be between 0 and 999.999
3220: IF nvl(p_aei_information15,'PE') = 'PE' THEN
3221: IF fnd_number.canonical_to_number(nvl(p_aei_information16,'0')) > 999.999 THEN
3222: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
3223: hr_utility.raise_error;
3224: END IF;
3225: END IF;
3226:
3219: -- if the contribution method is PE the value should be between 0 and 999.999
3220: IF nvl(p_aei_information15,'PE') = 'PE' THEN
3221: IF fnd_number.canonical_to_number(nvl(p_aei_information16,'0')) > 999.999 THEN
3222: hr_utility.set_message(8303,'PQP_230052_INV_PERCENT_VALUE');
3223: hr_utility.raise_error;
3224: END IF;
3225: END IF;
3226:
3227: --validate that the Date From is equal to or greater than the hire date
3228: OPEN c_get_hire_date(l_eff_date);
3229: FETCH c_get_hire_date INTO l_hire_date;
3230: CLOSE c_get_hire_date;
3231: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3232: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3233: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3234: hr_utility.raise_error;
3235: END IF;
3236:
3229: FETCH c_get_hire_date INTO l_hire_date;
3230: CLOSE c_get_hire_date;
3231: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3232: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3233: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3234: hr_utility.raise_error;
3235: END IF;
3236:
3237: --validate that if the override value is entered , the reason is also entered
3230: CLOSE c_get_hire_date;
3231: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3232: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3233: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3234: hr_utility.raise_error;
3235: END IF;
3236:
3237: --validate that if the override value is entered , the reason is also entered
3238: IF ((p_aei_information7 IS NOT NULL) AND (p_aei_information8 IS NULL)
3239: OR (p_aei_information9 IS NOT NULL) AND (p_aei_information10 IS NULL)
3240: OR (p_aei_information11 IS NOT NULL) AND (p_aei_information12 IS NULL)
3241: OR (p_aei_information20 IS NOT NULL) AND (p_aei_information21 IS NULL)
3242: ) THEN
3243: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
3244: hr_utility.raise_error;
3245: END IF;
3246:
3247: --validate that only one among Pension Salary,Basis or Contribution is overridden
3240: OR (p_aei_information11 IS NOT NULL) AND (p_aei_information12 IS NULL)
3241: OR (p_aei_information20 IS NOT NULL) AND (p_aei_information21 IS NULL)
3242: ) THEN
3243: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
3244: hr_utility.raise_error;
3245: END IF;
3246:
3247: --validate that only one among Pension Salary,Basis or Contribution is overridden
3248: IF NOT (((p_aei_information7 IS NOT NULL)
3263: ((p_aei_information7 IS NULL)
3264: AND (p_aei_information9 IS NULL)
3265: AND ((p_aei_information11 IS NULL) AND (p_aei_information20 IS NULL))
3266: )) THEN
3267: hr_utility.set_message(8303,'PQP_230057_INVALID_OVERRIDES');
3268: hr_utility.raise_error;
3269: END IF;
3270:
3271: /*--validate that if the override is entered for contribution value, then
3264: AND (p_aei_information9 IS NULL)
3265: AND ((p_aei_information11 IS NULL) AND (p_aei_information20 IS NULL))
3266: )) THEN
3267: hr_utility.set_message(8303,'PQP_230057_INVALID_OVERRIDES');
3268: hr_utility.raise_error;
3269: END IF;
3270:
3271: /*--validate that if the override is entered for contribution value, then
3272: -- the contribution type is also entered
3274: OR (p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
3275: OR (p_aei_information15 IS NOT NULL AND p_aei_information16 IS NULL)
3276: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
3277: ) THEN
3278: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
3279: hr_utility.raise_error;
3280: END IF; */
3281:
3282: --this validation has now changed as follows
3275: OR (p_aei_information15 IS NOT NULL AND p_aei_information16 IS NULL)
3276: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
3277: ) THEN
3278: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
3279: hr_utility.raise_error;
3280: END IF; */
3281:
3282: --this validation has now changed as follows
3283: --the following combinations would occur
3295:
3296: IF ((p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
3297: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
3298: ) THEN
3299: hr_utility.set_message(8303,'PQP_230140_INV_CONTRIBUTION');
3300: hr_utility.raise_error;
3301: END IF;
3302:
3303: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
3296: IF ((p_aei_information13 IS NULL AND p_aei_information14 IS NOT NULL)
3297: OR (p_aei_information15 IS NULL AND p_aei_information16 IS NOT NULL)
3298: ) THEN
3299: hr_utility.set_message(8303,'PQP_230140_INV_CONTRIBUTION');
3300: hr_utility.raise_error;
3301: END IF;
3302:
3303: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
3304: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
3302:
3303: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
3304: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
3305: ) THEN
3306: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
3307: hr_utility.raise_error;
3308: END IF;
3309:
3310: /*--validate that if an end date is entered, then end reason should also be entered
3303: IF ((nvl(p_aei_information13,'PE') = 'FA' AND p_aei_information14 IS NULL)
3304: OR (nvl(p_aei_information15,'PE') = 'FA' AND p_aei_information16 IS NULL)
3305: ) THEN
3306: hr_utility.set_message(8303,'PQP_230058_INVALID_CONTRIB');
3307: hr_utility.raise_error;
3308: END IF;
3309:
3310: /*--validate that if an end date is entered, then end reason should also be entered
3311: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
3308: END IF;
3309:
3310: /*--validate that if an end date is entered, then end reason should also be entered
3311: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
3312: hr_utility.set_message(8303,'PQP_230103_ENTER_END_REASON');
3313: hr_utility.raise_error;
3314: END IF; */
3315:
3316: --check to see if update can be allowed on the ASG EIT row
3309:
3310: /*--validate that if an end date is entered, then end reason should also be entered
3311: IF p_aei_information2 IS NOT NULL AND p_aei_information4 IS NULL THEN
3312: hr_utility.set_message(8303,'PQP_230103_ENTER_END_REASON');
3313: hr_utility.raise_error;
3314: END IF; */
3315:
3316: --check to see if update can be allowed on the ASG EIT row
3317: --also fetch the greatest date earned, so that any end date entered
3330: --do not allow an update of pension type if an update is not
3331: --allowed
3332: IF l_allow_update = 0 THEN
3333: IF (p_aei_information3 <> p_aei_information3_o) THEN
3334: hr_utility.set_message(8303,'PQP_230101_UPD_NOT_ALLOWED');
3335: hr_utility.raise_error;
3336: END IF;
3337: END IF;
3338:
3331: --allowed
3332: IF l_allow_update = 0 THEN
3333: IF (p_aei_information3 <> p_aei_information3_o) THEN
3334: hr_utility.set_message(8303,'PQP_230101_UPD_NOT_ALLOWED');
3335: hr_utility.raise_error;
3336: END IF;
3337: END IF;
3338:
3339: /* ELSIF fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) <>
3339: /* ELSIF fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) <>
3340: fnd_date.canonical_to_date(nvl(p_aei_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3341: IF l_eff_date <= l_date_earned OR fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
3342: <= l_date_earned THEN
3343: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
3344: hr_utility.raise_error;
3345: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3346: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3347: hr_utility.raise_error;
3340: fnd_date.canonical_to_date(nvl(p_aei_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3341: IF l_eff_date <= l_date_earned OR fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot)))
3342: <= l_date_earned THEN
3343: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
3344: hr_utility.raise_error;
3345: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3346: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3347: hr_utility.raise_error;
3348: END IF;
3342: <= l_date_earned THEN
3343: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
3344: hr_utility.raise_error;
3345: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3346: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3347: hr_utility.raise_error;
3348: END IF;
3349: END IF;
3350: --else update is allowed
3343: hr_utility.set_message(8303,'PQP_230102_DT_TO_AFTER_PAY_RUN');
3344: hr_utility.raise_error;
3345: ELSIF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3346: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3347: hr_utility.raise_error;
3348: END IF;
3349: END IF;
3350: --else update is allowed
3351: ELSE
3351: ELSE
3352: IF fnd_date.canonical_to_date(nvl(p_aei_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) <>
3353: fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3354: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3355: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3356: hr_utility.raise_error;
3357: END IF;
3358: END IF;
3359: END IF;*/
3352: IF fnd_date.canonical_to_date(nvl(p_aei_information2_o,fnd_date.date_to_canonical(hr_api.g_eot))) <>
3353: fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3354: IF l_eff_date > fnd_date.canonical_to_date(nvl(p_aei_information2,fnd_date.date_to_canonical(hr_api.g_eot))) THEN
3355: hr_utility.set_message(8303,'PQP_230099_DT_TO_BEF_END_DT');
3356: hr_utility.raise_error;
3357: END IF;
3358: END IF;
3359: END IF;*/
3360:
3411: -- Check if the End Date is Less than or equal
3412: -- to the Start Date
3413: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
3414: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3415: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
3416: hr_utility.raise_error;
3417: END IF;
3418:
3419: l_counter := 0;
3412: -- to the Start Date
3413: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
3414: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3415: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
3416: hr_utility.raise_error;
3417: END IF;
3418:
3419: l_counter := 0;
3420:
3445: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
3446: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3447: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3448: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3449: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3450: hr_utility.raise_error;
3451: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3452: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3453: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3446: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3447: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3448: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3449: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3450: hr_utility.raise_error;
3451: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3452: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3453: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3454: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3451: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3452: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3453: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3454: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3455: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3456: hr_utility.raise_error;
3457: END IF;
3458:
3459: END LOOP;
3452: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3453: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3454: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3455: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3456: hr_utility.raise_error;
3457: END IF;
3458:
3459: END LOOP;
3460:
3459: END LOOP;
3460:
3461: FOR temp_rec1 IN cur_abp_asg_info1
3462: LOOP
3463: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3464: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3465: -- Store the Min Start Date and Max End Date
3466: IF l_counter = 0 THEN
3467: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3460:
3461: FOR temp_rec1 IN cur_abp_asg_info1
3462: LOOP
3463: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3464: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3465: -- Store the Min Start Date and Max End Date
3466: IF l_counter = 0 THEN
3467: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3468: ,1,10),'YYYY/MM/DD'));
3483: END IF;
3484: END IF;
3485: l_counter := l_counter + 1;
3486: END LOOP;
3487: --hr_utility.trace_off;
3488:
3489: --Check to see if the start and end dates encompasses all other rows
3490: IF l_min_start_date IS NOT NULL AND l_max_end_date IS NOT NULL THEN
3491:
3493: <= l_min_start_date AND
3494: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3495: >= l_max_end_date THEN
3496:
3497: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3498: hr_utility.raise_error;
3499:
3500: END IF;
3501:
3494: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3495: >= l_max_end_date THEN
3496:
3497: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3498: hr_utility.raise_error;
3499:
3500: END IF;
3501:
3502: END IF;
3505: OPEN c_get_hire_date(l_eff_date);
3506: FETCH c_get_hire_date INTO l_hire_date;
3507: CLOSE c_get_hire_date;
3508: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3509: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3510: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3511: hr_utility.raise_error;
3512: END IF;
3513:
3506: FETCH c_get_hire_date INTO l_hire_date;
3507: CLOSE c_get_hire_date;
3508: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3509: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3510: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3511: hr_utility.raise_error;
3512: END IF;
3513:
3514: --validate that if the override value is entered , the reason is also entered
3507: CLOSE c_get_hire_date;
3508: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3509: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3510: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3511: hr_utility.raise_error;
3512: END IF;
3513:
3514: --validate that if the override value is entered , the reason is also entered
3515: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
3514: --validate that if the override value is entered , the reason is also entered
3515: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
3516: OR (p_aei_information8 IS NOT NULL) AND (p_aei_information9 IS NULL)
3517: ) THEN
3518: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
3519: hr_utility.raise_error;
3520: END IF;
3521:
3522: --validate that only one among Pension Salary,Basis is overridden
3515: IF ((p_aei_information6 IS NOT NULL) AND (p_aei_information7 IS NULL)
3516: OR (p_aei_information8 IS NOT NULL) AND (p_aei_information9 IS NULL)
3517: ) THEN
3518: hr_utility.set_message(8303,'PQP_230056_NO_OVERRIDE_REASON');
3519: hr_utility.raise_error;
3520: END IF;
3521:
3522: --validate that only one among Pension Salary,Basis is overridden
3523: IF NOT (((p_aei_information6 IS NOT NULL)
3530: OR
3531: ((p_aei_information6 IS NULL)
3532: AND (p_aei_information8 IS NULL)
3533: )) THEN
3534: hr_utility.set_message(8303,'PQP_230135_INV_EIT_OVERRIDES');
3535: hr_utility.raise_error;
3536: END IF;
3537:
3538: --validations for the salary override rows
3531: ((p_aei_information6 IS NULL)
3532: AND (p_aei_information8 IS NULL)
3533: )) THEN
3534: hr_utility.set_message(8303,'PQP_230135_INV_EIT_OVERRIDES');
3535: hr_utility.raise_error;
3536: END IF;
3537:
3538: --validations for the salary override rows
3539: IF p_aei_information6 IS NOT NULL THEN
3539: IF p_aei_information6 IS NOT NULL THEN
3540:
3541: --ensure that the end date is also entered
3542: IF p_aei_information2 IS NULL THEN
3543: hr_utility.set_message(8303,'PQP_230155_ENTER_END_DATE');
3544: hr_utility.raise_error;
3545: END IF;
3546:
3547: --ensure that the start date and end date are in the same year
3540:
3541: --ensure that the end date is also entered
3542: IF p_aei_information2 IS NULL THEN
3543: hr_utility.set_message(8303,'PQP_230155_ENTER_END_DATE');
3544: hr_utility.raise_error;
3545: END IF;
3546:
3547: --ensure that the start date and end date are in the same year
3548: IF NOT ((l_start_year = l_curr_year)
3547: --ensure that the start date and end date are in the same year
3548: IF NOT ((l_start_year = l_curr_year)
3549: AND (l_end_year = l_curr_year)
3550: ) THEN
3551: hr_utility.set_message(8303,'PQP_230156_ENTER_CURR_YEAR');
3552: hr_utility.raise_error;
3553: END IF;
3554:
3555: --find the minimum and maximum start and end dates
3548: IF NOT ((l_start_year = l_curr_year)
3549: AND (l_end_year = l_curr_year)
3550: ) THEN
3551: hr_utility.set_message(8303,'PQP_230156_ENTER_CURR_YEAR');
3552: hr_utility.raise_error;
3553: END IF;
3554:
3555: --find the minimum and maximum start and end dates
3556: l_counter := 0;
3580:
3581: IF fnd_date.canonical_to_date(p_aei_information1)
3582: > fnd_date.canonical_to_date(p_aei_information1_o) THEN
3583:
3584: hr_utility.set_message(8303,'PQP_230157_GAP_IN_SAL_ROW');
3585: hr_utility.raise_error;
3586:
3587: ELSIF fnd_date.canonical_to_date(p_aei_information1)
3588: < fnd_date.canonical_to_date(p_aei_information1_o) THEN
3581: IF fnd_date.canonical_to_date(p_aei_information1)
3582: > fnd_date.canonical_to_date(p_aei_information1_o) THEN
3583:
3584: hr_utility.set_message(8303,'PQP_230157_GAP_IN_SAL_ROW');
3585: hr_utility.raise_error;
3586:
3587: ELSIF fnd_date.canonical_to_date(p_aei_information1)
3588: < fnd_date.canonical_to_date(p_aei_information1_o) THEN
3589:
3586:
3587: ELSIF fnd_date.canonical_to_date(p_aei_information1)
3588: < fnd_date.canonical_to_date(p_aei_information1_o) THEN
3589:
3590: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3591: hr_utility.raise_error;
3592:
3593: END IF;
3594:
3587: ELSIF fnd_date.canonical_to_date(p_aei_information1)
3588: < fnd_date.canonical_to_date(p_aei_information1_o) THEN
3589:
3590: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3591: hr_utility.raise_error;
3592:
3593: END IF;
3594:
3595: ELSIF fnd_date.canonical_to_date(p_aei_information2_o)
3597:
3598: IF fnd_date.canonical_to_date(p_aei_information2)
3599: < fnd_date.canonical_to_date(p_aei_information2_o) THEN
3600:
3601: hr_utility.set_message(8303,'PQP_230157_GAP_IN_SAL_ROW');
3602: hr_utility.raise_error;
3603:
3604: ELSIF fnd_date.canonical_to_date(p_aei_information2)
3605: > fnd_date.canonical_to_date(p_aei_information2_o) THEN
3598: IF fnd_date.canonical_to_date(p_aei_information2)
3599: < fnd_date.canonical_to_date(p_aei_information2_o) THEN
3600:
3601: hr_utility.set_message(8303,'PQP_230157_GAP_IN_SAL_ROW');
3602: hr_utility.raise_error;
3603:
3604: ELSIF fnd_date.canonical_to_date(p_aei_information2)
3605: > fnd_date.canonical_to_date(p_aei_information2_o) THEN
3606:
3603:
3604: ELSIF fnd_date.canonical_to_date(p_aei_information2)
3605: > fnd_date.canonical_to_date(p_aei_information2_o) THEN
3606:
3607: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3608: hr_utility.raise_error;
3609:
3610: END IF;
3611:
3604: ELSIF fnd_date.canonical_to_date(p_aei_information2)
3605: > fnd_date.canonical_to_date(p_aei_information2_o) THEN
3606:
3607: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3608: hr_utility.raise_error;
3609:
3610: END IF;
3611:
3612: END IF;
3620: --verify that the minimum date is correct date or not
3621:
3622: IF (nvl(l_min_sal_start,fnd_date.canonical_to_date(p_aei_information1))
3623: <> get_valid_start_date(p_assignment_id,l_eff_date,l_error_status,l_error_message)) THEN
3624: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
3625: hr_utility.raise_error;
3626: Else
3627: IF (l_error_status = trim(to_char(1,'9'))) Then
3628: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
3621:
3622: IF (nvl(l_min_sal_start,fnd_date.canonical_to_date(p_aei_information1))
3623: <> get_valid_start_date(p_assignment_id,l_eff_date,l_error_status,l_error_message)) THEN
3624: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
3625: hr_utility.raise_error;
3626: Else
3627: IF (l_error_status = trim(to_char(1,'9'))) Then
3628: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
3629: hr_utility.raise_error;
3624: hr_utility.set_message(8303,'PQP_230158_ST_DT_JAN_01');
3625: hr_utility.raise_error;
3626: Else
3627: IF (l_error_status = trim(to_char(1,'9'))) Then
3628: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
3629: hr_utility.raise_error;
3630: End IF;
3631: END IF;
3632:
3625: hr_utility.raise_error;
3626: Else
3627: IF (l_error_status = trim(to_char(1,'9'))) Then
3628: hr_utility.set_message(8303,'PQP_230205_ASSGN_NOT_EXISTS');
3629: hr_utility.raise_error;
3630: End IF;
3631: END IF;
3632:
3633: END IF; /*End of check if salary has been overridden*/
3691: OPEN cur_sav_asg_info;
3692: FETCH cur_sav_asg_info INTO l_asg_sav_info_exists;
3693: IF cur_sav_asg_info%FOUND THEN
3694: CLOSE cur_sav_asg_info;
3695: hr_utility.set_message(8303,'PQP_230141_SAV_INFO_EXISTS');
3696: hr_utility.raise_error;
3697: ELSE
3698: CLOSE cur_sav_asg_info;
3699: END IF;
3692: FETCH cur_sav_asg_info INTO l_asg_sav_info_exists;
3693: IF cur_sav_asg_info%FOUND THEN
3694: CLOSE cur_sav_asg_info;
3695: hr_utility.set_message(8303,'PQP_230141_SAV_INFO_EXISTS');
3696: hr_utility.raise_error;
3697: ELSE
3698: CLOSE cur_sav_asg_info;
3699: END IF;
3700:
3704: FETCH cur_periods_per_yr INTO l_periods_per_yr;
3705: IF cur_periods_per_yr%FOUND THEN
3706: CLOSE cur_periods_per_yr;
3707: IF fnd_number.canonical_to_number(p_aei_information2) > l_periods_per_yr THEN
3708: hr_utility.set_message(8303,'PQP_230142_INV_PERIOD_NUMBER');
3709: hr_utility.raise_error;
3710: END IF;
3711: ELSE
3712: CLOSE cur_periods_per_yr;
3705: IF cur_periods_per_yr%FOUND THEN
3706: CLOSE cur_periods_per_yr;
3707: IF fnd_number.canonical_to_number(p_aei_information2) > l_periods_per_yr THEN
3708: hr_utility.set_message(8303,'PQP_230142_INV_PERIOD_NUMBER');
3709: hr_utility.raise_error;
3710: END IF;
3711: ELSE
3712: CLOSE cur_periods_per_yr;
3713: END IF;
3713: END IF;
3714:
3715: --validate that the amount entered is > 0
3716: IF fnd_number.canonical_to_number(p_aei_information3) <= 0 THEN
3717: hr_utility.set_message(8303,'PQP_230149_INV_ADDNL_AMT');
3718: hr_utility.raise_error;
3719: END IF;
3720:
3721:
3714:
3715: --validate that the amount entered is > 0
3716: IF fnd_number.canonical_to_number(p_aei_information3) <= 0 THEN
3717: hr_utility.set_message(8303,'PQP_230149_INV_ADDNL_AMT');
3718: hr_utility.raise_error;
3719: END IF;
3720:
3721:
3722: ELSIF p_information_type = 'NL_ADDL_CALC' THEN
3724: -- Check if the End Date is Less than or equal
3725: -- to the Start Date
3726: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
3727: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3728: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
3729: hr_utility.raise_error;
3730: END IF;
3731:
3732: l_counter := 0;
3725: -- to the Start Date
3726: IF trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <
3727: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3728: hr_utility.set_message(8303, 'PQP_230040_END_DT_BEF_ST_DT');
3729: hr_utility.raise_error;
3730: END IF;
3731:
3732: l_counter := 0;
3733:
3758: IF (trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) >=
3759: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3760: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3761: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3762: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3763: hr_utility.raise_error;
3764: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3765: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3766: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3759: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3760: trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) <=
3761: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3762: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3763: hr_utility.raise_error;
3764: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3765: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3766: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3767: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3764: ELSIF (trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) >=
3765: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3766: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3767: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3768: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3769: hr_utility.raise_error;
3770: END IF;
3771:
3772: END LOOP;
3765: trunc(to_date(substr(temp_rec.aei_information1,1,10),'YYYY/MM/DD')) AND
3766: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD')) <=
3767: trunc(to_date(substr(temp_rec.aei_information2,1,10),'YYYY/MM/DD'))) THEN
3768: hr_utility.set_message(8303, 'PQP_230134_EIT_OVERLAP_ROWS');
3769: hr_utility.raise_error;
3770: END IF;
3771:
3772: END LOOP;
3773:
3772: END LOOP;
3773:
3774: FOR temp_rec1 IN cur_ret_addl_info_calc
3775: LOOP
3776: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3777: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3778: -- Store the Min Start Date and Max End Date
3779: IF l_counter = 0 THEN
3780: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3773:
3774: FOR temp_rec1 IN cur_ret_addl_info_calc
3775: LOOP
3776: -- hr_utility.set_location('start date'||temp_rec1.org_information1,10);
3777: -- hr_utility.set_location('end date'||temp_rec1.org_information2,20);
3778: -- Store the Min Start Date and Max End Date
3779: IF l_counter = 0 THEN
3780: l_min_start_date := trunc(to_date(substr(temp_rec1.aei_information1
3781: ,1,10),'YYYY/MM/DD'));
3796: END IF;
3797: END IF;
3798: l_counter := l_counter + 1;
3799: END LOOP;
3800: --hr_utility.trace_off;
3801:
3802: --Check to see if the start and end dates encompasses all other rows
3803: IF l_min_start_date IS NOT NULL AND l_max_end_date IS NOT NULL THEN
3804:
3806: <= l_min_start_date AND
3807: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3808: >= l_max_end_date THEN
3809:
3810: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3811: hr_utility.raise_error;
3812:
3813: END IF;
3814:
3807: trunc(to_date(substr(nvl(p_aei_information2,'4712/12/31'),1,10),'YYYY/MM/DD'))
3808: >= l_max_end_date THEN
3809:
3810: hr_utility.set_message(8303,'PQP_230134_EIT_OVERLAP_ROWS');
3811: hr_utility.raise_error;
3812:
3813: END IF;
3814:
3815: END IF;
3818: OPEN c_get_hire_date(l_eff_date);
3819: FETCH c_get_hire_date INTO l_hire_date;
3820: CLOSE c_get_hire_date;
3821: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3822: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3823: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3824: hr_utility.raise_error;
3825: END IF;
3826:
3819: FETCH c_get_hire_date INTO l_hire_date;
3820: CLOSE c_get_hire_date;
3821: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3822: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3823: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3824: hr_utility.raise_error;
3825: END IF;
3826:
3827:
3820: CLOSE c_get_hire_date;
3821: IF l_hire_date > trunc(to_date(substr(p_aei_information1,1,10),'YYYY/MM/DD')) THEN
3822: hr_utility.set_message(8303,'PQP_230055_DATE_FRM_BEF_HIRE');
3823: hr_utility.set_message_token(8303,'HIREDATE',to_char(l_hire_date));
3824: hr_utility.raise_error;
3825: END IF;
3826:
3827:
3828: END IF;
3995: l_vop_num_or NUMBER;
3996:
3997: BEGIN
3998:
3999: hr_utility.set_location('entered get_proration_factor',10);
4000:
4001:
4002: --
4003: -- Fetch the pay period start and end dates
4006: FETCH c_get_period_dates INTO l_period_start_date
4007: ,l_period_end_date;
4008: CLOSE c_get_period_dates;
4009:
4010: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
4011: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
4012:
4013: --
4014: -- Fetch the greater of the assigment start date or the period start date
4007: ,l_period_end_date;
4008: CLOSE c_get_period_dates;
4009:
4010: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
4011: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
4012:
4013: --
4014: -- Fetch the greater of the assigment start date or the period start date
4015: --
4027:
4028: l_min_start_date := GREATEST(l_effective_date,trunc(l_period_start_date));
4029: l_max_end_date := LEAST(l_max_end_date,trunc(l_period_end_date));
4030:
4031: hr_utility.set_location('l_min_start_date : '||l_min_start_date,50);
4032: hr_utility.set_location('l_max_end_date : '||l_max_end_date,50);
4033:
4034: --
4035: -- Calcualte the total number of days in the pay period
4028: l_min_start_date := GREATEST(l_effective_date,trunc(l_period_start_date));
4029: l_max_end_date := LEAST(l_max_end_date,trunc(l_period_end_date));
4030:
4031: hr_utility.set_location('l_min_start_date : '||l_min_start_date,50);
4032: hr_utility.set_location('l_max_end_date : '||l_max_end_date,50);
4033:
4034: --
4035: -- Calcualte the total number of days in the pay period
4036: --
4043: --
4044: l_days_in_pp := nvl(l_max_end_date, trunc(l_period_end_date ))
4045: - nvl(l_min_start_date,trunc(l_period_start_date)) + 1;
4046:
4047: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
4048: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
4049:
4050: l_min_vop_start := NULL;
4051: l_max_vop_end := NULL;
4044: l_days_in_pp := nvl(l_max_end_date, trunc(l_period_end_date ))
4045: - nvl(l_min_start_date,trunc(l_period_start_date)) + 1;
4046:
4047: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
4048: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
4049:
4050: l_min_vop_start := NULL;
4051: l_max_vop_end := NULL;
4052: l_min_vop_start_or := NULL;
4196: IF p_attrib_name IN ('KIND_OF_PARTICIPATION','VALUE_OF_PARTICIPATION',
4197: 'OVERRIDE_ANNUAL_PENSION_SALARY','PENSION_SALARY_OVERRIDE_REASON'
4198: ,'OVERRIDE_PENSION_BASIS','PENSION_BASIS_OVERRIDE_REASON'
4199: ) THEN
4200: hr_utility.set_location('searching in the participation EIT',10);
4201: OPEN c_get_extra_info_id;
4202: FETCH c_get_extra_info_id INTO l_asg_extra_info_id1;
4203: IF c_get_extra_info_id%FOUND THEN
4204: CLOSE c_get_extra_info_id;
4201: OPEN c_get_extra_info_id;
4202: FETCH c_get_extra_info_id INTO l_asg_extra_info_id1;
4203: IF c_get_extra_info_id%FOUND THEN
4204: CLOSE c_get_extra_info_id;
4205: hr_utility.set_location('found a row in the participation EIT',20);
4206: OPEN c_get_asg_extra_info(l_asg_extra_info_id1);
4207: FETCH c_get_asg_extra_info INTO g_asg_extra_info_rec1(l_asg_extra_info_id1);
4208: CLOSE c_get_asg_extra_info;
4209:
4449: OPEN c_get_person_age;
4450: FETCH c_get_person_age into l_person_year_of_birth;
4451: IF (c_get_person_age%FOUND and l_person_year_of_birth IS NOT NULL) THEN
4452:
4453: hr_utility.set_location(' l_person_year_of_birth is '||l_person_year_of_birth,35);
4454:
4455: OPEN c_get_subcat(p_pension_sub_cat);
4456: FETCH c_get_subcat INTO l_subcat;
4457: CLOSE c_get_subcat;
4459: OPEN c_get_part_st_age;
4460: FETCH c_get_part_st_age into l_part_start_age;
4461: CLOSE c_get_part_st_age;
4462:
4463: hr_utility.set_location(' l_subcat is '||l_subcat,40);
4464: hr_utility.set_location(' l_part_start_age is '||l_part_start_age,50);
4465:
4466:
4467: IF l_subcat IS NOT NULL THEN
4460: FETCH c_get_part_st_age into l_part_start_age;
4461: CLOSE c_get_part_st_age;
4462:
4463: hr_utility.set_location(' l_subcat is '||l_subcat,40);
4464: hr_utility.set_location(' l_part_start_age is '||l_part_start_age,50);
4465:
4466:
4467: IF l_subcat IS NOT NULL THEN
4468:
4477: );
4478:
4479: l_return_value := NVL(l_return_value,trim(to_char(0,'9')));
4480:
4481: hr_utility.set_location(' l_return_value is '||l_return_value,50);
4482:
4483: p_column_value := fnd_number.canonical_to_number(l_return_value);
4484:
4485: hr_utility.set_location(' p_column_value is '||p_column_value,60);
4481: hr_utility.set_location(' l_return_value is '||l_return_value,50);
4482:
4483: p_column_value := fnd_number.canonical_to_number(l_return_value);
4484:
4485: hr_utility.set_location(' p_column_value is '||p_column_value,60);
4486:
4487: END IF;-- subcat check
4488:
4489: END IF;--c_get_person_age%FOUND
4493:
4494: EXCEPTION
4495:
4496: WHEN NO_DATA_FOUND THEN
4497: hr_utility.set_location('NO_DATA_FOUND for UDT : ', 90);
4498:
4499: p_column_value := 0;
4500:
4501: RETURN 1;
4501: RETURN 1;
4502:
4503: WHEN OTHERS THEN
4504:
4505: hr_utility.set_location('sqlcode '||SQLCODE, 70);
4506: hr_utility.set_location('sqlerr '||SQLERRM, 80);
4507: hr_utility.set_location('error occurred while getting values for UDT ', 90);
4508: p_column_value := 0;
4509:
4502:
4503: WHEN OTHERS THEN
4504:
4505: hr_utility.set_location('sqlcode '||SQLCODE, 70);
4506: hr_utility.set_location('sqlerr '||SQLERRM, 80);
4507: hr_utility.set_location('error occurred while getting values for UDT ', 90);
4508: p_column_value := 0;
4509:
4510: RETURN 1;
4503: WHEN OTHERS THEN
4504:
4505: hr_utility.set_location('sqlcode '||SQLCODE, 70);
4506: hr_utility.set_location('sqlerr '||SQLERRM, 80);
4507: hr_utility.set_location('error occurred while getting values for UDT ', 90);
4508: p_column_value := 0;
4509:
4510: RETURN 1;
4511:
4695: l_proc_name VARCHAR2(30) := 'get_abp_org_contrib_percent';
4696:
4697: BEGIN
4698:
4699: hr_utility.set_location(' Entering '||l_proc_name,10);
4700: --
4701: -- Get the Org id, Legal ER org id and Payroll id
4702: --
4703: OPEN c_find_org;
4705: INTO l_hr_org_id,l_payroll_id,l_legal_er_org_id;
4706:
4707: CLOSE c_find_org;
4708:
4709: hr_utility.set_location('... The HR Org org id is -- '||l_hr_org_id,10);
4710: hr_utility.set_location('... The payroll id is -- '||l_payroll_id,15);
4711: hr_utility.set_location('... The legal ER org id is -- '||l_legal_er_org_id,20);
4712:
4713: --
4706:
4707: CLOSE c_find_org;
4708:
4709: hr_utility.set_location('... The HR Org org id is -- '||l_hr_org_id,10);
4710: hr_utility.set_location('... The payroll id is -- '||l_payroll_id,15);
4711: hr_utility.set_location('... The legal ER org id is -- '||l_legal_er_org_id,20);
4712:
4713: --
4714: -- Derive the contribution values from the pension type
4707: CLOSE c_find_org;
4708:
4709: hr_utility.set_location('... The HR Org org id is -- '||l_hr_org_id,10);
4710: hr_utility.set_location('... The payroll id is -- '||l_payroll_id,15);
4711: hr_utility.set_location('... The legal ER org id is -- '||l_legal_er_org_id,20);
4712:
4713: --
4714: -- Derive the contribution values from the pension type
4715: --
4712:
4713: --
4714: -- Derive the contribution values from the pension type
4715: --
4716: hr_utility.set_location('... Fetching contrib values from the PT',25);
4717:
4718: OPEN c_pt_val;
4719: FETCH c_pt_val
4720: INTO l_pt_ee_perc
5008: asg.effective_end_date;
5009:
5010: BEGIN
5011:
5012: hr_utility.set_location('Entering...',5);
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5009:
5010: BEGIN
5011:
5012: hr_utility.set_location('Entering...',5);
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5010: BEGIN
5011:
5012: hr_utility.set_location('Entering...',5);
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5018: hr_utility.set_location('...Value of p_basis_method is '||p_basis_method,35);
5011:
5012: hr_utility.set_location('Entering...',5);
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5018: hr_utility.set_location('...Value of p_basis_method is '||p_basis_method,35);
5019:
5012: hr_utility.set_location('Entering...',5);
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5018: hr_utility.set_location('...Value of p_basis_method is '||p_basis_method,35);
5019:
5020: --
5013: hr_utility.set_location('...Value of p_assignment_id is '||p_assignment_id,10);
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5018: hr_utility.set_location('...Value of p_basis_method is '||p_basis_method,35);
5019:
5020: --
5021: -- Initialize to p_date_earned.
5014: hr_utility.set_location('...Value of p_date_earned is '||p_date_earned,15);
5015: hr_utility.set_location('...Value of p_business_group_id is '||p_business_group_id,20);
5016: hr_utility.set_location('...Value of p_pension_sub_cat is '||p_pension_sub_cat,25);
5017: hr_utility.set_location('...Value of p_conversion_rule is '||p_conversion_rule,30);
5018: hr_utility.set_location('...Value of p_basis_method is '||p_basis_method,35);
5019:
5020: --
5021: -- Initialize to p_date_earned.
5022: --
5112: FETCH c_find_org
5113: INTO l_org_id,l_payroll_id,l_legal_er_org_id;
5114: CLOSE c_find_org;
5115:
5116: hr_utility.set_location('...LH Asg Override not found. Deriving from the org',150);
5117: hr_utility.set_location('...LH Value of l_org_id is'||l_org_id,160);
5118: hr_utility.set_location('...LH Value of l_payroll_id is'||l_payroll_id,170);
5119: hr_utility.set_location('...LH Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5120:
5113: INTO l_org_id,l_payroll_id,l_legal_er_org_id;
5114: CLOSE c_find_org;
5115:
5116: hr_utility.set_location('...LH Asg Override not found. Deriving from the org',150);
5117: hr_utility.set_location('...LH Value of l_org_id is'||l_org_id,160);
5118: hr_utility.set_location('...LH Value of l_payroll_id is'||l_payroll_id,170);
5119: hr_utility.set_location('...LH Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5120:
5121: l_ee_asg_eligible := 0;
5114: CLOSE c_find_org;
5115:
5116: hr_utility.set_location('...LH Asg Override not found. Deriving from the org',150);
5117: hr_utility.set_location('...LH Value of l_org_id is'||l_org_id,160);
5118: hr_utility.set_location('...LH Value of l_payroll_id is'||l_payroll_id,170);
5119: hr_utility.set_location('...LH Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5120:
5121: l_ee_asg_eligible := 0;
5122:
5115:
5116: hr_utility.set_location('...LH Asg Override not found. Deriving from the org',150);
5117: hr_utility.set_location('...LH Value of l_org_id is'||l_org_id,160);
5118: hr_utility.set_location('...LH Value of l_payroll_id is'||l_payroll_id,170);
5119: hr_utility.set_location('...LH Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5120:
5121: l_ee_asg_eligible := 0;
5122:
5123: l_ee_asg_eligible := chk_pt_eligibility
5155: END IF;
5156:
5157: END IF;
5158:
5159: hr_utility.set_location('...Value of l_date_earned is '||l_date_earned,35);
5160:
5161: --
5162: -- For a particular ABP Sub Category/BG combination,
5163: -- check if a ABP Pension Scheme is created. No need to go through
5169: ,p_business_group_id => p_business_group_id
5170: ,p_pension_sub_cat => l_abp_sub_cat
5171: ,p_pension_type_id => l_pension_type_id);
5172:
5173: hr_utility.set_location('...Value of l_chk_abp_scheme is '||l_chk_abp_scheme,40);
5174:
5175: IF l_chk_abp_scheme = 1 THEN
5176:
5177: hr_utility.set_location('...ABP Pension Scheme created for PT '||l_pension_type_id,45);
5173: hr_utility.set_location('...Value of l_chk_abp_scheme is '||l_chk_abp_scheme,40);
5174:
5175: IF l_chk_abp_scheme = 1 THEN
5176:
5177: hr_utility.set_location('...ABP Pension Scheme created for PT '||l_pension_type_id,45);
5178:
5179: --
5180: -- For IPH and IPL after 31 Dec 2006 Return 0%. This is necessary so that
5181: -- the Tax and SI for the retro contributions in 2006 are reduced in 2007.
5204: -- Derive the value of ER Age Dpndnt Contribution
5205: --
5206: IF l_er_age_contribution = 'Y' THEN
5207:
5208: hr_utility.set_location('...ABP ER component is age dependant',50);
5209: l_er_return_value := get_contribution_percent
5210: (p_assignment_id
5211: ,l_date_earned
5212: ,p_business_group_id
5220: -- Derive the value of EE Age Dpndnt Contribution
5221: --
5222: IF l_ee_age_contribution = 'Y' THEN
5223:
5224: hr_utility.set_location('...ABP EE component is age dependant',55);
5225:
5226: l_ee_return_value := get_contribution_percent
5227: (p_assignment_id
5228: ,l_date_earned
5244: ,l_er_contrib_value;
5245:
5246: IF c_get_asg_info%FOUND THEN
5247:
5248: hr_utility.set_location('...Data found at the Asg EIT',60);
5249: hr_utility.set_location('...c_get_asg_info %found ',65);
5250:
5251: IF l_er_contrib_type = 'FA' THEN
5252: l_er_contrib_value_fa := l_er_contrib_value;
5245:
5246: IF c_get_asg_info%FOUND THEN
5247:
5248: hr_utility.set_location('...Data found at the Asg EIT',60);
5249: hr_utility.set_location('...c_get_asg_info %found ',65);
5250:
5251: IF l_er_contrib_type = 'FA' THEN
5252: l_er_contrib_value_fa := l_er_contrib_value;
5253: END IF;
5263: --
5264:
5265: IF l_ee_age_contribution = 'Y' THEN
5266:
5267: hr_utility.set_location('...Deriving EE age dependant contribution',70);
5268: p_ee_contrib_value := l_ee_age_contri_value;
5269: p_ee_contrib_type := 0;
5270:
5271: ELSE
5272: -- Derive the contribution percentage for certain set of
5273: -- assignments. This is indicated at the org level via the
5274: -- "Applicable to all employees" flag in the org developer df
5275:
5276: hr_utility.set_location('...Deriving contribution based on Applicable to all employees flag',75);
5277:
5278: l_asg_ret_value:= get_abp_org_contrib_percent
5279: (p_assignment_id => p_assignment_id
5280: ,p_date_earned => l_date_earned
5293: ELSE
5294: --
5295: -- User has defined either a FA or PE return these
5296: --
5297: hr_utility.set_location('...EE Asg Contribution is a PE or FA ',80);
5298: SELECT DECODE(l_ee_contrib_type,'PE',0,'FA',1)
5299: INTO p_ee_contrib_type
5300: FROM dual;
5301: p_ee_contrib_value := l_ee_contrib_value;
5311: --
5312:
5313: IF l_er_age_contribution = 'Y' THEN
5314:
5315: hr_utility.set_location('...Deriving ER age dependant contribution',90);
5316: p_er_contrib_value := l_er_age_contri_value;
5317: p_er_contrib_type := 0;
5318:
5319: ELSE
5321: -- Derive the contribution percentage for certain set of
5322: -- assignments. This is indicated at the org level via the
5323: -- "Applicable to all employees" flag in the org developer df
5324: --
5325: hr_utility.set_location('...Deriving contribution based on Applicable to all employees flag',95);
5326: l_asg_ret_value:= get_abp_org_contrib_percent
5327: (p_assignment_id => p_assignment_id
5328: ,p_date_earned => l_date_earned
5329: ,p_business_group_id => p_business_group_id
5342:
5343: SELECT DECODE(l_er_contrib_type,'PE',0,'FA',1)
5344: INTO p_er_contrib_type
5345: FROM dual;
5346: hr_utility.set_location('...ER Asg Contribution is a PE or FA ',100);
5347: p_er_contrib_value := l_er_contrib_value;
5348: l_er_return_value := 0;
5349:
5350: END IF;
5356: ELSE
5357: l_ret_value := 0;
5358: END IF;
5359:
5360: hr_utility.set_location('...Asg EE Contrib Type is '||p_ee_contrib_type,110);
5361: hr_utility.set_location('...Asg ER Contrib Type is '||p_er_contrib_type,120);
5362: hr_utility.set_location('...Asg EE Contrib Val is '||p_ee_contrib_value,130);
5363: hr_utility.set_location('...Asg ER Contrib Val is '||p_er_contrib_value,140);
5364:
5357: l_ret_value := 0;
5358: END IF;
5359:
5360: hr_utility.set_location('...Asg EE Contrib Type is '||p_ee_contrib_type,110);
5361: hr_utility.set_location('...Asg ER Contrib Type is '||p_er_contrib_type,120);
5362: hr_utility.set_location('...Asg EE Contrib Val is '||p_ee_contrib_value,130);
5363: hr_utility.set_location('...Asg ER Contrib Val is '||p_er_contrib_value,140);
5364:
5365: ELSE
5358: END IF;
5359:
5360: hr_utility.set_location('...Asg EE Contrib Type is '||p_ee_contrib_type,110);
5361: hr_utility.set_location('...Asg ER Contrib Type is '||p_er_contrib_type,120);
5362: hr_utility.set_location('...Asg EE Contrib Val is '||p_ee_contrib_value,130);
5363: hr_utility.set_location('...Asg ER Contrib Val is '||p_er_contrib_value,140);
5364:
5365: ELSE
5366: --
5359:
5360: hr_utility.set_location('...Asg EE Contrib Type is '||p_ee_contrib_type,110);
5361: hr_utility.set_location('...Asg ER Contrib Type is '||p_er_contrib_type,120);
5362: hr_utility.set_location('...Asg EE Contrib Val is '||p_ee_contrib_value,130);
5363: hr_utility.set_location('...Asg ER Contrib Val is '||p_er_contrib_value,140);
5364:
5365: ELSE
5366: --
5367: -- No overridden row at ASG level on this date,
5376: FETCH c_find_org
5377: INTO l_org_id,l_payroll_id,l_legal_er_org_id;
5378: CLOSE c_find_org;
5379:
5380: hr_utility.set_location('...Asg Override not found. Deriving from the org',150);
5381: hr_utility.set_location('...Value of l_org_id is'||l_org_id,160);
5382: hr_utility.set_location('...Value of l_payroll_id is'||l_payroll_id,170);
5383: hr_utility.set_location('...Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5384:
5377: INTO l_org_id,l_payroll_id,l_legal_er_org_id;
5378: CLOSE c_find_org;
5379:
5380: hr_utility.set_location('...Asg Override not found. Deriving from the org',150);
5381: hr_utility.set_location('...Value of l_org_id is'||l_org_id,160);
5382: hr_utility.set_location('...Value of l_payroll_id is'||l_payroll_id,170);
5383: hr_utility.set_location('...Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5384:
5385: l_ee_asg_eligible := 0;
5378: CLOSE c_find_org;
5379:
5380: hr_utility.set_location('...Asg Override not found. Deriving from the org',150);
5381: hr_utility.set_location('...Value of l_org_id is'||l_org_id,160);
5382: hr_utility.set_location('...Value of l_payroll_id is'||l_payroll_id,170);
5383: hr_utility.set_location('...Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5384:
5385: l_ee_asg_eligible := 0;
5386:
5379:
5380: hr_utility.set_location('...Asg Override not found. Deriving from the org',150);
5381: hr_utility.set_location('...Value of l_org_id is'||l_org_id,160);
5382: hr_utility.set_location('...Value of l_payroll_id is'||l_payroll_id,170);
5383: hr_utility.set_location('...Value of l_legal_er_org_id is'||l_legal_er_org_id,180);
5384:
5385: l_ee_asg_eligible := 0;
5386:
5387: l_ee_asg_eligible := chk_pt_eligibility
5405: --
5406: -- If the PT is age dependant, assign these values.
5407: --
5408: IF l_ee_age_contribution = 'Y' THEN
5409: hr_utility.set_location('...Age dependant contribution enabled',20);
5410: p_ee_contrib_value := l_ee_age_contri_value;
5411: END IF;
5412:
5413: IF l_er_age_contribution = 'Y' THEN
5410: p_ee_contrib_value := l_ee_age_contri_value;
5411: END IF;
5412:
5413: IF l_er_age_contribution = 'Y' THEN
5414: hr_utility.set_location('...Age dependant contribution enabled',20);
5415: p_er_contrib_value := l_er_age_contri_value;
5416: END IF;
5417:
5418: --
5495: l_ret_value := 1;
5496:
5497: END IF; -- Scheme creation check for a subcat
5498:
5499: hr_utility.set_location('...EE Contrib Type is '||p_ee_contrib_type,40);
5500: hr_utility.set_location('...ER Contrib Type is '||p_er_contrib_type,50);
5501: hr_utility.set_location('...EE Contrib Value is '||p_ee_contrib_value,40);
5502: hr_utility.set_location('...ER Contrib Value is '||p_er_contrib_value,50);
5503:
5496:
5497: END IF; -- Scheme creation check for a subcat
5498:
5499: hr_utility.set_location('...EE Contrib Type is '||p_ee_contrib_type,40);
5500: hr_utility.set_location('...ER Contrib Type is '||p_er_contrib_type,50);
5501: hr_utility.set_location('...EE Contrib Value is '||p_ee_contrib_value,40);
5502: hr_utility.set_location('...ER Contrib Value is '||p_er_contrib_value,50);
5503:
5504: RETURN l_ret_value;
5497: END IF; -- Scheme creation check for a subcat
5498:
5499: hr_utility.set_location('...EE Contrib Type is '||p_ee_contrib_type,40);
5500: hr_utility.set_location('...ER Contrib Type is '||p_er_contrib_type,50);
5501: hr_utility.set_location('...EE Contrib Value is '||p_ee_contrib_value,40);
5502: hr_utility.set_location('...ER Contrib Value is '||p_er_contrib_value,50);
5503:
5504: RETURN l_ret_value;
5505:
5498:
5499: hr_utility.set_location('...EE Contrib Type is '||p_ee_contrib_type,40);
5500: hr_utility.set_location('...ER Contrib Type is '||p_er_contrib_type,50);
5501: hr_utility.set_location('...EE Contrib Value is '||p_ee_contrib_value,40);
5502: hr_utility.set_location('...ER Contrib Value is '||p_er_contrib_value,50);
5503:
5504: RETURN l_ret_value;
5505:
5506: EXCEPTION
5505:
5506: EXCEPTION
5507:
5508: WHEN OTHERS THEN
5509: hr_utility.set_location('...Entered WHEN OTHERS EXCEPTION ',40);
5510: l_ret_value := 1;
5511:
5512: END get_abp_contribution;
5513:
5622: -- first check to see if any row exists at the ASG attribute level
5623: OPEN c_get_valid_asg_info;
5624: FETCH c_get_valid_asg_info INTO l_asg_extra_info_id;
5625: IF c_get_valid_asg_info%FOUND THEN
5626: hr_utility.set_location('found row at ASG EIT level',10);
5627: -- find the participation start date from the asg extra info
5628: CLOSE c_get_valid_asg_info;
5629: OPEN c_get_asg_info;
5630: FETCH c_get_asg_info INTO p_start_date;
5683: -- then return that org info id
5684: OPEN c_get_valid_org_info(l_org_id);
5685: FETCH c_get_valid_org_info INTO l_org_info_id;
5686: IF c_get_valid_org_info%FOUND THEN
5687: hr_utility.set_location('found row @ org info level'||l_org_id,20);
5688: l_loop_again := 0;
5689: CLOSE c_get_valid_org_info;
5690: -- fetch the participation start date from the org info row
5691: OPEN c_get_org_info(l_org_id);
5714: END IF;
5715: END IF;
5716: END LOOP;
5717: END IF; -- end of if valid asg info row found
5718: --hr_utility.trace_off;
5719: return l_ret_value;
5720:
5721: END get_participation_date;
5722:
5923: l_rows_exist NUMBER := 0;
5924: l_proc varchar2(20) := 'chk_dup_pp_row_ins';
5925:
5926: BEGIN
5927: hr_utility.set_location('Entering : '||l_proc,10);
5928: --first find the eff date the user had datetracked to
5929: OPEN c_get_eff_date;
5930: FETCH c_get_eff_date INTO l_eff_date;
5931: CLOSE c_get_eff_date;
5928: --first find the eff date the user had datetracked to
5929: OPEN c_get_eff_date;
5930: FETCH c_get_eff_date INTO l_eff_date;
5931: CLOSE c_get_eff_date;
5932: hr_utility.set_location('got the effective date : '||l_eff_date,20);
5933:
5934: --check to see if a row already exists in the EIT for this org
5935: OPEN c_rows_exist;
5936: FETCH c_rows_exist INTO l_rows_exist;
5935: OPEN c_rows_exist;
5936: FETCH c_rows_exist INTO l_rows_exist;
5937: IF c_rows_exist%FOUND THEN
5938: CLOSE c_rows_exist;
5939: hr_utility.set_message(8303,'ONLY_ONE_ROW_CAN_EXIST');
5940: hr_utility.raise_error;
5941: ELSE
5942: CLOSE c_rows_exist;
5943: END IF;
5936: FETCH c_rows_exist INTO l_rows_exist;
5937: IF c_rows_exist%FOUND THEN
5938: CLOSE c_rows_exist;
5939: hr_utility.set_message(8303,'ONLY_ONE_ROW_CAN_EXIST');
5940: hr_utility.raise_error;
5941: ELSE
5942: CLOSE c_rows_exist;
5943: END IF;
5944:
5951: ,p_org_information3 => p_org_information3
5952: ,p_effective_date => l_eff_date
5953: );
5954:
5955: hr_utility.set_location('leaving : '||l_proc,100);
5956: END chk_dup_pp_row_ins;
5957:
5958: --
5959: -- ------------------------------------------------------------------------
6095: l_completed VARCHAR2(1);
6096: l_abs_percent NUMBER := 0;
6097:
6098: BEGIN
6099: hr_utility.set_location('entered get_absence_adjustment',10);
6100:
6101: --fetch the pay period start and end dates
6102: OPEN c_get_period_dates;
6103: FETCH c_get_period_dates INTO l_period_start_date
6102: OPEN c_get_period_dates;
6103: FETCH c_get_period_dates INTO l_period_start_date
6104: ,l_period_end_date;
6105: CLOSE c_get_period_dates;
6106: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
6107: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
6108:
6109: --fetch the greater of the assigment start date or the period start date
6110: OPEN c_get_assign_start_date(c_start_date => l_period_start_date
6103: FETCH c_get_period_dates INTO l_period_start_date
6104: ,l_period_end_date;
6105: CLOSE c_get_period_dates;
6106: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
6107: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
6108:
6109: --fetch the greater of the assigment start date or the period start date
6110: OPEN c_get_assign_start_date(c_start_date => l_period_start_date
6111: ,c_end_date => l_period_end_date);
6123: OPEN c_get_abs_ele;
6124: FETCH c_get_abs_ele INTO l_abs_iv_id,l_abs_ele_id;
6125: CLOSE c_get_abs_ele;
6126:
6127: hr_utility.set_location('element id : '||l_abs_ele_id,42);
6128: hr_utility.set_location('input value id : '||l_abs_iv_id,45);
6129:
6130:
6131: l_completed := 'N';
6124: FETCH c_get_abs_ele INTO l_abs_iv_id,l_abs_ele_id;
6125: CLOSE c_get_abs_ele;
6126:
6127: hr_utility.set_location('element id : '||l_abs_ele_id,42);
6128: hr_utility.set_location('input value id : '||l_abs_iv_id,45);
6129:
6130:
6131: l_completed := 'N';
6132:
6132:
6133: l_effective_date := GREATEST(l_effective_date,trunc(l_period_start_date));
6134: l_min_start_date := l_effective_date;
6135: l_max_end_date := LEAST(l_max_end_date,trunc(l_period_end_date));
6136: hr_utility.set_location('eff date : '||l_effective_date,50);
6137:
6138: --find days in the pay period
6139: l_payroll_days := (trunc(l_period_end_date)
6140: - trunc(l_period_start_date)) + 1;
6144: l_days_in_pp := nvl(l_max_end_date,trunc(l_period_end_date))
6145: - nvl(l_min_start_date,trunc(l_period_start_date))
6146: + 1;
6147:
6148: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
6149: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
6150:
6151: FOR temp_rec in c_get_abs_ele_entry ( trunc(l_effective_date)
6152: ,l_abs_ele_id
6145: - nvl(l_min_start_date,trunc(l_period_start_date))
6146: + 1;
6147:
6148: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
6149: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
6150:
6151: FOR temp_rec in c_get_abs_ele_entry ( trunc(l_effective_date)
6152: ,l_abs_ele_id
6153: ,l_abs_iv_id
6169: ELSE
6170: l_start_date := temp_rec.start_date;
6171: END IF;
6172:
6173: hr_utility.set_location('start date : '||l_start_date,60);
6174: hr_utility.set_location('end date : '||l_end_date,70);
6175: hr_utility.set_location('entry value : '||temp_rec.perc_value,80);
6176:
6177: l_abs_percent := l_abs_percent + temp_rec.perc_value * ((trunc(l_end_date) -
6170: l_start_date := temp_rec.start_date;
6171: END IF;
6172:
6173: hr_utility.set_location('start date : '||l_start_date,60);
6174: hr_utility.set_location('end date : '||l_end_date,70);
6175: hr_utility.set_location('entry value : '||temp_rec.perc_value,80);
6176:
6177: l_abs_percent := l_abs_percent + temp_rec.perc_value * ((trunc(l_end_date) -
6178: trunc(l_start_date)) + 1);
6171: END IF;
6172:
6173: hr_utility.set_location('start date : '||l_start_date,60);
6174: hr_utility.set_location('end date : '||l_end_date,70);
6175: hr_utility.set_location('entry value : '||temp_rec.perc_value,80);
6176:
6177: l_abs_percent := l_abs_percent + temp_rec.perc_value * ((trunc(l_end_date) -
6178: trunc(l_start_date)) + 1);
6179:
6183:
6184: --find the average part time percentage value
6185: l_abs_percent := l_abs_percent/l_days_in_pp;
6186:
6187: hr_utility.set_location('final value : '||l_abs_percent,90);
6188:
6189: p_adjust_amt := ROUND(l_abs_percent,4);
6190:
6191: --hr_utility.trace_off;
6187: hr_utility.set_location('final value : '||l_abs_percent,90);
6188:
6189: p_adjust_amt := ROUND(l_abs_percent,4);
6190:
6191: --hr_utility.trace_off;
6192: return 0;
6193:
6194: EXCEPTION
6195:
6196: WHEN OTHERS THEN
6197:
6198: p_adjust_amt := 0;
6199: p_error_message := 'Error occured in get_absence_adjustment : '||SQLERRM;
6200: hr_utility.set_location('error occured exiting get_absence_adjustment',110);
6201: return 1;
6202:
6203: END get_absence_adjustment;
6204:
6252: l_payroll_days NUMBER;
6253: l_proration_factor NUMBER;
6254:
6255: BEGIN
6256: hr_utility.set_location('entered get_proration_factor',10);
6257:
6258: --fetch the pay period start and end dates
6259: OPEN c_get_period_dates;
6260: FETCH c_get_period_dates INTO l_period_start_date
6259: OPEN c_get_period_dates;
6260: FETCH c_get_period_dates INTO l_period_start_date
6261: ,l_period_end_date;
6262: CLOSE c_get_period_dates;
6263: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
6264: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
6265:
6266: --fetch the greater of the assigment start date or the period start date
6267: OPEN c_get_assign_start_date(c_start_date => l_period_start_date
6260: FETCH c_get_period_dates INTO l_period_start_date
6261: ,l_period_end_date;
6262: CLOSE c_get_period_dates;
6263: hr_utility.set_location('start date of pay period : '||l_period_start_date,30);
6264: hr_utility.set_location('end date of pay period : '||l_period_end_date,40);
6265:
6266: --fetch the greater of the assigment start date or the period start date
6267: OPEN c_get_assign_start_date(c_start_date => l_period_start_date
6268: ,c_end_date => l_period_end_date);
6278:
6279: l_effective_date := GREATEST(l_effective_date,trunc(l_period_start_date));
6280: l_min_start_date := l_effective_date;
6281: l_max_end_date := LEAST(l_max_end_date,trunc(l_period_end_date));
6282: hr_utility.set_location('eff date : '||l_effective_date,50);
6283:
6284: --find days in the pay period
6285: l_payroll_days := (trunc(l_period_end_date)
6286: - trunc(l_period_start_date)) + 1;
6290: l_days_in_pp := nvl(l_max_end_date,trunc(l_period_end_date))
6291: - nvl(l_min_start_date,trunc(l_period_start_date))
6292: + 1;
6293:
6294: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
6295: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
6296:
6297: --find the proration factor
6298: l_proration_factor := l_days_in_pp/l_payroll_days;
6291: - nvl(l_min_start_date,trunc(l_period_start_date))
6292: + 1;
6293:
6294: hr_utility.set_location('days in pay period : '||l_payroll_days,55);
6295: hr_utility.set_location('days asg valid : '||l_days_in_pp,57);
6296:
6297: --find the proration factor
6298: l_proration_factor := l_days_in_pp/l_payroll_days;
6299:
6296:
6297: --find the proration factor
6298: l_proration_factor := l_days_in_pp/l_payroll_days;
6299:
6300: hr_utility.set_location('final value : '||l_proration_factor,90);
6301:
6302: p_proration_factor := l_proration_factor;
6303:
6304: --hr_utility.trace_off;
6300: hr_utility.set_location('final value : '||l_proration_factor,90);
6301:
6302: p_proration_factor := l_proration_factor;
6303:
6304: --hr_utility.trace_off;
6305: return 0;
6306:
6307: EXCEPTION
6308:
6309: WHEN OTHERS THEN
6310:
6311: p_proration_factor := 1;
6312: p_error_message := 'Error occured in get_proration_factor : '||SQLERRM;
6313: hr_utility.set_location('error occured exiting get_proration_factor',110);
6314: return 1;
6315:
6316: END get_proration_factor;
6317:
6509: l_version_id per_org_structure_versions_v.org_structure_version_id%type default null;
6510:
6511: BEGIN
6512:
6513: hr_utility.set_location('Entering get_eoy_bonus_percentage',10);
6514: --fetch the hr org id from the assignment
6515: OPEN c_find_org_id;
6516: FETCH c_find_org_id INTO l_org_id;
6517: CLOSE c_find_org_id;
6515: OPEN c_find_org_id;
6516: FETCH c_find_org_id INTO l_org_id;
6517: CLOSE c_find_org_id;
6518:
6519: hr_utility.set_location('org id for the asg : '||l_org_id,20);
6520: --check to see if a value has been entered for
6521: --the eoy bonus percentage at this org level
6522: OPEN c_find_eoy_percent(l_org_id);
6523: FETCH c_find_eoy_percent INTO l_eoy_percent;
6521: --the eoy bonus percentage at this org level
6522: OPEN c_find_eoy_percent(l_org_id);
6523: FETCH c_find_eoy_percent INTO l_eoy_percent;
6524: IF c_find_eoy_percent%FOUND THEN
6525: hr_utility.set_location('EOY Bonus Percentage : '||l_eoy_percent,30);
6526: --found a value for the percentage at this org level
6527: --return from this point
6528: CLOSE c_find_eoy_percent;
6529: hr_utility.set_location('Leaving get_eoy_bonus_percentage',35);
6525: hr_utility.set_location('EOY Bonus Percentage : '||l_eoy_percent,30);
6526: --found a value for the percentage at this org level
6527: --return from this point
6528: CLOSE c_find_eoy_percent;
6529: hr_utility.set_location('Leaving get_eoy_bonus_percentage',35);
6530: p_eoy_bonus_percentage := fnd_number.canonical_to_number(l_eoy_percent);
6531: RETURN 0;
6532: ELSE
6533: --no value found at this org level,try to traverse up the
6531: RETURN 0;
6532: ELSE
6533: --no value found at this org level,try to traverse up the
6534: --org hierarchy to find a value at the parent levels
6535: hr_utility.set_location('no value found at hr org level,going up the tree',40);
6536: CLOSE c_find_eoy_percent;
6537:
6538: --first chk to see if a named hierarchy exists for the BG
6539: OPEN c_find_named_hierarchy;
6563: FETCH c_find_ver_frm_bg INTO l_version_id;
6564: CLOSE c_find_ver_frm_bg;
6565: END IF; -- end of if named hierarchy found
6566:
6567: hr_utility.set_location(' l_version_id '||l_version_id,50);
6568:
6569: IF l_version_id IS NULL THEN
6570: --no hierarchy has been defined, so return 0%
6571: hr_utility.set_location('No hierarchy found,hence returning 0',60);
6567: hr_utility.set_location(' l_version_id '||l_version_id,50);
6568:
6569: IF l_version_id IS NULL THEN
6570: --no hierarchy has been defined, so return 0%
6571: hr_utility.set_location('No hierarchy found,hence returning 0',60);
6572: hr_utility.set_location('Leaving get_eoy_bonus_percentage',65);
6573: p_eoy_bonus_percentage := 0;
6574: RETURN 0;
6575: END IF;
6568:
6569: IF l_version_id IS NULL THEN
6570: --no hierarchy has been defined, so return 0%
6571: hr_utility.set_location('No hierarchy found,hence returning 0',60);
6572: hr_utility.set_location('Leaving get_eoy_bonus_percentage',65);
6573: p_eoy_bonus_percentage := 0;
6574: RETURN 0;
6575: END IF;
6576:
6581: --find the parent of this org
6582: OPEN c_find_parent_id(l_org_id,l_version_id);
6583: FETCH c_find_parent_id INTO l_org_id;
6584: IF c_find_parent_id%FOUND THEN
6585: hr_utility.set_location('searching at parent : '||l_org_id,70);
6586: CLOSE c_find_parent_id;
6587: OPEN c_find_eoy_percent(l_org_id);
6588: FETCH c_find_eoy_percent INTO l_eoy_percent;
6589: IF c_find_eoy_percent%FOUND THEN
6586: CLOSE c_find_parent_id;
6587: OPEN c_find_eoy_percent(l_org_id);
6588: FETCH c_find_eoy_percent INTO l_eoy_percent;
6589: IF c_find_eoy_percent%FOUND THEN
6590: hr_utility.set_location('found eoy percent as : '||l_eoy_percent,80);
6591: CLOSE c_find_eoy_percent;
6592: p_eoy_bonus_percentage := fnd_number.canonical_to_number(l_eoy_percent);
6593: l_ret_val := 0;
6594: l_loop_again := 0;
6597: END IF;
6598: ELSE
6599: --no parent found, so return 0
6600: CLOSE c_find_parent_id;
6601: hr_utility.set_location('no parents found,returning 0',90);
6602: p_eoy_bonus_percentage := 0;
6603: l_loop_again := 0;
6604: l_ret_val := 0;
6605: END IF;
6605: END IF;
6606: END LOOP;
6607: END IF;
6608:
6609: hr_utility.set_location('Leaving get_eoy_bonus_percentage',95);
6610: RETURN l_ret_val;
6611:
6612: EXCEPTION
6613:
6612: EXCEPTION
6613:
6614: WHEN OTHERS THEN
6615: p_eoy_bonus_percentage := 0;
6616: hr_utility.set_location('Error occured : '||SQLERRM,100);
6617: RETURN 1;
6618:
6619: END get_eoy_bonus_percentage;
6620:
6748:
6749: l_reporting_dt := fnd_date.date_to_canonical(l_out_rep_dt);
6750: l_new_log_cre := 0;
6751:
6752: hr_utility.set_location('GAA -- The change event code is COSCKFF',10 );
6753: hr_utility.set_location('GAA -- Reporting date is '||l_reporting_dt,10 );
6754: --
6755: -- Update the change event log row so that prmtr_09 is
6756: -- populated with the next reporting date.
6749: l_reporting_dt := fnd_date.date_to_canonical(l_out_rep_dt);
6750: l_new_log_cre := 0;
6751:
6752: hr_utility.set_location('GAA -- The change event code is COSCKFF',10 );
6753: hr_utility.set_location('GAA -- Reporting date is '||l_reporting_dt,10 );
6754: --
6755: -- Update the change event log row so that prmtr_09 is
6756: -- populated with the next reporting date.
6757: --
6776: ,p_person_id => p_person_id
6777: ,p_business_group_id => p_business_group_id
6778: ,p_object_version_number => l_upd_ovn);
6779:
6780: hr_utility.set_location('GAA -- Updated prmtr_09 to the reporting date',10 );
6781:
6782: IF p_old_val1 IS NULL and p_new_val1 IS NOT NULL THEN
6783: --
6784: -- This is the first time the SC KFF is being assigned
6790: -- Call the API to register the part time percentage change
6791: -- event.
6792: NULL;
6793: ELSIF p_old_val1 IS NOT NULL and p_new_val1 IS NOT NULL THEN
6794: hr_utility.set_location('GAA -- KFF Id has changed',10 );
6795: --
6796: -- Assign appropriate assignment start and end dates
6797: --
6798: IF p_prmtr_10 = 'UPDATE' THEN
6801: ELSIF p_prmtr_10 = 'CORRECTION' THEN
6802: l_asg_st_dt := p_prmtr_02;
6803: l_asg_ed_dt := p_prmtr_03;
6804: END IF;
6805: hr_utility.set_location('GAA -- prmtr_10 value is : '||p_prmtr_10,10 );
6806:
6807: -- Make sure that the reporting date is set to the correct value
6808: -- if the changes are being made for a future date then we use that date
6809: -- to report the change.
6825: FETCH c_ptp INTO l_new_ptp;
6826: CLOSE c_ptp;
6827:
6828: IF NVL(l_old_ptp,100) <> NVL(l_new_ptp,100) THEN
6829: hr_utility.set_location('GAA -- PTP has changed : ',10 );
6830: --
6831: -- Check the log rows to see if there has been a change of ptp
6832: -- event registerted by the old KFF. If this is true,and the
6833: -- exact same row exists in the db , update it with the changed
6845: IF c_log_xst%FOUND THEN
6846: --
6847: -- Update the existing log with the changed part time percentages
6848: --
6849: hr_utility.set_location('GAA -- An existing row is found in the logs: ',10 );
6850: UPDATE ben_ext_chg_evt_log
6851: SET new_val1 = fnd_number.number_to_canonical(l_new_ptp)
6852: ,old_val1 = fnd_number.number_to_canonical(l_old_ptp)
6853: ,prmtr_09 = l_reporting_dt
6853: ,prmtr_09 = l_reporting_dt
6854: WHERE ext_chg_evt_log_id = l_xst_log_rec.ext_chg_evt_log_id;
6855:
6856: ELSIF c_log_xst%NOTFOUND THEN
6857: hr_utility.set_location('GAA -- Did not find any existing row. Creating new log',10);
6858: --
6859: -- Create new log to register that there has been a
6860: -- change in part time percentage
6861: --
6902: -- Part time percentage has not changed but the flex id is changing.
6903: -- update the surrogate key in the log tables for any changes
6904: -- logged by the old KFF id.
6905: --
6906: hr_utility.set_location('GAA -- PTP is the same no change. KFF id has changed: ',10 );
6907: IF p_prmtr_10 = 'UPDATE' THEN
6908: ben_xcl_ins.ins
6909: (p_ext_chg_evt_log_id => l_id1
6910: ,p_chg_evt_cd => 'COPTP'
6936: ,p_old_val3 => NULL
6937: ,p_old_val4 => NULL
6938: ,p_old_val5 => NULL
6939: ,p_old_val6 => NULL);
6940: hr_utility.set_location('GAA -- log row to track update of KFF Id . No chages to ptp ',10 );
6941:
6942: END IF; -- If a correction is made to the KFF but ptp did not change
6943:
6944: END IF; -- PTP is not equal
6965: SET prmtr_05 = fnd_date.date_to_canonical(TRUNC(p_chg_eff_dt)-1)
6966: WHERE ext_chg_evt_log_id = upd_rec.ext_chg_evt_log_id;
6967: END IF;
6968: END LOOP;
6969: hr_utility.set_location('GAA -- Updated the existing log to set the end as eff dt -1 ',10 );
6970:
6971: ELSIF p_prmtr_10 = 'CORRECTION' THEN
6972: --
6973: -- Update any existing log rows based on the changes made
7001: END IF;
7002: END LOOP;
7003: END IF; -- check if new logs are created
7004:
7005: hr_utility.set_location('GAA -- Updated the existing log to set the KFF id as the new KFF id ',10 );
7006: END IF; -- Check for update or correction
7007:
7008: END IF; -- KFF Ids are not equal
7009:
7021: ,p_reporting_date => l_out_rep_dt );
7022:
7023: l_reporting_dt := fnd_date.date_to_canonical(l_out_rep_dt);
7024:
7025: hr_utility.set_location('... Reporting date is '||l_reporting_dt,10 );
7026: --
7027: -- Update the change event log row so that prmtr_09 is
7028: -- populated with the next reporting date.
7029: --
7048: ,p_person_id => p_person_id
7049: ,p_business_group_id => p_business_group_id
7050: ,p_object_version_number => l_upd_ovn);
7051:
7052: hr_utility.set_location('... -- Updated prmtr_09 to the reporting date',10 );
7053: ELSIF p_chg_evt_cd = ('COPOS') THEN
7054: --
7055: -- Get the reporting date
7056: --
7064: END IF;
7065:
7066: l_reporting_dt := fnd_date.date_to_canonical(l_out_rep_dt);
7067:
7068: hr_utility.set_location('... Reporting date is '||l_reporting_dt,10 );
7069: --
7070: -- Update the change event log row so that prmtr_09 is
7071: -- populated with the next reporting date.
7072: --
7091: ,p_person_id => p_person_id
7092: ,p_business_group_id => p_business_group_id
7093: ,p_object_version_number => l_upd_ovn);
7094:
7095: hr_utility.set_location('... -- Updated prmtr_09 to the reporting date',10 );
7096:
7097: ELSIF p_chg_evt_cd = 'COAPP' THEN
7098:
7099: update per_assignment_extra_info
7328: l_addl_calc_flag per_assignment_extra_info.aei_information3%TYPE;
7329:
7330: BEGIN
7331:
7332: hr_utility.set_location ('Entering function: pqp_nl_abp_functions.Get_Retro_Addnl_Amt' , 2100);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7329:
7330: BEGIN
7331:
7332: hr_utility.set_location ('Entering function: pqp_nl_abp_functions.Get_Retro_Addnl_Amt' , 2100);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7330: BEGIN
7331:
7332: hr_utility.set_location ('Entering function: pqp_nl_abp_functions.Get_Retro_Addnl_Amt' , 2100);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7331:
7332: hr_utility.set_location ('Entering function: pqp_nl_abp_functions.Get_Retro_Addnl_Amt' , 2100);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7332: hr_utility.set_location ('Entering function: pqp_nl_abp_functions.Get_Retro_Addnl_Amt' , 2100);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7340: hr_utility.set_location ('p_ee_er_flag : '||TO_CHAR(p_ee_er_flag) , 2170);
7333: hr_utility.set_location ('p_bg_id: '||TO_CHAR(p_bg_id) , 2110);
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7340: hr_utility.set_location ('p_ee_er_flag : '||TO_CHAR(p_ee_er_flag) , 2170);
7341:
7334: hr_utility.set_location ('p_date_earned : '||TO_CHAR(p_date_earned) , 2120);
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7340: hr_utility.set_location ('p_ee_er_flag : '||TO_CHAR(p_ee_er_flag) , 2170);
7341:
7342: -- Assign parameter values to local variables
7335: hr_utility.set_location ('p_asg_id: '||TO_CHAR(p_asg_id) , 2130);
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7340: hr_utility.set_location ('p_ee_er_flag : '||TO_CHAR(p_ee_er_flag) , 2170);
7341:
7342: -- Assign parameter values to local variables
7343: l_sick_flag := p_sick_flag;
7336: hr_utility.set_location ('p_element_type_id: '||TO_CHAR(p_element_type_id) , 2140);
7337: hr_utility.set_location ('p_payroll_id: '||TO_CHAR(p_payroll_id) , 2150);
7338: hr_utility.set_location ('p_contri_perc: '||TO_CHAR(p_contri_perc) , 2160);
7339: hr_utility.set_location ('p_sick_flag: '||TO_CHAR(p_sick_flag) , 2170);
7340: hr_utility.set_location ('p_ee_er_flag : '||TO_CHAR(p_ee_er_flag) , 2170);
7341:
7342: -- Assign parameter values to local variables
7343: l_sick_flag := p_sick_flag;
7344: l_contri_perc := p_contri_perc;
7343: l_sick_flag := p_sick_flag;
7344: l_contri_perc := p_contri_perc;
7345: l_ee_er_flag := p_ee_er_flag;
7346:
7347: hr_utility.set_location ('l_sick_flag: '||TO_CHAR(l_sick_flag) , 2180);
7348: hr_utility.set_location ('l_contri_perc: '||TO_CHAR(l_contri_perc) , 2190);
7349: hr_utility.set_location ('l_ee_er_flag : '||TO_CHAR(l_ee_er_flag) , 2200);
7350:
7351: OPEN csr_addl_calc;
7344: l_contri_perc := p_contri_perc;
7345: l_ee_er_flag := p_ee_er_flag;
7346:
7347: hr_utility.set_location ('l_sick_flag: '||TO_CHAR(l_sick_flag) , 2180);
7348: hr_utility.set_location ('l_contri_perc: '||TO_CHAR(l_contri_perc) , 2190);
7349: hr_utility.set_location ('l_ee_er_flag : '||TO_CHAR(l_ee_er_flag) , 2200);
7350:
7351: OPEN csr_addl_calc;
7352: FETCH csr_addl_calc INTO l_addl_calc_flag;
7345: l_ee_er_flag := p_ee_er_flag;
7346:
7347: hr_utility.set_location ('l_sick_flag: '||TO_CHAR(l_sick_flag) , 2180);
7348: hr_utility.set_location ('l_contri_perc: '||TO_CHAR(l_contri_perc) , 2190);
7349: hr_utility.set_location ('l_ee_er_flag : '||TO_CHAR(l_ee_er_flag) , 2200);
7350:
7351: OPEN csr_addl_calc;
7352: FETCH csr_addl_calc INTO l_addl_calc_flag;
7353: CLOSE csr_addl_calc;
7351: OPEN csr_addl_calc;
7352: FETCH csr_addl_calc INTO l_addl_calc_flag;
7353: CLOSE csr_addl_calc;
7354:
7355: hr_utility.set_location ('l_addl_calc_flag : '|| NVL(l_addl_calc_flag,'Y') , 2202);
7356:
7357: -- If user has entered "No" In Additional Amout Calc EIT then dont calc addl Amt.
7358: IF NVL(l_addl_calc_flag,'Y') = 'Y' THEN
7359:
7356:
7357: -- If user has entered "No" In Additional Amout Calc EIT then dont calc addl Amt.
7358: IF NVL(l_addl_calc_flag,'Y') = 'Y' THEN
7359:
7360: hr_utility.set_location ('Inside EIT If Condition: ', 2205);
7361: -- Get the time span id for correction previous year
7362: -- Pass it as parameter to csr_scr_ent_val
7363: OPEN csr_time_span_id;
7364: FETCH csr_time_span_id INTO l_time_span_id;
7363: OPEN csr_time_span_id;
7364: FETCH csr_time_span_id INTO l_time_span_id;
7365: CLOSE csr_time_span_id;
7366:
7367: hr_utility.set_location ('Time Span Id: ' || TO_CHAR(l_time_span_id), 2210);
7368:
7369: -- At Run time decide whether the previous year entry is
7370: -- for Adjustment or Correction.
7371: -- Based on this, fetch the Input value Id for pay_value
7373: -- for the basis in retro element.
7374: -- Pass that to the main cursor.
7375: FOR csr_iv IN csr_iv_pv_id(l_time_span_id)
7376: LOOP
7377: hr_utility.set_location ('csr_iv.ele_id: ' || TO_CHAR(csr_iv.ele_id), 2212);
7378: hr_utility.set_location ('csr_iv.iv_id: ' || TO_CHAR(csr_iv.iv_id), 2214);
7379: -- Delta in basis is obtained using entry value
7380: -- Names of input value differ for EE and ER.
7381: IF l_ee_er_flag = 'EE' THEN
7374: -- Pass that to the main cursor.
7375: FOR csr_iv IN csr_iv_pv_id(l_time_span_id)
7376: LOOP
7377: hr_utility.set_location ('csr_iv.ele_id: ' || TO_CHAR(csr_iv.ele_id), 2212);
7378: hr_utility.set_location ('csr_iv.iv_id: ' || TO_CHAR(csr_iv.iv_id), 2214);
7379: -- Delta in basis is obtained using entry value
7380: -- Names of input value differ for EE and ER.
7381: IF l_ee_er_flag = 'EE' THEN
7382: OPEN csr_iv_id('ABP Employee Pension Basis',csr_iv.ele_id);
7381: IF l_ee_er_flag = 'EE' THEN
7382: OPEN csr_iv_id('ABP Employee Pension Basis',csr_iv.ele_id);
7383: FETCH csr_iv_id INTO l_iv_id_basis;
7384: CLOSE csr_iv_id;
7385: hr_utility.set_location ('iv basis id EE: ' || TO_CHAR(l_iv_id_basis), 2220);
7386: ELSIF l_ee_er_flag = 'ER' THEN
7387: OPEN csr_iv_id('ABP Employer Pension Basis',csr_iv.ele_id);
7388: FETCH csr_iv_id INTO l_iv_id_basis;
7389: CLOSE csr_iv_id;
7386: ELSIF l_ee_er_flag = 'ER' THEN
7387: OPEN csr_iv_id('ABP Employer Pension Basis',csr_iv.ele_id);
7388: FETCH csr_iv_id INTO l_iv_id_basis;
7389: CLOSE csr_iv_id;
7390: hr_utility.set_location ('iv basis id ER:' || TO_CHAR(l_iv_id_basis), 2230);
7391: ELSE
7392: hr_utility.set_location ('Exiting pqp_nl_abp_functions.Get_Retro_addnl_Amt function', 2240);
7393: p_dedn_retro_amt := 0;
7394: RETURN 1; -- return failure, since parameter passed in not EE or ER*/
7388: FETCH csr_iv_id INTO l_iv_id_basis;
7389: CLOSE csr_iv_id;
7390: hr_utility.set_location ('iv basis id ER:' || TO_CHAR(l_iv_id_basis), 2230);
7391: ELSE
7392: hr_utility.set_location ('Exiting pqp_nl_abp_functions.Get_Retro_addnl_Amt function', 2240);
7393: p_dedn_retro_amt := 0;
7394: RETURN 1; -- return failure, since parameter passed in not EE or ER*/
7395: END IF;
7396:
7404:
7405: l_addn_ded_basis := nvl(fnd_number.canonical_to_number(csr_basis.basis),0);
7406: l_already_retro_paid := nvl(fnd_number.canonical_to_number(csr_basis.paid),0);
7407:
7408: hr_utility.set_location ('l_addn_ded_basis: ' || l_addn_ded_basis, 2260);
7409: hr_utility.set_location ('l_already_retro_paid: ' || l_already_retro_paid, 2270);
7410:
7411: /* code for checking the sickness flag as yes or no in the formula */
7412: IF p_sick_flag = 'Y' THEN
7405: l_addn_ded_basis := nvl(fnd_number.canonical_to_number(csr_basis.basis),0);
7406: l_already_retro_paid := nvl(fnd_number.canonical_to_number(csr_basis.paid),0);
7407:
7408: hr_utility.set_location ('l_addn_ded_basis: ' || l_addn_ded_basis, 2260);
7409: hr_utility.set_location ('l_already_retro_paid: ' || l_already_retro_paid, 2270);
7410:
7411: /* code for checking the sickness flag as yes or no in the formula */
7412: IF p_sick_flag = 'Y' THEN
7413: hr_utility.set_location ('Sickness flag is Y', 2290);
7409: hr_utility.set_location ('l_already_retro_paid: ' || l_already_retro_paid, 2270);
7410:
7411: /* code for checking the sickness flag as yes or no in the formula */
7412: IF p_sick_flag = 'Y' THEN
7413: hr_utility.set_location ('Sickness flag is Y', 2290);
7414: l_ret_val := pqp_nl_abp_functions.get_absence_adjustment
7415: (p_asg_id,
7416: csr_basis.orig_date_earned, --p_date_earned,
7417: p_bg_id,
7418: 0,
7419: l_sick_perc,
7420: l_error_msg
7421: );
7422: hr_utility.set_location ('l_sick_perc: ' || TO_CHAR(l_sick_perc), 2300);
7423: hr_utility.set_location ('l_ret_val: '|| TO_CHAR(l_ret_val), 2310);
7424: IF l_ret_val = 0 THEN -- Success of previous function call
7425: -- Check if Formula is running for EE/ER, else return Zero.
7426: -- For EE, sickness amount is deducted from premium.
7419: l_sick_perc,
7420: l_error_msg
7421: );
7422: hr_utility.set_location ('l_sick_perc: ' || TO_CHAR(l_sick_perc), 2300);
7423: hr_utility.set_location ('l_ret_val: '|| TO_CHAR(l_ret_val), 2310);
7424: IF l_ret_val = 0 THEN -- Success of previous function call
7425: -- Check if Formula is running for EE/ER, else return Zero.
7426: -- For EE, sickness amount is deducted from premium.
7427: -- For ER, sickness amount is added to premium.
7430: ELSIF l_ee_er_flag = 'ER' THEN
7431: l_addn_ded_basis := l_addn_ded_basis + (l_addn_ded_basis * l_sick_perc/100);
7432: END IF;
7433: --
7434: hr_utility.set_location ('l_addn_ded_basis: ' || TO_CHAR(l_addn_ded_basis), 2320);
7435:
7436: l_addn_ded_retro_amt := l_addn_ded_retro_amt
7437: + (l_addn_ded_basis * p_contri_perc/100)
7438: - l_already_retro_paid;
7436: l_addn_ded_retro_amt := l_addn_ded_retro_amt
7437: + (l_addn_ded_basis * p_contri_perc/100)
7438: - l_already_retro_paid;
7439:
7440: hr_utility.set_location ('l_addn_ded_retro_amt: ' || TO_CHAR(l_addn_ded_retro_amt), 2330);
7441: ELSE -- l_ret_val = 1, previous function call failed
7442: l_addn_ded_retro_amt := 0;
7443: hr_utility.set_location ('l_addn_ded_retro_amt ' || TO_CHAR(l_addn_ded_retro_amt), 2340);
7444: END IF;
7439:
7440: hr_utility.set_location ('l_addn_ded_retro_amt: ' || TO_CHAR(l_addn_ded_retro_amt), 2330);
7441: ELSE -- l_ret_val = 1, previous function call failed
7442: l_addn_ded_retro_amt := 0;
7443: hr_utility.set_location ('l_addn_ded_retro_amt ' || TO_CHAR(l_addn_ded_retro_amt), 2340);
7444: END IF;
7445:
7446: ELSE -- no Sickness is attached
7447: hr_utility.set_location ('Sickness flag is N', 2350);
7443: hr_utility.set_location ('l_addn_ded_retro_amt ' || TO_CHAR(l_addn_ded_retro_amt), 2340);
7444: END IF;
7445:
7446: ELSE -- no Sickness is attached
7447: hr_utility.set_location ('Sickness flag is N', 2350);
7448: l_addn_ded_retro_amt := l_addn_ded_retro_amt
7449: + (l_addn_ded_basis * p_contri_perc/100)
7450: - l_already_retro_paid ;
7451: hr_utility.set_location ('l_addn_ded_retro_amt ' || TO_CHAR(l_addn_ded_retro_amt), 2360);
7447: hr_utility.set_location ('Sickness flag is N', 2350);
7448: l_addn_ded_retro_amt := l_addn_ded_retro_amt
7449: + (l_addn_ded_basis * p_contri_perc/100)
7450: - l_already_retro_paid ;
7451: hr_utility.set_location ('l_addn_ded_retro_amt ' || TO_CHAR(l_addn_ded_retro_amt), 2360);
7452: END IF; -- Sickness attached or not.
7453:
7454: END LOOP; -- iv cursor
7455:
7460: p_dedn_retro_amt := ROUND(NVL(l_addn_ded_retro_amt,0),2); -- final_amt
7461:
7462: ELSE
7463:
7464: hr_utility.set_location ('Inside EIT Else Condition: ', 2365);
7465: p_dedn_retro_amt := 0;
7466:
7467: END IF;
7468:
7465: p_dedn_retro_amt := 0;
7466:
7467: END IF;
7468:
7469: hr_utility.set_location ('p_dedn_retro_amt: ' || TO_CHAR(p_dedn_retro_amt), 2370);
7470: hr_utility.set_location ('Returning from pqp_nl_abp_functions.Get_Retro_addnl_Amt function', 2375);
7471:
7472: RETURN 0; -- success
7473:
7466:
7467: END IF;
7468:
7469: hr_utility.set_location ('p_dedn_retro_amt: ' || TO_CHAR(p_dedn_retro_amt), 2370);
7470: hr_utility.set_location ('Returning from pqp_nl_abp_functions.Get_Retro_addnl_Amt function', 2375);
7471:
7472: RETURN 0; -- success
7473:
7474: EXCEPTION
7472: RETURN 0; -- success
7473:
7474: EXCEPTION
7475: WHEN OTHERS THEN
7476: hr_utility.set_location ('Exception occured in pqp_nl_abp_functions.get_retro_addnl_amt', 2380);
7477: p_dedn_retro_amt := 0;
7478: RETURN 1; -- fail
7479:
7480: --hr_utility.trace_off;
7476: hr_utility.set_location ('Exception occured in pqp_nl_abp_functions.get_retro_addnl_amt', 2380);
7477: p_dedn_retro_amt := 0;
7478: RETURN 1; -- fail
7479:
7480: --hr_utility.trace_off;
7481: END Get_Retro_Addnl_Amt;
7482: --
7483: END pqp_nl_abp_functions;