[Home] [Help]
58: -- ---------------------------------------------------------------------------
59: -- |-----------------< hr_psf_bus_insert_validate >---------------------|
60: -- ---------------------------------------------------------------------------
61: --
62: procedure hr_psf_bus_insert_validate(p_rec in hr_psf_shd.g_rec_type
63: ,p_effective_date in date
64: ) is
65: l_chk_position_job_grade boolean;
66: l_transaction_status varchar2(100);
91: -- ---------------------------------------------------------------------------
92: -- |-----------------< hr_psf_bus_update_validate >---------------------|
93: -- ---------------------------------------------------------------------------
94: --
95: procedure hr_psf_bus_update_validate(p_rec in hr_psf_shd.g_rec_type
96: ,p_effective_date in date
97: ,p_validation_start_date in date
98: ,p_validation_end_date in date
99: ,p_datetrack_mode in varchar2
158: hr_utility.set_location('AVAILABILITY_STATUS_ID :'||p_rec.availability_status_id, 620);
159:
160: if ((p_datetrack_mode IN ('CORRECTION', 'UPDATE','UPDATE_CHANGE_INSERT',
161: 'UPDATE_OVERRIDE')) AND
162: ('ELIMINATED'=hr_psf_shd.get_availability_status(
163: p_rec.availability_status_id,p_rec.business_group_id))) then
164: hr_utility.set_location('AVAILABILITY STATUS : ELIMINATED', 621);
165: if (pqh_psf_bus.pos_assignments_exist(p_rec.position_id,
166: p_validation_start_date, p_validation_end_date)) then
1400: fetch c_positions into
1401: l_availability_status_id,l_business_group_id, l_position_type, l_pos_effective_date;
1402: close c_positions;
1403: l_availability_status :=
1404: hr_psf_shd.get_availability_status(l_availability_status_id,l_business_group_id);
1405: hr_utility.set_location('Open Status- l_availability_status:'||l_availability_status,
1406: 310);
1407: hr_utility.set_location('Open Status- l_position_type:'||l_position_type,
1408: 320);
2337: and budgeted_entity_cd = 'POSITION'
2338: and business_group_id = l_business_group_id
2339: and p_effective_date between budget_start_date and budget_end_date
2340: and (
2341: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'FTE'
2342: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'FTE'
2343: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'FTE'
2344: );
2345: --
2338: and business_group_id = l_business_group_id
2339: and p_effective_date between budget_start_date and budget_end_date
2340: and (
2341: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'FTE'
2342: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'FTE'
2343: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'FTE'
2344: );
2345: --
2346: hr_utility.set_location('l_budget_id:' || l_budget_id, 600);
2339: and p_effective_date between budget_start_date and budget_end_date
2340: and (
2341: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'FTE'
2342: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'FTE'
2343: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'FTE'
2344: );
2345: --
2346: hr_utility.set_location('l_budget_id:' || l_budget_id, 600);
2347: hr_utility.set_location('l_calendar:' || l_calendar, 600);
2790: and budgeted_entity_cd = p_budget_entity
2791: and business_group_id = p_business_group_id
2792: and p_effective_date between budget_start_date and budget_end_date
2793: and (
2794: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = p_unit_of_measure
2795: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = p_unit_of_measure
2796: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = p_unit_of_measure
2797: );
2798: --
2791: and business_group_id = p_business_group_id
2792: and p_effective_date between budget_start_date and budget_end_date
2793: and (
2794: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = p_unit_of_measure
2795: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = p_unit_of_measure
2796: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = p_unit_of_measure
2797: );
2798: --
2799: hr_utility.set_location('p_effective_date' || p_effective_date, 600);
2792: and p_effective_date between budget_start_date and budget_end_date
2793: and (
2794: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = p_unit_of_measure
2795: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = p_unit_of_measure
2796: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = p_unit_of_measure
2797: );
2798: --
2799: hr_utility.set_location('p_effective_date' || p_effective_date, 600);
2800: hr_utility.set_location('l_budget_id:' || l_budget_id, 600);
3115: and budgeted_entity_cd = 'POSITION'
3116: and business_group_id = l_business_group_id
3117: and p_effective_date between budget_start_date and budget_end_date
3118: and (
3119: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3120: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3121: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3122: );
3123: hr_utility.set_location('budget is:'||l_budget_id,30);
3116: and business_group_id = l_business_group_id
3117: and p_effective_date between budget_start_date and budget_end_date
3118: and (
3119: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3120: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3121: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3122: );
3123: hr_utility.set_location('budget is:'||l_budget_id,30);
3124: open c1(l_budget_unit1_id);
3117: and p_effective_date between budget_start_date and budget_end_date
3118: and (
3119: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3120: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3121: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3122: );
3123: hr_utility.set_location('budget is:'||l_budget_id,30);
3124: open c1(l_budget_unit1_id);
3125: fetch c1 into l_unit1_name;
3206: and budgeted_entity_cd = 'POSITION'
3207: and business_group_id = l_business_group_id
3208: and p_effective_date between budget_start_date and budget_end_date
3209: and (
3210: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3211: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3212: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3213: );
3214: hr_utility.set_location('budget exists' || l_budget_id, 50);
3207: and business_group_id = l_business_group_id
3208: and p_effective_date between budget_start_date and budget_end_date
3209: and (
3210: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3211: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3212: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3213: );
3214: hr_utility.set_location('budget exists' || l_budget_id, 50);
3215: hr_utility.set_location('start_date is '||to_char(l_start_date,'dd-MM-RRRR'),55);
3208: and p_effective_date between budget_start_date and budget_end_date
3209: and (
3210: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3211: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3212: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3213: );
3214: hr_utility.set_location('budget exists' || l_budget_id, 50);
3215: hr_utility.set_location('start_date is '||to_char(l_start_date,'dd-MM-RRRR'),55);
3216: hr_utility.set_location('end_date is '||to_char(l_end_date,'dd-MM-RRRR'),60);
3331: and budgeted_entity_cd = 'POSITION'
3332: and business_group_id = l_business_group_id
3333: and p_effective_date between budget_start_date and budget_end_date
3334: and (
3335: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3336: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3337: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3338: );
3339: --
3332: and business_group_id = l_business_group_id
3333: and p_effective_date between budget_start_date and budget_end_date
3334: and (
3335: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3336: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3337: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3338: );
3339: --
3340: select budget_version_id into l_budget_version_id
3333: and p_effective_date between budget_start_date and budget_end_date
3334: and (
3335: hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
3336: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
3337: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
3338: );
3339: --
3340: select budget_version_id into l_budget_version_id
3341: from pqh_budget_versions bvr
4689: and p_effective_date between bgt.budget_start_date and bgt.budget_end_date
4690: and p_effective_date between bver.date_from and bver.date_to
4691: and bgt.budgeted_entity_cd = 'POSITION'
4692: and bgt.position_control_flag = 'Y'
4693: and (hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit1_id) = p_budget_unit_cd
4694: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit2_id) = p_budget_unit_cd
4695: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit3_id) = p_budget_unit_cd);
4696: --
4697: begin
4690: and p_effective_date between bver.date_from and bver.date_to
4691: and bgt.budgeted_entity_cd = 'POSITION'
4692: and bgt.position_control_flag = 'Y'
4693: and (hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit1_id) = p_budget_unit_cd
4694: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit2_id) = p_budget_unit_cd
4695: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit3_id) = p_budget_unit_cd);
4696: --
4697: begin
4698: open c_pc_budget_info(p_position_id, p_budget_unit_cd, p_effective_date);
4691: and bgt.budgeted_entity_cd = 'POSITION'
4692: and bgt.position_control_flag = 'Y'
4693: and (hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit1_id) = p_budget_unit_cd
4694: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit2_id) = p_budget_unit_cd
4695: or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit3_id) = p_budget_unit_cd);
4696: --
4697: begin
4698: open c_pc_budget_info(p_position_id, p_budget_unit_cd, p_effective_date);
4699: fetch c_pc_budget_info into