[Home] [Help]
PACKAGE BODY: APPS.PO_POXPRREQ_XMLP_PKG
Source
1 PACKAGE BODY PO_POXPRREQ_XMLP_PKG AS
2 /* $Header: POXPRREQB.pls 120.1.12020000.3 2013/02/10 17:13:36 vegajula ship $ */
3
4 USER_EXIT_FAILURE EXCEPTION;
5
6 function BeforeReport return boolean is
7 begin
8
9 BEGIN
10 /*SRW.USER_EXIT('FND SRWINIT');*/null;
11
12
13
14
15 If P_req_num_from = P_req_num_to THEN
16 P_single_req_print := 1;
17 END IF;
18
19
20
21
22 if (get_p_struct_num <> TRUE )
23 then /*SRW.MESSAGE('1','P Struct Num Init failed');*/null;
24
25 end if;
26 if (get_chart_of_accounts_id <> TRUE )
27 then /*SRW.MESSAGE('2','Init failed');*/null;
28
29 end if;
30
31 null;
32
33
34 null;
35
36
37 null;
38
39 RETURN TRUE;
40 END; return (TRUE);
41 end;
42
43 function AfterReport return boolean is
44 begin
45
46 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
47 return (TRUE);
48 end;
49
50 function get_p_struct_num return boolean is
51
52 l_p_struct_num number;
53
54 begin
55 select structure_id
56 into l_p_struct_num
57 from mtl_default_sets_view
58 where functional_area_id = 2 ;
59
60 P_STRUCT_NUM := l_p_struct_num ;
61
62 return(TRUE) ;
63
64 RETURN NULL; exception
65 when others then return(FALSE) ;
66 end;
67
68 function get_chart_of_accounts_id return boolean is
69
70 l_chart_of_accounts_id number;
71
72 begin
73 select gsob.chart_of_accounts_id
74 into l_chart_of_accounts_id
75 from gl_sets_of_books gsob,
76 financials_system_parameters fsp
77 where fsp.set_of_books_id = gsob.set_of_books_id ;
78
79 P_CHART_OF_ACCOUNTS_ID := l_chart_of_accounts_id ;
80
81 return(TRUE) ;
82
83 RETURN NULL; exception
84 when others then return(FALSE) ;
85 end;
86
90 declare
87 function g_requisitiongroupfilter(req_num_type in varchar2, Requisition in varchar2) return boolean is
88 begin
89
91
92 check_req_num number;
93 check_req_num_from number;
94 check_req_num_to number;
95
96 begin
97
98 if req_num_type = 'NUMERIC' then
99 if rtrim(Requisition, '0123456789') is null then
100 check_req_num := to_number(Requisition);
101 else
102 check_req_num := -1;
103 end if;
104
105 if rtrim(nvl(P_req_num_from, Requisition), '0123456789') is null then
106 check_req_num_from := to_number(nvl(P_req_num_from, Requisition));
107 else
108 check_req_num_from := -1;
109 end if;
110
111 if rtrim(nvl(P_req_num_to, Requisition), '0123456789') is null then
112 check_req_num_to := to_number(nvl(P_req_num_to, Requisition));
113 else
114 check_req_num_to := -1;
115 end if;
116
117 if check_req_num between check_req_num_from and check_req_num_to then
118 return true ;
119 else
120 return false;
121 end if;
122 else
123 return true;
124 end if;
125
126 end ;
127 return (TRUE);
128 end;
129
130 function line_notesformula(line_note_datatype_id in number, line_note_media_id in number) return char is
131 short_note Varchar2(2000);
132 long_note clob; /* Bug 13712851 */
133 begin
134 if line_note_datatype_id = 1 then
135 select short_text
136 into short_note
137 from fnd_documents_short_text
138 where media_id = line_note_media_id;
139 return short_note;
140 elsif line_note_datatype_id = 2 then
141 select long_text
142 into long_note
143 from fnd_documents_long_text
144 where media_id = line_note_media_id;
145 return long_note;
146 else
147 return 'Attachment is not a Text format';
148 end if;
149
150 end;
151
152 function item_noteformula(item_note_datatype_id in number, item_note_media_id in number) return char is
153 short_note Varchar2(2000);
154 long_note clob; /* Bug 13712851 */
155 begin
156 if item_note_datatype_id = 1 then
157 select short_text
158 into short_note
159 from fnd_documents_short_text
160 where media_id = item_note_media_id;
161 return short_note;
162 elsif item_note_datatype_id = 2 then
163 select long_text
164 into long_note
165 from fnd_documents_long_text
166 where media_id = item_note_media_id;
167 return long_note;
168 else
169 return 'Attachment is not a Text format';
170 end if;
171
172 end;
173
174 function header_notesformula(header_note_datatype_id in number, header_note_media_id in number) return char is
175 short_note Varchar2(2000) := NULL;
176 long_note clob := NULL; /* Bug 13712851 */
177 begin
178 if header_note_datatype_id = 1 then
179 IF (header_note_media_id IS NOT NULL)THEN
180 select short_text
181 into short_note
182 from fnd_documents_short_text
183 where media_id = header_note_media_id;
184 END IF;
185 return short_note;
186 elsif header_note_datatype_id = 2 then
187 IF (header_note_media_id IS NOT NULL)THEN
188 select long_text
189 into long_note
190 from fnd_documents_long_text
191 where media_id = header_note_media_id;
192 END IF;
193 return long_note;
194 else
195 return 'Attachment is not a Text format';
196 end if;
197
198 end;
199
200 function c_amount_precision(GL_CURRENCY in varchar2, C_AMOUNT in number) return number is
201
202
203
204
205
206 X_CURRENCY_PRECISION NUMBER;
207 DUMMY_NUM1 NUMBER;
208 DUMMY_NUM2 NUMBER;
209 BEGIN
210
211 /*SRW.REFERENCE(C_AMOUNT);*/null;
212
213 /*SRW.REFERENCE(GL_CURRENCY);*/null;
214
215 FND_CURRENCY.GET_INFO(GL_CURRENCY,X_CURRENCY_PRECISION,DUMMY_NUM1,DUMMY_NUM2);
216 return ROUND(C_AMOUNT,X_CURRENCY_PRECISION);
217
218 END;
219
220 function c_total_amount_precision(GL_CURRENCY in varchar2, TOTAL_AMOUNT in number) return number is
221
222
223
224
225
226 X_CURRENCY_PRECISION NUMBER;
227 TOT_AMOUNT_WITH_PRECISION_DISP VARCHAR2(38);
228 DUMMY_NUM1 NUMBER;
229 DUMMY_NUM2 NUMBER;
230
231 BEGIN
232
233 /*SRW.REFERENCE(GL_CURRENCY);*/null;
234
235 /*SRW.REFERENCE(TOTAL_AMOUNT);*/null;
236
237 FND_CURRENCY.GET_INFO(GL_CURRENCY,X_CURRENCY_PRECISION,DUMMY_NUM1, DUMMY_NUM2);
238 --return ROUND(TOTAL_AMOUNT,X_CURRENCY_PRECISION);
239 return X_CURRENCY_PRECISION;
240
241
242 END;
243
244 --Functions to refer Oracle report placeholders--
245
246 END PO_POXPRREQ_XMLP_PKG ;
247