1 PACKAGE JMF_SHIKYU_RPT_UTIL AS
2 --$Header: JMFUSKRS.pls 120.2 2005/12/07 18:43:38 vchu noship $
3 --+===========================================================================+
4 --| Copyright (c) 2005 Oracle Corporation |
5 --| Redwood Shores, California, USA |
6 --| All rights reserved. |
7 --+===========================================================================+
8 --| |
9 --| FILENAME : JMFUSKRS.pls |
10 --| |
11 --| DESCRIPTION: Specification file of the utility package for |
12 --| the Charge Based SHIKYU reports. |
13 --| |
14 --| HISTORY: |
15 --| 27-APR-2005 shu Created. |
16 --| 29-NOV-2005 shu added uom_to_code function . |
17 --+===========================================================================+
18
19 --========================================================================
20 -- PROCEDURE : get_item_number PUBLIC
21 -- PARAMETERS: p_organization_id the organization id
22 -- : p_inventory_item_id the item id
23 -- : x_item_number the return item number
24 -- COMMENT : for getting the item flexfield number
25 -- PRE-COND :
26 -- EXCEPTIONS:
27 --========================================================================
28 PROCEDURE get_item_number
29 ( p_organization_id IN NUMBER
30 , p_inventory_item_id IN NUMBER
31 , x_item_number OUT NOCOPY VARCHAR2
32 );
33
34 --========================================================================
35 -- FUNCTION : get_item_number PUBLIC
36 -- PARAMETERS: p_organization_id the organization id
37 -- : p_inventory_item_id the item id
38 -- RETURN : will return the item number
39 -- COMMENT : for getting the item flexfield number
40 -- PRE-COND :
41 -- EXCEPTIONS:
42 --========================================================================
43 FUNCTION get_item_number
44 ( p_organization_id IN NUMBER
45 , p_inventory_item_id IN NUMBER
46 )
47 RETURN VARCHAR2;
48
49 --========================================================================
50 -- FUNCTION : uom_to_code PUBLIC
51 -- PARAMETERS: p_unit_of_measure the 25-character unit of measure
52 -- RETURN : will return the 3-character uom code in jmf_shikyu_% tables
53 -- COMMENT : getting the UOM code
54 -- PRE-COND :
55 -- EXCEPTIONS:
56 --========================================================================
57 FUNCTION uom_to_code(p_unit_of_measure IN VARCHAR2) RETURN VARCHAR2;
58
59 --========================================================================
60 -- FUNCTION : get_item_primary_uom_code PUBLIC
61 -- PARAMETERS: p_org_id the organization id
62 -- : p_item_id the item id
63 -- RETURN : will return the primary uom code
64 -- COMMENT : getting the primary UOM code
65 -- PRE-COND :
66 -- EXCEPTIONS:
67 --========================================================================
68 FUNCTION get_item_primary_uom_code
69 ( p_org_id IN NUMBER
70 , p_item_id IN NUMBER
71 )
72 RETURN VARCHAR2;
73
74 --========================================================================
75 -- FUNCTION : get_item_primary_uom_code PUBLIC
76 -- PARAMETERS: p_org_id the organization id
77 -- : p_item_id the item id
78 -- : p_current_uom_Code current uom_code
79 -- RETURN : will return the primary uom code
80 -- COMMENT : getting the primary UOM code
81 -- PRE-COND :
82 -- EXCEPTIONS:
83 --========================================================================
84 FUNCTION get_item_primary_uom_code
85 ( p_org_id IN NUMBER
86 , p_item_id IN NUMBER
87 , p_current_uom_code IN VARCHAR2
88 )
89 RETURN VARCHAR2;
90
91 --========================================================================
92 -- FUNCTION : get_item_primary_quantity PUBLIC
93 -- PARAMETERS: p_org_id the organization id
94 -- : p_item_id the item id
95 -- : p_current_uom_Code current uom_code
96 -- : p_current_qty current item quantity
97 -- RETURN : will return the quantity for the item using the primary uom
98 -- COMMENT : getting the item quantity using primary UOM
99 -- PRE-COND :
100 -- EXCEPTIONS:
101 --========================================================================
102 FUNCTION get_item_primary_quantity
103 ( p_org_id IN NUMBER
104 , p_item_id IN NUMBER
105 , p_current_uom_code IN VARCHAR2
106 , p_current_qty IN NUMBER
107 )
108 RETURN NUMBER;
109
110 --========================================================================
111 -- FUNCTION : po_uom_convert_p PUBLIC
112 -- PARAMETERS: p_from_unit
113 -- : p_to_unit
114 -- : p_item_id
115 -- RETURN :
116 -- Created a function po_uom_convert_p which is pure function to be used in
117 -- the where and select clauses of a SQL
118 -- COMMENT :
119 -- PRE-COND :
120 -- EXCEPTIONS:
121 --========================================================================
122 FUNCTION po_uom_convert_p
123 ( p_from_unit IN VARCHAR2
124 , p_to_unit IN VARCHAR2
125 , p_item_id IN NUMBER
126 )
127 RETURN NUMBER;
128
129 --========================================================================
130 -- FUNCTION : get_min2 PUBLIC
131 -- PARAMETERS: p_number1 the number1
132 -- : p_number2 the number2
133 -- RETURN : return the less one
134 -- COMMENT : getting the less number
135 -- PRE-COND :
136 -- EXCEPTIONS:
137 --========================================================================
138 FUNCTION get_min2
139 ( p_number1 IN NUMBER
140 , p_number2 IN NUMBER
141 )
142 RETURN NUMBER;
143
144 --========================================================================
145 -- FUNCTION : get_min3 PUBLIC
146 -- PARAMETERS: p_number1 the number1
147 -- : p_number2 the number2
148 -- : p_number3 the number3
149 -- RETURN : return the less one
150 -- COMMENT : getting the less number
151 -- PRE-COND :
152 -- EXCEPTIONS:
153 --========================================================================
154 FUNCTION get_min3
155 ( p_number1 IN NUMBER
156 , p_number2 IN NUMBER
157 , p_number3 IN NUMBER
158 )
159 RETURN NUMBER;
160
161 --========================================================================
162 -- FUNCTION : rate_exists PUBLIC
163 -- PARAMETERS: p_from_currency From currency
164 -- : p_to_currency To currency
165 -- : p_conversion_date Conversion date
166 -- : p_conversion_type Conversion type
167 -- RETURN : return the sonversion rate
168 -- COMMENT : reference to the APPS.GL_CURRENCY_API,
169 -- Returns 'Y' if there is a conversion rate between the two currencies
170 -- for a given conversion date and conversion type;
171 -- 'N' otherwise.
172
173 -- PRE-COND :
174 -- EXCEPTIONS:
175 --========================================================================
176 FUNCTION rate_exists
177 ( p_from_currency IN VARCHAR2 -- FND_CURRENCIES.currency_code
178 , p_to_currency IN VARCHAR2
179 , p_conversion_date IN DATE
180 , p_conversion_type IN VARCHAR2 DEFAULT NULL
181 )
182 RETURN VARCHAR2;
183
184 --========================================================================
185 -- FUNCTION : get_rate PUBLIC
186 -- PARAMETERS: p_from_currency From currency
187 -- : p_to_currency To currency
188 -- : p_conversion_date Conversion date
189 -- : p_conversion_type Conversion type
190 -- RETURN : return the sonversion rate
191 -- COMMENT : reference to the APPS.GL_CURRENCY_API, to get the currency conversion rate
192 -- PRE-COND :
193 -- EXCEPTIONS:
194 --========================================================================
195 FUNCTION get_rate
196 ( p_from_currency IN VARCHAR2 -- FND_CURRENCIES.currency_code
197 , p_to_currency IN VARCHAR2
198 , p_conversion_date IN DATE
199 , p_conversion_type IN VARCHAR2 DEFAULT NULL
200 )
201 RETURN NUMBER;
202
203 --========================================================================
204 -- FUNCTION : get_rate PUBLIC
205 -- PARAMETERS: p_ledger_id Set of books id (in R12 set of book will be replaced by ledger)
206 -- : p_from_currency From currency
207 -- : p_conversion_date Conversion date
208 -- : p_conversion_type Conversion type
209 -- RETURN : return the sonversion rate
210 -- COMMENT : reference to the APPS.GL_CURRENCY_API,
211 -- Returns the rate between the from currency and the functional
212 -- currency of the set of books.
213 -- PRE-COND :
214 -- EXCEPTIONS:
215 --========================================================================
216 FUNCTION get_rate
217 ( p_ledger_id IN NUMBER
218 , p_from_currency IN VARCHAR2 -- FND_CURRENCIES.currency_code
219 , p_conversion_date IN DATE
220 , p_conversion_type IN VARCHAR2 DEFAULT NULL
221 )
222 RETURN NUMBER;
223
224 --========================================================================
225 -- FUNCTION : convert_amount PUBLIC
226 -- PARAMETERS: p_from_currency From currency
227 -- : p_to_currency To currency
228 -- : p_conversion_date Conversion date
229 -- : p_conversion_type Conversion type
230 -- : p_amount Amount to be converted from the from currency
231 -- into the to currency
232 -- RETURN : return the sonversion rate
233 -- COMMENT : reference to the APPS.GL_CURRENCY_API,
234 -- Returns the amount converted from the from currency into the
235 -- to currency for a given conversion date and conversion type.
236 -- The amount returned is rounded to the precision and minimum
237 -- account unit of the to currency.
238 -- PRE-COND :
239 -- EXCEPTIONS:
240 --========================================================================
241 FUNCTION convert_amount
242 ( p_from_currency IN VARCHAR2 -- FND_CURRENCIES.currency_code
243 , p_to_currency IN VARCHAR2
244 , p_conversion_date IN DATE
245 , p_conversion_type IN VARCHAR2 DEFAULT NULL
246 , p_amount IN NUMBER
247 )
248 RETURN NUMBER;
249
250 --========================================================================
251 -- FUNCTION : convert_amount PUBLIC
252 -- PARAMETERS: p_ledger_id Set of books id (in R12 set of book will be replaced by ledger)
253 -- : p_from_currency From currency
254 -- : p_conversion_date Conversion date
255 -- : p_conversion_type Conversion type
256 -- : p_amount Amount to be converted from the from currency
257 -- into the to currency
258 -- RETURN : return the sonversion rate
259 -- COMMENT : reference to the APPS.GL_CURRENCY_API,
260 -- Returns the amount converted from the from currency into the
261 -- functional currency of that set of books. The amount returned is
262 -- rounded to the precision and minimum account unit of the to currency.
263
264 -- PRE-COND :
265 -- EXCEPTIONS:
266 --========================================================================
267 FUNCTION convert_amount
268 ( p_ledger_id IN NUMBER
269 , p_from_currency IN VARCHAR2 -- FND_CURRENCIES.currency_code
270 , p_conversion_date IN DATE
271 , p_conversion_type IN VARCHAR2 DEFAULT NULL
272 , p_amount IN NUMBER
273 )
274 RETURN NUMBER;
275
276 -- moved to JMF_SHIKYU_UTIL by Vincent as it is generic for all SHIKYU
277 --========================================================================
278 -- PROCEDURE : debug_output PUBLIC
279 -- PARAMETERS: p_output_to Identifier of where to output to
280 -- p_api_name the called api name
281 -- p_message the message that need to be output
282 -- COMMENT : the debug output, for using in readonly UT environment
283 -- PRE-COND :
284 -- EXCEPTIONS:
285 --========================================================================
286 PROCEDURE debug_output
287 (
288 p_output_to IN VARCHAR2
289 ,p_api_name IN VARCHAR2
290 ,p_message IN VARCHAR2
291 );
292
293 END JMF_SHIKYU_RPT_UTIL;
294