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
167: hr_utility.set_location('ASSIGNMENTS EXIST FOR ELIMINATED POSITION', 623);
168: pqh_utility.set_message(800,'PER_POS_ELIMINATED',p_rec.organization_id);
169: pqh_utility.raise_error;
170: end if;
171: end if;
172: --
165: if (pqh_psf_bus.pos_assignments_exist(p_rec.position_id,
166: p_validation_start_date, p_validation_end_date)) then
167: hr_utility.set_location('ASSIGNMENTS EXIST FOR ELIMINATED POSITION', 623);
168: pqh_utility.set_message(800,'PER_POS_ELIMINATED',p_rec.organization_id);
169: pqh_utility.raise_error;
170: end if;
171: end if;
172: --
173: --
187: close c_asg_max_count;
188: hr_utility.set_location('l_max_count:'||l_asg_max_count, 630);
189: hr_utility.set_location('Position FTE:'||p_rec.fte, 630);
190: if (l_asg_max_count > p_rec.fte) then
191: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',p_rec.organization_id);
192: pqh_utility.raise_error;
193: end if;
194: hr_utility.set_location('Check FTE validation rule:', 630);
195: --
188: hr_utility.set_location('l_max_count:'||l_asg_max_count, 630);
189: hr_utility.set_location('Position FTE:'||p_rec.fte, 630);
190: if (l_asg_max_count > p_rec.fte) then
191: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',p_rec.organization_id);
192: pqh_utility.raise_error;
193: end if;
194: hr_utility.set_location('Check FTE validation rule:', 630);
195: --
196: end if;
202: --
203: l_chk_earliest_hire_date := pqh_psf_bus.chk_earliest_hire_date(
204: p_position_id => p_rec.position_id, p_earliest_hire_date => p_rec.earliest_hire_date );
205: if (not l_chk_earliest_hire_date ) then
206: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',p_rec.organization_id);
207: pqh_utility.raise_error;
208: end if;
209: hr_utility.set_location('Check Earliest hire date validation rule:', 640);
210: --
203: l_chk_earliest_hire_date := pqh_psf_bus.chk_earliest_hire_date(
204: p_position_id => p_rec.position_id, p_earliest_hire_date => p_rec.earliest_hire_date );
205: if (not l_chk_earliest_hire_date ) then
206: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',p_rec.organization_id);
207: pqh_utility.raise_error;
208: end if;
209: hr_utility.set_location('Check Earliest hire date validation rule:', 640);
210: --
211: -- Check proposed date for layoff validation rule
213: --
214: l_chk_prop_date_for_layoff := pqh_psf_bus.chk_prop_date_for_layoff(
215: p_position_id => p_rec.position_id, p_proposed_date_for_layoff => p_rec.proposed_date_for_layoff );
216: if (not l_chk_prop_date_for_layoff ) then
217: --pqh_utility.set_message(8302,'PQH_LAYOFF_DT_GT_ASG_DT',p_rec.organization_id);
218: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',p_rec.organization_id);
219: pqh_utility.raise_error;
220: end if;
221: hr_utility.set_location('Check proposed date for layoff validation rule:', 650);
214: l_chk_prop_date_for_layoff := pqh_psf_bus.chk_prop_date_for_layoff(
215: p_position_id => p_rec.position_id, p_proposed_date_for_layoff => p_rec.proposed_date_for_layoff );
216: if (not l_chk_prop_date_for_layoff ) then
217: --pqh_utility.set_message(8302,'PQH_LAYOFF_DT_GT_ASG_DT',p_rec.organization_id);
218: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',p_rec.organization_id);
219: pqh_utility.raise_error;
220: end if;
221: hr_utility.set_location('Check proposed date for layoff validation rule:', 650);
222: end;
215: p_position_id => p_rec.position_id, p_proposed_date_for_layoff => p_rec.proposed_date_for_layoff );
216: if (not l_chk_prop_date_for_layoff ) then
217: --pqh_utility.set_message(8302,'PQH_LAYOFF_DT_GT_ASG_DT',p_rec.organization_id);
218: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',p_rec.organization_id);
219: pqh_utility.raise_error;
220: end if;
221: hr_utility.set_location('Check proposed date for layoff validation rule:', 650);
222: end;
223: --
272: if not pqh_psf_bus.chk_seasonal_dates(
273: p_position_id => p_rec.position_id,
274: p_seasonal_flag => l_rec.seasonal_flag,
275: p_assignment_start_date => p_effective_date) then
276: pqh_utility.set_message(8302,'PQH_NON_SEASONAL_ASG_DATE',l_rec.organization_id);
277: pqh_utility.raise_error;
278: end if;
279: end if;
280: --
273: p_position_id => p_rec.position_id,
274: p_seasonal_flag => l_rec.seasonal_flag,
275: p_assignment_start_date => p_effective_date) then
276: pqh_utility.set_message(8302,'PQH_NON_SEASONAL_ASG_DATE',l_rec.organization_id);
277: pqh_utility.raise_error;
278: end if;
279: end if;
280: --
281: -- Check whether Assignment Grade is same as Position Grade.
281: -- Check whether Assignment Grade is same as Position Grade.
282: --
283: hr_utility.set_location('Insert Validate: Before Assignment Grade', 130);
284: if p_rec.grade_id <> l_rec.entry_grade_id then
285: pqh_utility.set_message(8302,'PQH_NON_POSITION_GRADE',l_rec.organization_id);
286: pqh_utility.raise_error;
287: end if;
288: --
289: -- Check assignment start date to be greater than earliest hire date of the position
282: --
283: hr_utility.set_location('Insert Validate: Before Assignment Grade', 130);
284: if p_rec.grade_id <> l_rec.entry_grade_id then
285: pqh_utility.set_message(8302,'PQH_NON_POSITION_GRADE',l_rec.organization_id);
286: pqh_utility.raise_error;
287: end if;
288: --
289: -- Check assignment start date to be greater than earliest hire date of the position
290: --
289: -- Check assignment start date to be greater than earliest hire date of the position
290: --
291: hr_utility.set_location('Insert Validate: greater than earliest hire date', 130);
292: if p_rec.effective_start_date < l_rec.earliest_hire_date then
293: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',l_rec.organization_id);
294: pqh_utility.raise_error;
295: end if;
296: --
297: -- Check whether assignment date is before proposed date for Layoff
290: --
291: hr_utility.set_location('Insert Validate: greater than earliest hire date', 130);
292: if p_rec.effective_start_date < l_rec.earliest_hire_date then
293: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',l_rec.organization_id);
294: pqh_utility.raise_error;
295: end if;
296: --
297: -- Check whether assignment date is before proposed date for Layoff
298: --
297: -- Check whether assignment date is before proposed date for Layoff
298: --
299: hr_utility.set_location('Insert Validate: before proposed date for Layoff', 130);
300: if (p_rec.effective_start_date > l_rec.proposed_date_for_layoff ) then
301: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',l_rec.organization_id);
302: pqh_utility.raise_error;
303: end if;
304: --
305: -- Validate whether a SHARED position has FTE greater than the sum of the budgeted FTE's attached to the Position
298: --
299: hr_utility.set_location('Insert Validate: before proposed date for Layoff', 130);
300: if (p_rec.effective_start_date > l_rec.proposed_date_for_layoff ) then
301: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',l_rec.organization_id);
302: pqh_utility.raise_error;
303: end if;
304: --
305: -- Validate whether a SHARED position has FTE greater than the sum of the budgeted FTE's attached to the Position
306: --
339: hr_utility.set_location('Insert Validate:POOLED', 130);
340: if pqh_psf_bus.open_status(p_rec.position_id, p_rec.effective_start_date) = 'OPEN' then
341: null;
342: else
343: pqh_utility.set_message(8302,'PQH_POOLED_POS_NOT_OPEN',l_rec.organization_id);
344: pqh_utility.raise_error;
345: end if;
346: hr_utility.set_location('Insert Validate:END POOLED', 130);
347: elsif l_rec.position_type = 'SINGLE' or l_rec.position_type = 'SHARED' then
340: if pqh_psf_bus.open_status(p_rec.position_id, p_rec.effective_start_date) = 'OPEN' then
341: null;
342: else
343: pqh_utility.set_message(8302,'PQH_POOLED_POS_NOT_OPEN',l_rec.organization_id);
344: pqh_utility.raise_error;
345: end if;
346: hr_utility.set_location('Insert Validate:END POOLED', 130);
347: elsif l_rec.position_type = 'SINGLE' or l_rec.position_type = 'SHARED' then
348: hr_utility.set_location('Insert Validate:SINGLE-SHARED', 130);
368: p_rec.effective_start_date,
369: l_rec.organization_id,
370: l_default_asg_fte);
371: --hr_utility.set_location('POSITION RESERVED', 114);
372: --pqh_utility.set_message(8302,'PQH_POS_RESERVED',l_rec.organization_id);
373: --pqh_utility.raise_error;
374: else
375: l_future_res_date := chk_future_reserved_fte(p_rec.assignment_id, p_rec.person_id,
376: p_rec.position_id, l_rec.position_type,
369: l_rec.organization_id,
370: l_default_asg_fte);
371: --hr_utility.set_location('POSITION RESERVED', 114);
372: --pqh_utility.set_message(8302,'PQH_POS_RESERVED',l_rec.organization_id);
373: --pqh_utility.raise_error;
374: else
375: l_future_res_date := chk_future_reserved_fte(p_rec.assignment_id, p_rec.person_id,
376: p_rec.position_id, l_rec.position_type,
377: p_rec.effective_start_date, hr_general.end_of_time, l_default_asg_fte);
377: p_rec.effective_start_date, hr_general.end_of_time, l_default_asg_fte);
378: if l_future_res_date is not null then
379: hr_utility.set_message(8302,'PQH_POS_FUTURE_RESERVED');
380: hr_utility.set_message_token('FUTURE_RESERVED_DATE', l_future_res_date);
381: pqh_utility.set_message_level_cd('W');
382: pqh_utility.raise_error;
383: end if;
384: end if;
385: end if;
378: if l_future_res_date is not null then
379: hr_utility.set_message(8302,'PQH_POS_FUTURE_RESERVED');
380: hr_utility.set_message_token('FUTURE_RESERVED_DATE', l_future_res_date);
381: pqh_utility.set_message_level_cd('W');
382: pqh_utility.raise_error;
383: end if;
384: end if;
385: end if;
386: end if;
394: l_chk_pos_budget := chk_pos_budget(p_rec.position_id, p_rec.effective_start_date);
395: hr_utility.set_location('Money Related Rule after chk_pos_budget', 136);
396: if not l_chk_pos_budget then
397: hr_utility.set_location('Money Related Rule failed', 140);
398: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_rec.organization_id);
399: pqh_utility.raise_error;
400: else
401: hr_utility.set_location('Money Related Rule success', 140);
402: end if;
395: hr_utility.set_location('Money Related Rule after chk_pos_budget', 136);
396: if not l_chk_pos_budget then
397: hr_utility.set_location('Money Related Rule failed', 140);
398: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_rec.organization_id);
399: pqh_utility.raise_error;
400: else
401: hr_utility.set_location('Money Related Rule success', 140);
402: end if;
403: */
475: p_position_id => p_rec.position_id,
476: p_seasonal_flag => l_rec.seasonal_flag,
477: p_assignment_start_date => p_validation_start_date) then
478:
479: pqh_utility.set_message(8302,'PQH_NON_SEASONAL_ASG_DATE',l_rec.organization_id);
480: pqh_utility.raise_error;
481: end if;
482: end if;
483: end if;
476: p_seasonal_flag => l_rec.seasonal_flag,
477: p_assignment_start_date => p_validation_start_date) then
478:
479: pqh_utility.set_message(8302,'PQH_NON_SEASONAL_ASG_DATE',l_rec.organization_id);
480: pqh_utility.raise_error;
481: end if;
482: end if;
483: end if;
484: --
485: -- Check whether Assignment Grade is same as Position Grade.
486: --
487: if p_rec.position_id <> nvl(l_asg.position_id, -999) or p_rec.grade_id <> l_asg.grade_id then
488: if p_rec.grade_id <> l_rec.entry_grade_id then
489: pqh_utility.set_message(8302,'PQH_NON_POSITION_GRADE',l_rec.organization_id);
490: pqh_utility.raise_error;
491: end if;
492: end if;
493: --
486: --
487: if p_rec.position_id <> nvl(l_asg.position_id, -999) or p_rec.grade_id <> l_asg.grade_id then
488: if p_rec.grade_id <> l_rec.entry_grade_id then
489: pqh_utility.set_message(8302,'PQH_NON_POSITION_GRADE',l_rec.organization_id);
490: pqh_utility.raise_error;
491: end if;
492: end if;
493: --
494: -- Check assignment start date to be greater than earliest hire date of the position
494: -- Check assignment start date to be greater than earliest hire date of the position
495: --
496: if p_rec.position_id <> nvl(l_asg.position_id, -999) or p_validation_start_date <> l_asg.effective_start_date then
497: if p_validation_start_date < l_rec.earliest_hire_date then
498: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',l_rec.organization_id);
499: pqh_utility.raise_error;
500: end if;
501: --
502: -- Check whether assignment date is before proposed date for Layoff
495: --
496: if p_rec.position_id <> nvl(l_asg.position_id, -999) or p_validation_start_date <> l_asg.effective_start_date then
497: if p_validation_start_date < l_rec.earliest_hire_date then
498: pqh_utility.set_message(8302,'PQH_ASG_HIRED_BEFORE_EARLIEST',l_rec.organization_id);
499: pqh_utility.raise_error;
500: end if;
501: --
502: -- Check whether assignment date is before proposed date for Layoff
503: --
501: --
502: -- Check whether assignment date is before proposed date for Layoff
503: --
504: if (p_validation_start_date > l_rec.proposed_date_for_layoff ) then
505: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',l_rec.organization_id);
506: pqh_utility.raise_error;
507: end if;
508: end if;
509: --
502: -- Check whether assignment date is before proposed date for Layoff
503: --
504: if (p_validation_start_date > l_rec.proposed_date_for_layoff ) then
505: pqh_utility.set_message(8302,'PQH_ASG_DT_GT_LAYOFF_DT',l_rec.organization_id);
506: pqh_utility.raise_error;
507: end if;
508: end if;
509: --
510: -- Validate whether a SHARED position has FTE greater than the sum of the budgeted FTE's attached to the Position
554: hr_utility.set_location('before PQH_FTE_NE_SHARED_POS_FTE_CAP ', 100);
555: --
556: l_assignment_fte := pqh_psf_bus.assignment_fte(p_rec.assignment_id, p_validation_start_date);
557: if (l_rec.fte/l_rec.max_persons <> l_assignment_fte) then
558: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_rec.organization_id);
559: pqh_utility.raise_error;
560: end if;
561: --
562: hr_utility.set_location('after PQH_FTE_NE_SHARED_POS_FTE_CAP ', 100);
555: --
556: l_assignment_fte := pqh_psf_bus.assignment_fte(p_rec.assignment_id, p_validation_start_date);
557: if (l_rec.fte/l_rec.max_persons <> l_assignment_fte) then
558: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_rec.organization_id);
559: pqh_utility.raise_error;
560: end if;
561: --
562: hr_utility.set_location('after PQH_FTE_NE_SHARED_POS_FTE_CAP ', 100);
563: --
569: if l_rec.position_type = 'POOLED' then
570: if pqh_psf_bus.open_status(l_rec.position_id, l_rec.effective_start_date) = 'OPEN' then
571: null;
572: else
573: pqh_utility.set_message(8302,'PQH_POOLED_POS_NOT_OPEN',l_rec.organization_id);
574: pqh_utility.raise_error;
575: end if;
576: elsif l_rec.position_type = 'SINGLE' or l_rec.position_type = 'SHARED' then
577: hr_utility.set_location('SINGLE OR SHARED', 111);
570: if pqh_psf_bus.open_status(l_rec.position_id, l_rec.effective_start_date) = 'OPEN' then
571: null;
572: else
573: pqh_utility.set_message(8302,'PQH_POOLED_POS_NOT_OPEN',l_rec.organization_id);
574: pqh_utility.raise_error;
575: end if;
576: elsif l_rec.position_type = 'SINGLE' or l_rec.position_type = 'SHARED' then
577: hr_utility.set_location('SINGLE OR SHARED', 111);
578: -- if pqh_psf_bus.open_status(l_rec.position_id, l_rec.effective_start_date) = 'OPEN' then -- Commented for Bug#13860076
591: p_validation_start_date,
592: l_rec.organization_id);
593:
594: --hr_utility.set_location('POSITION RESERVED', 114);
595: --pqh_utility.set_message(8302,'PQH_POS_RESERVED',l_rec.organization_id);
596: --pqh_utility.raise_error;
597: else
598: l_future_res_date := chk_future_reserved_fte(p_rec.assignment_id, p_rec.person_id,
599: p_rec.position_id, l_rec.position_type,
592: l_rec.organization_id);
593:
594: --hr_utility.set_location('POSITION RESERVED', 114);
595: --pqh_utility.set_message(8302,'PQH_POS_RESERVED',l_rec.organization_id);
596: --pqh_utility.raise_error;
597: else
598: l_future_res_date := chk_future_reserved_fte(p_rec.assignment_id, p_rec.person_id,
599: p_rec.position_id, l_rec.position_type,
600: p_validation_start_date, hr_general.end_of_time);
600: p_validation_start_date, hr_general.end_of_time);
601: if l_future_res_date is not null then
602: hr_utility.set_message(8302,'PQH_POS_FUTURE_RESERVED');
603: hr_utility.set_message_token('FUTURE_RESERVED_DATE', l_future_res_date);
604: pqh_utility.set_message_level_cd('W');
605: pqh_utility.raise_error;
606: end if;
607: end if;
608: end if;
601: if l_future_res_date is not null then
602: hr_utility.set_message(8302,'PQH_POS_FUTURE_RESERVED');
603: hr_utility.set_message_token('FUTURE_RESERVED_DATE', l_future_res_date);
604: pqh_utility.set_message_level_cd('W');
605: pqh_utility.raise_error;
606: end if;
607: end if;
608: end if;
609: end if;
745: l_bgt_realloc := nvl(l_bdgt,0) + nvl(l_realloc,0);
746: --
747: if l_bgt_realloc < l_sum then
748: l_bgt_lt_abv_fte := true;
749: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
750: pqh_utility.raise_error;
751: end if;
752: else
753: --
746: --
747: if l_bgt_realloc < l_sum then
748: l_bgt_lt_abv_fte := true;
749: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
750: pqh_utility.raise_error;
751: end if;
752: else
753: --
754: if l_fte < l_sum then
752: else
753: --
754: if l_fte < l_sum then
755: l_bgt_lt_abv_fte := true;
756: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
757: pqh_utility.raise_error;
758: end if;
759: end if;
760: end if;
753: --
754: if l_fte < l_sum then
755: l_bgt_lt_abv_fte := true;
756: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
757: pqh_utility.raise_error;
758: end if;
759: end if;
760: end if;
761: end loop;
875: --
876: if (l_bgt_realloc < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
877: l_abv_gt_fte := true;
878: ---Position Budget FTE is less than the sum of the assignment budget FTE
879: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
880: pqh_utility.raise_error;
881: end if;
882: else
883: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
876: if (l_bgt_realloc < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
877: l_abv_gt_fte := true;
878: ---Position Budget FTE is less than the sum of the assignment budget FTE
879: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
880: pqh_utility.raise_error;
881: end if;
882: else
883: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
884: l_abv_gt_fte := true;
882: else
883: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
884: l_abv_gt_fte := true;
885: ---Position FTE is less than the sum of the assignment budget FTE
886: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
887: pqh_utility.raise_error;
888: end if;
889: end if;
890: --
883: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
884: l_abv_gt_fte := true;
885: ---Position FTE is less than the sum of the assignment budget FTE
886: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
887: pqh_utility.raise_error;
888: end if;
889: end if;
890: --
891: if (not l_abv_gt_fte) and (l_position_type = 'SHARED') then
911: hr_utility.set_location('Position : FTE, Head Count, Pos Type:'||
912: l_fte||' - '||l_max_persons ||' - '||l_position_type, 120);
913: --
914: if (l_position_type = 'SHARED') and (l_fte/l_max_persons <> p_value) then
915: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_organization_id);
916: pqh_utility.raise_error;
917: end if;
918: end if;
919: END IF ; -- IF l_assignment_type IN ('C','E') THEN -- bug 7008697
912: l_fte||' - '||l_max_persons ||' - '||l_position_type, 120);
913: --
914: if (l_position_type = 'SHARED') and (l_fte/l_max_persons <> p_value) then
915: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_organization_id);
916: pqh_utility.raise_error;
917: end if;
918: end if;
919: END IF ; -- IF l_assignment_type IN ('C','E') THEN -- bug 7008697
920: hr_utility.set_location('Exiting Procedure '||l_proc, 200);
1049: if (l_bgt_realloc < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
1050: hr_utility.set_location('PQH_SUM_ABV_FTE_GT_POS_BGT_FTE', 152);
1051: l_abv_gt_fte := true;
1052: ---Position Budget FTE is less than the sum of the assignment budget FTE
1053: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE' ,l_organization_id);
1054: pqh_utility.raise_error;
1055: end if;
1056: else
1057: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
1050: hr_utility.set_location('PQH_SUM_ABV_FTE_GT_POS_BGT_FTE', 152);
1051: l_abv_gt_fte := true;
1052: ---Position Budget FTE is less than the sum of the assignment budget FTE
1053: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE' ,l_organization_id);
1054: pqh_utility.raise_error;
1055: end if;
1056: else
1057: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
1058: hr_utility.set_location('PQH_SUM_ABV_FTE_GT_POS_FTE :'||l_organization_id, 153);
1057: if (l_fte < nvl(l_sum_abv,0)+ nvl(p_value,0)) then
1058: hr_utility.set_location('PQH_SUM_ABV_FTE_GT_POS_FTE :'||l_organization_id, 153);
1059: l_abv_gt_fte := true;
1060: ---Position FTE is less than the sum of the assignment budget FTE
1061: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
1062: pqh_utility.raise_error;
1063: end if;
1064: end if;
1065: --
1058: hr_utility.set_location('PQH_SUM_ABV_FTE_GT_POS_FTE :'||l_organization_id, 153);
1059: l_abv_gt_fte := true;
1060: ---Position FTE is less than the sum of the assignment budget FTE
1061: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
1062: pqh_utility.raise_error;
1063: end if;
1064: end if;
1065: --
1066: hr_utility.set_location('Before check reserved', 154);
1091: hr_utility.set_location('Before fte capacity', 155);
1092: --
1093: if (l_position_type = 'SHARED') and (l_fte/l_max_persons <> p_value) then
1094: hr_utility.set_location('PQH_FTE_NE_SHARED_POS_FTE_CAP', 156);
1095: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_organization_id);
1096: pqh_utility.raise_error;
1097: end if;
1098: --
1099: hr_utility.set_location('After fte capacity', 157);
1092: --
1093: if (l_position_type = 'SHARED') and (l_fte/l_max_persons <> p_value) then
1094: hr_utility.set_location('PQH_FTE_NE_SHARED_POS_FTE_CAP', 156);
1095: pqh_utility.set_message(8302,'PQH_FTE_NE_SHARED_POS_FTE_CAP',l_organization_id);
1096: pqh_utility.raise_error;
1097: end if;
1098: --
1099: hr_utility.set_location('After fte capacity', 157);
1100: --
1145: and ast.per_system_status <> 'TERM_ASSIGN';
1146: --
1147: begin
1148: /*
1149: l_assignment_fte := pqh_utility.get_pos_budget_values(
1150: p_position_id,p_effective_date,p_effective_date, 'FTE');
1151: */
1152: if p_position_id is not null then
1153: -- l_assignment_fte := 1;
1188: and ast.per_system_status <> 'TERM_ASSIGN';
1189: --
1190: begin
1191: /*
1192: l_assignment_fte := pqh_utility.get_pos_budget_values(
1193: p_position_id,p_effective_date,p_effective_date, 'FTE');
1194: */
1195: if p_position_id is not null then
1196: -- l_assignment_fte := 1;
4269: --
4270: if l_bgt_and_realloc_fte < l_total_asg_fte then
4271: hr_utility.set_message(8302,'PQH_SHARED_FUT_BFTE_LT_AFTE');
4272: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4273: pqh_utility.set_message_level_cd('W');
4274: pqh_utility.raise_error;
4275: return;
4276: end if;
4277: else
4270: if l_bgt_and_realloc_fte < l_total_asg_fte then
4271: hr_utility.set_message(8302,'PQH_SHARED_FUT_BFTE_LT_AFTE');
4272: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4273: pqh_utility.set_message_level_cd('W');
4274: pqh_utility.raise_error;
4275: return;
4276: end if;
4277: else
4278: if l_position_fte < l_total_asg_fte then
4277: else
4278: if l_position_fte < l_total_asg_fte then
4279: hr_utility.set_message(8302,'PQH_SHARED_FUT_PFTE_LT_AFTE');
4280: hr_utility.set_message_token('FUTURE_ASG_DATE',r1.effective_start_date );
4281: pqh_utility.set_message_level_cd('W');
4282: pqh_utility.raise_error;
4283: return;
4284: end if;
4285: end if;
4278: if l_position_fte < l_total_asg_fte then
4279: hr_utility.set_message(8302,'PQH_SHARED_FUT_PFTE_LT_AFTE');
4280: hr_utility.set_message_token('FUTURE_ASG_DATE',r1.effective_start_date );
4281: pqh_utility.set_message_level_cd('W');
4282: pqh_utility.raise_error;
4283: return;
4284: end if;
4285: end if;
4286: --
4289: if l_total_asg_fte > 1 then
4290: hr_utility.set_message(8302,'PQH_SINGLE_POS_FUTURE_ASG');
4291: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4292: --- Fix For Bug # 10201563---
4293: -- pqh_utility.set_message_level_cd('E');
4294: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4295: pqh_utility.set_message_level_cd('W');
4296: else
4297: pqh_utility.set_message_level_cd('E');
4291: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4292: --- Fix For Bug # 10201563---
4293: -- pqh_utility.set_message_level_cd('E');
4294: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4295: pqh_utility.set_message_level_cd('W');
4296: else
4297: pqh_utility.set_message_level_cd('E');
4298: end if;
4299: --- Fix For Bug # 10201563---
4293: -- pqh_utility.set_message_level_cd('E');
4294: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4295: pqh_utility.set_message_level_cd('W');
4296: else
4297: pqh_utility.set_message_level_cd('E');
4298: end if;
4299: --- Fix For Bug # 10201563---
4300: pqh_utility.raise_error;
4301: return;
4296: else
4297: pqh_utility.set_message_level_cd('E');
4298: end if;
4299: --- Fix For Bug # 10201563---
4300: pqh_utility.raise_error;
4301: return;
4302: end if;
4303: --
4304: end if;
4339: --
4340: if l_bgt_and_realloc_fte < l_total_asg_fte then
4341: hr_utility.set_message(8302,'PQH_SHARED_FUT_BFTE_LT_AFTE');
4342: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4343: pqh_utility.set_message_level_cd('W');
4344: pqh_utility.raise_error;
4345: return;
4346: end if;
4347: else
4340: if l_bgt_and_realloc_fte < l_total_asg_fte then
4341: hr_utility.set_message(8302,'PQH_SHARED_FUT_BFTE_LT_AFTE');
4342: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4343: pqh_utility.set_message_level_cd('W');
4344: pqh_utility.raise_error;
4345: return;
4346: end if;
4347: else
4348: if l_position_fte < l_total_asg_fte then
4347: else
4348: if l_position_fte < l_total_asg_fte then
4349: hr_utility.set_message(8302,'PQH_SHARED_FUT_PFTE_LT_AFTE');
4350: hr_utility.set_message_token('FUTURE_ASG_DATE',r1.effective_start_date );
4351: pqh_utility.set_message_level_cd('W');
4352: pqh_utility.raise_error;
4353: return;
4354: end if;
4355: end if;
4348: if l_position_fte < l_total_asg_fte then
4349: hr_utility.set_message(8302,'PQH_SHARED_FUT_PFTE_LT_AFTE');
4350: hr_utility.set_message_token('FUTURE_ASG_DATE',r1.effective_start_date );
4351: pqh_utility.set_message_level_cd('W');
4352: pqh_utility.raise_error;
4353: return;
4354: end if;
4355: end if;
4356: --
4359: if l_total_asg_fte > 1 then
4360: hr_utility.set_message(8302,'PQH_SINGLE_POS_FUTURE_ASG');
4361: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4362: --- Fix For Bug # 10201563---
4363: -- pqh_utility.set_message_level_cd('E');
4364: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4365: pqh_utility.set_message_level_cd('W');
4366: else
4367: pqh_utility.set_message_level_cd('E');
4361: hr_utility.set_message_token('FUTURE_ASG_DATE', r1.effective_start_date);
4362: --- Fix For Bug # 10201563---
4363: -- pqh_utility.set_message_level_cd('E');
4364: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4365: pqh_utility.set_message_level_cd('W');
4366: else
4367: pqh_utility.set_message_level_cd('E');
4368: end if;
4369: --- Fix For Bug # 10201563---
4363: -- pqh_utility.set_message_level_cd('E');
4364: if NVL(fnd_profile.value('GHR_POS_VALID_WARN_ERROR'),'E') = 'W' then
4365: pqh_utility.set_message_level_cd('W');
4366: else
4367: pqh_utility.set_message_level_cd('E');
4368: end if;
4369: --- Fix For Bug # 10201563---
4370: pqh_utility.raise_error;
4371: return;
4366: else
4367: pqh_utility.set_message_level_cd('E');
4368: end if;
4369: --- Fix For Bug # 10201563---
4370: pqh_utility.raise_error;
4371: return;
4372: end if;
4373: --
4374: end if;
4412: l_bgt_realloc := nvl(l_budgeted_fte,0) + nvl(l_realloc,0);
4413: --
4414: if l_bgt_realloc < l_sum then
4415: p_bgt_lt_abv_fte := true;
4416: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
4417: pqh_utility.raise_error;
4418: end if;
4419: else
4420: if l_position_fte < l_sum then
4413: --
4414: if l_bgt_realloc < l_sum then
4415: p_bgt_lt_abv_fte := true;
4416: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_BGT_FTE',l_organization_id);
4417: pqh_utility.raise_error;
4418: end if;
4419: else
4420: if l_position_fte < l_sum then
4421: p_bgt_lt_abv_fte := true;
4418: end if;
4419: else
4420: if l_position_fte < l_sum then
4421: p_bgt_lt_abv_fte := true;
4422: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
4423: pqh_utility.raise_error;
4424: end if;
4425: end if;
4426: --
4419: else
4420: if l_position_fte < l_sum then
4421: p_bgt_lt_abv_fte := true;
4422: pqh_utility.set_message(8302,'PQH_SUM_ABV_FTE_GT_POS_FTE',l_organization_id);
4423: pqh_utility.raise_error;
4424: end if;
4425: end if;
4426: --
4427: exception when others then
4549: --
4550: --
4551: if (l_blank_res_pos_fte < 0) then
4552: hr_utility.set_location('POSITION RESERVED2', 114);
4553: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4554: pqh_utility.raise_error;
4555: elsif ((l_total_asg_fte <= (l_blank_res_pos_fte + l_unreserved_fte))
4556: or (nvl(l_blank_res_pos_fte,0) >=
4557: nvl(l_asg_fte,0) + nvl(p_default_asg_fte,0))) then
4550: --
4551: if (l_blank_res_pos_fte < 0) then
4552: hr_utility.set_location('POSITION RESERVED2', 114);
4553: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4554: pqh_utility.raise_error;
4555: elsif ((l_total_asg_fte <= (l_blank_res_pos_fte + l_unreserved_fte))
4556: or (nvl(l_blank_res_pos_fte,0) >=
4557: nvl(l_asg_fte,0) + nvl(p_default_asg_fte,0))) then
4558: hr_utility.set_location('PQH_ANONYM_POS_RESERVED', 115);
4555: elsif ((l_total_asg_fte <= (l_blank_res_pos_fte + l_unreserved_fte))
4556: or (nvl(l_blank_res_pos_fte,0) >=
4557: nvl(l_asg_fte,0) + nvl(p_default_asg_fte,0))) then
4558: hr_utility.set_location('PQH_ANONYM_POS_RESERVED', 115);
4559: pqh_utility.set_message(8302,'PQH_ANONYM_POS_RESERVED',p_organization_id);
4560: pqh_utility.raise_error;
4561: else
4562: hr_utility.set_location('PQH_POS_RESERVED', 116);
4563: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4556: or (nvl(l_blank_res_pos_fte,0) >=
4557: nvl(l_asg_fte,0) + nvl(p_default_asg_fte,0))) then
4558: hr_utility.set_location('PQH_ANONYM_POS_RESERVED', 115);
4559: pqh_utility.set_message(8302,'PQH_ANONYM_POS_RESERVED',p_organization_id);
4560: pqh_utility.raise_error;
4561: else
4562: hr_utility.set_location('PQH_POS_RESERVED', 116);
4563: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4564: pqh_utility.raise_error;
4559: pqh_utility.set_message(8302,'PQH_ANONYM_POS_RESERVED',p_organization_id);
4560: pqh_utility.raise_error;
4561: else
4562: hr_utility.set_location('PQH_POS_RESERVED', 116);
4563: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4564: pqh_utility.raise_error;
4565: end if;
4566: hr_utility.set_location('inside reserved_error',80);
4567: --
4560: pqh_utility.raise_error;
4561: else
4562: hr_utility.set_location('PQH_POS_RESERVED', 116);
4563: pqh_utility.set_message(8302,'PQH_POS_RESERVED',p_organization_id);
4564: pqh_utility.raise_error;
4565: end if;
4566: hr_utility.set_location('inside reserved_error',80);
4567: --
4568: end;
4651: p_message_name in varchar2,
4652: p_organization_id in number) return varchar2 is
4653: l_rule_level_cd varchar2(1);
4654: begin
4655: pqh_utility.get_message_level_cd
4656: (p_organization_id => p_organization_id,
4657: p_application_id => p_application_id,
4658: p_message_name => p_message_name,
4659: p_rule_level_cd => l_rule_level_cd);
4915: l_salary_input_value_id := p_input_value_id;
4916: end if;
4917: --
4918: if (not is_budget_commt_element(l_budget_id, l_salary_element_type_id) ) then
4919: pqh_utility.set_message(8302,'PQH_SAL_NOT_COMMT_ELEMENT',l_asg_organization_id);
4920: pqh_utility.set_message_token('ELEMENT', decode_element(l_salary_element_type_id));
4921: pqh_utility.set_message_token('BUDGET', l_budget_name);
4922: pqh_utility.raise_error;
4923: return;
4916: end if;
4917: --
4918: if (not is_budget_commt_element(l_budget_id, l_salary_element_type_id) ) then
4919: pqh_utility.set_message(8302,'PQH_SAL_NOT_COMMT_ELEMENT',l_asg_organization_id);
4920: pqh_utility.set_message_token('ELEMENT', decode_element(l_salary_element_type_id));
4921: pqh_utility.set_message_token('BUDGET', l_budget_name);
4922: pqh_utility.raise_error;
4923: return;
4924: end if;
4917: --
4918: if (not is_budget_commt_element(l_budget_id, l_salary_element_type_id) ) then
4919: pqh_utility.set_message(8302,'PQH_SAL_NOT_COMMT_ELEMENT',l_asg_organization_id);
4920: pqh_utility.set_message_token('ELEMENT', decode_element(l_salary_element_type_id));
4921: pqh_utility.set_message_token('BUDGET', l_budget_name);
4922: pqh_utility.raise_error;
4923: return;
4924: end if;
4925: --
4918: if (not is_budget_commt_element(l_budget_id, l_salary_element_type_id) ) then
4919: pqh_utility.set_message(8302,'PQH_SAL_NOT_COMMT_ELEMENT',l_asg_organization_id);
4920: pqh_utility.set_message_token('ELEMENT', decode_element(l_salary_element_type_id));
4921: pqh_utility.set_message_token('BUDGET', l_budget_name);
4922: pqh_utility.raise_error;
4923: return;
4924: end if;
4925: --
4926: hr_utility.set_location(l_proc,7);
5010: --
5011: if (l_pos_under_budgeted_amt < 0) then
5012: hr_utility.set_location(l_proc||'Leaving with error',11);
5013:
5014: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_asg_organization_id);
5015: -- pqh_utility.set_message_level_cd(l_message_level);
5016: pqh_utility.set_message_token('POSITION',
5017: hr_general.decode_position(l_asg_position_id));
5018: pqh_utility.set_message_token('UNDER_BUDGETED_AMT',
5011: if (l_pos_under_budgeted_amt < 0) then
5012: hr_utility.set_location(l_proc||'Leaving with error',11);
5013:
5014: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_asg_organization_id);
5015: -- pqh_utility.set_message_level_cd(l_message_level);
5016: pqh_utility.set_message_token('POSITION',
5017: hr_general.decode_position(l_asg_position_id));
5018: pqh_utility.set_message_token('UNDER_BUDGETED_AMT',
5019: to_char( -l_pos_under_budgeted_amt,
5012: hr_utility.set_location(l_proc||'Leaving with error',11);
5013:
5014: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_asg_organization_id);
5015: -- pqh_utility.set_message_level_cd(l_message_level);
5016: pqh_utility.set_message_token('POSITION',
5017: hr_general.decode_position(l_asg_position_id));
5018: pqh_utility.set_message_token('UNDER_BUDGETED_AMT',
5019: to_char( -l_pos_under_budgeted_amt,
5020: fnd_currency.GET_FORMAT_MASK(nvl(l_currency_code,'USD'),length(trunc(l_pos_under_budgeted_amt))+15)
5014: pqh_utility.set_message(8302,'PQH_SUM_ASG_AMT_GT_BGT_AMT',l_asg_organization_id);
5015: -- pqh_utility.set_message_level_cd(l_message_level);
5016: pqh_utility.set_message_token('POSITION',
5017: hr_general.decode_position(l_asg_position_id));
5018: pqh_utility.set_message_token('UNDER_BUDGETED_AMT',
5019: to_char( -l_pos_under_budgeted_amt,
5020: fnd_currency.GET_FORMAT_MASK(nvl(l_currency_code,'USD'),length(trunc(l_pos_under_budgeted_amt))+15)
5021: ));
5022: /*
5019: to_char( -l_pos_under_budgeted_amt,
5020: fnd_currency.GET_FORMAT_MASK(nvl(l_currency_code,'USD'),length(trunc(l_pos_under_budgeted_amt))+15)
5021: ));
5022: /*
5023: pqh_utility.set_message_token('BUDGETED',nvl(l_pos_budgeted_amt,0));
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5020: fnd_currency.GET_FORMAT_MASK(nvl(l_currency_code,'USD'),length(trunc(l_pos_under_budgeted_amt))+15)
5021: ));
5022: /*
5023: pqh_utility.set_message_token('BUDGETED',nvl(l_pos_budgeted_amt,0));
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5021: ));
5022: /*
5023: pqh_utility.set_message_token('BUDGETED',nvl(l_pos_budgeted_amt,0));
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5029: */
5022: /*
5023: pqh_utility.set_message_token('BUDGETED',nvl(l_pos_budgeted_amt,0));
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5029: */
5030: pqh_utility.raise_error;
5023: pqh_utility.set_message_token('BUDGETED',nvl(l_pos_budgeted_amt,0));
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5029: */
5030: pqh_utility.raise_error;
5031: end if;
5024: pqh_utility.set_message_token('ACTUALS',nvl(l_pos_actuals_amt,0));
5025: pqh_utility.set_message_token('COMMITMENT',nvl(l_pos_commitment_amt,0));
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5029: */
5030: pqh_utility.raise_error;
5031: end if;
5032: --
5026: pqh_utility.set_message_token('REALLOC_OUT',nvl(l_pos_reallocated_out_amt,0));
5027: pqh_utility.set_message_token('REALLOC_IN',nvl(l_pos_reallocated_in_amt,0));
5028: pqh_utility.set_message_token('RESERVED',nvl(l_pos_reserved_amt,0));
5029: */
5030: pqh_utility.raise_error;
5031: end if;
5032: --
5033: hr_utility.set_location(l_proc||'Leaving',12);
5034: --