1 PACKAGE BODY PER_PERUSADA_XMLP_PKG AS
2 /* $Header: PERUSADAB.pls 120.0 2007/12/28 06:54:19 srikrish noship $ */
3
4 function BeforeReport return boolean is
5 begin
6 P_SESSION_DATE1:=TO_CHAR(P_SESSION_DATE,'DD-MON-YYYY');
7 --hr_standard.event('BEFORE REPORT');
8 p_org_structure_version_id_1:= p_org_structure_version_id;
9 insert into fnd_sessions (session_id, effective_date)
10 select userenv('sessionid'), trunc(sysdate)
11 from dual
12 where not exists
13 (select 1
14 from fnd_sessions fs
15 where fs.session_id = userenv('sessionid'));
16 c_business_group_name := hr_reports.get_business_group(p_business_group_id);
17 c_organization := hr_us_reports.get_org_name(p_organization_id, p_business_group_id);
18 IF P_ORG_STRUCTURE_VERSION_ID_1 is null then
19 P_ORG_STRUCTURE_VERSION_ID_1 := -1;
20 c_organization_hierarchy := null;
21 ELSE c_organization_hierarchy := hr_us_reports.get_org_hierarchy_name(P_ORG_STRUCTURE_VERSION_ID_1);
22 END IF;
23 select to_number(rule_mode)
24 into c_disability_id_flex_num
25 from pay_legislation_rules
26 where legislation_code = 'US'
27 and rule_type = 'ADA_DIS';
28 select to_number(rule_mode)
29 into c_disability_acc_id_flex_num
30 from pay_legislation_rules
31 where legislation_code = 'US'
32 and rule_type = 'ADA_DIS_ACC';
33 IF p_person is not null THEN
34 c_lex_assign_where := c_lex_assign_where ||
35 ' and peo.person_id = '|| to_char(p_person);
36 c_full_name := hr_reports.get_person_name(p_session_date, p_person);
37 END IF;
38 IF p_employee_number is not null THEN
39 c_lex_assign_where := c_lex_assign_where ||
40 ' and peo.person_id = '|| to_char(p_employee_number);
41 select employee_number
42 into c_employee_number
43 from per_all_people_f
44 where person_id = p_employee_number;
45 END IF;
46 IF nvl(p_registered_disabled, 'N') in ('Y','P','F') THEN
47 c_lex_assign_where := c_lex_assign_where ||
48 ' and peo.registered_disabled_flag in (''Y'',''P'',''F'')';
49 END IF;
50 IF p_job_id is not null THEN
51 c_lex_assign_where := c_lex_assign_where ||
52 ' and job.job_id = '|| to_char(p_job_id);
53 select name
54 into c_job_name
55 from per_jobs_vl
56 where job_id = p_job_id;
57 END IF;
58 IF p_position_name is not null THEN
59 c_lex_assign_where := c_lex_assign_where ||
60 ' and (hr_general.decode_position_latest_name(ass.position_id)) = '''||p_position_name||'''';
61 END IF;
62 IF p_location is not null THEN
63 c_lex_assign_where := c_lex_assign_where ||
64 ' and loc.location_id = '|| to_char(p_location);
65 select location_code
66 into c_location_code
67 from hr_locations
68 where location_id = p_location;
69 END IF;
70 /*srw.message(5, 'Additional restrictions IF nvl(:p_sort, 'Employee') = 'Employee' THEN
71 :c_lex_assign_order := ' initcap(peo.full_name) ';*/null;
72 IF nvl(p_sort, 'Employee') = 'Employee' THEN
73 --:c_lex_assign_order := ' initcap(peo.full_name) ';
74 c_lex_assign_order := ' initcap(peo.full_name) ';
75 ELSE
76 /* :c_lex_assign_order := ' job.name,loc.location_code,gdt.name,
77 (hr_general.decode_position_latest_name(ass.position_id)),initcap(peo.full_name)';*/
78 c_lex_assign_order := ' job.name,loc.location_code,gdt.name,
79 (hr_general.decode_position_latest_name(ass.position_id)),initcap(peo.full_name)';
80 END IF;
81
82 --Added during DT Fix
83 if c_lex_assign_where is null then
84 c_lex_assign_where := ' ';
85 end if;
86 --End of DT Fix
87 return (TRUE);
88 end;
89
90 function g_1groupfilter(establishment_id1 in number) return boolean is
91 begin
92
93 /*srw.message('001', 'Tax Unit ID '||to_char(tax_unit_id));*/null;
94
95 /*srw.message('002', 'Estab. ID '||to_char(establishment_id1));*/null;
96
97 if establishment_id1 is null and P_ORG_STRUCTURE_VERSION_ID_1 = -1 then
98 /*srw.message(3, 'The GRE is not an establishment. Please enter a hierarchy.');*/null;
99
100 end if; return (TRUE);
101 end;
102
103 function G_DisabilitiesGroupFilter return boolean is
104 begin
105
106 /*srw.message (4, 'person id '||to_char(person_id));*/null;
107 return (TRUE);
108 end;
109
110 function G_2GroupFilter return boolean is
111 begin
112
113 /*srw.message(6, 'est '||d_cmpy_name);*/null;
114
115 /*srw.message(6, 'est id '||to_char(establishment_id));*/null;
116 return (TRUE);
117 end;
118
119 function AfterPForm return boolean is
120 begin
121
122 if P_ORG_STRUCTURE_VERSION_ID is not null then
123 return (TRUE);
124 else
125 /*srw.message(7,'Please enter a hierarchy');*/null;
126
127 return(FALSE);
128 end if;
129 RETURN NULL; end;
130
131 function AfterReport return boolean is
132 begin
133
134 --hr_standard.event('AFTER REPORT');
135
136 return (TRUE);
137 end;
138
139 --Functions to refer Oracle report placeholders--
140
141 Function C_BUSINESS_GROUP_NAME_p return varchar2 is
142 Begin
143 return C_BUSINESS_GROUP_NAME;
144 END;
145 Function C_REPORT_TYPE_p return varchar2 is
146 Begin
147 return C_REPORT_TYPE;
148 END;
149 Function C_ORGANIZATION_HIERARCHY_p return varchar2 is
150 Begin
151 return C_ORGANIZATION_HIERARCHY;
152 END;
153 Function C_ORGANIZATION_p return varchar2 is
154 Begin
155 return C_ORGANIZATION;
156 END;
157 Function C_DISABILITY_ID_FLEX_NUM_p return number is
158 Begin
159 return C_DISABILITY_ID_FLEX_NUM;
160 END;
161 Function C_DISABILITY_ACC_ID_FLEX_NUM_p return number is
162 Begin
163 return C_DISABILITY_ACC_ID_FLEX_NUM;
164 END;
165 Function C_lex_assign_where_p return varchar2 is
166 Begin
167 return C_lex_assign_where;
168 END;
169 Function C_lex_assign_order_p return varchar2 is
170 Begin
171 return C_lex_assign_order;
172 END;
173 Function C_full_name_p return varchar2 is
174 Begin
175 return C_full_name;
176 END;
177 Function C_employee_number_p return varchar2 is
178 Begin
179 return C_employee_number;
180 END;
181 Function C_job_name_p return varchar2 is
182 Begin
183 return C_job_name;
184 END;
185 Function C_location_code_p return varchar2 is
186 Begin
187 return C_location_code;
188 END;
189 END PER_PERUSADA_XMLP_PKG ;