1 PACKAGE BODY hr_de_extra_work_inc_checks AS
2 /* $Header: pedeincv.pkb 120.1 2006/09/12 09:38:36 abppradh noship $ */
3 --
4 --
5 -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 -- Work Incident checks.
7 --
8 -- 1. The Work Stop Date (p_inc_information10) must be on or after Work Incident Date
9 -- (p_incident_date).
10 --
11 -- 2. The Payment End Date (p_inc_information9) must be on or after Work Incident Date
12 -- (p_incident_date).
13 --
14 -- 3. The Work Resumption Date (p_inc_information11) must be on or after Work Incident Date
15 -- (p_incident_date).
16 --
17 -- 4. The Job Start Date (p_inc_information3) must be on or before Work Incident Date
18 -- (p_incident_date).
19 --
20 -- 5. The Work Stop Date (p_inc_information10) must be on or before Work Resumption Date
21 -- (p_inc_information11).
22 -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 --
24 PROCEDURE work_incident_checks
25 (p_incident_date IN DATE
26 ,p_inc_information3 IN VARCHAR2
27 ,p_inc_information9 IN VARCHAR2
28 ,p_inc_information10 IN VARCHAR2
29 ,p_inc_information11 IN VARCHAR2) IS
30 --
31 --
32 -- Local exceptions.
33 --
34 work_stop_date_too_early EXCEPTION;
35 payment_end_date_too_early EXCEPTION;
36 work_resump_date_too_early EXCEPTION;
37 job_start_date_too_late EXCEPTION;
38 resump_date_before_stop_date EXCEPTION;
39 BEGIN
40 --
41 --
42 -- Check if DE is installed
43 IF hr_utility.chk_product_install('Oracle Human Resources', 'DE') THEN
44
45 -- The Work Stop Date must be on or after Work Incident Date.
46 --
47 IF p_inc_information10 IS NOT NULL THEN
48 IF p_incident_date > TRUNC(fnd_date.canonical_to_date(p_inc_information10)) THEN
49 RAISE work_stop_date_too_early;
50 END IF;
51 END IF;
52 --
53 --
54 -- The Payment End Date must be on or after Work Incident Date.
55 --
56 IF p_inc_information9 IS NOT NULL THEN
57 IF p_incident_date > TRUNC(fnd_date.canonical_to_date(p_inc_information9)) THEN
58 RAISE payment_end_date_too_early;
59 END IF;
60 END IF;
61 --
62 --
63 -- The Work Resumption Date must be on or after Work Incident Date.
64 --
65 IF p_inc_information11 IS NOT NULL THEN
66 IF p_incident_date > TRUNC(fnd_date.canonical_to_date(p_inc_information11)) THEN
67 RAISE work_resump_date_too_early;
68 END IF;
69 END IF;
70 --
71 --
72 -- The Job Start Date must be on or before Work Incident Date.
73 --
74 IF p_inc_information3 IS NOT NULL THEN
75 IF p_incident_date < TRUNC(fnd_date.canonical_to_date(p_inc_information3)) THEN
76 RAISE job_start_date_too_late;
77 END IF;
78 END IF;
79 --
80 --
81 -- The Work Stop Date must be on or before Work Resumption Date.
82 --
83 IF p_inc_information10 IS NOT NULL AND p_inc_information11 IS NOT NULL THEN
84 IF TRUNC(fnd_date.canonical_to_date(p_inc_information11)) < TRUNC(fnd_date.canonical_to_date(p_inc_information10)) THEN
85 RAISE resump_date_before_stop_date;
86 END IF;
87 END IF;
88
89 END IF;
90 EXCEPTION
91 --
92 --
93 -- Work stop date is before the work incident date.
94 --
95 WHEN work_stop_date_too_early THEN
96 hr_utility.set_message(800, 'HR_DE_STOP_DATE_TOO_EARLY');
97 hr_utility.raise_error;
98 --
99 --
100 -- Payment stop date is before the work incident date.
101 --
102 WHEN payment_end_date_too_early THEN
103 hr_utility.set_message(800, 'HR_DE_PYMNT_DATE_TOO_EARLY');
104 hr_utility.raise_error;
105 --
106 --
107 -- Work resumption date is before the work incident date.
108 --
109 WHEN work_resump_date_too_early THEN
110 hr_utility.set_message(800, 'HR_DE_RESUMP_DATE_TOO_EARLY');
111 hr_utility.raise_error;
112 --
113 --
114 -- Job start date is after the work incident date.
115 --
116 WHEN job_start_date_too_late THEN
117 hr_utility.set_message(800, 'HR_DE_JOB_START_DATE_TOO_LATE');
118 hr_utility.raise_error;
119 --
120 --
121 -- Work Stop Date is after the Work Resumption Date.
122 --
123 WHEN resump_date_before_stop_date THEN
124 hr_utility.set_message(800, 'HR_DE_RESUMP_BEFORE_STOP_DATE');
125 hr_utility.raise_error;
126 END work_incident_checks;
127 END hr_de_extra_work_inc_checks;