DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PAXEXONE_XMLP_PKG

Source


1 PACKAGE BODY PA_PAXEXONE_XMLP_PKG AS
2 /* $Header: PAXEXONEB.pls 120.0 2008/01/02 11:30:05 krreddy noship $ */
3 
4 FUNCTION  get_cover_page_values RETURN BOOLEAN IS
5 
6 BEGIN
7 
8 	RETURN(TRUE);
9 
10 EXCEPTION
11 	WHEN OTHERS THEN
12   		RETURN(FALSE);
13 
14 END;
15 
16 function BeforeReport return boolean is
17 begin
18 
19 Declare
20  init_failure exception;
21  hold_employee_name  VARCHAR2(80);
22  org_name hr_organization_units.name%TYPE;
23 
24 BEGIN
25 
26 
27 
28 /*srw.user_exit('FND SRWINIT');*/null;
29 
30 /*srw.message(1,'Expense Report Testing on dom1151');*/null;
31 
32 IF p_mrcsobtype = 'R'
33 THEN
34   fnd_client_info.set_currency_context(p_ca_set_of_books_id);
35 END IF;
36 
37 
38 
39 
40 
41 
42 
43 /*srw.message(1,'this is ur report');*/null;
44 
45 /*srw.user_exit('FND GETPROFILE
46 NAME="PA_DEBUG_MODE"
47 FIELD=":p_debug_mode"
48 PRINT_ERROR="N"');*/null;
49 
50 
51 
52 
53 
54 
55 IF incurred_org is not null then
56    select substr(name,1,30)
57    into org_name from
58    hr_organization_units
59    where organization_id = incurred_org;
60 END IF;
61 c_incurred_org := org_name;
62 
63 
64 
65 IF employee_id is not null
66   THEN
67     select SUBSTR(full_name,1,80)
68     into   hold_employee_name
69     from   per_people_f
70     where  person_id = employee_id
71     and   sysdate between effective_start_date
72 					 and  nvl(effective_end_date,sysdate + 1)
73     and   (employee_number IS NOT NULL or npw_number IS NOT NULL);
74     c_employee_name := hold_employee_name;
75 END IF;
76 
77 
78 IF (get_company_name <> TRUE) THEN       RAISE init_failure;
79 END IF;
80 
81 EXCEPTION
82   WHEN   OTHERS  THEN
83     RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
84 
85 END;  return (TRUE);
86 end;
87 
88 FUNCTION  get_company_name    RETURN BOOLEAN IS
89   l_name                gl_sets_of_books.name%TYPE;
90 
91 BEGIN
92 
93   SELECT  gl.name
94   INTO    l_name
95   FROM    gl_sets_of_books gl
96   WHERE   gl.set_of_books_id = p_ca_set_of_books_id;
97 
98   c_company_name_header     := l_name;
99 
100   RETURN (TRUE);
101 
102 EXCEPTION
103 
104   WHEN   OTHERS  THEN
105     RETURN (FALSE);
106 
107 END;
108 
109 function c_billable_expensesformula(c_total_expenses in number, c_total_billable_expenses in number) return number is
110   temp_value  number;
111 begin
112   if c_total_expenses <> 0 then
113     temp_value := round((nvl(c_total_billable_expenses,0)/c_total_expenses),4) * 100;
114   else
115     temp_value :=  0;
116   end if;
117   return(temp_value);
118 end;
119 
120 function AfterReport return boolean is
121 begin
122 
123 	BEGIN
124  		/*srw.user_exit('FND SRWEXIT');*/null;
125 
126 	END;
127 
128 	return (TRUE);
129 
130 end;
131 
132 function c_display_total_bill_expformul(c_total_billable_expenses in number) return varchar2 is
133 begin
134 
135 /*SRW.REFERENCE(c_total_billable_expenses);*/null;
136 
137 RETURN
138   (TO_CHAR(c_total_billable_expenses, pa_currency.currency_fmt_mask(12)));
139 end;
140 
141 function c_display_total_expformula(c_total_expenses in number) return varchar2 is
142 begin
143 
144 /*SRW.REFERENCE(c_total_expenses);*/null;
145 
146 RETURN
147   (TO_CHAR(c_total_expenses, pa_currency.currency_fmt_mask(12)));
148 end;
149 
150 function c_display_bill_expformula(c_billable_expenses in number) return varchar2 is
151 begin
152 
153 /*SRW.REFERENCE(c_billable_expenses);*/null;
154 
155 RETURN
156   (to_char(c_billable_expenses));
157   end;
158 
159 function c_expensesformula(expenses in number) return varchar2 is
160 begin
161 
162 /*SRW.REFERENCE(expenses);*/null;
163 
164 RETURN
165   (TO_CHAR(expenses, pa_currency.currency_fmt_mask(12)));
166 end;
167 
168 function c_billable_expformula(billable_expenses in number) return varchar2 is
169 begin
170 
171 /*SRW.REFERENCE(billable_expenses);*/null;
172 
173 RETURN
174   (TO_CHAR(billable_expenses, pa_currency.currency_fmt_mask(10)));
175 end;
176 
177 function c_disp_rep_expensesformula(c_rep_expenses in number) return varchar2 is
178 begin
179 
180 /*SRW.REFERENCE(c_rep_expenses);*/null;
181 
182 RETURN
183   (TO_CHAR(c_rep_expenses, pa_currency.currency_fmt_mask(12)));
184 end;
185 
186 function c_amountformula(amount in number) return char is
187 begin
188   /*srw.reference(amount);*/null;
189 
190   return(to_char(amount,pa_currency.currency_fmt_mask(12)));
191 end;
192 
193 function c_amount1formula(sse_amount in number) return char is
194 begin
195   /*srw.reference(sse_amount);*/null;
196 
197   return(to_char(sse_amount,pa_currency.currency_fmt_mask(12)));
198 end;
199 
200 function c_dis_sum_invoiceformula(c_sum_invoice in number) return char is
201 begin
202   /*srw.reference(c_sum_invoice);*/null;
203 
204   return(to_char(c_sum_invoice,pa_currency.currency_fmt_mask(12)));
205 end;
206 
207 function c_disp_sum_sseformula(c_sum_sse in number) return char is
208 begin
209   /*srw.reference(c_sum_sse);*/null;
210 
211   return(to_char(c_sum_sse,pa_currency.currency_fmt_mask(12)));
212 end;
213 
214 function c_dis_sum_invoice1formula(c_sum_invoice1 in number) return char is
215 begin
216    /*srw.reference(c_sum_invoice1);*/null;
217 
218   return(to_char(c_sum_invoice1,pa_currency.currency_fmt_mask(12)));
219 end;
220 
221 function c_disp_sum_sse1formula(c_sum_sse1 in number) return char is
222 begin
223  /*srw.reference(c_sum_sse1);*/null;
224 
225   return(to_char(c_sum_sse1,pa_currency.currency_fmt_mask(12)));
226 end;
227 
228 function c_bill_pctformula(c_sum_invoice in number, c_sum_invoice1 in number) return char is
229 
230   temp_value  number;
231 begin
232   if c_sum_invoice <> 0 then
233     temp_value := round((nvl(c_sum_invoice,0)/c_sum_invoice1),4) * 100;
234   else
235     temp_value :=  0;
236   end if;
237   return(temp_value);
238 end;
239 
240 function AfterPForm return boolean is
241 begin
242 
243 
244 
245 IF p_ca_set_of_books_id <> -1999 THEN
246 BEGIN
247 select decode(mrc_sob_type_code,'R','R','P')
248 into p_mrcsobtype
249 from gl_sets_of_books
250 where set_of_books_id = p_ca_set_of_books_id;
251 EXCEPTION
252 WHEN OTHERS THEN
253 p_mrcsobtype := 'P';
254 END;
255 ELSE
256 p_mrcsobtype := 'P';
257 END IF;
258 
259 IF p_mrcsobtype = 'R'
260 THEN
261 
262                   lp_pa_ei_denorm_v := 'PA_EI_DENORM_MRC_V';
263   lp_ap_invoice_dist := 'AP_INVOICE_DISTS_MRC_V';
264 ELSE
265                   lp_pa_ei_denorm_v := 'PA_EI_DENORM_V';
266   lp_ap_invoice_dist := 'AP_INVOICE_DISTRIBUTIONS';
267 END IF;
268 
269 
270 
271 
272 
273   return (TRUE);
274 end;
275 
276 --Functions to refer Oracle report placeholders--
277 
278  Function C_COMPANY_NAME_HEADER_p return varchar2 is
279 	Begin
280 	 return C_COMPANY_NAME_HEADER;
281 	 END;
282  Function C_employee_name_p return varchar2 is
283 	Begin
284 	 return C_employee_name;
285 	 END;
286  Function c_no_data_found_p return varchar2 is
287 	Begin
288 	 return c_no_data_found;
289 	 END;
290  Function c_incurred_org_p return varchar2 is
291 	Begin
292 	 return c_incurred_org;
293 	 END;
294 END PA_PAXEXONE_XMLP_PKG ;
295