[Home] [Help]
PACKAGE BODY: APPS.FA_FAS447_XMLP_PKG
Source
1 PACKAGE BODY FA_FAS447_XMLP_PKG AS
2 /* $Header: FAS447B.pls 120.1 2009/07/19 09:34:34 glchen ship $ */
3 function report_nameformula(Company_Name in varchar2) return varchar2 is
4 begin
5 DECLARE
6 l_report_name VARCHAR2(80);
7 l_conc_program_id NUMBER;
8 BEGIN
9 --Added during DT Fix
10 P_CONC_REQUEST_ID := fnd_global.CONC_REQUEST_ID;
11 --End of DT Fix
12 RP_Company_Name := Company_Name;
13 SELECT cr.concurrent_program_id
14 INTO l_conc_program_id
15 FROM FND_CONCURRENT_REQUESTS cr
16 WHERE cr.program_application_id = 140
17 AND cr.request_id = P_CONC_REQUEST_ID;
18 SELECT cp.user_concurrent_program_name
19 INTO l_report_name
20 FROM FND_CONCURRENT_PROGRAMS_VL cp
21 WHERE
22 cp.concurrent_program_id= l_conc_program_id
23 and cp.application_id = 140;
24 l_report_name := substr(l_report_name,1,instr(l_report_name,' (XML)'));
25 RP_Report_Name := l_report_name;
26 RETURN(l_report_name);
27 EXCEPTION
28 WHEN OTHERS THEN
29 RP_Report_Name := ':Form 4797 - Ordinary Gains and Losses Report:';
30 RETURN(RP_REPORT_NAME);
31 END;
32 RETURN NULL; end;
33 function BeforeReport return boolean is
34 begin
35 /*SRW.USER_EXIT('FND SRWINIT');*/null;
36 return (TRUE);
37 end;
38 function AfterReport return boolean is
39 begin
40 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
41 return (TRUE);
42 end;
43 function Period1_PCFormula return Number is
44 begin
45 DECLARE
46 l_period_POD DATE;
47 l_period_PCD DATE;
48 l_period_PC NUMBER(15);
49 l_period_FY NUMBER(15);
50 BEGIN
51 SELECT period_counter,
52 period_open_date,
53 nvl(period_close_date, sysdate),
54 fiscal_year
55 INTO l_period_PC,
56 l_period_POD,
57 l_period_PCD,
58 l_period_FY
59 FROM FA_DEPRN_PERIODS
60 WHERE book_type_code = P_BOOK
61 AND period_name = P_PERIOD1;
62 Period1_POD := l_period_POD;
63 Period1_PCD := l_period_PCD;
64 Period1_FY := l_period_FY;
65 return(l_period_PC);
66 END;
67 RETURN NULL; end;
68 function Period2_PCFormula return Number is
69 begin
70 DECLARE
71 l_period_POD DATE;
72 l_period_PCD DATE;
73 l_period_PC NUMBER(15);
74 l_period_FY NUMBER(15);
75 BEGIN
76 SELECT period_counter,
77 period_open_date,
78 nvl(period_close_date, sysdate),
79 fiscal_year
80 INTO l_period_PC,
81 l_period_POD,
82 l_period_PCD,
83 l_period_FY
84 FROM FA_DEPRN_PERIODS
85 WHERE book_type_code = P_BOOK
86 AND period_name = P_PERIOD2;
87 Period2_POD := l_period_POD;
88 Period2_PCD := l_period_PCD;
89 Period2_FY := l_period_FY;
90 return(l_period_PC);
91 END;
92 RETURN NULL; end;
93 function PRECFormula return VARCHAR2 is
94 begin
95 DECLARE
96 l_precision NUMBER(15);
97 BEGIN
98 SELECT
99 cur.precision
100 INTO
101 l_precision
102 FROM FA_BOOK_CONTROLS bc,
103 GL_SETS_OF_BOOKS sob,
104 FND_CURRENCIES cur
105 WHERE bc.book_type_code = P_BOOK
106 AND sob.set_of_books_id = bc.set_of_books_id
107 AND sob.currency_code = cur.currency_code;
108 Precision := l_precision;
109 return(l_precision);
110 END;
111 RETURN NULL; end;
112 function GAIN_NLSFormula return VARCHAR2 is
113 begin
114 DECLARE
115 l_meaning VARCHAR2(80);
116 BEGIN
117 select MEANING
118 into l_meaning
119 from FA_LOOKUPS
120 where LOOKUP_TYPE = 'GAINLOSS'
121 and LOOKUP_CODE = 'GAIN';
122 return (l_meaning);
123 EXCEPTION
124 WHEN OTHERS THEN
125 return (null);
126 END;
127 RETURN NULL; end;
128 function LOSS_NLSFormula return VARCHAR2 is
129 begin
130 DECLARE
131 l_meaning VARCHAR2(80);
132 BEGIN
133 select MEANING
134 into l_meaning
135 from FA_LOOKUPS
136 where LOOKUP_TYPE = 'GAINLOSS'
137 and LOOKUP_CODE = 'LOSS';
138 return (l_meaning);
139 EXCEPTION
140 WHEN OTHERS THEN
141 return (null);
142 END;
143 RETURN NULL; end;
144 --Functions to refer Oracle report placeholders--
145 Function PRECISION_p return number is
146 Begin
147 return PRECISION;
148 END;
149 Function ACCT_BAL_APROMPT_p return varchar2 is
150 Begin
151 return ACCT_BAL_APROMPT;
152 END;
153 Function ACCT_CC_APROMPT_p return varchar2 is
154 Begin
155 return ACCT_CC_APROMPT;
156 END;
157 Function CAT_MAJ_RPROMPT_p return varchar2 is
158 Begin
159 return CAT_MAJ_RPROMPT;
160 END;
161 Function Period1_POD_p return date is
162 Begin
163 return Period1_POD;
164 END;
165 Function Period1_PCD_p return date is
166 Begin
167 return Period1_PCD;
168 END;
169 Function Period1_FY_p return number is
170 Begin
171 return Period1_FY;
172 END;
173 Function Period2_POD_p return date is
174 Begin
175 return Period2_POD;
176 END;
177 Function Period2_PCD_p return date is
178 Begin
179 return Period2_PCD;
180 END;
181 Function Period2_FY_p return number is
182 Begin
183 return Period2_FY;
184 END;
185 Function RP_COMPANY_NAME_p return varchar2 is
186 Begin
187 return RP_COMPANY_NAME;
188 END;
189 Function RP_REPORT_NAME_p return varchar2 is
190 Begin
191 return RP_REPORT_NAME;
192 END;
193 Function RP_BAL_LPROMPT_p return varchar2 is
194 Begin
195 return RP_BAL_LPROMPT;
196 END;
197 END FA_FAS447_XMLP_PKG ;
198