[Home] [Help]
PACKAGE BODY: APPS.AR_RAXCUS_XMLP_PKG
Source
1 PACKAGE BODY AR_RAXCUS_XMLP_PKG AS
2 /* $Header: RAXCUSB.pls 120.0 2007/12/27 14:17:16 abraghun noship $ */
3
4 function BeforeReport return boolean is
5 begin
6
7 P_CONC_REQUEST_ID:=FND_GLOBAL.conc_request_id;
8 return (TRUE);
9 end;
10
11 function AfterReport return boolean is
12 begin
13
14 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
15 return (TRUE);
16 end;
17
18 function report_nameformula(Company_Name in varchar2) return varchar2 is
19 begin
20
21 DECLARE
22 l_report_name VARCHAR2(80);
23 BEGIN
24 RP_Company_Name := Company_Name;
25 SELECT substrb(cp.user_concurrent_program_name,1,80)
26 INTO l_report_name
27 FROM FND_CONCURRENT_PROGRAMS_VL cp,
28 FND_CONCURRENT_REQUESTS cr
29 WHERE cr.request_id = P_CONC_REQUEST_ID
30 AND cp.application_id = cr.program_application_id
31 AND cp.concurrent_program_id = cr.concurrent_program_id;
32
33 RP_Report_Name := l_report_name;
34 RETURN(l_report_name);
35 EXCEPTION
36 WHEN NO_DATA_FOUND
37 THEN RP_REPORT_NAME := 'Customer Listing - Summary';
38 RETURN('REPORT TITLE');
39 END;
40 RETURN NULL; end;
41
42 function AfterPForm return boolean is
43 begin
44
45 DECLARE
46
47 l_status_low VARCHAR2 (80);
48 l_status_high VARCHAR2 (80);
49 l_customer_name_low VARCHAR2 (50);
50 l_customer_name_high VARCHAR2 (50);
51 l_customer_number_low VARCHAR2 (30);
52 l_customer_number_high VARCHAR2 (30);
53
54 BEGIN
55
56 /*SRW.USER_EXIT('FND SRWINIT');*/null;
57
58
59 select decode(upper(p_status_low), NULL, min(look.lookup_code),
60 p_status_low),
61 decode(upper(p_status_high), NULL, max(look.lookup_code),
62 p_status_high),
63 decode(upper(p_customer_name_low), NULL, min(substrb(party.party_name,1,50)),
64 p_customer_name_low),
65 decode(upper(p_customer_name_high), NULL, max(substrb(party.party_name,1,50)),
66 p_customer_name_high),
67 decode(upper(p_customer_number_low), NULL, min(c.account_number),
68 p_customer_number_low),
69 decode(upper(p_customer_number_high),NULL, max(c.account_number),
70 p_customer_number_high)
71 into l_status_low,
72 l_status_high,
73 l_customer_name_low,
74 l_customer_name_high,
75 l_customer_number_low,
76 l_customer_number_high
77 from hz_cust_accounts c,
78 hz_parties party,
79 ar_lookups look
80 where c.status = look.lookup_code
81 and c.party_id = party.party_id
82 and look.lookup_type = 'CODE_STATUS';
83
84 pr_customer_name_low := l_customer_name_low ;
85 pr_customer_name_high := l_customer_name_high ;
86 pr_customer_number_low := l_customer_number_low ;
87 pr_customer_number_high := l_customer_number_high ;
88 pr_status_low := l_status_low ;
89 pr_status_high := l_status_high ;
90
91 if p_city_low is NOT NULL then
92 lp_city_low := ' and loc.city >= :p_city_low ';
93 end if ;
94 if p_city_high is NOT NULL then
95 lp_city_high := ' and loc.city <= :p_city_high ';
96 end if ;
97
98 if p_state_low is NOT NULL then
99 lp_state_low := ' and loc.state >= :p_state_low ';
100 end if ;
101 if p_state_high is NOT NULL then
102 lp_state_high := ' and loc.state <= :p_state_high ';
103 end if ;
104
105 if p_zip_low is NOT NULL then
106 lp_zip_low := ' and loc.postal_code >= :p_zip_low ';
107 end if ;
108 if p_zip_high is NOT NULL then
109 lp_zip_high := ' and loc.postal_code <= :p_zip_high ';
110 end if ;
111
112
113 if p_site_low is NOT NULL then
114 lp_site_low := ' and look.lookup_code >= :p_site_low ';
115 end if ;
116 if p_site_high is NOT NULL then
117 lp_site_high := ' and look.lookup_code <= :p_site_high ';
118 end if ;
119
120 END ;
121 return (TRUE);
122 end;
123
124 function c_data_not_foundformula(Customer_Name in varchar2) return number is
125 begin
126
127 rp_data_found := Customer_Name ;
128 return (0);
129 end;
130
131 function CF_ORDER_BYFormula return Char is
132
133
134 begin
135 return(ARPT_SQL_FUNC_UTIL.get_lookup_meaning('SORT_BY_RAXCUS',p_order_by));
136
137 end ;
138
139 --Functions to refer Oracle report placeholders--
140
141 Function RP_COMPANY_NAME_p return varchar2 is
142 Begin
143 return RP_COMPANY_NAME;
144 END;
145 Function RP_REPORT_NAME_p return varchar2 is
146 Begin
147 return substr(RP_REPORT_NAME,1,instr(RP_REPORT_NAME,' (XML)'));
148 END;
149 Function RP_DATA_FOUND_p return varchar2 is
150 Begin
151 return RP_DATA_FOUND;
152 END;
153 END AR_RAXCUS_XMLP_PKG ;
154