1 package body hr_perinfo_util_web as
2 /* $Header: hrpiutlw.pkb 120.3 2005/12/13 13:50:50 svittal noship $ */
3 c_prompts hr_util_misc_web.g_prompts%TYPE;
4 c_title hr_util_misc_web.g_title%TYPE;
5 g_package varchar2(31) := 'HR_PERINFO_UTIL_WEB';
6 g_person_id per_all_people_f.person_id%TYPE;
7 g_region_code constant varchar2(30) := 'HR_PERINFO_FRAMES';
8 g_application_id constant integer := 601;
9
10
11 -- private function
12 --
13 function isR11i(p_application_id in number default 800)
14 RETURN BOOLEAN is
15 --
16 cursor csr_get_prod_verison is
17 select PRODUCT_VERSION
18 from FND_PRODUCT_INSTALLATIONS
19 where APPLICATION_ID = p_application_id;
20 --
21 l_version FND_PRODUCT_INSTALLATIONS.PRODUCT_VERSION%TYPE;
22 --
23 begin
24 open csr_get_prod_verison;
25 fetch csr_get_prod_verison into l_version;
26 close csr_get_prod_verison;
27 l_version := substr(l_version,1,4);
28 l_version := replace(l_version,'.');
29 if to_number(l_version) >= 115 then
30 return true;
31 else
32 return false;
33 end if;
34
35 end isR11i;
36
37
38
39 /*------------------------------------------------------------------------------
40 |
41 | Name : isDateLessThanCreationDate
42 |
43 | Purpose :
44 |
45 | This function will check if the passed in date is less than the date
46 | on which the person was created. The creation date of the person is
47 | MIN(EFFECTIVE_START_DATE) from per_all_people_f for a person.
48 |
49 | In Parameters :
50 |
51 | p_date : The date to be checked.
52 | p_person_id : The ID of person for whom this check is done.
53 |
54 | Returns :
55 |
56 | Boolean :
57 |
58 | TRUE : If the date is less than the creation date.
59 | FALSE : If the date is equal to or greater than the creation
60 | date.
61 +-----------------------------------------------------------------------------*/
62
63 FUNCTION isDateLessThanCreationDate
64 (p_date IN DATE,p_person_id IN NUMBER) RETURN BOOLEAN IS
65
66 CURSOR csr_min_start_date IS
67 SELECT min(pp.effective_start_date)
68 FROM per_all_people_f pp
69 WHERE pp.person_id = p_person_id;
70
71 l_start_date DATE;
72 BEGIN
73 OPEN csr_min_start_date;
74 FETCH csr_min_start_date INTO l_start_date;
75 CLOSE csr_min_start_date;
76
77 IF trunc(p_date) >= trunc(l_start_date) THEN
78 RETURN FALSE;
79 ELSE
80 RETURN TRUE;
81 END IF;
82 EXCEPTION
83 WHEN OTHERS THEN
84 raise;
85 END isDateLessThanCreationDate;
86
87 /*------------------------------------------------------------------------------
88 |
89 | Name : isLessThanCurrentStartDate
90 |
91 | Purpose :
92 |
93 | This function will check if the passed in date is less than the
94 | Effective Start Date of the person reocrd which is current for a
95 | given Object Version Number and Person ID.
96 |
97 | In Parameters :
98 |
99 | p_date : The date to be checked.
100 | p_person_id : The ID of person for whom this check is done.
101 | p_ovn : The Object Version of the Person row in question.
102 |
103 | Returns :
104 |
105 | Boolean :
106 |
107 | TRUE : If the date is less than the Effective Start Date.
108 | FALSE : If the date is equal to or greater than the Effective
109 | Start date.
110 +-----------------------------------------------------------------------------*/
111
112 FUNCTION isLessThanCurrentStartDate
113 (p_effective_date IN DATE
114 ,p_person_id IN NUMBER
115 ,p_ovn IN NUMBER) RETURN BOOLEAN IS
116
117 CURSOR csr_chk_effective_date IS
118 SELECT 'Y'
119 FROM per_all_people_f pp
120 WHERE pp.person_id = p_person_id
121 AND pp.object_version_number = p_ovn
122 AND trunc(p_effective_date) < trunc(pp.effective_start_date);
123
124 l_result VARCHAR2(10);
125 BEGIN
126 OPEN csr_chk_effective_date;
127 FETCH csr_chk_effective_date INTO l_result;
128 CLOSE csr_chk_effective_date;
129
130 IF l_result = 'Y' THEN
131 RETURN TRUE;
132 ELSE
133 RETURN FALSE;
134 END IF;
135 EXCEPTION
136 WHEN OTHERS THEN
137 raise;
138 END isLessThanCurrentStartDate;
139
140
141
142 END hr_perinfo_util_web;