[Home] [Help]
PACKAGE BODY: APPS.AR_RAXSOL_XMLP_PKG
Source
1 PACKAGE BODY AR_RAXSOL_XMLP_PKG AS
2 /* $Header: RAXSOLB.pls 120.0 2007/12/27 14:34:03 abraghun noship $ */
3
4 function BeforeReport return boolean is
5 begin
6
7 /*SRW.USER_EXIT('FND SRWINIT');*/null;
8
9
10
11
12 get_boiler_plates ;
13
14 return (TRUE);
15 end;
16
17 function AfterReport return boolean is
18 begin
19
20 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
21 return (TRUE);
22 end;
23
24 function report_nameformula(Company_Name in varchar2) return varchar2 is
25 begin
26
27 DECLARE
28 l_report_name VARCHAR2(80);
29 BEGIN
30 RP_Company_Name := Company_Name;
31 SELECT substrb(cp.user_concurrent_program_name,1,80)
32 INTO l_report_name
33 FROM FND_CONCURRENT_PROGRAMS_VL cp,
34 FND_CONCURRENT_REQUESTS cr
35 WHERE cr.request_id = P_CONC_REQUEST_ID
36 AND cp.application_id = cr.program_application_id
37 AND cp.concurrent_program_id = cr.concurrent_program_id;
38
39 RP_Report_Name := l_report_name;
40 RETURN(l_report_name);
41 EXCEPTION
42 WHEN NO_DATA_FOUND
43 THEN RP_REPORT_NAME := 'Transaction Batch Source Listing';
44 RETURN('REPORT TITLE');
45 END;
46 RETURN NULL; end;
47
48 function C_GET_MEANINGFormula return Number is
49 begin
50
51 BEGIN
52
53 DECLARE
54 l_id VARCHAR2 (80);
55 BEGIN
56 select meaning
57 into l_id
58 from ar_lookups
59 where lookup_type = 'REFERENCE'
60 and lookup_code = 'Id';
61
62 rp_id := l_id ;
63
64 EXCEPTION
65 WHEN NO_DATA_FOUND THEN
66 l_id := '' ;
67 END ;
68
69 DECLARE
70 l_none VARCHAR2 (80);
71 BEGIN
72 select meaning
73 into l_none
74 from ar_lookups
75 where lookup_type = 'REFERENCE'
76 and lookup_code = 'None';
77
78 rp_none := l_none ;
79
80 EXCEPTION
81 WHEN NO_DATA_FOUND THEN
82 l_none := '' ;
83 END ;
84
85 DECLARE
86 l_number VARCHAR2 (80);
87 BEGIN
88 select meaning
89 into l_number
90 from ar_lookups
91 where lookup_type = 'REFERENCE'
92 and lookup_code = 'Number';
93
94 rp_number := l_number ;
95
96 EXCEPTION
97 WHEN NO_DATA_FOUND THEN
98 l_number := '' ;
99 END ;
100
101
102 DECLARE
103 l_segment VARCHAR2 (80);
104 BEGIN
105 select meaning
106 into l_segment
107 from ar_lookups
108 where lookup_type = 'REFERENCE'
109 and lookup_code = 'Segment';
110
111 rp_segment := l_segment ;
112
113 EXCEPTION
114 WHEN NO_DATA_FOUND THEN
115 l_segment := '' ;
116 END ;
117
118
119 DECLARE
120 l_value VARCHAR2 (80);
121 BEGIN
122 select meaning
123 into l_value
124 from ar_lookups
125 where lookup_type = 'REFERENCE'
126 and lookup_code = 'Value';
127
128 rp_value := l_value ;
129 EXCEPTION
130 WHEN NO_DATA_FOUND THEN
131 l_value := '' ;
132 END ;
133
134
135 DECLARE
136 l_yes VARCHAR2 (80);
137 BEGIN
138 select meaning
139 into l_yes
140 from ar_lookups
141 where lookup_type = 'YES/NO'
142 and lookup_code = 'Y';
143
144 rp_yes := l_yes ;
145 EXCEPTION
146 WHEN NO_DATA_FOUND THEN
147 l_yes := '' ;
148 END ;
149
150
151 DECLARE
152 l_no VARCHAR2 (80);
153 BEGIN
154 select meaning
155 into l_no
156 from ar_lookups
157 where lookup_type = 'YES/NO'
158 and lookup_code = 'N';
159
160 rp_no := l_no ;
161 EXCEPTION
162 WHEN NO_DATA_FOUND THEN
163 l_no := '' ;
164 END ;
165
166 DECLARE
167 l_amt VARCHAR2 (80);
168 BEGIN
169 select meaning
170 into l_amt
171 from ar_lookups
172 where lookup_type = 'AMT/PER'
173 and lookup_code = 'Amount';
174
175 rp_amt := l_amt ;
176 EXCEPTION
177 WHEN NO_DATA_FOUND THEN
178 l_amt := '' ;
179 END ;
180
181 DECLARE
182 l_per VARCHAR2 (80);
183 BEGIN
184 select meaning
185 into l_per
186 from ar_lookups
187 where lookup_type = 'AMT/PER'
188 and lookup_code = 'Percent';
189
190 rp_per := l_per ;
191 EXCEPTION
192 WHEN NO_DATA_FOUND THEN
193 l_per := '' ;
194 END ;
195
196 DECLARE
197 l_code VARCHAR2 (80);
198 BEGIN
199 select meaning
200 into l_code
201 from ar_lookups
202 where lookup_type = 'CODE'
203 and lookup_code = 'Code';
204
205 rp_code := l_code ;
206 EXCEPTION
207 WHEN NO_DATA_FOUND THEN
208 l_code := '' ;
209 END ;
210 return (0);
211 END ;
212
213 RETURN NULL; end;
214
215 --function c_last_invoice_numberformula(auto_trx_numbering in varchar2, batch_source_id in number) return char is
216 function c_last_invoice_numberformula(auto_trx_numbering in varchar2, batch_source_id_t in number) return char is
217 begin
218
219 DECLARE
220 l_last_invoice_number varchar2(20) ;
221
222 BEGIN
223
224
225 if auto_trx_numbering <> 'N' then
226 SELECT MAX(TRX_NUMBER)
227 INTO l_last_invoice_number
228 FROM RA_CUSTOMER_TRX
229 WHERE BATCH_SOURCE_ID = batch_source_id_t
230 ;
231 end if ;
232 return (l_last_invoice_number);
233
234 END ;
235 RETURN NULL; end;
236
237 function RP_SYSDATEFormula return VARCHAR2 is
238 begin
239
240 DECLARE
241
242 l_date VARCHAR2 (20);
243
244 BEGIN
245 SELECT SYSDATE
246 INTO l_date
247 FROM
248 DUAL ;
249 return (l_date);
250 END ;
251
252 RETURN NULL; end;
253
254 function c_data_not_foundformula(Name in varchar2) return number is
255 begin
256
257 rp_data_found := Name ;
258 return (0);
259
260 end;
261
262 procedure get_lookup_meaning(p_lookup_type in VARCHAR2,
263 p_lookup_code in VARCHAR2,
264 p_lookup_meaning in out NOCOPY VARCHAR2)
265 is
266
267 w_meaning varchar2(80);
268
269 begin
270
271 select meaning
272 into w_meaning
273 from fnd_lookups
274 where lookup_type = p_lookup_type
275 and lookup_code = p_lookup_code ;
276
277 p_lookup_meaning := w_meaning ;
278
279 exception
280 when no_data_found then
281 p_lookup_meaning := null ;
282
283 end ;
284
285 procedure get_boiler_plates is
286
287 w_industry_code varchar2(20);
288 w_industry_stat varchar2(20);
289
290 begin
291
292 if fnd_installation.get(0, 0,
293 w_industry_stat,
294 w_industry_code) then
295 if w_industry_code = 'C' then
296 c_salesrep_title := null ;
297 c_salescredit_title := null ;
298 c_salester_title := null ;
299 else
300 get_lookup_meaning('IND_SALES_REP',
301 w_industry_code,
302 c_salesrep_title);
303 get_lookup_meaning('IND_SALES_CREDIT',
304 w_industry_code,
305 c_salescredit_title);
306 get_lookup_meaning('IND_SALES_TERRITORY',
307 w_industry_code,
308 c_salester_title);
309 end if;
310 end if;
311
312 c_industry_code := w_Industry_code ;
313
314 end ;
315
316 function set_display_for_core(p_field_name in VARCHAR2)
317 return boolean is
318
319 begin
320
321 if c_industry_code = 'C' then
322 return(TRUE);
323 elsif p_field_name = 'SALESREP' then
324 if c_salesrep_title is not null then
325 return(FALSE);
326 else
327 return(TRUE);
328 end if;
329 elsif p_field_name = 'SALESCREDIT' then
330 if c_salescredit_title is not null then
331 return(FALSE);
332 else
333 return(TRUE);
334 end if;
335 elsif p_field_name = 'SALESTER' then
336 if c_salester_title is not null then
337 return(FALSE);
338 else
339 return(TRUE);
340 end if;
341 end if;
342
343 RETURN NULL; end;
344
345 function set_display_for_gov(p_field_name in VARCHAR2)
346 return boolean is
347
348 begin
349
350
351 if c_industry_code = 'C' then
352 return(FALSE);
353 elsif p_field_name = 'SALESREP' then
354 if c_salesrep_title is not null then
355 return(TRUE);
356 else
357 return(FALSE);
358 end if;
359 elsif p_field_name = 'SALESCREDIT' then
360 if c_salescredit_title is not null then
361 return(TRUE);
362 else
363 return(FALSE);
364 end if;
365 elsif p_field_name = 'SALESTER' then
366 if c_salester_title is not null then
367 return(TRUE);
368 else
369 return(FALSE);
370 end if;
371 end if;
372
373 RETURN NULL; end ;
374
375 --Functions to refer Oracle report placeholders--
376
377 Function RP_COMPANY_NAME_p return varchar2 is
378 Begin
379 return RP_COMPANY_NAME;
380 END;
381 Function RP_REPORT_NAME_p return varchar2 is
382 Begin
383 return RP_REPORT_NAME;
384 END;
385 Function RP_DATA_FOUND_p return varchar2 is
386 Begin
387 return RP_DATA_FOUND;
388 END;
389 Function RP_ID_p return varchar2 is
390 Begin
391 return RP_ID;
392 END;
393 Function RP_NONE_p return varchar2 is
394 Begin
395 return RP_NONE;
396 END;
397 Function RP_SEGMENT_p return varchar2 is
398 Begin
399 return RP_SEGMENT;
400 END;
401 Function RP_NUMBER_p return varchar2 is
402 Begin
403 return RP_NUMBER;
404 END;
405 Function RP_VALUE_p return varchar2 is
406 Begin
407 return RP_VALUE;
408 END;
409 Function RP_YES_p return varchar2 is
410 Begin
411 return RP_YES;
412 END;
413 Function RP_AMT_p return varchar2 is
414 Begin
415 return RP_AMT;
416 END;
417 Function RP_NO_p return varchar2 is
418 Begin
419 return RP_NO;
420 END;
421 Function RP_PER_p return varchar2 is
422 Begin
423 return RP_PER;
424 END;
425 Function RP_CODE_p return varchar2 is
426 Begin
427 return RP_CODE;
428 END;
429 Function c_industry_code_p return varchar2 is
430 Begin
431 return c_industry_code;
432 END;
433 Function c_salesrep_title_p return varchar2 is
434 Begin
435 return c_salesrep_title;
436 END;
437 Function c_salescredit_title_p return varchar2 is
438 Begin
439 return c_salescredit_title;
440 END;
441 Function c_salester_title_p return varchar2 is
442 Begin
443 return c_salester_title;
444 END;
445 END AR_RAXSOL_XMLP_PKG ;
446
447