[Home] [Help]
PACKAGE BODY: APPS.PO_POXKIAGN_XMLP_PKG
Source
4 USER_EXIT_FAILURE EXCEPTION;
1 PACKAGE BODY PO_POXKIAGN_XMLP_PKG AS
2 /* $Header: POXKIAGNB.pls 120.1 2007/12/25 10:59:35 krreddy noship $ */
3
5
6 function BeforeReport return boolean is
7 begin
8
9 DECLARE
10 l_sort po_lookup_codes.displayed_field%type;
11 BEGIN
12 /*SRW.USER_EXIT('FND SRWINIT');*/null;
13
14
15 LP_STRUCT_NUM := P_STRUCT_NUM ;
16
17
18 if (get_p_struct_num <> TRUE )
19 then /*SRW.MESSAGE('1','P Struct Num Init failed');*/null;
20
21 end if;
22
23 IF P_ORDERBY IS NOT NULL THEN
24
25 SELECT displayed_field
26 INTO l_sort
27 FROM po_lookup_codes
28 WHERE lookup_code = P_ORDERBY
29 AND lookup_type = 'SRS ORDER BY';
30
31 P_ORDERBY_DISP := l_sort;
32
33 ELSE
34
35 P_ORDERBY_DISP := '';
36
37 END IF;
38
39
40 null;
41
42
43 null;
44
45
49 return (TRUE);
46 null;
47 RETURN TRUE;
48 END;
50 end;
51
52 procedure get_precision is
53 begin
54 /*srw.attr.mask := SRW.FORMATMASK_ATTR;*/null;
55
56 if P_qty_precision = 0 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0';*/null;
57
58 else
59 if P_qty_precision = 1 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.0';*/null;
60
61 else
62 if P_qty_precision = 3 then /*srw.attr.formatmask := '-NN,NNN,NNN,NN0.000';*/null;
63
64 else
65 if P_qty_precision = 4 then /*srw.attr.formatmask := '-N,NNN,NNN,NN0.0000';*/null;
66
67 else
68 if P_qty_precision = 5 then /*srw.attr.formatmask := '-NNN,NNN,NN0.00000';*/null;
69
70 else
71 if P_qty_precision = 6 then /*srw.attr.formatmask := '-NN,NNN,NN0.000000';*/null;
72
73 else /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.00';*/null;
74
75 end if; end if; end if; end if; end if; end if;
76 /*srw.set_attr(0,srw.attr);*/null;
77
78 end;
79
80 function get_p_struct_num return boolean is
81
82 l_p_struct_num number;
83
84 begin
85 select structure_id
86 into l_p_struct_num
87 from mtl_default_sets_view
88 where functional_area_id = 2 ;
89
90 LP_STRUCT_NUM := l_p_struct_num ;
91
92 return(TRUE) ;
93
94 RETURN NULL; exception
95 when others then return(FALSE) ;
96 end;
97
98 function orderby_clauseFormula return VARCHAR2 is
99 begin
100
101 BEGIN
102 IF P_ORDERBY = 'CATEGORY' THEN
103 RETURN(P_ORDERBY_CAT);
104 ELSIF P_ORDERBY = 'PO NUMBER' THEN
105 RETURN('decode(psp1.manual_po_num_type, ''NUMERIC'',
106 null, poh.segment1),
107 decode(psp1.manual_po_num_type, ''NUMERIC'',
108 to_number(poh.segment1), null)');
109 END IF;
110 END;
111 RETURN NULL; end;
112
113 function return_amt_list(C_min_quote in number, Market_price in number, List in number, C_quantity in number, Rate in number) return number is
114 amount number := 0;
115 begin
116 /*srw.reference(C_quantity);*/null;
117
118 /*srw.reference(C_min_quote);*/null;
119
120 /*srw.reference(List);*/null;
121
122 /*srw.reference(Market_price);*/null;
123
124 /*srw.reference(Rate);*/null;
125
126
127 if C_min_quote is not null and C_min_quote <> 0 then
128 amount := C_min_quote;
129 elsif Market_price is not null then
130 amount := Market_price;
131 elsif List is not null then
132 amount := List;
133 end if;
134
135 return (amount)*nvl(C_quantity,0)* nvl(Rate,1);
136
137 end;
138
139 function return_amt_saved(C_AMOUNT_LIST in number, C_AMOUNT_ACTUAL in number) return number is
140 begin
141 /*srw.reference (C_AMOUNT_LIST);*/null;
142
143 /*srw.reference (C_AMOUNT_ACTUAL);*/null;
144
145
146 return C_AMOUNT_LIST - C_AMOUNT_ACTUAL;
147
148 end;
149
150 function return_discount(C_AMOUNT_LIST in number, C_AMOUNT_ACTUAL in number) return number is
151 begin
152 /*srw.reference (C_AMOUNT_LIST);*/null;
153
154 /*srw.reference (C_AMOUNT_ACTUAL);*/null;
155
156
157 if (C_AMOUNT_LIST - C_AMOUNT_ACTUAL) <= 0 then
158 return 0;
159 else
160 return ((C_AMOUNT_LIST - C_AMOUNT_ACTUAL) /C_AMOUNT_LIST) * 100;
161 end if;
162
163 RETURN NULL; end;
164
165 function return_list(Order_type in varchar2, C_min_quote in number, Market_price in number, List in number, Rate in number) return number is
166
167 list_price number := 0;
168
169 begin
170 /*srw.reference(Order_type);*/null;
171
172 /*srw.reference(C_min_quote);*/null;
173
174 /*srw.reference(Market_price);*/null;
175
176 /*srw.reference(List);*/null;
177
178 /*srw.reference(Rate);*/null;
179
180
181 if Order_type = 'AMOUNT' then
182 return 0;
183 elsif C_min_quote is not null and C_min_quote <> 0 then
184 list_price := C_min_quote;
185 elsif Market_price is not null then
186 list_price := Market_price;
187 elsif List is not null then
188 list_price := List;
189 end if;
190
191 return (list_price * nvl(Rate,1));
192
193 end;
194
195 function return_type(C_min_quote in number, Quote_code in varchar2, Market_price in number, Market_code in varchar2, List in number, List_code in varchar2) return varchar2 is
196
197 type_code VARCHAR2(25) := ' ';
198
199 begin
200
201 /*srw.reference (C_min_quote);*/null;
202
203 /*srw.reference (Market_price);*/null;
204
205 /*srw.reference (List);*/null;
206
207
208 if C_min_quote is not NULL and C_min_quote <> 0 then
209 type_code := Quote_code;
210 elsif Market_price is not NULL then
211 type_code := Market_code;
212 elsif List is not NULL then
213 type_code := List_code;
214 end if;
215
216 return type_code;
217
218 end;
219
220 function return_amt_act(C_quantity in number, Line_price in number, Rate in number) return number is
221 begin
222
223 /*srw.reference(C_quantity);*/null;
224
225 /*srw.reference(Line_price);*/null;
226
227 /*srw.reference(Rate);*/null;
228
229
230 return(nvl(C_quantity,0)
231 * nvl(Line_price,0)
232 * nvl(Rate,1));
233 end;
234
235 function get_quantity(Shipment_quantity in number, Line_quantity in number) return number is
236
237 begin
238 /*srw.reference (Shipment_quantity);*/null;
239
240 /*srw.reference (Line_quantity);*/null;
241
242 /*srw.reference (P_qty_precision);*/null;
243
244
245 if (Shipment_quantity) is not null then
246 return round(Shipment_quantity,P_qty_precision);
247 else
248 return round(nvl(Line_quantity,0),P_qty_precision);
249 end if;
250
251 RETURN NULL; end;
252
253 function AfterReport return boolean is
254 begin
255 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
256
257 return (TRUE);
258 end;
259
260 --Functions to refer Oracle report placeholders--
261
262 END PO_POXKIAGN_XMLP_PKG ;
263