[Home] [Help]
PACKAGE BODY: APPS.FA_FASCC_XMLP_PKG
Source
1 PACKAGE BODY FA_FASCC_XMLP_PKG AS
2 /* $Header: FASCCB.pls 120.0.12010000.1 2008/07/28 13:16:29 appldev ship $ */
3
4 function BookFormula return VARCHAR2 is
5 begin
6
7 DECLARE
8 l_book VARCHAR2(15);
9 l_accounting_flex_structure NUMBER(15);
10 l_currency_code VARCHAR2(15);
11 l_precision NUMBER(15);
12 BEGIN
13 IF upper(p_mrcsobtype) = 'R'
14 THEN
15 SELECT bc.book_type_code,
16 bc.accounting_flex_structure,
17 sob.currency_code,
18 cur.precision
19 INTO l_book,
20 l_accounting_flex_Structure,
21 l_currency_code,
22 l_precision
23 FROM FA_BOOK_CONTROLS_MRC_V bc,
24 GL_SETS_OF_BOOKS sob,
25 FND_CURRENCIES cur
26 WHERE bc.book_type_code = P_BOOK
27 AND sob.set_of_books_id = bc.set_of_books_id
28 AND sob.currency_code = cur.currency_code;
29 ELSE
30 SELECT bc.book_type_code,
31 bc.accounting_flex_structure,
32 sob.currency_code,
33 cur.precision
34 INTO l_book,
35 l_accounting_flex_Structure,
36 l_currency_code,
37 l_precision
38 FROM FA_BOOK_CONTROLS bc,
39 GL_SETS_OF_BOOKS sob,
40 FND_CURRENCIES cur
41 WHERE bc.book_type_code = P_BOOK
42 AND sob.set_of_books_id = bc.set_of_books_id
43 AND sob.currency_code = cur.currency_code;
44 END IF;
45 Accounting_Flex_Structure:=l_accounting_flex_structure;
46 Currency_Code := l_currency_code;
47 Precision := l_precision;
48
49 return(l_book);
50 END;
51
52 RETURN NULL; end;
53
54 function Period1Formula return VARCHAR2 is
55 begin
56
57 DECLARE
58 l_period_name VARCHAR2(15);
59 l_period_POD DATE;
60 l_period_PCD DATE;
61 l_period_PC NUMBER(15);
62 BEGIN
63 IF upper(p_mrcsobtype) = 'R'
64 THEN
65 SELECT period_name,
66 period_counter,
67 period_open_date,
68 nvl(period_close_date, sysdate)
69 INTO l_period_name,
70 l_period_PC,
71 l_period_POD,
72 l_period_PCD
73 FROM FA_DEPRN_PERIODS_MRC_V
74 WHERE book_type_code = P_BOOK
75 AND period_name = P_PERIOD1;
76 ELSE
77 SELECT period_name,
78 period_counter,
79 period_open_date,
80 nvl(period_close_date, sysdate)
81 INTO l_period_name,
82 l_period_PC,
83 l_period_POD,
84 l_period_PCD
85 FROM FA_DEPRN_PERIODS
86 WHERE book_type_code = P_BOOK
87 AND period_name = P_PERIOD1;
88 END IF;
89
90 Period1_PC := l_period_PC;
91 Period1_POD := l_period_POD;
92 Period1_PCD := l_period_PCD;
93 return(l_period_name);
94 END;
95
96 RETURN NULL; end;
97
98 function report_nameformula(Company_Name in varchar2) return varchar2 is
99 begin
100
101 DECLARE
102 l_report_name VARCHAR2(80);
103 l_conc_program_id NUMBER;
104 BEGIN
105 --Added during DT Fix
106 P_CONC_REQUEST_ID := fnd_global.CONC_REQUEST_ID;
107 --End of DT Fix
108 RP_Company_Name := Company_Name;
109
110 SELECT cr.concurrent_program_id
111 INTO l_conc_program_id
112 FROM FND_CONCURRENT_REQUESTS cr
113 WHERE cr.program_application_id = 140
114 AND cr.request_id = P_CONC_REQUEST_ID;
115
116 SELECT cp.user_concurrent_program_name
117 INTO l_report_name
118 FROM FND_CONCURRENT_PROGRAMS_VL cp
119 WHERE
120 cp.concurrent_program_id= l_conc_program_id
121 and cp.application_id = 140;
122
123 l_report_name := substr(l_report_name,1,instr(l_report_name,' (XML)'));
124
125 RP_Report_Name := l_report_name;
126 RETURN(l_report_name);
127
128 EXCEPTION
129 WHEN OTHERS THEN
130 RP_Report_Name := 'Cost Clearing Reconciliation Report';
131 RETURN('Cost Clearing Reconciliation Report');
132 END;
133 RETURN NULL; end;
134
135 function BeforeReport return boolean is
136 begin
137
138 /*SRW.USER_EXIT('FND SRWINIT');*/null;
139
140
141 IF upper(p_mrcsobtype) = 'R'
142 THEN
143 fnd_client_info.set_currency_context(p_ca_set_of_books_id);
144 END IF;
145
146 return (TRUE);
147 end;
148
149 function AfterReport return boolean is
150 begin
151
152 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
153 return (TRUE);
154 end;
155
156 function AfterPForm return boolean is
157 begin
158
159 IF p_ca_set_of_books_id <> -1999
160 THEN
161
162 BEGIN
163 select mrc_sob_type_code, currency_code
164 into p_mrcsobtype, lp_currency_code
165 from gl_sets_of_books
166 where set_of_books_id = p_ca_set_of_books_id;
167 EXCEPTION
168 WHEN OTHERS THEN
169 p_mrcsobtype := 'P';
170 END;
171 ELSE
172 p_mrcsobtype := 'P';
173 END IF;
174
175 IF upper(p_mrcsobtype) = 'R'
176 THEN
177 lp_fa_book_controls := 'FA_BOOK_CONTROLS_MRC_V';
178 lp_fa_asset_invoices := 'FA_ASSET_INVOICES_MRC_V';
179 lp_fa_books := 'FA_BOOKS_MRC_V';
180 lp_fa_books_bas := 'FA_BOOKS_BAS';
181 lp_fa_asset_invoices_bas := 'FA_ASSET_INVOICES_BAS';
182 ELSE
183 lp_fa_book_controls := 'FA_BOOK_CONTROLS';
184 lp_fa_asset_invoices := 'FA_ASSET_INVOICES';
185 lp_fa_books := 'FA_BOOKS';
186 lp_fa_books_bas := 'FA_BOOKS';
187 lp_fa_asset_invoices_bas := 'FA_ASSET_INVOICES';
188 END IF;
189
190 return (TRUE);
191 end;
192
193 function lp_fa_asset_invoicesValidTrigg return boolean is
194 begin
195
196 return (TRUE);
197 end;
198
199 --Functions to refer Oracle report placeholders--
200
201 Function Accounting_Flex_Structure_p return number is
202 Begin
203 return Accounting_Flex_Structure;
204 END;
205 Function ACCT_BAL_APROMPT_p return varchar2 is
206 Begin
207 return ACCT_BAL_APROMPT;
208 END;
209 Function ACCT_CC_APROMPT_p return varchar2 is
210 Begin
211 return ACCT_CC_APROMPT;
212 END;
213 Function Currency_Code_p return varchar2 is
214 Begin
215 return Currency_Code;
216 END;
217 Function Period1_PC_p return number is
218 Begin
219 return Period1_PC;
220 END;
221 Function Period1_PCD_p return date is
222 Begin
223 return Period1_PCD;
224 END;
225 Function Period1_POD_p return date is
226 Begin
227 return Period1_POD;
228 END;
229 Function Precision_p return number is
230 Begin
231 return Precision;
232 END;
233 Function RP_COMPANY_NAME_p return varchar2 is
234 Begin
235 return RP_COMPANY_NAME;
236 END;
237 Function RP_REPORT_NAME_p return varchar2 is
238 Begin
239 return RP_REPORT_NAME;
240 END;
241 Function RP_DATA_FOUND_p return varchar2 is
242 Begin
243 return RP_DATA_FOUND;
244 END;
245 END FA_FASCC_XMLP_PKG ;
246