DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_POXDETIT_XMLP_PKG

Source


1 PACKAGE BODY PO_POXDETIT_XMLP_PKG AS
2 /* $Header: POXDETITB.pls 120.1 2007/12/25 10:54:36 krreddy noship $ */
3 
4 USER_EXIT_FAILURE EXCEPTION;
5 
6 function BeforeReport return boolean is
7 begin
8 
9 declare
10 l_active_inactive     po_lookup_codes.displayed_field%type ;
11 begin
12 if P_active_inactive is not null then
13 
14     select displayed_field
15     into l_active_inactive
16     from po_lookup_codes
17     where lookup_code = P_active_inactive
18     and lookup_type = 'ACTIVE_INACTIVE';
19 
20     P_act_inact_disp := l_active_inactive ;
21 
22 else
23 
24     P_act_inact_disp := '' ;
25 
26 end if;
27 
28 end;
29 
30 BEGIN
31 if (get_p_struct_num = false ) then
32 /*srw.message(1,'Failure to get :P_struct num.') ;*/null;
33 
34 end if;
35   /*SRW.USER_EXIT('FND SRWINIT');*/null;
36 
37   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
38             /*SRW.MESSAGE(1,'srw_init');*/null;
39 
40 END;
41 BEGIN
42    select gsb.chart_of_accounts_id into p_chart_of_accounts_id
43    from gl_sets_of_books gsb, financials_system_parameters fsp
44    where gsb.set_of_books_id = fsp.set_of_books_id;
45 EXCEPTION
46    when no_data_found then
47 	/*srw.message(1,'chart of accounts id');*/null;
48 
49 END;
50 BEGIN
51 
52   /*srw.user_exit('FND INSTALLATION OUTPUT_TYPE="STATUS"
53                                  OUTPUT_FIELD=":P_OFA_STATUS"
54                                          APPS="OFA"') ;*/null;
55 
56  temp:= fnd_installation.get_app_info('OFA',P_OFA_STATUS,l_INDUSTRY,l_ORACLE_SCHEMA);
57 
58 /*srw.message(1,'OFA Installation status is ' || P_OFA_STATUS) ;*/null;
59 
60 
61   /*srw.user_exit('FND INSTALLATION OUTPUT_TYPE="STATUS"
62                                  OUTPUT_FIELD=":P_CST_STATUS"
63                                          APPS="INV"') ;*/null;
64 
65 
66  temp:= fnd_installation.get_app_info('INV',P_CST_STATUS,l_INDUSTRY,l_ORACLE_SCHEMA);
67 
68 /*srw.message(1,'CST Installation status is ' || P_CST_STATUS) ;*/null;
69 
70 
71 
72  null;
73   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
74             /*SRW.MESSAGE(1,'Before Item Flex');*/null;
75 
76 END;
77 BEGIN
78 
79  null;
80   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
81             /*SRW.MESSAGE(1,'Before Acc Flex');*/null;
82 
83 END;
84 BEGIN
85 
86  null;
87   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
88             /*SRW.MESSAGE(1,'Before Cat Flex');*/null;
89 
90 END;
91 BEGIN
92 
93  null;
94   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
95             /*SRW.MESSAGE(1,'Before Category Where');*/null;
96 
97 END;
98 BEGIN
99 
100  null;
101   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
102             /*SRW.MESSAGE(1,'Before Item Where');*/null;
103 
104 END;
105 BEGIN
106 
107  null;
108   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
109             /*SRW.MESSAGE(1,'Before Item Orderby');*/null;
110 
111 END;
112 BEGIN
113 
114  null;
115   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
116             /*SRW.MESSAGE(1,'Before Categroy Orderby');*/null;
117 
118 END;
119 
120 IF (P_OFA_STATUS = 'I' ) then begin
121  select count(*), max(category_flex_structure)
122  into   P_FA_INSTALLED, P_acat_struct_num
123  from fa_system_controls;
124 end;
125 end if;
126 
127 if P_FA_INSTALLED <> 0 then begin
128 
129  null;
130   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
131             /*SRW.MESSAGE(1,'Before Ass Flex');*/null;
132 
133 END; end if;
134 RETURN TRUE;  return (TRUE);
135 end;
136 
137 function AfterReport return boolean is
138 begin
139 
140 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
141   return (TRUE);
142 end;
143 
144 function orderby_clauseFormula return VARCHAR2 is
145 begin
146 
147 if P_ORDERBY = 'CATEGORY' then
148    return(P_ORDERBY_CAT);
149 else
150    return(P_ORDERBY_ITEM);
151 end if;
152 RETURN NULL; end;
153 
154 procedure get_precision is
155 begin
156 /*srw.attr.mask        :=  SRW.FORMATMASK_ATTR;*/null;
157 
158 if P_qty_precision = 0 then /*srw.attr.formatmask  := '-NNN,NNN,NNN,NN0';*/null;
159 
160 else
161 if P_qty_precision = 1 then /*srw.attr.formatmask  := '-NNN,NNN,NNN,NN0.0';*/null;
162 
163 else
164 if P_qty_precision = 3 then /*srw.attr.formatmask  :=  '-NN,NNN,NNN,NN0.000';*/null;
165 
166 else
167 if P_qty_precision = 4 then /*srw.attr.formatmask  :=   '-N,NNN,NNN,NN0.0000';*/null;
168 
169 else
170 if P_qty_precision = 5 then /*srw.attr.formatmask  :=     '-NNN,NNN,NN0.00000';*/null;
171 
172 else
173 if P_qty_precision = 6 then /*srw.attr.formatmask  :=      '-NN,NNN,NN0.000000';*/null;
174 
175 else /*srw.attr.formatmask  :=  '-NNN,NNN,NNN,NN0.00';*/null;
176 
177 end if; end if; end if; end if; end if; end if;
178 /*srw.set_attr(0,srw.attr);*/null;
179 
180 end;
181 
182 function get_p_struct_num return boolean is
183 
184 l_p_struct_num number;
185 
186 begin
187         select structure_id
188         into l_p_struct_num
189         from mtl_default_sets_view
190         where functional_area_id = 2 ;
191 
192         P_STRUCT_NUM := l_p_struct_num ;
193 
194         return(TRUE) ;
195 
196         RETURN NULL; exception
197         when others then return(FALSE) ;
198 end;
199 
200 function C_OFA_dynamicFormula return VARCHAR2 is
201 begin
202 
203 if (P_OFA_STATUS = 'I') then return ('fa_categories') ;
204 else return ('gl_code_combinations') ;
205 end if ;
206 RETURN NULL; end;
207 
208 function C_OFA_WhereFormula return VARCHAR2 is
209 begin
210 
211 IF (P_OFA_STATUS = 'I') then return ('AND      msi.asset_category_id             = fac.category_id (+)') ;
212 else return('and msi.expense_account               = fac.code_combination_id (+)') ;
213 end if;
214 
215 RETURN NULL; end;
216 
217 function C_CST_SELECTFormula return VARCHAR2 is
218 begin
219 
220 IF (P_CST_STATUS = 'I') THEN
221 RETURN(',CIC.UNBURDENED_COST    standard_cost') ;
222 else
223   RETURN(',null');
224 END IF;
225 RETURN NULL; end;
226 
227 function C_CST_FROMFormula return VARCHAR2 is
228 begin
229 
230 
231   IF (P_CST_STATUS = 'I') THEN
232  	RETURN(',CST_ITEM_COSTS CIC,MTL_PARAMETERS MP');
233 	  else
234    RETURN('');
235   END IF;
236 
237   RETURN NULL;
238 end;
239 
240 function C_CST_WHEREFormula return VARCHAR2 is
241 begin
242 
243 
244  IF (P_CST_STATUS = 'I') THEN
245   RETURN('
246 	AND  cic.organization_id = mp.cost_organization_id
247 	AND  cic.cost_type_id = mp.primary_cost_method
248 	AND  cic.inventory_item_id (+)  = msi.inventory_item_id
249 	AND  cic.organization_id (+)    = msi.organization_id
250         ') ;
251 	  else
252    RETURN('');
253  END IF;
254  RETURN NULL;
255 
256 end;
257 
258 function noteformula(item_note_datatype_id in number, item_note_media_id in number) return char is
259 short_note Varchar2(2000);
260 long_note Long;
261 begin
262   if item_note_datatype_id = 1 then
263     select short_text
264       into short_note
265       from fnd_documents_short_text
266      where media_id = item_note_media_id;
267     return short_note;
268   elsif item_note_datatype_id = 2 then
269     select long_text
270       into long_note
271       from fnd_documents_long_text
272      where media_id = item_note_media_id;
273     return long_note;
274   else
275     return 'Attachment is not a Text format';
276   end if;
277 
278 end;
279 
280 --Functions to refer Oracle report placeholders--
281 
282 END PO_POXDETIT_XMLP_PKG ;
283