DBA Data[Home] [Help]

PACKAGE BODY: APPS.AR_ARXASR_XMLP_PKG

Source


1 PACKAGE BODY AR_ARXASR_XMLP_PKG AS
2 /* $Header: ARXASRB.pls 120.0 2007/12/27 13:33:19 abraghun noship $ */
3 
4 function BeforeReport return boolean is
5 begin
6 	P_CONC_REQUEST_ID:=FND_GLOBAL.conc_request_id;
7 /*SRW.USER_EXIT('FND SRWINIT');*/null;
8 
9 
10 
11 
12 
13 begin
14 
15  P_CONS_PROFILE_VALUE := AR_SETUP.value('AR_SHOW_BILLING_NUMBER',null);
16      /*srw.message ('101', 'Consolidated Billing Profile:  ' || P_CONS_PROFILE_VALUE);*/null;
17 
18 
19 exception
20      when others then
21      /*srw.message ('101', 'Consolidated Billing Profile:  Failed.');*/null;
22 
23 end;
24 
25 
26      If    ( P_CONS_PROFILE_VALUE = 'N' ) then
27            lp_query_show_bill        := 'to_char(NULL)';
28           -- lp_table_show_bill        := null;
29            lp_table_show_bill        := ' ';
30           -- lp_where_show_bill        := null;
31 			lp_where_show_bill        := ' ';
32 
33      Else  lp_query_show_bill        := 'ci.cons_billing_number';
34            lp_table_show_bill        := 'ar_cons_inv ci,';
35            lp_where_show_bill        := 'and ps.cons_inv_id = ci.cons_inv_id(+)';
36 
37      End if;
38   return (TRUE);
39 end;
40 
41 function AfterReport return boolean is
42 begin
43 
44 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
45   return (TRUE);
46 end;
47 
48 function report_nameformula(Company_Name in varchar2) return varchar2 is
49 begin
50 
51 DECLARE
52     l_report_name  VARCHAR2(240);
53 BEGIN
54     RP_Company_Name := Company_Name;
55     SELECT cp.user_concurrent_program_name
56     INTO   l_report_name
57     FROM   FND_CONCURRENT_PROGRAMS_VL cp,
58            FND_CONCURRENT_REQUESTS cr
59     WHERE  cr.request_id = P_CONC_REQUEST_ID
60     AND    cp.application_id = cr.program_application_id
61     AND    cp.concurrent_program_id = cr.concurrent_program_id;
62 
63     RP_Report_Name := l_report_name;
64     RETURN(l_report_name);
65 EXCEPTION
66     WHEN NO_DATA_FOUND
67     THEN RP_REPORT_NAME := NULL;
68          RETURN(NULL);
69 END;
70 RETURN NULL; end;
71 
72 function AfterPForm return boolean is
73 begin
74 
75 
76  /*SRW.USER_EXIT('FND SRWINIT');*/null;
77 
78 
79   p_mrcsobtype := 'P';
80 
81 
82   lp_ar_system_parameters := 'AR_SYSTEM_PARAMETERS';
83   lp_ar_system_parameters_all := 'AR_SYSTEM_PARAMETERS_ALL';
84   lp_ar_payment_schedules := 'AR_PAYMENT_SCHEDULES';
85   lp_ar_payment_schedules_all := 'AR_PAYMENT_SCHEDULES_ALL';
86   lp_ar_adjustments := 'AR_ADJUSTMENTS';
87   lp_ar_adjustments_all := 'AR_ADJUSTMENTS_ALL';
88   lp_ar_cash_receipt_history := 'AR_CASH_RECEIPT_HISTORY';
89   lp_ar_cash_receipt_history_all := 'AR_CASH_RECEIPT_HISTORY_ALL';
90   lp_ar_batches := 'AR_BATCHES';
91   lp_ar_batches_all := 'AR_BATCHES_ALL';
92   lp_ar_cash_receipts := 'AR_CASH_RECEIPTS';
93   lp_ar_cash_receipts_all := 'AR_CASH_RECEIPTS_ALL';
94   lp_ar_distributions := 'AR_DISTRIBUTIONS';
95   lp_ar_distributions_all := 'AR_DISTRIBUTIONS_ALL';
96   lp_ra_customer_trx := 'RA_CUSTOMER_TRX';
97   lp_ra_customer_trx_all := 'RA_CUSTOMER_TRX_ALL';
98   lp_ra_batches := 'RA_BATCHES';
99   lp_ra_batches_all := 'RA_BATCHES_ALL';
100   lp_ra_cust_trx_gl_dist := 'RA_CUST_TRX_LINE_GL_DIST';
101   lp_ra_cust_trx_gl_dist_all := 'RA_CUST_TRX_LINE_GL_DIST_ALL';
102   lp_ar_misc_cash_dists := 'AR_MISC_CASH_DISTRIBUTIONS';
103   lp_ar_misc_cash_dists_all := 'AR_MISC_CASH_DISTRIBUTIONS_ALL';
104   lp_ar_rate_adjustments := 'AR_RATE_ADJUSTMENTS';
105   lp_ar_rate_adjustments_all := 'AR_RATE_ADJUSTMENTS_ALL';
106   lp_ar_receivable_apps := 'AR_RECEIVABLE_APPLICATIONS';
107   lp_ar_receivable_apps_all := 'AR_RECEIVABLE_APPLICATIONS_ALL';
108 
109 
110 
111 BEGIN
112 
113 
114 
115 if p_start_account_status is NOT NULL then
116   lp_start_account_status1 := 'and   decode(cp_site.collector_id, null, cp_cust.account_status,
117 			cp_site.account_status ) >= :p_start_account_status' ;
118   lp_start_account_status2 := 'and  cp_cust.account_status >= :p_start_account_status' ;
119 
120 end if ;
121 if p_end_account_status is NOT NULL then
122   lp_end_account_status1 := 'and   decode(cp_site.collector_id, null, cp_cust.account_status,
123 			cp_site.account_status ) <= :p_end_account_status' ;
124   lp_end_account_status2 := 'and  cp_cust.account_status <= :p_end_account_status' ;
125 
126 end if ;
127 
128 
129 if p_customer_name_low is NOT NULL then
130   lp_customer_name_low := 'and party.party_name  >= :p_customer_name_low';
131 end if ;
132 if p_customer_name_high is NOT NULL then
133   lp_customer_name_high := 'and party.party_name  <= :p_customer_name_high';
134 end if ;
135 if p_customer_number_low is NOT NULL then
136   lp_customer_number_low := 'and cust_acct.account_number  >= :p_customer_number_low';
137 end if ;
138 if p_customer_number_high is NOT NULL then
139   lp_customer_number_high := 'and cust_acct.account_number  <= :p_customer_number_high';
140 end if ;
141 if p_collector_name_low is NOT NULL then
142   lp_collector_name_low := 'and col.name  >= :p_collector_name_low';
143 end if ;
144 if p_collector_name_high is NOT NULL then
145   lp_collector_name_high := 'and col.name  <= :p_collector_name_high';
146 end if ;
147 
148 if upper (p_order_by) = 'COLLECTOR' then
149   lp_order_by := 'order by 1, 6 , 5 , 2 , 3 , 8 , 7 ' ;
150 elsif  upper (p_order_by) = 'CUSTOMER NUMBER' then
151   lp_order_by := ' order by  1 , 3 , 8 , 7 '  ;
152 else
153   lp_order_by := ' order by  1 , 2 , 3 , 8 , 7 ' ;
154 end if ;
155 
156 END ;
157   return (TRUE);
158 end;
159 
160 function c_status_summary_labelformula(status in varchar2) return varchar2 is
161 begin
162 
163 return ( status );
164 
165 end;
166 
167 function c_data_not_foundformula(status in varchar2) return number is
168 begin
169 
170 
171 rp_data_found := nvl(status , 'null') ;
172 
173 return (0);
174 
175 end;
176 
177 --Functions to refer Oracle report placeholders--
178 
179  Function RP_COMPANY_NAME_p return varchar2 is
180 	Begin
181 	 return RP_COMPANY_NAME;
182 	 END;
183  Function RP_REPORT_NAME_p return varchar2 is
184 	Begin
185 	 return substr(RP_REPORT_NAME,1,instr(RP_REPORT_NAME,' (XML)'));
186 	 END;
187  Function RP_DATA_FOUND_p return varchar2 is
188 	Begin
189 	 return RP_DATA_FOUND;
190 	 END;
191  Function RPD_REPORT_SUMMARY_p return varchar2 is
192 	Begin
193 	 return RPD_REPORT_SUMMARY;
194 	 END;
195 END AR_ARXASR_XMLP_PKG ;
196