[Home] [Help]
PACKAGE BODY: APPS.PO_POXRVODS_XMLP_PKG
Source
1 PACKAGE BODY PO_POXRVODS_XMLP_PKG AS
2 /* $Header: POXRVODSB.pls 120.1 2007/12/25 12:11:55 krreddy noship $ */
3
4 function AfterReport return boolean is
5 begin
6
7 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
8 return (TRUE);
9 end;
10
11 function BeforeReport return boolean is
12 begin
13
14 Declare
15 l_org_displayed org_organization_definitions.organization_name%type;
16 Begin
17 If (P_org_id is not null) then
18 begin
19 select organization_name
20 into l_org_displayed
21 from org_organization_definitions
22 where organization_id = P_org_id ;
23
24 P_org_displayed := l_org_displayed ;
25 end;
26 else begin
27 P_org_displayed := '' ;
28 end;
29 End if;
30 End;
31
32 /* P_OVERDUE_DATE_param:=nvl(P_OVERDUE_DATE,sysdate-1);
33 if P_OVERDUE_DATE= to_date('9999/01/01','yyyy/mm/dd') then P_OVERDUE_DATE_param:=sysdate-1; end if;
34 */
35 FORMAT_MASK := PO_COMMON_xmlp_pkg.GET_PRECISION(P_QTY_PRECISION);
36 BEGIN
37
38 /*SRW.MESSAGE('23','Test message');*/null;
39
40 /*SRW.USER_EXIT('FND SRWINIT');*/null;
41
42 if (get_p_struct_num <> TRUE )
43 then /*SRW.MESSAGE('1','Init failed');*/null;
44
45 end if;
46
47 null;
48
49
50 null;
51
52
53 null;
54
55 RETURN TRUE;
56 END;
57 return (TRUE);
58 end;
59
60 procedure get_precision is
61 begin
62 /*srw.attr.mask := SRW.FORMATMASK_ATTR;*/null;
63
64 if P_qty_precision = 0 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0';*/null;
65
66 else
67 if P_qty_precision = 1 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.0';*/null;
68
69 else
70 if P_qty_precision = 3 then /*srw.attr.formatmask := '-NN,NNN,NNN,NN0.000';*/null;
71
72 else
73 if P_qty_precision = 4 then /*srw.attr.formatmask := '-N,NNN,NNN,NN0.0000';*/null;
74
75 else
76 if P_qty_precision = 5 then /*srw.attr.formatmask := '-NNN,NNN,NN0.00000';*/null;
77
78 else
79 if P_qty_precision = 6 then /*srw.attr.formatmask := '-NN,NNN,NN0.000000';*/null;
80
81 else /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.00';*/null;
82
83 end if; end if; end if; end if; end if; end if;
84 /*srw.set_attr(0,srw.attr);*/null;
85
86 end;
87
88 function get_p_struct_num return boolean is
89
90 l_p_struct_num number;
91
92 begin
93 select structure_id
94 into l_p_struct_num
95 from mtl_default_sets_view
96 where functional_area_id = 2 ;
97
98 P_STRUCT_NUM := l_p_struct_num ;
99
100 return(TRUE) ;
101
102 RETURN NULL; exception
103 when others then return(FALSE) ;
104 end;
105
106 function AfterPForm return boolean is
107 begin
108 Declare
109
110
111 apostrophe_pos_from number;
112 before_apos_from varchar2(240);
113 after_apos_from varchar2(240);
114 vend_length_from varchar2(240);
115
116 apostrophe_pos_to number;
117 before_apos_to varchar2(240);
118 after_apos_to varchar2(240);
119 vend_length_to varchar2(240);
120
121 check_apos_from number;
122 check_apos_to number;
123
124
125 apostrophe_pos_buyer number;
126 before_apos_buyer varchar2(240);
127 after_apos_buyer varchar2(240);
128 vend_length_buyer varchar2(240);
129
130 check_apos_buyer number;
131
132
133
134
135 Begin
136
137
138
139
140
141 check_apos_buyer := instr(p_buyer,'''',1);
142
143 if check_apos_buyer > 0 then
144
145 vend_length_buyer := NVL(length(p_buyer), 0);
146 apostrophe_pos_buyer := instr(p_buyer,'''',1);
147 before_apos_buyer := substr(p_buyer,1,apostrophe_pos_buyer - 1);
148 after_apos_buyer := substr(p_buyer,apostrophe_pos_buyer + 1,vend_length_buyer);
149
150 P_where_buyer := 'hre.full_name = '||''''||before_apos_buyer||''''||''''||after_apos_buyer||'''';
151
152 else
153 if (P_buyer is null) then
154 P_where_buyer := '1=1';
155 else
156 P_where_buyer := 'hre.full_name = '||''''||p_buyer||'''';
157 end if;
158 end if;
159
160
161
162
163
164 check_apos_from := instr(p_vendor_from,'''',1);
165 check_apos_to := instr(p_vendor_to,'''',1);
166
167
168
169 if check_apos_from > 0 then
170
171 vend_length_from := NVL(length(p_vendor_from), 0);
172 apostrophe_pos_from := instr(p_vendor_from,'''',1);
173 before_apos_from := substr(p_vendor_from,1,apostrophe_pos_from - 1);
174 after_apos_from := substr(p_vendor_from,apostrophe_pos_from + 1,vend_length_from);
175
176 P_where_vendor_from := 'pov.vendor_name >= '||''''||before_apos_from||''''||''''||after_apos_from||'''';
177
178 else
179 if (P_vendor_from is null) then
180 P_where_vendor_from := '1=1';
181 else
182 P_where_vendor_from := 'pov.vendor_name >= '||''''||p_vendor_from||'''';
183 end if;
184 end if;
185
186 if check_apos_to > 0 then
187
188 vend_length_to := NVL(length(p_vendor_to), 0);
189 apostrophe_pos_to := instr(p_vendor_to,'''',1);
190 before_apos_to := substr(p_vendor_to,1,apostrophe_pos_to - 1);
191 after_apos_to := substr(p_vendor_to,apostrophe_pos_to + 1,vend_length_to);
192
193 P_where_vendor_to := 'pov.vendor_name <= ' ||''''||before_apos_to||''''||''''||after_apos_to||'''';
194
195 else
196 if (P_vendor_to is null) then
197 P_where_vendor_to := '1=1';
198 else
199 P_where_vendor_to := 'pov.vendor_name <= '||''''||p_vendor_to||'''';
200 end if;
201 end if;
202
203
204 if P_WHERE_VENDOR_FROM is null then P_WHERE_VENDOR_FROM:= 'and 1=1'; end if;
205 if P_where_vendor_to is null then P_where_vendor_to:= 'and 1=1'; end if;
206 if P_where_buyer is null then P_where_buyer:= 'and 1=1'; end if;
207
208
209
210
211 End;
212 return (TRUE);
213 end;
214
215 function c_item_flexformula(item_id in number,C_ORGANISATION_ID in number) return char is
216 t_stmt VARCHAR2(2000);
217 C_FLEX_ITEM varchar2(800);
218 BEGIN
219
220
221 IF item_id IS NOT NULL THEN
222 t_stmt := 'SELECT SUBSTR( '||P_FLEX_ITEM||' ,1,900)
223 INTO :C_FLEX_ITEM
224 FROM mtl_system_items msi
225 WHERE inventory_item_id = :item_id
226 AND organization_id = :organization_id';
227 /*SRW.DO_SQL(t_stmt);*/
228 execute immediate t_stmt using P_FLEX_ITEM,item_id,C_ORGANISATION_ID;
229 null;
230
231 RETURN C_FLEX_ITEM;
232 ELSE
233 RETURN NULL;
234 END IF;
235 EXCEPTION
236 WHEN OTHERS THEN
237 RETURN NULL;
238 END;
239
240
241 --Functions to refer Oracle report placeholders--
242
243 END PO_POXRVODS_XMLP_PKG ;
244