20: l_error exception;
21: l_argument varchar2(30);
22: --
23: Begin
24: hr_utility.set_location('Entering:'||l_proc, 5);
25: --
26: -- Only proceed with validation if a row exists for
27: -- the current record in the HR Schema
28: --
29: if not per_pyp_shd.api_updating
30: (p_pay_proposal_id => p_rec.pay_proposal_id
31: ,p_object_version_number => p_rec.object_version_number
32: ) then
33: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
34: hr_utility.set_message_token('PROCEDURE', l_proc);
35: hr_utility.set_message_token('STEP', '5');
36: end if;
37: --
30: (p_pay_proposal_id => p_rec.pay_proposal_id
31: ,p_object_version_number => p_rec.object_version_number
32: ) then
33: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
34: hr_utility.set_message_token('PROCEDURE', l_proc);
35: hr_utility.set_message_token('STEP', '5');
36: end if;
37: --
38: hr_utility.set_location(l_proc, 6);
31: ,p_object_version_number => p_rec.object_version_number
32: ) then
33: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
34: hr_utility.set_message_token('PROCEDURE', l_proc);
35: hr_utility.set_message_token('STEP', '5');
36: end if;
37: --
38: hr_utility.set_location(l_proc, 6);
39: --
34: hr_utility.set_message_token('PROCEDURE', l_proc);
35: hr_utility.set_message_token('STEP', '5');
36: end if;
37: --
38: hr_utility.set_location(l_proc, 6);
39: --
40: if p_rec.business_group_id <> per_pyp_shd.g_old_rec.business_group_id then
41: l_argument := 'business_group_id';
42: raise l_error;
40: if p_rec.business_group_id <> per_pyp_shd.g_old_rec.business_group_id then
41: l_argument := 'business_group_id';
42: raise l_error;
43: end if;
44: hr_utility.set_location(l_proc, 7);
45: --
46: if p_rec.assignment_id <> per_pyp_shd.g_old_rec.assignment_id then
47: l_argument := 'assignment_id';
48: raise l_error;
46: if p_rec.assignment_id <> per_pyp_shd.g_old_rec.assignment_id then
47: l_argument := 'assignment_id';
48: raise l_error;
49: end if;
50: hr_utility.set_location(l_proc, 8);
51: --
52: if p_rec.pay_proposal_id <> per_pyp_shd.g_old_rec.pay_proposal_id then
53: l_argument := 'pay_proposal_id';
54: raise l_error;
52: if p_rec.pay_proposal_id <> per_pyp_shd.g_old_rec.pay_proposal_id then
53: l_argument := 'pay_proposal_id';
54: raise l_error;
55: end if;
56: hr_utility.set_location(l_proc, 9);
57: --
58: /* change_date can be updated provided that the proposal has not already
59: been approved.
60:
61: if p_rec.change_date <> per_pyp_shd.g_old_rec.change_date then
62: l_argument := 'change_date';
63: raise l_error;
64: end if;
65: hr_utility.set_location(l_proc, 10);*/
66: --
67: if p_rec.last_change_date <> per_pyp_shd.g_old_rec.last_change_date then
68: l_argument := 'last_change_date';
69: raise l_error;
67: if p_rec.last_change_date <> per_pyp_shd.g_old_rec.last_change_date then
68: l_argument := 'last_change_date';
69: raise l_error;
70: end if;
71: hr_utility.set_location(l_proc, 11);
72: exception
73: when l_error then
74: hr_api.argument_changed_error
75: (p_api_name => l_proc
75: (p_api_name => l_proc
76: ,p_argument => l_argument);
77: when others then
78: raise;
79: hr_utility.set_location(' Leaving:'||l_proc, 12);
80: end check_non_updateable_args;
81: --
82: /* procedure changed to incorporate changes for Bug#7386307 by schowdhu*/
83:
114: l_next_proposed_date date;
115: l_next_approved_date date;
116:
117: begin
118: hr_utility.set_location('Entering:'|| l_proc, 10);
119: if p_date_to is not null then
120:
121: OPEN csr_next_proposed_date;
122: fetch csr_next_proposed_date into l_next_proposed_date;
127: CLOSE csr_next_approved_date;
128:
129: if p_approved = 'N' and l_next_proposed_date is not null then
130: if p_date_to >= l_next_proposed_date then
131: hr_utility.set_message(800, 'PER_SAL_DATES_OVERLAP');
132: hr_utility.raise_error;
133: end if;
134: end if;
135: if p_approved = 'Y' and l_next_approved_date is not null then
128:
129: if p_approved = 'N' and l_next_proposed_date is not null then
130: if p_date_to >= l_next_proposed_date then
131: hr_utility.set_message(800, 'PER_SAL_DATES_OVERLAP');
132: hr_utility.raise_error;
133: end if;
134: end if;
135: if p_approved = 'Y' and l_next_approved_date is not null then
136: if p_date_to >= l_next_approved_date then
133: end if;
134: end if;
135: if p_approved = 'Y' and l_next_approved_date is not null then
136: if p_date_to >= l_next_approved_date then
137: hr_utility.set_message(800, 'PER_SAL_DATES_OVERLAP');
138: hr_utility.raise_error;
139:
140: end if;
141:
134: end if;
135: if p_approved = 'Y' and l_next_approved_date is not null then
136: if p_date_to >= l_next_approved_date then
137: hr_utility.set_message(800, 'PER_SAL_DATES_OVERLAP');
138: hr_utility.raise_error;
139:
140: end if;
141:
142:
146:
147: end if;
148:
149: --
150: hr_utility.set_location('Leaving :'|| l_proc, 90);
151: end validate_date_to;
152: --
153: procedure gen_last_change_date
154: (p_rec in out nocopy per_pyp_shd.g_rec_type) is
165: and pro.change_date
167: --
168: Begin
169: hr_utility.set_location('Entering:' || l_proc, 1);
170: --
171: -- set the last_change_date
172: --
173: open csr_last_change_date;
172: --
173: open csr_last_change_date;
174: fetch csr_last_change_date into l_last_change_date;
175: if csr_last_change_date%notfound then
176: hr_utility.set_location(l_proc, 2);
177: p_rec.last_change_date := null;
178: else
179: p_rec.last_change_date := l_last_change_date;
180: end if;
179: p_rec.last_change_date := l_last_change_date;
180: end if;
181: close csr_last_change_date;
182: --
183: hr_utility.set_location('Leaving: ' || l_proc, 3);
184: --
185: end gen_last_change_date;
186: --
187: --
347: l_proc varchar2(72) := g_package||'chk_pay_basis_change_date';
348: --
349: begin
350: --
351: hr_utility.set_location('Entering: ' || l_proc,1);
352: --
353: -- check that whether this is the first salary record or not
354: -- i.e. At least one approved salary exists.
355: --
356: open csr_first_proposal;
357: fetch csr_first_proposal into l_exists;
358: if csr_first_proposal%found then
359: close csr_first_proposal;
360: hr_utility.set_location(l_proc,5);
361: --
362: -- Now check whether there has been a pay_basis change in the assignment.
363: -- If there is no salary element going to the end of time this means
364: -- that the pay_basis has changed.
368: open csr_element_effective_end_date;
369: fetch csr_element_effective_end_date into l_effective_end_date;
370: if csr_element_effective_end_date%notfound then
371: close csr_element_effective_end_date;
372: hr_utility.set_location(l_proc,10);
373: hr_utility.set_message(801,'HR_51716_PYP_ELEMNT_ID_INVL');
374: hr_utility.raise_error;
375: else
376: close csr_element_effective_end_date;
369: fetch csr_element_effective_end_date into l_effective_end_date;
370: if csr_element_effective_end_date%notfound then
371: close csr_element_effective_end_date;
372: hr_utility.set_location(l_proc,10);
373: hr_utility.set_message(801,'HR_51716_PYP_ELEMNT_ID_INVL');
374: hr_utility.raise_error;
375: else
376: close csr_element_effective_end_date;
377: if l_effective_end_date = hr_general.end_of_time then
370: if csr_element_effective_end_date%notfound then
371: close csr_element_effective_end_date;
372: hr_utility.set_location(l_proc,10);
373: hr_utility.set_message(801,'HR_51716_PYP_ELEMNT_ID_INVL');
374: hr_utility.raise_error;
375: else
376: close csr_element_effective_end_date;
377: if l_effective_end_date = hr_general.end_of_time then
378: hr_utility.set_location(l_proc,15);
374: hr_utility.raise_error;
375: else
376: close csr_element_effective_end_date;
377: if l_effective_end_date = hr_general.end_of_time then
378: hr_utility.set_location(l_proc,15);
379: else
380: --
381: -- element has ended for some reason. Check
382: -- to see if the new proposal is the day after the element has ended
381: -- element has ended for some reason. Check
382: -- to see if the new proposal is the day after the element has ended
383: -- which is correct for a pay basis change
384: --
385: hr_utility.set_location(l_proc,20);
386: if (l_effective_end_date+1 <> p_change_date) then
387: --
388: -- new proposal is not 1 day after element end so check to see if
389: -- element ends on the day the assignment ends, so changes are OK.
387: --
388: -- new proposal is not 1 day after element end so check to see if
389: -- element ends on the day the assignment ends, so changes are OK.
390: --
391: hr_utility.set_location(l_proc,25);
392: open csr_asg_effective_end_date;
393: fetch csr_asg_effective_end_date into l_asg_effective_end_date;
394: close csr_asg_effective_end_date;
395: if (l_asg_effective_end_date <>l_effective_end_date) then
408: --
409: -- element does not end on the day that the assignment ends, but
410: -- could end on the final process date
411: --
412: hr_utility.set_location(l_proc,26);
413: --4073821
414: -- open csr_pds_final_process_date;
415: -- fetch csr_pds_final_process_date into l_pds_final_process_date;
416: -- close csr_pds_final_process_date;
415: -- fetch csr_pds_final_process_date into l_pds_final_process_date;
416: -- close csr_pds_final_process_date;
417: if (l_pds_final_process_date <> l_effective_end_date) or
418: (l_pds_final_process_date is null) then
419: hr_utility.set_location(l_proc,27);
420: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
421: hr_utility.raise_error;
422: end if;
423: ELSIF NVL(l_ele_term_rule,'F') = 'L' THEN
416: -- close csr_pds_final_process_date;
417: if (l_pds_final_process_date <> l_effective_end_date) or
418: (l_pds_final_process_date is null) then
419: hr_utility.set_location(l_proc,27);
420: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
421: hr_utility.raise_error;
422: end if;
423: ELSIF NVL(l_ele_term_rule,'F') = 'L' THEN
424: --
417: if (l_pds_final_process_date <> l_effective_end_date) or
418: (l_pds_final_process_date is null) then
419: hr_utility.set_location(l_proc,27);
420: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
421: hr_utility.raise_error;
422: end if;
423: ELSIF NVL(l_ele_term_rule,'F') = 'L' THEN
424: --
425: -- Element does not end on the day that the assignment ends, but
424: --
425: -- Element does not end on the day that the assignment ends, but
426: -- could end on the last standard process date
427: --
428: hr_utility.set_location(l_proc,26);
429: if (l_pds_last_std_proc_date <> l_effective_end_date) or
430: (l_pds_last_std_proc_date is null) then
431: hr_utility.set_location(l_proc,27);
432: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
427: --
428: hr_utility.set_location(l_proc,26);
429: if (l_pds_last_std_proc_date <> l_effective_end_date) or
430: (l_pds_last_std_proc_date is null) then
431: hr_utility.set_location(l_proc,27);
432: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
433: hr_utility.raise_error;
434: end if;
435: END IF; -- End of Termination Rule condition added for Bug 4073821
428: hr_utility.set_location(l_proc,26);
429: if (l_pds_last_std_proc_date <> l_effective_end_date) or
430: (l_pds_last_std_proc_date is null) then
431: hr_utility.set_location(l_proc,27);
432: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
433: hr_utility.raise_error;
434: end if;
435: END IF; -- End of Termination Rule condition added for Bug 4073821
436: end if;
429: if (l_pds_last_std_proc_date <> l_effective_end_date) or
430: (l_pds_last_std_proc_date is null) then
431: hr_utility.set_location(l_proc,27);
432: hr_utility.set_message(801,'HR_51717_PYP_CHG_DATE_INVL');
433: hr_utility.raise_error;
434: end if;
435: END IF; -- End of Termination Rule condition added for Bug 4073821
436: end if;
437: end if;
441: end if;
442: --
443: else
444: close csr_first_proposal;
445: hr_utility.set_location(l_proc,28);
446: end if;
447: --
448: -- Now do a further check to see whether there is future pay_basis changes
449: -- The following validation is removed by ggnanagu
456: --
457: -- raise an error if there future pay_basis change in the assignment.
458: --
459: close csr_asg_pay_bases;
460: hr_utility.set_location(l_proc,30);
461: hr_utility.set_message(801,'HR_51718_PYP_FUTU_PAY_BAS_CHG');
462: hr_utility.raise_error;
463: else
464: close csr_asg_pay_bases;
457: -- raise an error if there future pay_basis change in the assignment.
458: --
459: close csr_asg_pay_bases;
460: hr_utility.set_location(l_proc,30);
461: hr_utility.set_message(801,'HR_51718_PYP_FUTU_PAY_BAS_CHG');
462: hr_utility.raise_error;
463: else
464: close csr_asg_pay_bases;
465: hr_utility.set_location(l_proc,31);
458: --
459: close csr_asg_pay_bases;
460: hr_utility.set_location(l_proc,30);
461: hr_utility.set_message(801,'HR_51718_PYP_FUTU_PAY_BAS_CHG');
462: hr_utility.raise_error;
463: else
464: close csr_asg_pay_bases;
465: hr_utility.set_location(l_proc,31);
466: end if;
461: hr_utility.set_message(801,'HR_51718_PYP_FUTU_PAY_BAS_CHG');
462: hr_utility.raise_error;
463: else
464: close csr_asg_pay_bases;
465: hr_utility.set_location(l_proc,31);
466: end if;
467: */
468:
469: hr_utility.set_location('Leaving: ' ||l_proc,35);
465: hr_utility.set_location(l_proc,31);
466: end if;
467: */
468:
469: hr_utility.set_location('Leaving: ' ||l_proc,35);
470: --
471: end chk_pay_basis_change_date;
472: --
473: --
513: where asg.assignment_id = p_assignment_id
514: and p_change_date between asg.effective_start_date
515: and asg.effective_end_date;
516: begin
517: hr_utility.set_location('Entering:'|| l_proc, 10);
518: --
519: -- Always perform this validation on update and delete
520: -- even although the assignment_id value cannot be changed.
521: --
526: fnd_message.set_name('PER', 'PER_SAL_ASG_NOT_EXIST');
527: fnd_message.raise_error;
528: end if;
529: close csr_asg_sec;
530: hr_utility.set_location(' Leaving:'|| l_proc, 30);
531: end chk_access;
532: --
533: --
534: -------------------------------------------------------------------------------
656: and ptp.end_date(+)); --bug 2694178, 2801228
657: --
658: --
659: begin
660: hr_utility.set_location('Entering:'|| l_proc, 1);
661: --
662: -- Check mandatory parameters have been set
663: --
664: hr_api.mandatory_arg_error
696: -- if we are updating but it was already approved then error.
697: --
698: if ((l_api_updating and per_pyp_shd.g_old_rec.approved='Y') and
699: (nvl(g_validate_ss_change_pay,'N') = 'N'))then
700: hr_utility.set_message(800,'HR_51349_PYP_CNT_UPD_CHG_DATE');
701: hr_utility.raise_error;
702: else
703: hr_utility.set_location(l_proc, 2);
704: --
697: --
698: if ((l_api_updating and per_pyp_shd.g_old_rec.approved='Y') and
699: (nvl(g_validate_ss_change_pay,'N') = 'N'))then
700: hr_utility.set_message(800,'HR_51349_PYP_CNT_UPD_CHG_DATE');
701: hr_utility.raise_error;
702: else
703: hr_utility.set_location(l_proc, 2);
704: --
705: -- Check the assignment details as of change_date
699: (nvl(g_validate_ss_change_pay,'N') = 'N'))then
700: hr_utility.set_message(800,'HR_51349_PYP_CNT_UPD_CHG_DATE');
701: hr_utility.raise_error;
702: else
703: hr_utility.set_location(l_proc, 2);
704: --
705: -- Check the assignment details as of change_date
706: --
707: open csr_chk_assig_details;
707: open csr_chk_assig_details;
708: fetch csr_chk_assig_details into l_system_status, l_business_group_id,
709: l_assignment_type, l_payroll_status, l_pay_basis_id,l_payroll_id;
710: if csr_chk_assig_details%notfound then
711: hr_utility.set_location(l_proc, 5);
712: -- The assignment_id is incorrect
713: close csr_chk_assig_details;
714: /**
715: * Bug Fix: 3144666
717: **/
718: p_payroll_warning := true;
719: /*Change date does not fall within any payroll period.
720: Message changed for Bug 3077957 */
721: -- hr_utility.set_message(800,'PER_289483_CHG_DT_NO_PAY_PRD');
722: -- hr_utility.raise_error;
723: --
724: else close csr_chk_assig_details;
725: --
718: p_payroll_warning := true;
719: /*Change date does not fall within any payroll period.
720: Message changed for Bug 3077957 */
721: -- hr_utility.set_message(800,'PER_289483_CHG_DT_NO_PAY_PRD');
722: -- hr_utility.raise_error;
723: --
724: else close csr_chk_assig_details;
725: --
726: -- Check that the business group id is the same.
725: --
726: -- Check that the business group id is the same.
727: --
728: if l_business_group_id <> p_business_group_id then
729: hr_utility.set_location(l_proc, 10);
730: -- The business_group_id is incorrect
731: hr_utility.set_message(801,'HR_51255_PYP_INVLID_BUS_GROUP');
732: hr_utility.raise_error;
733: --
727: --
728: if l_business_group_id <> p_business_group_id then
729: hr_utility.set_location(l_proc, 10);
730: -- The business_group_id is incorrect
731: hr_utility.set_message(801,'HR_51255_PYP_INVLID_BUS_GROUP');
732: hr_utility.raise_error;
733: --
734: -- Check that the system_status is not 'TERM_ASSIGN'
735: --
728: if l_business_group_id <> p_business_group_id then
729: hr_utility.set_location(l_proc, 10);
730: -- The business_group_id is incorrect
731: hr_utility.set_message(801,'HR_51255_PYP_INVLID_BUS_GROUP');
732: hr_utility.raise_error;
733: --
734: -- Check that the system_status is not 'TERM_ASSIGN'
735: --
736: elsif l_system_status = 'TERM_ASSIGN' then
733: --
734: -- Check that the system_status is not 'TERM_ASSIGN'
735: --
736: elsif l_system_status = 'TERM_ASSIGN' then
737: hr_utility.set_location(l_proc, 15);
738: hr_utility.set_message(801,'HR_7340_SAL_ASS_TERMINATED');
739: hr_utility.raise_error;
740: --
741: -- Check that the payroll_status is not closed
734: -- Check that the system_status is not 'TERM_ASSIGN'
735: --
736: elsif l_system_status = 'TERM_ASSIGN' then
737: hr_utility.set_location(l_proc, 15);
738: hr_utility.set_message(801,'HR_7340_SAL_ASS_TERMINATED');
739: hr_utility.raise_error;
740: --
741: -- Check that the payroll_status is not closed
742: -- If the payroll is null then there is no need check payroll status
735: --
736: elsif l_system_status = 'TERM_ASSIGN' then
737: hr_utility.set_location(l_proc, 15);
738: hr_utility.set_message(801,'HR_7340_SAL_ASS_TERMINATED');
739: hr_utility.raise_error;
740: --
741: -- Check that the payroll_status is not closed
742: -- If the payroll is null then there is no need check payroll status
743: -- bug# 2801228
742: -- If the payroll is null then there is no need check payroll status
743: -- bug# 2801228
744: elsif (nvl(l_payroll_status,'C') <> 'O' and
745: l_payroll_id is not null) then
746: hr_utility.set_location(l_proc, 25);
747: /**
748: * Bug Fix: 3144666
749: * Description: To change the error to warning
750: **/
748: * Bug Fix: 3144666
749: * Description: To change the error to warning
750: **/
751: p_payroll_warning := true;
752: --hr_utility.set_message(800,'HR_SAL_PAYROLL_PERIOD_CLOSED');
753: --hr_utility.raise_error; -- Error will raised instead of warning.
754: -- bug# 2694178
755: --
756: -- Check that the assignment has a vaild pay_basis
749: * Description: To change the error to warning
750: **/
751: p_payroll_warning := true;
752: --hr_utility.set_message(800,'HR_SAL_PAYROLL_PERIOD_CLOSED');
753: --hr_utility.raise_error; -- Error will raised instead of warning.
754: -- bug# 2694178
755: --
756: -- Check that the assignment has a vaild pay_basis
757: --
755: --
756: -- Check that the assignment has a vaild pay_basis
757: --
758: elsif (l_pay_basis_id IS NULL) then
759: hr_utility.set_location(l_proc, 30);
760: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
761: hr_utility.raise_error;
762: elsif (l_api_updating = false) then
763: --
756: -- Check that the assignment has a vaild pay_basis
757: --
758: elsif (l_pay_basis_id IS NULL) then
759: hr_utility.set_location(l_proc, 30);
760: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
761: hr_utility.raise_error;
762: elsif (l_api_updating = false) then
763: --
764: -- check that the p_change_date is greater than the last proposal
757: --
758: elsif (l_pay_basis_id IS NULL) then
759: hr_utility.set_location(l_proc, 30);
760: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
761: hr_utility.raise_error;
762: elsif (l_api_updating = false) then
763: --
764: -- check that the p_change_date is greater than the last proposal
765: -- change_date.
770: /*
771: open csr_last_change_date;
772: fetch csr_last_change_date into l_change_date;
773: if csr_last_change_date%notfound then
774: hr_utility.set_location(l_proc, 35);
775: --
776: elsif
777: l_change_date > p_change_date then
778: hr_utility.set_location(l_proc, 40);
774: hr_utility.set_location(l_proc, 35);
775: --
776: elsif
777: l_change_date > p_change_date then
778: hr_utility.set_location(l_proc, 40);
779: close csr_last_change_date;
780: hr_utility.set_message(801,'HR_7293_SAL_FUTURE_APPS_EXIST');
781: hr_utility.raise_error;
782: --
776: elsif
777: l_change_date > p_change_date then
778: hr_utility.set_location(l_proc, 40);
779: close csr_last_change_date;
780: hr_utility.set_message(801,'HR_7293_SAL_FUTURE_APPS_EXIST');
781: hr_utility.raise_error;
782: --
783: end if;
784: close csr_last_change_date;
777: l_change_date > p_change_date then
778: hr_utility.set_location(l_proc, 40);
779: close csr_last_change_date;
780: hr_utility.set_message(801,'HR_7293_SAL_FUTURE_APPS_EXIST');
781: hr_utility.raise_error;
782: --
783: end if;
784: close csr_last_change_date;
785: */
790: /*
791: open csr_other_proposals_exist;
792: fetch csr_other_proposals_exist into l_exists;
793: if csr_other_proposals_exist%notfound then
794: hr_utility.set_location(l_proc, 45);
795: close csr_other_proposals_exist;
796: --
797: else
798: close csr_other_proposals_exist;
795: close csr_other_proposals_exist;
796: --
797: else
798: close csr_other_proposals_exist;
799: hr_utility.set_location(l_proc, 50);
800: hr_utility.set_message(801, 'HR_7294_SAL_ONLY_ONE_PROPOSAL');
801: hr_utility.raise_error;
802: end if;
803: */
796: --
797: else
798: close csr_other_proposals_exist;
799: hr_utility.set_location(l_proc, 50);
800: hr_utility.set_message(801, 'HR_7294_SAL_ONLY_ONE_PROPOSAL');
801: hr_utility.raise_error;
802: end if;
803: */
804:
797: else
798: close csr_other_proposals_exist;
799: hr_utility.set_location(l_proc, 50);
800: hr_utility.set_message(801, 'HR_7294_SAL_ONLY_ONE_PROPOSAL');
801: hr_utility.raise_error;
802: end if;
803: */
804:
805: --
807: --
808: open csr_dup_change_date;
809: fetch csr_dup_change_date into l_exists;
810: if csr_dup_change_date%notfound then
811: hr_utility.set_location(l_proc, 55);
812: close csr_dup_change_date;
813: else
814: hr_utility.set_location(l_proc, 60);
815: close csr_dup_change_date;
810: if csr_dup_change_date%notfound then
811: hr_utility.set_location(l_proc, 55);
812: close csr_dup_change_date;
813: else
814: hr_utility.set_location(l_proc, 60);
815: close csr_dup_change_date;
816: hr_utility.set_message(801,'HR_13000_SAL_DATE_NOT_UNIQUE');
817: hr_utility.raise_error;
818: end if;
812: close csr_dup_change_date;
813: else
814: hr_utility.set_location(l_proc, 60);
815: close csr_dup_change_date;
816: hr_utility.set_message(801,'HR_13000_SAL_DATE_NOT_UNIQUE');
817: hr_utility.raise_error;
818: end if;
819: --
820: -- This code was added at version 70.4 to fix bug 411671.
813: else
814: hr_utility.set_location(l_proc, 60);
815: close csr_dup_change_date;
816: hr_utility.set_message(801,'HR_13000_SAL_DATE_NOT_UNIQUE');
817: hr_utility.raise_error;
818: end if;
819: --
820: -- This code was added at version 70.4 to fix bug 411671.
821: -- this checks that the change_date of the salary proposal is valid if
829: -- Salary Basis change date
830: /*
831:
832: chk_pay_basis_change_date (p_assignment_id,p_change_date);
833: hr_utility.set_location(l_proc, 61);
834:
835: */
836: end if;
837: --
837: --
838: end if;
839: end if;
840: end if;
841: hr_utility.set_location('Leaving: ' || l_proc, 65);
842: end chk_assignment_id_change_date;
843: --
844: --
845: --
882: l_num_months number(15) := 0;
883: l_num_days number(15) := 0;
884: --
885: begin
886: hr_utility.set_location('Entering:'|| l_proc, 1);
887: --
888: -- Check if the frequency is year
889: --
890: if (p_frequency = 'Y')then
887: --
888: -- Check if the frequency is year
889: --
890: if (p_frequency = 'Y')then
891: hr_utility.set_location(l_proc, 2);
892: l_num_months := 12 * p_period;
893: elsif
894: (p_frequency = 'M') then
895: hr_utility.set_location(l_proc, 3);
891: hr_utility.set_location(l_proc, 2);
892: l_num_months := 12 * p_period;
893: elsif
894: (p_frequency = 'M') then
895: hr_utility.set_location(l_proc, 3);
896: l_num_months := p_period;
897: --
898: elsif (p_frequency = 'W' ) then
899: hr_utility.set_location(l_proc, 4);
895: hr_utility.set_location(l_proc, 3);
896: l_num_months := p_period;
897: --
898: elsif (p_frequency = 'W' ) then
899: hr_utility.set_location(l_proc, 4);
900: l_num_days := 7 * p_period;
901: --
902: elsif
903: (p_frequency = 'D') then
900: l_num_days := 7 * p_period;
901: --
902: elsif
903: (p_frequency = 'D') then
904: hr_utility.set_location(l_proc, 5);
905: l_num_days := p_period;
906: --
907: else
908: hr_utility.set_location(l_proc, 6);
904: hr_utility.set_location(l_proc, 5);
905: l_num_days := p_period;
906: --
907: else
908: hr_utility.set_location(l_proc, 6);
909: hr_utility.set_message(801,'HR_51258_PYP_INVAL_FREQ_PERIOD');
910: hr_utility.raise_error;
911: end if;
912: --
905: l_num_days := p_period;
906: --
907: else
908: hr_utility.set_location(l_proc, 6);
909: hr_utility.set_message(801,'HR_51258_PYP_INVAL_FREQ_PERIOD');
910: hr_utility.raise_error;
911: end if;
912: --
913: -- Now return the derived date
906: --
907: else
908: hr_utility.set_location(l_proc, 6);
909: hr_utility.set_message(801,'HR_51258_PYP_INVAL_FREQ_PERIOD');
910: hr_utility.raise_error;
911: end if;
912: --
913: -- Now return the derived date
914: --
912: --
913: -- Now return the derived date
914: --
915: if (l_num_months <> 0) then
916: hr_utility.set_location(l_proc, 7);
917: l_derived_date := add_months(p_change_date,l_num_months);
918: --
919: elsif (l_num_days <> 0 ) then
920: hr_utility.set_location(l_proc, 8);
916: hr_utility.set_location(l_proc, 7);
917: l_derived_date := add_months(p_change_date,l_num_months);
918: --
919: elsif (l_num_days <> 0 ) then
920: hr_utility.set_location(l_proc, 8);
921: l_derived_date := p_change_date + l_num_days;
922: --
923: end if;
924: hr_utility.set_location('Leaving: ' ||l_proc, 9);
920: hr_utility.set_location(l_proc, 8);
921: l_derived_date := p_change_date + l_num_days;
922: --
923: end if;
924: hr_utility.set_location('Leaving: ' ||l_proc, 9);
925: --
926: return l_derived_date;
927: --
928: end derive_next_sal_perf_date;
1000: and nvl(assg.effective_end_date, hr_api.g_eot)
1001: and ast.per_system_status = 'TERM_ASSIGN';
1002: --
1003: begin
1004: hr_utility.set_location('Entering:'|| l_proc, 1);
1005: p_inv_next_sal_date_warning := false;
1006: --
1007: -- Check mandatory parameters have being set.
1008: --
1037: --
1038: -- If the next_sal_review is not null do the following checks
1039: --
1040: if (p_next_sal_review_date IS NOT NULL) then
1041: hr_utility.set_location(l_proc, 2);
1042: --
1043: -- Check that the next_sal_review date is not before the change_date
1044: --
1045: -- Bug 740286
1044: --
1045: -- Bug 740286
1046: -- if (p_change_date > p_next_sal_review_date) then
1047: --
1048: -- hr_utility.set_location(l_proc, 3);
1049: -- hr_utility.set_message(801, 'HR_13007_SAL_DATE_NEXT_DATE');
1050: -- hr_utility.raise_error;
1051: -- end if;
1052: --
1045: -- Bug 740286
1046: -- if (p_change_date > p_next_sal_review_date) then
1047: --
1048: -- hr_utility.set_location(l_proc, 3);
1049: -- hr_utility.set_message(801, 'HR_13007_SAL_DATE_NEXT_DATE');
1050: -- hr_utility.raise_error;
1051: -- end if;
1052: --
1053: -- check the assignment_status as the next_sal_review_date.
1046: -- if (p_change_date > p_next_sal_review_date) then
1047: --
1048: -- hr_utility.set_location(l_proc, 3);
1049: -- hr_utility.set_message(801, 'HR_13007_SAL_DATE_NEXT_DATE');
1050: -- hr_utility.raise_error;
1051: -- end if;
1052: --
1053: -- check the assignment_status as the next_sal_review_date.
1054: -- if the assignment status is TERM_ASSIGN then issue a warning
1061: end if;
1062: --
1063: close csr_valid_assg_status;
1064: --
1065: hr_utility.set_location('LEAVING ' ||l_proc, 4);
1066: end if;
1067: --
1068: end if;
1069: --
1066: end if;
1067: --
1068: end if;
1069: --
1070: hr_utility.set_location('Leaving: ' ||l_proc, 5);
1071: --
1072: end chk_next_sal_review_date;
1073: --
1074: --
1159: and nvl(assg.effective_end_date, hr_api.g_eot)
1160: and ast.per_system_status = 'TERM_ASSIGN';
1161: --
1162: begin
1163: hr_utility.set_location('Entering:'|| l_proc, 1);
1164: p_inv_next_sal_date_warning := false;
1165: --
1166: -- Check mandatory parameters have being set.
1167: --
1205: fetch csr_sal_review_details into l_sal_review_period,
1206: l_sal_review_period_frequency;
1207: if csr_sal_review_details%found then
1208: if (l_sal_review_period is not null) then
1209: hr_utility.set_location(l_proc, 6);
1210: p_next_sal_review_date :=
1211: derive_next_sal_perf_date
1212: (p_change_date => p_change_date
1213: ,p_period => l_sal_review_period
1216: open csr_valid_assg_status;
1217: fetch csr_valid_assg_status into l_exists;
1218: --
1219: if csr_valid_assg_status%found then
1220: hr_utility.set_location(l_proc, 7);
1221: p_inv_next_sal_date_warning := true;
1222: end if;
1223: --
1224: close csr_valid_assg_status;
1225: --
1226: end if;
1227: end if;
1228: close csr_sal_review_details;
1229: hr_utility.set_location(l_proc, 10);
1230: --
1231: end if;
1232: --
1233: end if;
1231: end if;
1232: --
1233: end if;
1234: --
1235: hr_utility.set_location('Leaving: ' ||l_proc, 11);
1236: end chk_chg_next_sal_review_date;
1237: --
1238: --
1239: -- ----------------------------------------------------------------------------
1292: and p_change_date between ass.effective_start_date
1293: AND ass.effective_end_date;
1294: --
1295: begin
1296: hr_utility.set_location('Entering:'|| l_proc, 1);
1297: --
1298: -- Check mandatory parameters have being set.
1299: --
1300: hr_api.mandatory_arg_error
1324: ,p_object_version_number => p_object_version_number);
1325: --
1326: if (l_api_updating AND(per_pyp_shd.g_old_rec.multiple_components <>
1327: p_multiple_components) OR not l_api_updating) then
1328: hr_utility.set_location(l_proc, 4);
1329: --
1330: -- check that the value of the multiple_components is either 'Y' or 'N'
1331: --
1332: if (p_multiple_components <> 'Y' AND p_multiple_components <> 'N') then
1329: --
1330: -- check that the value of the multiple_components is either 'Y' or 'N'
1331: --
1332: if (p_multiple_components <> 'Y' AND p_multiple_components <> 'N') then
1333: hr_utility.set_location(l_proc, 5);
1334: hr_utility.set_message (801, 'HR_51261_PYP_INVAL_MULTI_COMP');
1335: hr_utility.raise_error;
1336: end if;
1337: --
1330: -- check that the value of the multiple_components is either 'Y' or 'N'
1331: --
1332: if (p_multiple_components <> 'Y' AND p_multiple_components <> 'N') then
1333: hr_utility.set_location(l_proc, 5);
1334: hr_utility.set_message (801, 'HR_51261_PYP_INVAL_MULTI_COMP');
1335: hr_utility.raise_error;
1336: end if;
1337: --
1338: -- Check that the multiple_components is not set to 'Y' for the first
1331: --
1332: if (p_multiple_components <> 'Y' AND p_multiple_components <> 'N') then
1333: hr_utility.set_location(l_proc, 5);
1334: hr_utility.set_message (801, 'HR_51261_PYP_INVAL_MULTI_COMP');
1335: hr_utility.raise_error;
1336: end if;
1337: --
1338: -- Check that the multiple_components is not set to 'Y' for the first
1339: -- proposal
1343: /*
1344: open csr_is_first_proposal;
1345: fetch csr_is_first_proposal into l_exists;
1346: if csr_is_first_proposal%notfound then
1347: hr_utility.set_location(l_proc, 10);
1348: if (p_multiple_components = 'Y') then
1349: close csr_is_first_proposal;
1350: hr_utility.set_location(l_proc, 15);
1351: hr_utility.set_message (801, 'HR_51262_PYP_FIRST_SAL_COMP');
1346: if csr_is_first_proposal%notfound then
1347: hr_utility.set_location(l_proc, 10);
1348: if (p_multiple_components = 'Y') then
1349: close csr_is_first_proposal;
1350: hr_utility.set_location(l_proc, 15);
1351: hr_utility.set_message (801, 'HR_51262_PYP_FIRST_SAL_COMP');
1352: hr_utility.raise_error;
1353: end if;
1354: --
1347: hr_utility.set_location(l_proc, 10);
1348: if (p_multiple_components = 'Y') then
1349: close csr_is_first_proposal;
1350: hr_utility.set_location(l_proc, 15);
1351: hr_utility.set_message (801, 'HR_51262_PYP_FIRST_SAL_COMP');
1352: hr_utility.raise_error;
1353: end if;
1354: --
1355: end if;
1348: if (p_multiple_components = 'Y') then
1349: close csr_is_first_proposal;
1350: hr_utility.set_location(l_proc, 15);
1351: hr_utility.set_message (801, 'HR_51262_PYP_FIRST_SAL_COMP');
1352: hr_utility.raise_error;
1353: end if;
1354: --
1355: end if;
1356: --
1353: end if;
1354: --
1355: end if;
1356: --
1357: hr_utility.set_location(l_proc, 20);
1358: --
1359: close csr_is_first_proposal; */
1360:
1361: end if;
1358: --
1359: close csr_is_first_proposal; */
1360:
1361: end if;
1362: hr_utility.set_location('Leaving: '||l_proc, 25);
1363:
1364: end chk_multiple_components;
1365: --
1366: --
1404: l_api_updating boolean;
1405: --
1406:
1407: begin
1408: hr_utility.set_location('Entering:'|| l_proc, 1);
1409: --
1410: -- Check mandatory parameters have being set.
1411: --
1412: hr_api.mandatory_arg_error
1425: --
1426: if (l_api_updating AND (nvl(per_pyp_shd.g_old_rec.proposal_reason,hr_api.g_varchar2) <>
1427: nvl(p_proposal_reason,hr_api.g_varchar2))
1428: OR not l_api_updating ) then
1429: hr_utility.set_location(l_proc, 6);
1430: --
1431: -- check that the p_proposal_reason exists in hr_lookups.
1432: --
1433: if (p_proposal_reason IS NOT NULL ) then
1436: ,p_lookup_type => 'PROPOSAL_REASON'
1437: ,p_lookup_code => p_proposal_reason
1438: ) then
1439: -- Error: Invalid proposal_reason
1440: hr_utility.set_location(l_proc, 10);
1441: hr_utility.set_message(801,'HR_51265_INVAL_PRO_REASON');
1442: hr_utility.raise_error;
1443: end if;
1444: --
1437: ,p_lookup_code => p_proposal_reason
1438: ) then
1439: -- Error: Invalid proposal_reason
1440: hr_utility.set_location(l_proc, 10);
1441: hr_utility.set_message(801,'HR_51265_INVAL_PRO_REASON');
1442: hr_utility.raise_error;
1443: end if;
1444: --
1445: end if;
1438: ) then
1439: -- Error: Invalid proposal_reason
1440: hr_utility.set_location(l_proc, 10);
1441: hr_utility.set_message(801,'HR_51265_INVAL_PRO_REASON');
1442: hr_utility.raise_error;
1443: end if;
1444: --
1445: end if;
1446: end if;
1444: --
1445: end if;
1446: end if;
1447: --
1448: hr_utility.set_location(' Leaving:'|| l_proc, 15);
1449: end chk_proposal_reason;
1450: --
1451: -- ----------------------------------------------------------------------------
1452: -- |---------------------< is_salary_in_range >--------------------------------|
1508: and p_change_date between effective_start_date and effective_end_date;
1509: --
1510: --
1511: begin
1512: hr_utility.set_location('Entering:'|| l_proc, 10);
1513: open csr_asg;
1514: fetch csr_asg into
1515: l_organization_id
1516: ,l_pay_basis_id
1519: ,l_normal_hours
1520: ,l_frequency;
1521: close csr_asg;
1522: --
1523: hr_utility.set_location(l_proc, 20);
1524: is_salary_in_range_int
1525: (p_organization_id =>l_organization_id
1526: ,p_pay_basis_id =>l_pay_basis_id
1527: ,p_position_id =>l_position_id
1535: ,p_prop_salary_ele_warning =>l_prop_salary_ele_warning
1536: ,p_prop_salary_grade_warning =>l_prop_salary_grade_warning
1537: );
1538: --
1539: hr_utility.set_location(l_proc, 30);
1540: --
1541: p_proposed_salary_warning :=l_prop_salary_link_warning
1542: OR l_prop_salary_ele_warning
1543: OR l_prop_salary_grade_warning;
1540: --
1541: p_proposed_salary_warning :=l_prop_salary_link_warning
1542: OR l_prop_salary_ele_warning
1543: OR l_prop_salary_grade_warning;
1544: hr_utility.set_location('Leaving:'|| l_proc, 10);
1545: end is_salary_in_range;
1546:
1547: --
1548: -- ----------------------------------------------------------------------------
1730: --
1731: --
1732: --
1733: begin
1734: hr_utility.set_location('Entering:'|| l_proc, 1);
1735: -- Get the pay_basis details for validating
1736: -- the proposed salary.
1737: open currency;
1738: fetch currency into
1745: ,l_uom;
1746:
1747: if currency%notfound is null then
1748: close currency;
1749: hr_utility.set_location(l_proc, 5);
1750: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1751: hr_utility.raise_error;
1752: --
1753: elsif (l_element_type_id IS NULL) then
1746:
1747: if currency%notfound is null then
1748: close currency;
1749: hr_utility.set_location(l_proc, 5);
1750: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1751: hr_utility.raise_error;
1752: --
1753: elsif (l_element_type_id IS NULL) then
1754: --
1747: if currency%notfound is null then
1748: close currency;
1749: hr_utility.set_location(l_proc, 5);
1750: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1751: hr_utility.raise_error;
1752: --
1753: elsif (l_element_type_id IS NULL) then
1754: --
1755: -- issue an error message if the l_element_type_id is null
1754: --
1755: -- issue an error message if the l_element_type_id is null
1756: --
1757: close currency;
1758: hr_utility.set_location(l_proc, 6);
1759: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1760: hr_utility.raise_error;
1761: else
1762: close currency;
1755: -- issue an error message if the l_element_type_id is null
1756: --
1757: close currency;
1758: hr_utility.set_location(l_proc, 6);
1759: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1760: hr_utility.raise_error;
1761: else
1762: close currency;
1763: end if;
1756: --
1757: close currency;
1758: hr_utility.set_location(l_proc, 6);
1759: hr_utility.set_message(801, 'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1760: hr_utility.raise_error;
1761: else
1762: close currency;
1763: end if;
1764: --
1763: end if;
1764: --
1765: -- Now check the proporsed salary to be in appropriate range
1766: --
1767: hr_utility.set_location(l_proc, 7);
1768: open csr_get_min_max_values;
1769: fetch csr_get_min_max_values into
1770: l_normal_hours,
1771: l_normal_hours_frequency,
1773: l_org_working_hours_frequency,
1774: l_bus_working_hours,
1775: l_bus_working_hours_frequency,
1776: l_minimum,l_maximum;
1777: hr_utility.set_location(l_proc, 10);
1778: if csr_get_min_max_values%notfound then
1779: hr_utility.set_location(l_proc, 11);
1780: close csr_get_min_max_values;
1781: else
1775: l_bus_working_hours_frequency,
1776: l_minimum,l_maximum;
1777: hr_utility.set_location(l_proc, 10);
1778: if csr_get_min_max_values%notfound then
1779: hr_utility.set_location(l_proc, 11);
1780: close csr_get_min_max_values;
1781: else
1782: open csr_get_pos_min_max_values;
1783: fetch csr_get_pos_min_max_values into
1789: fetch csr_get_ele_values into l_ele_w_or_e, l_ele_min_value,
1790: l_ele_max_value, l_link_w_or_e, l_link_min_value,
1791: l_link_max_value;
1792: if csr_get_ele_values%notfound then
1793: hr_utility.set_location(l_proc, 12);
1794: end if;
1795: close csr_get_ele_values;
1796: --
1797: hr_utility.set_location(l_proc, 15);
1793: hr_utility.set_location(l_proc, 12);
1794: end if;
1795: close csr_get_ele_values;
1796: --
1797: hr_utility.set_location(l_proc, 15);
1798: --
1799: if l_pyp_working_hours is null then
1800: if l_org_working_hours is null then
1801: l_working_hours := l_bus_working_hours;
1799: if l_pyp_working_hours is null then
1800: if l_org_working_hours is null then
1801: l_working_hours := l_bus_working_hours;
1802: l_working_hours_frequency := l_bus_working_hours_frequency;
1803: hr_utility.set_location(l_proc, 17);
1804: else
1805: l_working_hours := l_org_working_hours;
1806: l_working_hours_frequency := l_org_working_hours_frequency;
1807: hr_utility.set_location(l_proc, 18);
1803: hr_utility.set_location(l_proc, 17);
1804: else
1805: l_working_hours := l_org_working_hours;
1806: l_working_hours_frequency := l_org_working_hours_frequency;
1807: hr_utility.set_location(l_proc, 18);
1808: end if;
1809: else
1810: l_working_hours := l_pyp_working_hours;
1811: l_working_hours_frequency := l_pyp_working_hours_frequency;
1808: end if;
1809: else
1810: l_working_hours := l_pyp_working_hours;
1811: l_working_hours_frequency := l_pyp_working_hours_frequency;
1812: hr_utility.set_location(l_proc, 19);
1813: end if;
1814: --
1815:
1816: --
1818: --
1819: if((p_proposed_salary_n < NVL(l_link_min_value,p_proposed_salary_n-1))
1820: or(p_proposed_salary_n > NVL(l_link_max_value,p_proposed_salary_n+1)))
1821: then
1822: hr_utility.set_location(l_proc, 20);
1823: p_prop_salary_link_warning := true;
1824: end if;
1825: --
1826: -- check ele min/max
1827: --
1828: if((p_proposed_salary_n < NVL(l_ele_min_value,p_proposed_salary_n-1))
1829: or (p_proposed_salary_n > NVL(l_ele_max_value,p_proposed_salary_n+1)))
1830: then
1831: hr_utility.set_location(l_proc, 30);
1832: p_prop_salary_ele_warning := true;
1833: end if;
1834: --
1835: -- Now check if the assignment has a grade then the proposed
1838: if (l_minimum IS NOT NULL and l_maximum IS NOT NULL) then
1839: --
1840: -- checks grade rates and pro rates if necessary
1841: --
1842: hr_utility.set_location(l_proc, 40);
1843: if (l_working_hours = 0) then
1844: -- if working hours are set to zero then ignore it.
1845: hr_utility.set_location(l_proc, 45);
1846: l_adj_factor:=1;
1841: --
1842: hr_utility.set_location(l_proc, 40);
1843: if (l_working_hours = 0) then
1844: -- if working hours are set to zero then ignore it.
1845: hr_utility.set_location(l_proc, 45);
1846: l_adj_factor:=1;
1847: elsif
1848: (l_working_hours IS NOT NULL)
1849: AND (l_normal_hours IS NOT NULL)
1851: AND (l_grade_basis = 'HOURLY'))
1852: AND (l_normal_hours_frequency=l_working_hours_frequency) then
1853: -- if both assignment hours and normal hours are defined then do a comparison
1854: --
1855: hr_utility.set_location(l_proc, 50);
1856: l_adj_factor := l_normal_hours/l_working_hours;
1857: --
1858: else
1859: -- otherwise ignore again.
1856: l_adj_factor := l_normal_hours/l_working_hours;
1857: --
1858: else
1859: -- otherwise ignore again.
1860: hr_utility.set_location(l_proc, 55);
1861: l_adj_factor:=1;
1862: end if;
1863: l_annual_salary:=p_proposed_salary_n
1864: *nvl(l_pay_annualization_factor,1);
1869: *nvl(l_grade_annualization_factor,1);
1870: --
1871: if( (l_annual_salary < l_adj_minimum) or
1872: (l_annual_salary > l_adj_maximum) ) then
1873: hr_utility.set_location(l_proc, 60);
1874: p_prop_salary_grade_warning := true;
1875: end if;
1876: end if;
1877: --
1878: end if;
1879: if csr_get_min_max_values%ISOPEN then
1880: close csr_get_min_max_values;
1881: end if;
1882: hr_utility.set_location('Leaving: ' ||l_proc, 65);
1883: end is_salary_in_range_int;
1884: --
1885: ----------------------------------------------------------------------------
1886: -- |--------------------------< chk_proposed_salary >-----------------------
1948: l_proposed_salary_warning boolean;
1949:
1950: --
1951: begin
1952: hr_utility.set_location('Entering:'|| l_proc, 1);
1953: --
1954: -- Check mandatory parameters have being set.
1955: --
1956: hr_api.mandatory_arg_error
1997: -- Change made by ggnanagu
1998: --
1999:
2000: /* if (l_api_updating)AND(per_pyp_shd.g_old_rec.approved = 'Y' ) then
2001: hr_utility.set_location(l_proc||' proposed = '||to_char(p_proposed_salary_n)||' old = '||to_char(per_pyp_shd.g_old_rec.proposed_salary_n), 2);
2002: hr_utility.set_message(801,'HR_51268_PYP_CANT_UPD_RECORD');
2003: hr_utility.raise_error;
2004: end if; */
2005:
1998: --
1999:
2000: /* if (l_api_updating)AND(per_pyp_shd.g_old_rec.approved = 'Y' ) then
2001: hr_utility.set_location(l_proc||' proposed = '||to_char(p_proposed_salary_n)||' old = '||to_char(per_pyp_shd.g_old_rec.proposed_salary_n), 2);
2002: hr_utility.set_message(801,'HR_51268_PYP_CANT_UPD_RECORD');
2003: hr_utility.raise_error;
2004: end if; */
2005:
2006: is_salary_in_range
1999:
2000: /* if (l_api_updating)AND(per_pyp_shd.g_old_rec.approved = 'Y' ) then
2001: hr_utility.set_location(l_proc||' proposed = '||to_char(p_proposed_salary_n)||' old = '||to_char(per_pyp_shd.g_old_rec.proposed_salary_n), 2);
2002: hr_utility.set_message(801,'HR_51268_PYP_CANT_UPD_RECORD');
2003: hr_utility.raise_error;
2004: end if; */
2005:
2006: is_salary_in_range
2007: (p_assignment_id => p_assignment_id
2011: ,p_proposed_salary_warning => l_proposed_salary_warning);
2012: p_proposed_salary_warning := l_proposed_salary_warning;
2013: end if;
2014: end if;
2015: hr_utility.set_location('Leaving: ' ||l_proc, 3);
2016: end chk_proposed_salary;
2017: --
2018: --
2019: ------------------------------------------------------------------------
2119: and change_date > p_change_date;
2120: --
2121: --
2122: begin
2123: hr_utility.set_location('Entering:'|| l_proc, 5);
2124: --
2125: -- Check mandatory parameters have being set.
2126: --
2127: --
2168: --
2169: -- check that the value of the approved is either 'Y' or 'N'
2170: --
2171: if (p_approved <> 'Y' AND p_approved <> 'N') then
2172: hr_utility.set_location(l_proc, 10);
2173: hr_utility.set_message (801, 'HR_51278_PYP_INVL_APPR_VAL');
2174: hr_utility.raise_error;
2175: end if;
2176: --
2169: -- check that the value of the approved is either 'Y' or 'N'
2170: --
2171: if (p_approved <> 'Y' AND p_approved <> 'N') then
2172: hr_utility.set_location(l_proc, 10);
2173: hr_utility.set_message (801, 'HR_51278_PYP_INVL_APPR_VAL');
2174: hr_utility.raise_error;
2175: end if;
2176: --
2177: --
2170: --
2171: if (p_approved <> 'Y' AND p_approved <> 'N') then
2172: hr_utility.set_location(l_proc, 10);
2173: hr_utility.set_message (801, 'HR_51278_PYP_INVL_APPR_VAL');
2174: hr_utility.raise_error;
2175: end if;
2176: --
2177: --
2178: -- Check that the approved flag cannot be set to 'Y' if the
2179: -- proposed salary is null.
2180: --
2181: if
2182: (p_proposed_salary_n IS NULL AND p_approved = 'Y') then
2183: hr_utility.set_location(l_proc, 20);
2184: hr_utility.set_message(801,'HR_51269_PYP_CANT_APPR_SAL');
2185: hr_utility.raise_error;
2186: end if;
2187:
2180: --
2181: if
2182: (p_proposed_salary_n IS NULL AND p_approved = 'Y') then
2183: hr_utility.set_location(l_proc, 20);
2184: hr_utility.set_message(801,'HR_51269_PYP_CANT_APPR_SAL');
2185: hr_utility.raise_error;
2186: end if;
2187:
2188: -- Validation Added by ggnanagu
2181: if
2182: (p_proposed_salary_n IS NULL AND p_approved = 'Y') then
2183: hr_utility.set_location(l_proc, 20);
2184: hr_utility.set_message(801,'HR_51269_PYP_CANT_APPR_SAL');
2185: hr_utility.raise_error;
2186: end if;
2187:
2188: -- Validation Added by ggnanagu
2189: -- If there are approved proposals in the future then this proposal
2193: if (p_approved = 'N' and NVL(BEN_CWB_POST_PROCESS.g_is_cwb_component_plan,'N') = 'N') THEN
2194: open csr_future_approved_proposals;
2195: fetch csr_future_approved_proposals into l_exists;
2196: if csr_future_approved_proposals%notfound then
2197: hr_utility.set_location(l_proc, 55);
2198: close csr_future_approved_proposals;
2199: else
2200: hr_utility.set_location(l_proc, 60);
2201: close csr_future_approved_proposals;
2196: if csr_future_approved_proposals%notfound then
2197: hr_utility.set_location(l_proc, 55);
2198: close csr_future_approved_proposals;
2199: else
2200: hr_utility.set_location(l_proc, 60);
2201: close csr_future_approved_proposals;
2202: hr_utility.set_message(801,'HR_FUTURE_APPROVED_PROPOSALS');
2203: hr_utility.raise_error;
2204: end if;
2198: close csr_future_approved_proposals;
2199: else
2200: hr_utility.set_location(l_proc, 60);
2201: close csr_future_approved_proposals;
2202: hr_utility.set_message(801,'HR_FUTURE_APPROVED_PROPOSALS');
2203: hr_utility.raise_error;
2204: end if;
2205: end if;
2206: --
2199: else
2200: hr_utility.set_location(l_proc, 60);
2201: close csr_future_approved_proposals;
2202: hr_utility.set_message(801,'HR_FUTURE_APPROVED_PROPOSALS');
2203: hr_utility.raise_error;
2204: end if;
2205: end if;
2206: --
2207: -- Check that the approve flag is correct for the first proposal.
2209: if ( p_proposed_salary_n IS NOT NULL) then
2210: open csr_is_first_proposal;
2211: fetch csr_is_first_proposal into l_exists;
2212: if csr_is_first_proposal%notfound then
2213: hr_utility.set_location(l_proc, 30);
2214: close csr_is_first_proposal;
2215: open asg_type;
2216: fetch asg_type into l_assignment_type;
2217: if (asg_type%notfound) then
2215: open asg_type;
2216: fetch asg_type into l_assignment_type;
2217: if (asg_type%notfound) then
2218: close asg_type;
2219: hr_utility.set_location(l_proc, 40);
2220: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
2221: hr_utility.raise_error;
2222: else
2223: hr_utility.set_location(l_proc, 50);
2216: fetch asg_type into l_assignment_type;
2217: if (asg_type%notfound) then
2218: close asg_type;
2219: hr_utility.set_location(l_proc, 40);
2220: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
2221: hr_utility.raise_error;
2222: else
2223: hr_utility.set_location(l_proc, 50);
2224: close asg_type;
2217: if (asg_type%notfound) then
2218: close asg_type;
2219: hr_utility.set_location(l_proc, 40);
2220: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
2221: hr_utility.raise_error;
2222: else
2223: hr_utility.set_location(l_proc, 50);
2224: close asg_type;
2225: if (l_assignment_type='E' or l_assignment_type='C') then -- a workers 1st proposal must be approved
2219: hr_utility.set_location(l_proc, 40);
2220: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
2221: hr_utility.raise_error;
2222: else
2223: hr_utility.set_location(l_proc, 50);
2224: close asg_type;
2225: if (l_assignment_type='E' or l_assignment_type='C') then -- a workers 1st proposal must be approved
2226: hr_utility.set_location(l_proc, 55);
2227: if p_approved = 'N' then
2222: else
2223: hr_utility.set_location(l_proc, 50);
2224: close asg_type;
2225: if (l_assignment_type='E' or l_assignment_type='C') then -- a workers 1st proposal must be approved
2226: hr_utility.set_location(l_proc, 55);
2227: if p_approved = 'N' then
2228: --vkodedal 05-Oct-2007 ER to satisfy satutory requirement
2229: --Retain auto approve first proposal functionality if profile is null or set to Yes
2230: l_autoApprove:=fnd_profile.value('HR_AUTO_APPROVE_FIRST_PROPOSAL');
2228: --vkodedal 05-Oct-2007 ER to satisfy satutory requirement
2229: --Retain auto approve first proposal functionality if profile is null or set to Yes
2230: l_autoApprove:=fnd_profile.value('HR_AUTO_APPROVE_FIRST_PROPOSAL');
2231: if(l_autoApprove is null or l_autoApprove ='Y') then
2232: hr_utility.set_location(l_proc, 60);
2233: hr_utility.set_message (800,'HR_52513_PYP_FIRST_EMP_NOT_APR');
2234: hr_utility.raise_error;
2235: end if;
2236: end if;
2229: --Retain auto approve first proposal functionality if profile is null or set to Yes
2230: l_autoApprove:=fnd_profile.value('HR_AUTO_APPROVE_FIRST_PROPOSAL');
2231: if(l_autoApprove is null or l_autoApprove ='Y') then
2232: hr_utility.set_location(l_proc, 60);
2233: hr_utility.set_message (800,'HR_52513_PYP_FIRST_EMP_NOT_APR');
2234: hr_utility.raise_error;
2235: end if;
2236: end if;
2237: else
2230: l_autoApprove:=fnd_profile.value('HR_AUTO_APPROVE_FIRST_PROPOSAL');
2231: if(l_autoApprove is null or l_autoApprove ='Y') then
2232: hr_utility.set_location(l_proc, 60);
2233: hr_utility.set_message (800,'HR_52513_PYP_FIRST_EMP_NOT_APR');
2234: hr_utility.raise_error;
2235: end if;
2236: end if;
2237: else
2238: if p_approved = 'Y' then -- an applicants first proposal must be unapproved
2235: end if;
2236: end if;
2237: else
2238: if p_approved = 'Y' then -- an applicants first proposal must be unapproved
2239: hr_utility.set_location(l_proc, 70);
2240: hr_utility.set_message (800,'HR_52514_PYP_FIRST_APPL_APR');
2241: hr_utility.raise_error;
2242: end if;
2243: end if;
2236: end if;
2237: else
2238: if p_approved = 'Y' then -- an applicants first proposal must be unapproved
2239: hr_utility.set_location(l_proc, 70);
2240: hr_utility.set_message (800,'HR_52514_PYP_FIRST_APPL_APR');
2241: hr_utility.raise_error;
2242: end if;
2243: end if;
2244: end if;
2237: else
2238: if p_approved = 'Y' then -- an applicants first proposal must be unapproved
2239: hr_utility.set_location(l_proc, 70);
2240: hr_utility.set_message (800,'HR_52514_PYP_FIRST_APPL_APR');
2241: hr_utility.raise_error;
2242: end if;
2243: end if;
2244: end if;
2245: else
2244: end if;
2245: else
2246: close csr_is_first_proposal;
2247: end if;
2248: hr_utility.set_location(l_proc, 80);
2249: end if;
2250: --
2251: -- Check that if the approved set to 'Y' and one or more
2252: -- unapproved components exists.
2252: -- unapproved components exists.
2253: --
2254: open csr_unapproved_components;
2255: fetch csr_unapproved_components into l_exists;
2256: hr_utility.set_location(l_proc,90);
2257: if csr_unapproved_components%found then
2258: hr_utility.set_location(l_proc,100);
2259: p_approved_warning := true;
2260: end if;
2254: open csr_unapproved_components;
2255: fetch csr_unapproved_components into l_exists;
2256: hr_utility.set_location(l_proc,90);
2257: if csr_unapproved_components%found then
2258: hr_utility.set_location(l_proc,100);
2259: p_approved_warning := true;
2260: end if;
2261: close csr_unapproved_components;
2262: --
2262: --
2263: -- Check that an approved proposal cannot be unapproved.
2264: --
2265: if (l_api_updating AND per_pyp_shd.g_old_rec.approved = 'Y' AND p_approved = 'N') then
2266: hr_utility.set_location(l_proc,110);
2267: hr_utility.set_message(801,'HR_51270_PYP_CANT_UNAPPRO_PRO');
2268: hr_utility.raise_error;
2269: end if;
2270: hr_utility.set_location(l_proc,120);
2263: -- Check that an approved proposal cannot be unapproved.
2264: --
2265: if (l_api_updating AND per_pyp_shd.g_old_rec.approved = 'Y' AND p_approved = 'N') then
2266: hr_utility.set_location(l_proc,110);
2267: hr_utility.set_message(801,'HR_51270_PYP_CANT_UNAPPRO_PRO');
2268: hr_utility.raise_error;
2269: end if;
2270: hr_utility.set_location(l_proc,120);
2271: -- end if;
2264: --
2265: if (l_api_updating AND per_pyp_shd.g_old_rec.approved = 'Y' AND p_approved = 'N') then
2266: hr_utility.set_location(l_proc,110);
2267: hr_utility.set_message(801,'HR_51270_PYP_CANT_UNAPPRO_PRO');
2268: hr_utility.raise_error;
2269: end if;
2270: hr_utility.set_location(l_proc,120);
2271: -- end if;
2272: --
2266: hr_utility.set_location(l_proc,110);
2267: hr_utility.set_message(801,'HR_51270_PYP_CANT_UNAPPRO_PRO');
2268: hr_utility.raise_error;
2269: end if;
2270: hr_utility.set_location(l_proc,120);
2271: -- end if;
2272: --
2273: hr_utility.set_location('Leaving: '||l_proc,130);
2274: --
2269: end if;
2270: hr_utility.set_location(l_proc,120);
2271: -- end if;
2272: --
2273: hr_utility.set_location('Leaving: '||l_proc,130);
2274: --
2275: end chk_approved;
2276: --
2277: --
2367: where pay_proposal_id = p_pay_proposal_id;
2368:
2369: --
2370: begin
2371: hr_utility.set_location('Entering:'|| l_proc, 1);
2372: -- get the proposal details first.
2373: --
2374: open csr_get_pro_detail;
2375: fetch csr_get_pro_detail into l_assignment_id,l_business_group_id,
2375: fetch csr_get_pro_detail into l_assignment_id,l_business_group_id,
2376: l_change_date,l_multiple_components, l_approved;
2377: if csr_get_pro_detail%notfound then
2378: close csr_get_pro_detail;
2379: hr_utility.set_location(l_proc, 2);
2380: per_pyp_shd.constraint_error('PER_PAY_PROPOSALS_PK');
2381: end if;
2382: close csr_get_pro_detail;
2383: --
2420: open csr_component_exists;
2421: fetch csr_component_exists into l_exists;
2422: if csr_component_exists%found then
2423: close csr_component_exists;
2424: hr_utility.set_location (l_proc,2);
2425: hr_utility.set_message(801, 'HR_51326_PYP_CANT_DEL_MULT_PRO');
2426: hr_utility.raise_error;
2427: end if;
2428: close csr_component_exists;
2421: fetch csr_component_exists into l_exists;
2422: if csr_component_exists%found then
2423: close csr_component_exists;
2424: hr_utility.set_location (l_proc,2);
2425: hr_utility.set_message(801, 'HR_51326_PYP_CANT_DEL_MULT_PRO');
2426: hr_utility.raise_error;
2427: end if;
2428: close csr_component_exists;
2429: end if;
2422: if csr_component_exists%found then
2423: close csr_component_exists;
2424: hr_utility.set_location (l_proc,2);
2425: hr_utility.set_message(801, 'HR_51326_PYP_CANT_DEL_MULT_PRO');
2426: hr_utility.raise_error;
2427: end if;
2428: close csr_component_exists;
2429: end if;
2430: --
2433: --
2434: open csr_is_latest_proposal;
2435: fetch csr_is_latest_proposal into l_last_change_date;
2436: if csr_is_latest_proposal%notfound then
2437: hr_utility.set_location(l_proc,5);
2438: close csr_is_latest_proposal;
2439: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2440: hr_utility.raise_error;
2441: --
2435: fetch csr_is_latest_proposal into l_last_change_date;
2436: if csr_is_latest_proposal%notfound then
2437: hr_utility.set_location(l_proc,5);
2438: close csr_is_latest_proposal;
2439: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2440: hr_utility.raise_error;
2441: --
2442: --
2443: -- The following code is commented out by ggnanagu
2436: if csr_is_latest_proposal%notfound then
2437: hr_utility.set_location(l_proc,5);
2438: close csr_is_latest_proposal;
2439: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
2440: hr_utility.raise_error;
2441: --
2442: --
2443: -- The following code is commented out by ggnanagu
2444: -- Now its possible to delete any salary proposal
2446: /* elsif (l_change_date < l_last_change_date) then
2447: --
2448: -- raise an error. You can only delete the latest proposal
2449: --
2450: hr_utility.set_location(l_proc,10);
2451: close csr_is_latest_proposal;
2452: hr_utility.set_message(801, 'HR_7292_SAL_NOT_LATEST_SAL_REC');
2453: hr_utility.raise_error;*/
2454: --
2448: -- raise an error. You can only delete the latest proposal
2449: --
2450: hr_utility.set_location(l_proc,10);
2451: close csr_is_latest_proposal;
2452: hr_utility.set_message(801, 'HR_7292_SAL_NOT_LATEST_SAL_REC');
2453: hr_utility.raise_error;*/
2454: --
2455: elsif l_approved = 'Y' then
2456: --
2449: --
2450: hr_utility.set_location(l_proc,10);
2451: close csr_is_latest_proposal;
2452: hr_utility.set_message(801, 'HR_7292_SAL_NOT_LATEST_SAL_REC');
2453: hr_utility.raise_error;*/
2454: --
2455: elsif l_approved = 'Y' then
2456: --
2457: -- Only do the salary range validation check, if we are
2462: if (csr_get_latest_salary%notfound) then
2463: --
2464: -- This means that there is no other proposals
2465: --
2466: hr_utility.set_location(l_proc, 20);
2467: close csr_get_latest_salary;
2468: --
2469: --
2470: else
2477: ,p_change_date => l_change_date
2478: ,p_proposed_salary_n => l_proposed_salary
2479: ,p_proposed_salary_warning => p_salary_warning);
2480: --
2481: hr_utility.set_location(l_proc, 40);
2482: --
2483: end if;
2484: --
2485: /**** This check should be done at BP level ***/
2489: --
2490: open csr_unapproved_components;
2491: fetch csr_unapproved_components into l_exists;
2492: if csr_unapproved_components%notfound then
2493: hr_utility.set_location(l_proc, 45);
2494: --
2495: -- There is no unapproved components
2496: --
2497: p_components_warning := false;
2495: -- There is no unapproved components
2496: --
2497: p_components_warning := false;
2498: else
2499: hr_utility.set_location(l_proc, 50);
2500: p_components_warning := true;
2501: end if;
2502: close csr_unapproved_components;
2503: ***/
2504: end if;
2505: if csr_is_latest_proposal%ISOPEN then
2506: close csr_is_latest_proposal;
2507: end if;
2508: hr_utility.set_location('Leaving: ' ||l_proc, 55);
2509: end chk_del_pay_proposal;
2510:
2511: -- -----------------------------------------------------------------------
2512: -- |---------------------< chk_date_overlapping >--------------------------|
2536: --
2537: l_proc varchar2(72):= g_package||'chk_date_overlapping';
2538: --
2539: begin
2540: hr_utility.set_location('Entering:'|| l_proc, 5);
2541: --
2542: --
2543: if(p_change_date > p_date_to ) then
2544: hr_utility.set_location(l_proc, 10);
2540: hr_utility.set_location('Entering:'|| l_proc, 5);
2541: --
2542: --
2543: if(p_change_date > p_date_to ) then
2544: hr_utility.set_location(l_proc, 10);
2545: hr_utility.set_message(800,'PER_PROPOSAL_DATE_OVERLAP');
2546: hr_utility.raise_error;
2547: end if;
2548: hr_utility.set_location(' Leaving:'||l_proc, 20);
2541: --
2542: --
2543: if(p_change_date > p_date_to ) then
2544: hr_utility.set_location(l_proc, 10);
2545: hr_utility.set_message(800,'PER_PROPOSAL_DATE_OVERLAP');
2546: hr_utility.raise_error;
2547: end if;
2548: hr_utility.set_location(' Leaving:'||l_proc, 20);
2549: end chk_date_overlapping;
2542: --
2543: if(p_change_date > p_date_to ) then
2544: hr_utility.set_location(l_proc, 10);
2545: hr_utility.set_message(800,'PER_PROPOSAL_DATE_OVERLAP');
2546: hr_utility.raise_error;
2547: end if;
2548: hr_utility.set_location(' Leaving:'||l_proc, 20);
2549: end chk_date_overlapping;
2550: --
2544: hr_utility.set_location(l_proc, 10);
2545: hr_utility.set_message(800,'PER_PROPOSAL_DATE_OVERLAP');
2546: hr_utility.raise_error;
2547: end if;
2548: hr_utility.set_location(' Leaving:'||l_proc, 20);
2549: end chk_date_overlapping;
2550: --
2551: --
2552: --
2577: --
2578: l_proc varchar2(72):= g_package||'chk_forced_ranking';
2579: --
2580: begin
2581: hr_utility.set_location('Entering:'|| l_proc, 5);
2582: --
2583: --
2584: if(p_forced_ranking <= 0) then
2585: hr_utility.set_location(l_proc, 10);
2581: hr_utility.set_location('Entering:'|| l_proc, 5);
2582: --
2583: --
2584: if(p_forced_ranking <= 0) then
2585: hr_utility.set_location(l_proc, 10);
2586: hr_utility.set_message(800,'HR_52400_PYP_INVALID_RANKING');
2587: hr_utility.raise_error;
2588: end if;
2589: hr_utility.set_location(' Leaving:'||l_proc, 20);
2582: --
2583: --
2584: if(p_forced_ranking <= 0) then
2585: hr_utility.set_location(l_proc, 10);
2586: hr_utility.set_message(800,'HR_52400_PYP_INVALID_RANKING');
2587: hr_utility.raise_error;
2588: end if;
2589: hr_utility.set_location(' Leaving:'||l_proc, 20);
2590: end chk_forced_ranking;
2583: --
2584: if(p_forced_ranking <= 0) then
2585: hr_utility.set_location(l_proc, 10);
2586: hr_utility.set_message(800,'HR_52400_PYP_INVALID_RANKING');
2587: hr_utility.raise_error;
2588: end if;
2589: hr_utility.set_location(' Leaving:'||l_proc, 20);
2590: end chk_forced_ranking;
2591: --
2585: hr_utility.set_location(l_proc, 10);
2586: hr_utility.set_message(800,'HR_52400_PYP_INVALID_RANKING');
2587: hr_utility.raise_error;
2588: end if;
2589: hr_utility.set_location(' Leaving:'||l_proc, 20);
2590: end chk_forced_ranking;
2591: --
2592: --
2593: -- ----------------------------------------------------------------------------
2642: and prv.performance_review_id = p_performance_review_id;
2643: --
2644:
2645: begin
2646: hr_utility.set_location('Entering:'|| l_proc, 5);
2647: --
2648: -- Check mandatory parameters have being set.
2649: --
2650: hr_api.mandatory_arg_error
2663: --
2664: if (l_api_updating AND (nvl(per_pyp_shd.g_old_rec.performance_review_id,hr_api.g_number)
2665: <> nvl(p_performance_review_id,hr_api.g_number))
2666: or not l_api_updating) then
2667: hr_utility.set_location(l_proc, 10);
2668: --
2669: --
2670: if (p_performance_review_id IS NOT NULL) then
2671: --
2671: --
2672: open csr_chk_performance_review_id;
2673: fetch csr_chk_performance_review_id into l_exists;
2674: if csr_chk_performance_review_id%notfound then
2675: hr_utility.set_location(l_proc, 15);
2676: close csr_chk_performance_review_id;
2677: per_pyp_shd.constraint_error('PER_PAY_PROPOSALS_FK4');
2678: end if;
2679: --
2681: end if;
2682: --
2683: end if;
2684: --
2685: hr_utility.set_location(' Leaving:'|| l_proc, 20);
2686: end chk_performance_review_id;
2687: --
2688: -- -----------------------------------------------------------------------
2689: -- |------------------------------< chk_df >-----------------------------|
2717: --
2718: l_proc varchar2(72) := g_package||'chk_df';
2719: --
2720: begin
2721: hr_utility.set_location('Entering:'||l_proc, 10);
2722: --
2723: if ((p_rec.pay_proposal_id is not null) and (
2724: nvl(per_pyp_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
2725: nvl(p_rec.attribute_category, hr_api.g_varchar2) or
2820: );
2821: end if;
2822: end if;
2823: --
2824: hr_utility.set_location(' Leaving:'||l_proc, 20);
2825: end chk_df;
2826: --
2827: -- ----------------------------------------------------------------------------
2828: -- |---------------------------< insert_validate >----------------------------|
2842: l_proposed_salary_warning boolean := false;
2843: l_approved_warning boolean := false;
2844: --
2845: Begin
2846: hr_utility.set_location('Entering:'||l_proc, 5);
2847: --
2848: -- Call all supporting business operations. Mapping to the
2849: -- appropriate Business Rules in perpyp.bru is provided (where
2850: -- relevant)
2856: -- Rule CHK_BUSINESS_GROUP_ID a,c
2857: --
2858: hr_api.validate_bus_grp_id(p_rec.business_group_id);
2859: --
2860: hr_utility.set_location(l_proc, 10);
2861: --
2862: --
2863: -- Validate assignment id and change_date
2864: --
2879: ,p_payroll_warning => p_payroll_warning
2880: ,p_object_version_number => p_rec.object_version_number
2881: );
2882: --
2883: hr_utility.set_location(l_proc, 15);
2884:
2885: --
2886: --
2887: -- Validate that date_to is not earlier than the start_date
2915: ,p_change_date => p_rec.change_date
2916: ,p_object_version_number => p_rec.object_version_number
2917: );
2918: --
2919: hr_utility.set_location(l_proc, 20);
2920: --
2921: --
2922: -- Validate multiple_components
2923: --
2932: ,p_multiple_components => p_rec.multiple_components
2933: ,p_object_version_number => p_rec.object_version_number
2934: );
2935: --
2936: hr_utility.set_location(l_proc, 35);
2937: --
2938: --
2939: -- Validate next_sal_review_date and change_date
2940: --
2951: ,p_object_version_number => p_rec.object_version_number
2952: ,p_inv_next_sal_date_warning => p_inv_next_sal_date_warning
2953: );
2954: --
2955: hr_utility.set_location(l_proc, 50);
2956: --
2957: -- Validate next_sal_review_date
2958: --
2959: -- Business Rule Mapping
2969: ,p_object_version_number => p_rec.object_version_number
2970: ,p_inv_next_sal_date_warning => p_inv_next_sal_date_warning
2971: );
2972: --
2973: hr_utility.set_location(l_proc, 55);
2974: --
2975: --
2976: -- Validate proposed_salary
2977: --
2990: -- vkodedal 19-feb-2008
2991: ,p_multiple_components => p_rec.multiple_components
2992: );
2993: --
2994: hr_utility.set_location(l_proc, 70);
2995: --
2996: -- Validate approved
2997: --
2998: -- Business Rule Mapping
3008: ,p_proposed_salary_n => p_rec.proposed_salary_n
3009: ,p_object_version_number => p_rec.object_version_number
3010: ,p_approved_warning => p_approved_warning
3011: );
3012: hr_utility.set_location(l_proc, 75);
3013: --
3014: -- Validate performance_review_id
3015: --
3016: -- Business Rule Mapping
3023: ,p_performance_review_id => p_rec.performance_review_id
3024: ,p_object_version_number => p_rec.object_version_number
3025: );
3026: --
3027: hr_utility.set_location(l_proc, 80);
3028: --
3029: -- Validate forced_ranking
3030: --
3031: -- Business Rule Mapping
3035: per_pyp_bus.chk_forced_ranking
3036: (p_forced_ranking => p_rec.forced_ranking);
3037: --
3038: --
3039: hr_utility.set_location(l_proc, 85);
3040: --
3041: --
3042: -- Call descriptive flexfield validation routines
3043: --
3042: -- Call descriptive flexfield validation routines
3043: --
3044: chk_df(p_rec => p_rec);
3045: --
3046: hr_utility.set_location(' Leaving:'||l_proc, 90);
3047: End insert_validate;
3048: --
3049: -- ----------------------------------------------------------------------------
3050: -- |---------------------------< update_validate >----------------------------|
3060: --
3061: l_proc varchar2(72) := g_package||'update_validate';
3062: --
3063: Begin
3064: hr_utility.set_location('Entering:'||l_proc, 5);
3065: --
3066: -- Call all supporting business operations. Mapping to the
3067: -- appropriate Business Rules in perpyp.bru is provided (where
3068: -- relevant)
3070: -- Validate business_group id
3071: --
3072: hr_api.validate_bus_grp_id(p_rec.business_group_id);
3073: --
3074: hr_utility.set_location(l_proc, 12);
3075: --
3076: -- Check those columns which cannot be updated
3077: -- have not changed
3078: --
3085: --
3086: per_pyp_bus.check_non_updateable_args
3087: (p_rec =>p_rec);
3088: --
3089: hr_utility.set_location (l_proc,10);
3090: --
3091: -- Validate assignment id and change_date
3092: --
3093: -- Business Rule Mapping
3107: ,p_payroll_warning => p_payroll_warning
3108: ,p_object_version_number => p_rec.object_version_number
3109: );
3110: --
3111: hr_utility.set_location (l_proc,12);
3112: --
3113: --
3114: -- Validate that date_to is not earlier than the start_date
3115: --
3143: ,p_change_date => p_rec.change_date
3144: ,p_object_version_number => p_rec.object_version_number
3145: );
3146: --
3147: hr_utility.set_location(l_proc, 15);
3148: --
3149: -- Validate multiple_components
3150: --
3151: -- Business Rule Mapping
3159: ,p_multiple_components => p_rec.multiple_components
3160: ,p_object_version_number => p_rec.object_version_number
3161: );
3162: --
3163: hr_utility.set_location(l_proc, 20);
3164: --
3165: -- Validate next_sal_review_date and change_date
3166: --
3167: -- Business Rule Mapping
3177: ,p_object_version_number => p_rec.object_version_number
3178: ,p_inv_next_sal_date_warning => p_inv_next_sal_date_warning
3179: );
3180: --
3181: hr_utility.set_location(l_proc, 40);
3182: --
3183: -- Validate next_sal_review_date
3184: --
3185: -- Business Rule Mapping
3195: ,p_object_version_number => p_rec.object_version_number
3196: ,p_inv_next_sal_date_warning => p_inv_next_sal_date_warning
3197: );
3198: --
3199: hr_utility.set_location(l_proc, 45);
3200: --
3201: --
3202: -- Validate proposed_salary
3203: --
3216: -- vkodedal 19-feb-2008
3217: ,p_multiple_components => p_rec.multiple_components
3218: );
3219: --
3220: hr_utility.set_location(l_proc, 60);
3221: --
3222: -- Validate approved
3223: --
3224: -- Business Rule Mapping
3235: ,p_object_version_number => p_rec.object_version_number
3236: ,p_approved_warning => p_approved_warning
3237: );
3238: --
3239: hr_utility.set_location(l_proc, 65);
3240: --
3241: -- Validate performance_review_id
3242: --
3243: -- Business Rule Mapping
3250: ,p_performance_review_id => p_rec.performance_review_id
3251: ,p_object_version_number => p_rec.object_version_number
3252: );
3253: --
3254: hr_utility.set_location(l_proc, 70);
3255: --
3256: -- Validate forced_ranking
3257: --
3258: -- Business Rule Mapping
3261: --
3262: per_pyp_bus.chk_forced_ranking
3263: (p_forced_ranking => p_rec.forced_ranking);
3264: --
3265: hr_utility.set_location(l_proc, 75);
3266: --
3267: --
3268: -- Call descriptive flexfield validation routines
3269: --
3269: --
3270: chk_df(p_rec => p_rec);
3271: --
3272: --
3273: hr_utility.set_location(' Leaving:'||l_proc, 85);
3274: End update_validate;
3275: --
3276: -- ----------------------------------------------------------------------------
3277: -- |---------------------------< delete_validate >----------------------------|
3284: --
3285: l_proc varchar2(72) := g_package||'delete_validate';
3286: --
3287: Begin
3288: hr_utility.set_location('Entering:'||l_proc, 5);
3289: --
3290: -- Call all supporting business operations
3291: --
3292: -- Validate delete
3304: ,p_object_version_number => p_rec.object_version_number
3305: ,p_salary_warning => p_salary_warning
3306: );
3307:
3308: hr_utility.set_location(' Leaving:'||l_proc, 10);
3309: End delete_validate;
3310: --
3311: -- ---------------------------------------------------------------------------
3312: -- |---------------------< return_legislation_code >-------------------------|
3329: --
3330: l_legislation_code varchar2(150);
3331: l_proc varchar2(72) := 'return_legislation_code';
3332: begin
3333: hr_utility.set_location('Entering:'|| l_proc, 10);
3334: --
3335: -- Ensure that all the mandatory parameter are not null
3336: --
3337: hr_api.mandatory_arg_error(p_api_name => l_proc,
3344: -- call to this function. Just return the value in the global
3345: -- variable.
3346: --
3347: l_legislation_code := g_legislation_code;
3348: hr_utility.set_location(l_proc, 20);
3349: else
3350: --
3351: -- The ID is different to the last call to this function
3352: -- or this is the first call to this function.
3357: --
3358: -- The primary key is invalid therefore we must error
3359: --
3360: close csr_leg_code;
3361: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
3362: hr_utility.raise_error;
3363: end if;
3364: hr_utility.set_location(l_proc, 30);
3365: --
3358: -- The primary key is invalid therefore we must error
3359: --
3360: close csr_leg_code;
3361: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
3362: hr_utility.raise_error;
3363: end if;
3364: hr_utility.set_location(l_proc, 30);
3365: --
3366: -- Set the global variables so the values are
3360: close csr_leg_code;
3361: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
3362: hr_utility.raise_error;
3363: end if;
3364: hr_utility.set_location(l_proc, 30);
3365: --
3366: -- Set the global variables so the values are
3367: -- available for the next call to this function
3368: --
3369: close csr_leg_code;
3370: g_pay_proposal_id := p_pay_proposal_id;
3371: g_legislation_code := l_legislation_code;
3372: end if;
3373: hr_utility.set_location(' Leaving:'|| l_proc, 40);
3374: --
3375: return l_legislation_code;
3376: end return_legislation_code;
3377: --