[Home] [Help]
PACKAGE BODY: APPS.PO_POXACTPO_XMLP_PKG
Source
1 PACKAGE BODY PO_POXACTPO_XMLP_PKG AS
2 /* $Header: POXACTPOB.pls 120.2 2008/01/05 12:07:11 dwkrishn noship $ */
3
4 function BeforeReport return boolean is
5 DATE_FORMAT varchar2(30):='DD'||'-MON-'||'YY';
6 begin
7
8 /*srw.user_exit ('FND SRWINIT');*/null;
9
10
11
12
13 declare
14
15 l_po_type po_lookup_codes.displayed_field%type ;
16 l_sort po_lookup_codes.displayed_field%type ;
17
18
19 begin
20
21 if P_type is not null then
22
23 select displayed_field
24 into l_po_type
25 from po_lookup_codes
26 where lookup_code = P_type
27 and lookup_type = 'PO TYPE';
28
29 P_type_displayed := l_po_type ;
30
31 else
32
33 P_type_displayed := '' ;
34
35 end if;
36
37 if P_orderby is not null then
38
39 select displayed_field
40 into l_sort
41 from po_lookup_codes
42 where lookup_code = P_orderby
43 and lookup_type = 'SRS ORDER BY';
44
45 P_orderby_displayed := l_sort ;
46
47 else
48
49 P_orderby_displayed := '' ;
50
51 end if;
52 LP_CREATION_DATE_FROM:=to_char(P_CREATION_DATE_FROM,DATE_FORMAT);
53 LP_CREATION_DATE_TO:=to_char(P_CREATION_DATE_TO,DATE_FORMAT);
54
55 RETURN TRUE;
56 end;
57
58 RETURN NULL; end ;
59
60 function AfterReport return boolean is
61 begin
62
63 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
64 return (TRUE);
65 end;
66
67 function orderby_clauseFormula return VARCHAR2 is
68 begin
69
70 If P_ORDERBY = 'DATE' then
71 return('1');
72 elsif P_ORDERBY = 'BUYER' then
73 return('5');
74 end if;
75 --RETURN NULL; end;
76 RETURN('1'); end;
77
78 function round_amount(c_amount in number, c_po_currency_precision in number) return number is
79 begin
80 /*srw.reference(c_amount);*/null;
81
82 /*srw.reference(c_po_currency_precision);*/null;
83
84
85 return (round(c_amount, c_po_currency_precision));
86
87 end;
88
89 function base_amount_round(c_base_amount in number, c_precision in number) return number is
90 begin
91
92 /*srw.reference(c_base_amount);*/null;
93
94 /*srw.reference(c_precision);*/null;
95
96
97 return (round(c_base_amount, c_precision));
98
99 end;
100
101 function AfterPForm return boolean is
102 begin
103
104 /*srw.user_exit ('FND SRWINIT');*/null;
105
106
107 declare
108 l_sysparam_sob_id number;
109 begin
110 IF p_ca_set_of_books_id <> -1999
111 THEN
112 BEGIN
113 select decode(mrc_sob_type_code,'R','R','P'),currency_code
114 into p_mrcsobtype,p_base_currency
115 from gl_sets_of_books
116 where set_of_books_id = p_ca_set_of_books_id;
117 EXCEPTION
118 WHEN OTHERS THEN
119 p_mrcsobtype := 'P';
120 END;
121 ELSE
122 p_mrcsobtype := 'P';
123 END IF;
124
125
126 BEGIN
127 select set_of_books_id
128 into l_sysparam_sob_id
129 from financials_system_parameters;
130 EXCEPTION
131 WHEN NO_DATA_FOUND THEN
132 FND_MESSAGE.set_name('SQLGL', 'MRC_SYSTEM_OPTIONS_NOT_FOUND');
133 FND_MESSAGE.set_token('MODULE', 'PO_POXACTPO_XMLP_PKG');
134 /*srw.message(2000, FND_MESSAGE.get);*/null;
135
136 raise;
137 WHEN OTHERS THEN
138 FND_MESSAGE.set_name('SQLGL', 'MRC_TABLE_ERROR');
139 FND_MESSAGE.set_token('MODULE', 'PO_POXACTPO_XMLP_PKG');
140 FND_MESSAGE.set_token('TABLE', 'FINANCIALS_SYSTEM_PARAMETERS');
141 /*srw.message('1000',fnd_message.get);*/null;
142
143 raise;
144 END;
145
146 lp_fin_system_parameters := 'financials_system_parameters';
147 lp_fin_system_parameters_all := 'financials_system_params_all';
148 lp_po_headers := 'po_headers';
149 lp_po_headers_all := 'po_headers_all';
150 lp_po_distributions := 'po_distributions';
151 lp_po_distributions_all := 'po_distributions_all';
152 lp_rcv_shipment_headers := 'rcv_shipment_headers';
153 lp_rcv_transactions := 'rcv_transactions';
154 lp_rcv_sub_ledger_details := 'rcv_sub_ledger_details';
155 lp_rcv_receiving_sub_ledger := 'rcv_receiving_sub_ledger';
156
157 END;
158
159
160
161
162
163 if P_creation_date_from is Null and P_creation_date_to is Null then
164
165 P_poh_Creation_Date_clause := ' AND 1 = 1 ';
166
167 P_por_Creation_Date_clause := ' AND 1 = 1 ';
168
169 elsif P_Creation_date_from is Null then
170
171 P_poh_Creation_Date_clause := ' AND poh.creation_date <= '''|| (P_creation_date_to + 1) ||'''';
172
173 P_por_Creation_Date_clause := ' AND por.creation_date <= '''|| (P_creation_date_to + 1) ||'''';
174
175 elsif P_Creation_date_to is Null then
176
177 P_poh_Creation_Date_clause := ' AND poh.creation_date >= '''||P_creation_date_from || '''';
178
179 P_por_Creation_Date_clause := ' AND por.creation_date >= '''||P_creation_date_from || '''';
180
181 else
182
183 P_poh_Creation_Date_clause := ' AND poh.creation_date BETWEEN '''||P_creation_date_from || ''' And '''|| (P_creation_date_to + 1) ||'''';
184
185 P_por_Creation_Date_clause := ' AND por.creation_date BETWEEN '''||P_creation_date_from || ''' And '''|| (P_creation_date_to + 1) ||'''';
186
187
188 End if;
189
190 return (TRUE);
191 end;
192
193 --Functions to refer Oracle report placeholders--
194
195 END PO_POXACTPO_XMLP_PKG ;
196