DBA Data[Home] [Help]

PACKAGE BODY: APPS.AR_ARXDIR_XMLP_PKG

Source


1 PACKAGE BODY AR_ARXDIR_XMLP_PKG AS
2 /* $Header: ARXDIRB.pls 120.0 2007/12/27 13:47:17 abraghun noship $ */
3 
4 function BeforeReport return boolean is
5 begin
6 
7 /*SRW.USER_EXIT('FND SRWINIT');*/null;
8 
9 P_ORDER_BY_T:=UPPER(P_ORDER_BY);
10 
11 rp_sum_for := ARP_STANDARD.FND_MESSAGE(
12                   'AR_REPORTS_SUM_FOR');
13 
14 
15 
16 begin
17 
18  P_CONS_PROFILE_VALUE := AR_SETUP.value('AR_SHOW_BILLING_NUMBER',null);
19 
20      /*srw.message ('101', 'Consolidated Billing Profile:  ' || P_CONS_PROFILE_VALUE);*/null;
21 
22 
23 exception
24      when others then
25           /*srw.message ('101', 'Consolidated Billing Profile:  Failed.');*/null;
26 
27 end;
28 
29 
30 If    ( P_CONS_PROFILE_VALUE = 'N' ) then
31       lp_query_show_bill        := 'to_char(NULL)';
32       --lp_table_show_bill        := null;
33       --lp_where_show_bill        := null;
34       lp_table_show_bill        := ' ';
35       lp_where_show_bill        := ' ';
36 
37 Else  lp_query_show_bill        := 'ci.cons_billing_number';
38       lp_table_show_bill        := 'ar_cons_inv ci,';
39       lp_where_show_bill        := 'and ar_payment_schedules.cons_inv_id = ci.cons_inv_id(+)';
40 
41 End if;
42 
43   return (TRUE);
44 end;
45 
46 function AfterReport return boolean is
47 begin
48 
49 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
50   return (TRUE);
51 end;
52 
53 function report_nameformula(Company_Name in varchar2) return varchar2 is
54 begin
55 
56 DECLARE
57     l_report_name  VARCHAR2(80);
58 BEGIN
59     RP_Company_Name := Company_Name;
60 
61     SELECT substr(cp.user_concurrent_program_name,1,80)
62     INTO   l_report_name
63     FROM   FND_CONCURRENT_PROGRAMS_VL cp,
64            FND_CONCURRENT_REQUESTS cr
65     WHERE  cr.request_id = P_CONC_REQUEST_ID
66     AND    cp.application_id = cr.program_application_id
67     AND    cp.concurrent_program_id = cr.concurrent_program_id;
68 
69     RP_Report_Name := l_report_name;
70     RETURN(l_report_name);
71 EXCEPTION
72     WHEN NO_DATA_FOUND
73     THEN RP_REPORT_NAME := null;
74          RETURN(NULL);
75 END;
76 RETURN NULL; end;
77 
78 function AfterPForm return boolean is
79 begin
80 
81 
82 BEGIN
83 
84 if p_due_date_low is NOT NULL   then
85   lp_due_date_low := 'and ar_payment_schedules.due_date >= :p_due_date_low';
86 end if ;
87 if p_due_date_high is NOT NULL   then
88   lp_due_date_high := 'and ar_payment_schedules.due_date <= :p_due_date_high';
89 end if ;
90 
91 if p_item_number_low is NOT NULL   then
92   lp_item_number_low  := ' and ar_payment_schedules.trx_number  >= :p_item_number_low' ;
93 end if ;
94 
95 if p_item_number_high is  NOT NULL  then
96   lp_item_number_high  := ' and ar_payment_schedules.trx_number  <= :p_item_number_high' ;
97 end if ;
98 
99 if p_customer_name_low is NOT NULL   then
100   lp_customer_name_low := 'and PARTY.PARTY_NAME  >= :p_customer_name_low ' ;
101 end if ;
102 
103 if p_customer_name_high is NOT NULL   then
104   lp_customer_name_high := 'and PARTY.PARTY_NAME  <= :p_customer_name_high ' ;
105 end if ;
106 
107 if p_customer_number_low is NOT NULL   then
108   lp_customer_number_low := 'and CUST.ACCOUNT_NUMBER  >= :p_customer_number_low ' ;
109 end if ;
110 
111 if p_customer_number_high is NOT NULL   then
112   lp_customer_number_high := 'and CUST.ACCOUNT_NUMBER  <= :p_customer_number_high ' ;
113 end if ;
114 
115 if p_collector_low is NOT NULL   then
116   lp_collector_low  := 'and ar_collectors.name >= :p_collector_low ';
117 end if ;
118 
119 if p_collector_high is NOT NULL   then
120   lp_collector_high  := 'and ar_collectors.name <= :p_collector_high ';
121 end if ;
122 
123 if p_invoice_status is NOT NULL then
124    IF p_invoice_status = 'O' THEN
125       --p_invoice_status := 'OP';
126       p_invoice_status_param := 'OP';
127    ELSE
128       --p_invoice_status := 'CL' ;
129       p_invoice_status_param := 'CL' ;
130    END IF;
131    --lp_status := ' and ar_payment_schedules.status = :p_invoice_status ';
132    lp_status := ' and ar_payment_schedules.status = AR_ARXDIR_XMLP_PKG.p_invoice_status_param ';
133 end if;
134 if ( UPPER (p_order_by) = 'CUSTOMER') then
135   lp_order_by := 'order by  '||
136   	        'ar_payment_schedules.invoice_currency_code,'||
137     	        'PARTY.PARTY_NAME,'||
138 		'CUST.CUST_ACCOUNT_ID,'||
139 		'CUST.ACCOUNT_NUMBER,'||
140   	        'ar_payment_schedules.due_date,'||
141   	        'ar_payment_schedules.trx_number'
142 		;
143 elsif ( UPPER (p_order_by) = 'INVOICE NUMBER') then
144   lp_order_by := 'order by  '||
145   	        'ar_payment_schedules.invoice_currency_code,'||
146   	        'ar_payment_schedules.trx_number,'||
147     	        'PARTY.PARTY_NAME,'||
148 		'CUST.CUST_ACCOUNT_ID,'||
149 		'CUST.ACCOUNT_NUMBER,'||
150   	        'ar_payment_schedules.due_date'
151 		;
152 elsif ( UPPER (p_order_by) = 'DUE DATE') then
153   lp_order_by := 'order by  '||
154   	        'ar_payment_schedules.invoice_currency_code,'||
155   	        'ar_payment_schedules.due_date,'||
156     	        'PARTY.PARTY_NAME,'||
157   		'CUST.CUST_ACCOUNT_ID,'||
158 		'CUST.ACCOUNT_NUMBER,'||
159 	        'ar_payment_schedules.trx_number'
160 		;
161 end if ;
162 
163 END ;
164   return (TRUE);
165 end;
166 
167 function c_data_not_foundformula(Currency_Main in varchar2) return number is
168 begin
169 
170 rp_data_found := Currency_Main ;
171 return (0);
172 end;
173 
174 function c_cust_summary_labelformula(Dummy_Customer_Name in varchar2) return varchar2 is
175 begin
176 
177 DECLARE
178 
179 l_temp    VARCHAR2 (70);
180 
181 BEGIN
182 
183 l_temp := rp_sum_for || ' ' || Dummy_Customer_Name;
184 return (l_temp);
185 
186 END ;
187 
188 RETURN NULL; end;
189 
190 function c_currency_summary_labelformul(Currency_Main in varchar2) return varchar2 is
191 begin
192 
193 DECLARE
194 
195 l_temp       VARCHAR2 (100);
196 
197 BEGIN
198 
199 l_temp := rp_sum_for || ' ' || Currency_Main;
200 return (l_temp);
201 
202 END ;
203 RETURN NULL; end;
204 
205 function cons_numberformula(Number in varchar2, cons_bill_number in varchar2) return varchar2 is
206 begin
207 
208 /*srw.reference(Number);*/null;
209 
210 /*srw.reference(cons_bill_number);*/null;
211 
212 
213 If    ( P_CONS_PROFILE_VALUE = 'N' ) then
214       return(substr(Number,1,38));
215  ELSIF ( P_CONS_PROFILE_VALUE = 'Y' ) AND
216        (cons_bill_number is NULL) then
217        return(substr(Number,1,38));
218  ELSE
219        return(substr(substr(Number,1,NVL(length(Number), 0))||'/'||cons_bill_number,1,38));
220 
221 END IF;
222 RETURN NULL; end;
223 
224 --Functions to refer Oracle report placeholders--
225 
226  Function RP_COMPANY_NAME_p return varchar2 is
227 	Begin
228 	 return RP_COMPANY_NAME;
229 	 END;
230  Function RP_REPORT_NAME_p return varchar2 is
231 	Begin
232 	 return RP_REPORT_NAME;
233 	 END;
234  Function RP_DATA_FOUND_p return varchar2 is
235 	Begin
236 	 return RP_DATA_FOUND;
237 	 END;
238  Function RPD_REPORT_TOTAL_INV_p return varchar2 is
239 	Begin
240 	 return RPD_REPORT_TOTAL_INV;
241 	 END;
242  Function RPD_REPORT_TOTAL_BAL_p return varchar2 is
243 	Begin
244 	 return RPD_REPORT_TOTAL_BAL;
245 	 END;
246  Function RPD_REPORT_TOTAL_DISP_p return varchar2 is
247 	Begin
248 	 return RPD_REPORT_TOTAL_DISP;
249 	 END;
250  Function rp_sum_for_p return varchar2 is
251 	Begin
252 	 return rp_sum_for;
253 	 END;
254 END AR_ARXDIR_XMLP_PKG ;
255