DBA Data[Home] [Help]

PACKAGE BODY: APPS.AR_RAXCUSLR_XMLP_PKG

Source


1 PACKAGE BODY AR_RAXCUSLR_XMLP_PKG AS
2 /* $Header: RAXCUSLRB.pls 120.0 2007/12/27 14:17:44 abraghun noship $ */
3 
4 function AfterPForm return boolean is
5 begin
6 
7 begin
8 
9 if lcn is not null then
10 	lp_lcn := ' AND RACU.ACCOUNT_NUMBER >= :lcn ';
11 else
12         LP_LCN := ' ';
13 end if;
14 
15 if hcn is not null then
16 	lp_hcn := ' AND RACU.ACCOUNT_NUMBER <= :hcn ';
17 else
18         LP_HCN := ' ';
19 end if;
20 
21 if p_customer_name_low is not null then
22 	lp_customer_low  := ' AND PARTY.PARTY_NAME >= :p_customer_name_low ';
23  else
24         LP_CUSTOMER_LOW := ' ';
25 end if;
26 
27 if p_customer_name_high is not null then
28 	lp_customer_high  := ' AND PARTY.PARTY_NAME <= :p_customer_name_high ';
29 else
30         LP_CUSTOMER_HIGH := ' ';
31 end if;
32 
33 
34 end;  return (TRUE);
35 end;
36 
37 function BeforeReport return boolean is
38 begin
39 
40      /*srw.message ('100', 'BeforeReport Trigger +');*/null;
41 
42 
43      /*SRW.USER_EXIT('FND SRWINIT');*/null;
44 
45 
46      Get_Customer_Segment;
47      Setup_Automotive_Requirements;
48      Get_Company_Name;
49      Get_Report_Name;
50 
51      get_boiler_plates;
52 
53      /*srw.message ('100', 'BeforeReport Trigger -');*/null;
54 
55 
56      return (TRUE);
57 
58 end;
59 
60 PROCEDURE Get_Customer_Segment IS
61      BEGIN
62 
63         /*  srw.message ('100', 'BeforeReport_Procs.Get_Customer_Segment');*/
64 
65          /* srw.user_exit('FND FLEXSQL
66                          CODE="CT#"
67                          APPL_SHORT_NAME="AR"
68                          TABLEALIAS="RATT"
69                          OUTPUT=":TERR_FLEX_ALL_SEG"
70                          MODE="SELECT"
71                          DISPLAY="ALL"');*/
72 
73           null;
74      EXCEPTION
75           WHEN NO_DATA_FOUND THEN
76               /* srw.message ('101', 'BeforeReport_Procs.Get_Customer_Segment:  Segment Not Found');*/
77                /*RAISE;*/
78 	       null;
79           WHEN OTHERS THEN
80               /* srw.message ('101', 'BeforeReport_Procs.Get_Customer_Segment:  Segment Failed.');*/
81               /* RAISE; */
82 	      null;
83 
84      END;
85 
86 
87      /*
88       --------------------------------------------------------------------------
89      |  Procedure:      Setup_Automotive_Requirements                           |
90      |                                                                          |
91      |  Functionality:  Setup various report parameters if the Automotive       |
92      |                  product has been installed on the customer's site.      |
93       --------------------------------------------------------------------------
94      */
95 
96      PROCEDURE Setup_Automotive_Requirements IS
97      BEGIN
98 
99          /* srw.message ('100', 'BeforeReport_Procs.Setup_Automotive_Requirements');*/
100 
101          /* srw.user_exit('FND INSTALLATION OUTPUT_TYPE="STATUS"
102                          OUTPUT_FIELD=":P_veh_install_status"
103                          APPS="VEH"') ;*/
104 
105           IF P_veh_install_status = 'I' THEN
106 
107                /* Automotive Specific solution */
108 
109               /* srw.message ('100', 'BeforeReport_Procs.Setup_Automotive_Requirements:  Automotive Installed');*/
110 
111                P_veh_install_status := 'Y';
112                P_veh_select_column1 := 'TPD.TRANSLATOR_CODE';
113                P_veh_select_column2 := 'RAAD.ECE_TP_LOCATION_CODE';
114                P_veh_from_table     := 'ECE_TP_DETAILS TPD, ECE_TP_HEADERS TPH, ';
115                P_veh_where_clause1  := 'TPD.TP_HEADER_ID(+)';
116                P_veh_where_clause2  := 'TPH.TP_HEADER_ID(+)';
117           END IF;
118 
119      EXCEPTION
120           WHEN NO_DATA_FOUND THEN
121                /*srw.message ('101', 'BeforeReport_Procs.Setup_Automotive_Requirements:  Automotive Not Found');*/
122               /* RAISE; */
123 	      null;
124           WHEN OTHERS THEN
125               /* srw.message ('101', 'BeforeReport_Procs.Setup_Automotive_Requirements:  Automotive Failed.'); */
126               /* RAISE; */
127 	      null;
128      END;
129 
130 
131      /*
132       --------------------------------------------------------------------------
133      |  Procedure:      Get_Company_Name                                        |
134      |                                                                          |
135      |  Functionality:  The Company Name is displayed within the header of each |
136      |                  page within the report.                                 |
137       --------------------------------------------------------------------------
138      */
139 
140      PROCEDURE Get_Company_Name IS
141      l_sob_id          NUMBER(15);
142      l_company_name    VARCHAR2(30);
143      BEGIN
144 
145           /*srw.message ('100', 'BeforeReport_Procs.Get_Company_Name');*/
146 
147           SELECT sob.name
148           INTO   L_Company_Name
149           FROM   gl_sets_of_books sob,
150                  ar_system_parameters ar
151           WHERE  sob.set_of_books_id  = ar.set_of_books_id;
152 
153 	  /*srw.message ('100', 'L_Company_Name = ' || L_Company_Name); */
154 
155          RP_Company_Name := L_Company_Name;
156 
157 
158          SELECT set_of_books_id
159          INTO   l_sob_id
160          FROM   ar_system_parameters;
161 
162 	/* srw.message ('100', 'l_sob_id = ' || l_sob_id);*/
163 
164 /*
165          :RP_Company_Name := 'US Operations';
166 */
167 
168      EXCEPTION
169           WHEN NO_DATA_FOUND THEN
170               /* srw.message ('101', 'BeforeReport_Procs.Get_Company_Name:  SOB Not Found.');
171                srw.message ('101', 'BeforeReport_Procs.Get_Company_Name:  Company Name Not Found.');
172 
173                RAISE;*/
174 	       null;
175 
176           WHEN OTHERS THEN
177               /* srw.message ('101', 'BeforeReport_Procs.Get_Company_Name:  Company Name Failed.');
178                RAISE;*/
179 	       null;
180      END;
181 
182 
183      /*
184       --------------------------------------------------------------------------
185      |  Procedure:      Get_Report_Name                                         |
186      |                                                                          |
187      |  Functionality:  The report name is displayed within the header of each  |
188      |                  page within the report.                                 |
189       --------------------------------------------------------------------------
190      */
191 
192      PROCEDURE Get_Report_Name IS
193      l_report_name     VARCHAR2(240);
194      BEGIN
195 
196          /* srw.message ('100', 'BeforeReport_Procs.Get_Report_Name'); */
197 
198           SELECT cp.user_concurrent_program_name
199           INTO   l_report_name
200           FROM   FND_CONCURRENT_PROGRAMS_VL cp,
201                  FND_CONCURRENT_REQUESTS cr
202           WHERE  cr.request_id = P_CONC_REQUEST_ID
203           AND    cp.application_id = cr.program_application_id
204           AND    cp.concurrent_program_id = cr.concurrent_program_id;
205 
206           RP_Report_Name := l_report_name;
207 
208      EXCEPTION
209           WHEN NO_DATA_FOUND THEN
210              /*  srw.message ('101', 'BeforeReport_Procs.Get_Report_Name:  Name not found');*/
211                RP_REPORT_NAME := '';
212           WHEN OTHERS THEN
213               /* srw.message ('101', 'BeforeReport_Procs.Get_Report_Name:  Company Name Failed.');
214                RAISE;*/
215 	       null;
216      END;
217 
218 
219 
220 function AfterReport return boolean is
221 begin
222 
223 /*srw.user_exit('FND SRWEXIT');*/null;
224   return (TRUE);
225 end;
226 
227 function ITEM_FLEX_STRUCTUREFormula return VARCHAR2 is
228   l_item_flex VARCHAR2(50);
229 begin
230 
231 
232 
233   oe_profile.get('SO_ORGANIZATION_ID', l_item_flex );
234 
235   RETURN(l_item_flex) ;
236 end;
237 
238 function Set_DataFormula return VARCHAR2 is
239 begin
240 
241 begin
242 RP_DATA_FOUND := 'X';
243 return('X');
244 end;
245 
246 RETURN NULL; end;
247 
248 procedure get_lookup_meaning(p_lookup_type	in varchar2,
249 			     p_lookup_code	in varchar2,
250 			     p_lookup_meaning  	in out nocopy varchar2) is
251 w_meaning varchar2(80);
252 
253 begin
254 
255 select meaning
256   into w_meaning
257   from fnd_lookups
258  where lookup_type = p_lookup_type
259    and lookup_code = p_lookup_code ;
260 
261 p_lookup_meaning := w_meaning ;
262 
263 exception
264    when no_data_found then
265         		p_lookup_meaning := null ;
266 
267 end ;
268 
269 procedure get_boiler_plates is
270 
271 w_industry_code varchar2(20);
272 w_industry_stat varchar2(20);
273 
274 begin
275 
276 /*srw.message ('100', 'Get_Boiler_Plates');*/null;
277 
278 
279 if fnd_installation.get(0, 0,
280                         w_industry_stat,
281 	    	        w_industry_code) then
282    if w_industry_code = 'C' then
283       c_sales_title := null ;
284    else
285       get_lookup_meaning('IND_SALES',
286                        	 w_industry_code,
287 			 c_sales_title);
288       get_lookup_meaning('IND_SALES_TERRITORY',
289                        	 w_industry_code,
290 			 c_salester_title);
291       get_lookup_meaning('IND_SALES_REP',
292                        	 w_industry_code,
293 			 c_salesrep_title);
294 
295    end if;
296 end if;
297 
298 c_industry_code :=   w_Industry_code ;
299 
300 end ;
301 
302 function set_display_for_core(p_field_name in varchar2) return boolean is
303 
304 begin
305 
306 if c_industry_code = 'C' then
307    return(TRUE);
308 elsif p_field_name = 'SALES' then
309    if c_sales_title is not null then
310       return(FALSE);
311    else
312       return(TRUE);
313    end if;
314 elsif p_field_name = 'SALESREP' then
315    if c_salesrep_title is not null then
316       return(FALSE);
317    else
318       return(TRUE);
319    end if;
320 elsif p_field_name = 'SALESTER' then
321    if c_salester_title is not null then
322       return(FALSE);
323    else
324       return(TRUE);
325    end if;
326 end if;
327 
328 RETURN NULL; end;
329 
330 function set_display_for_gov(p_field_name in varchar2) return boolean is
331 
332 begin
333 
334 
335 if c_industry_code = 'C' then
336    return(FALSE);
337 elsif p_field_name = 'SALES' then
338    if c_sales_title is not null then
339       return(TRUE);
340    else
341       return(FALSE);
342    end if;
343 elsif p_field_name = 'SALESREP' then
344    if c_salesrep_title is not null then
345       return(TRUE);
346    else
347       return(FALSE);
348    end if;
349 elsif p_field_name = 'SALESTER' then
350    if c_salester_title is not null then
351       return(TRUE);
352    else
353       return(FALSE);
354    end if;
355 end if;
356 
357 RETURN NULL; end ;
358 
359 function c_veh_tp_designatorformula(TRANSLATOR_CODE in varchar2) return varchar2 is
360 begin
361 
362 /*SRW.REFERENCE(TRANSLATOR_CODE);*/null;
363 
364 RETURN(TRANSLATOR_CODE);
365 end;
366 
367 function G_CU_ADDRESSGroupFilter return boolean is
368 begin
369 
370 
371   return (TRUE);
372 end;
373 
374 function CF_ORDER_BYFormula return Char is
375 begin
376 
377 return(ARPT_SQL_FUNC_UTIL.get_lookup_meaning('SORT_BY_RAXCUSLR',p_order_by));
378 
379 
380 end;
381 
382 --Functions to refer Oracle report placeholders--
383 
384  Function RP_COMPANY_NAME_p return varchar2 is
385 	Begin
386 	 return RP_COMPANY_NAME;
387 	 END;
388  Function RP_REPORT_NAME_p return varchar2 is
389 	Begin
390 	 return RP_REPORT_NAME;
391 	 END;
392  Function RP_DATA_FOUND_p return varchar2 is
393 	Begin
394 	 return RP_DATA_FOUND;
395 	 END;
396  Function TERR_FLEX_ALL_SEG_p return varchar2 is
397 	Begin
398 	 return TERR_FLEX_ALL_SEG;
399 	 END;
400  Function c_industry_code_p return varchar2 is
401 	Begin
402 	 return c_industry_code;
403 	 END;
404  Function c_salesrep_title_p return varchar2 is
405 	Begin
406 	 return c_salesrep_title;
407 	 END;
408  Function c_sales_title_p return varchar2 is
409 	Begin
410 	 return c_sales_title;
411 	 END;
412  Function c_salester_title_p return varchar2 is
413 	Begin
414 	 return c_salester_title;
415 	 END;
416 END AR_RAXCUSLR_XMLP_PKG ;
417 
418