DBA Data[Home] [Help]

PACKAGE: APPS.PO_UOM_S

Source


1 PACKAGE PO_UOM_S AUTHID CURRENT_USER as
2 /* $Header: RCVTXU1S.pls 120.1.12020000.4 2012/12/28 03:41:50 jictang ship $*/
3 
4 /*===========================================================================
5   PACKAGE NAME:		PO_UOM_S
6 
7   DESCRIPTION:
8 
9   CLIENT/SERVER:	Server
10 
11   LIBRARY NAME
12 
13   OWNER:
14 
15   PROCEDURE NAMES:	uom_convert()
16 			val_uom_conversion()
17 			val_unit_of_measure()
18 ===========================================================================*/
19 /*===========================================================================
20   FUNCTION NAME:	val_unit_of_measure()
21 
22   DESCRIPTION:		This function checks whether a given Unit of Measure
23 			is still valid.
24 
25 
26   PARAMETERS:		X_unit_of_measure IN VARCHAR2
27 
28   RETURN TYPE:		BOOLEAN
29 
30   DESIGN REFERENCES:
31 
32   ALGORITHM:
33 
34   NOTES:
35 
36   OPEN ISSUES:
37 
38   CLOSED ISSUES:
39 
40   CHANGE HISTORY:	Created 	09-JUL-1995	LBROADBE
41 			Changed to	14-AUG-1995	LBROADBE
42 			Function
43 ===========================================================================*/
44 FUNCTION  val_unit_of_measure(X_unit_of_measure IN VARCHAR2) return BOOLEAN;
45 
46 /*===========================================================================
47   PROCEDURE NAME: uom_convert()
48 
49   DESCRIPTION:
50 	This is the PO wrapper procedure to the Inventory uom procedure.
51    	It calls the stored function po_uom_convert for now. It needs to be
52  	changed to call the Inventory stored procedure once Inventory is done
53 	creating it.
54 
55   USAGE:
56 	po_uom_s.uom_convert(from_quantity, from_uom, item_id, to_uom,
57 			     to_quantity)
58 
59   PARAMETERS:
60 	from_quantity	IN  number   - source quantity
61 	from_uom	IN  varchar2 - source unit of measure
62 	item_id		IN  number   - item id (null for one time items)
63 	to_uom		IN  varchar2 - destination unit of measure
64 	to_quantity	OUT number   - destination quantity
65 
66   DESIGN REFERENCES: Generic
67 
68   ALGORITHM:
69 
70   NOTES:
71 
72   OPEN ISSUES:
73 
74   CLOSED ISSUES:
75 
76   CHANGE HISTORY:
77 	17-MAR-95	Sanjay Kothary	Created
78 ===========================================================================*/
79 
80 PROCEDURE uom_convert(	from_quantity	in	number,
81 			from_uom	in	varchar2,
82 			item_id		in	number,
83 			to_uom		in	varchar2,
84 			to_quantity	out	NOCOPY number);
85 
86 --Bug 15937903,override uom_convert to round quantity correctly
87 PROCEDURE uom_convert2( item_id          in      number,
88                        source_org_id    in      number,
89                        from_uom         in      varchar2,
90                        unit_of_issue    in      varchar2,
91                        from_quantity    in      number,
92                        to_quantity      out     NOCOPY number);
93 --Bug 15937903
94 /*===========================================================================
95   PROCEDURE NAME:	val_uom_conversion()
96 
97   DESCRIPTION:
98 	o PRO - For each match record, we check if there is a uom conversion
99 		defined between purchasing order and receipt. if not defined,
100 		the match will be rejected.
101   PARAMETERS:
102 
103   DESIGN REFERENCES:	RCVRCMUR.dd
104 
105   ALGORITHM:
106 
107   NOTES:
108 
109   OPEN ISSUES:
110 
111   CLOSED ISSUES:
112 
113   CHANGE HISTORY:
114 ===========================================================================*/
115 
116 PROCEDURE val_uom_conversion;
117 
118 /*===========================================================================
119   PROCEDURE NAME:  po_uom_conversion()
120 
121   DESCRIPTION:
122 	This is the PO uom conversion procedure
123    	It needs to be
124  	changed to call the Inventory stored procedure once Inventory is done
125 	creating it.
126 
127   USAGE:
128 	po_uom_s.po_uom_conversion ( from_unit  varchar2, to_unit 	varchar2, item_id number, uom_rate    	out 	number )
129 
130   PARAMETERS:
131 	from_unit	IN  varchar2 - source unit of measure
132 	to_unit		IN  varchar2 - destination unit of measure
133 	item_id		IN  number   - item id (null for one time items)
134 	uom_rate	OUT number   - conversion rate between the two units
135 
136   DESIGN REFERENCES: Generic
137 
138   ALGORITHM:
139 
140   NOTES:
141 
142   OPEN ISSUES:
143 
144   CLOSED ISSUES:
145 
146   CHANGE HISTORY:
147 	17-MAR-95	Sanjay Kothary	Created
148 ===========================================================================*/
149 
150 procedure po_uom_conversion ( from_unit  in varchar2,
151                               to_unit    in varchar2,
152                               item_id    in number,
153                               uom_rate   out NOCOPY number );
154 /*===========================================================================
155   PROCEDURE NAME:  po_uom_convert ()
156 
157   DESCRIPTION:
158 	This is the PO uom conversion procedure that returns a the conversion
159         rate from the function
160    	It needs to be
161  	changed to call the Inventory stored procedure once Inventory is done
162 	creating it.
163 
164   USAGE:
165 	conv_rate := po_uom_s.po_uom_convert ( from_unit   varchar2,
166                           to_unit  varchar2,
167 			  item_id  number );
168 
169   PARAMETERS:
170 	from_unit	IN  varchar2 - source unit of measure
171 	to_unit		IN  varchar2 - destination unit of measure
172 	item_id		IN  number   - item id (null for one time items)
173 
174   RETURNS:
175 
176 	conversion_rate NUMBER - conversion rate between the two units
177 
178   DESIGN REFERENCES: Generic
179 
180   ALGORITHM:
181 
182   NOTES:
183 
184   OPEN ISSUES:
185 
186   CLOSED ISSUES:
187 
188   CHANGE HISTORY:
189 	17-MAR-95	Sanjay Kothary	Created
190 ===========================================================================*/
191 function po_uom_convert ( from_unit   in varchar2,
192                           to_unit     in varchar2,
193 			  item_id     in number ) return number;
194 
195 
196 /*===========================================================================
197   PROCEDURE NAME:  get_primary_uom()
198 
199   DESCRIPTION:
200         This function returns the primary UOM based on item_id/organization
201         for both pre-defined and one-time items
202 
203   USAGE:
204 	uom := po_uom_s.get_primary_uom ( item_id  number,   org_id   number,
205 current_unit_of_measure   varchar2 )
206 
207   PARAMETERS:
208 	item_id		IN  number   - item id (null for one time items)
209         org_id          IN  number   - org id
210         current_unit_of_measure IN VARCHAR2 - currently defined uom on trx.
211 
212   RETURNS:
213 
214 	primary_uom - VARCHAR2 - Primary UOM for given item and org
215 
216   DESIGN REFERENCES: Generic
217 
218   ALGORITHM:
219 
220   NOTES:
221 
222   OPEN ISSUES:
223 
224   CLOSED ISSUES:
225 
226   CHANGE HISTORY:
227 	17-MAR-95	Sanjay Kothary	Created
228 ===========================================================================*/
229 function get_primary_uom ( item_id  in number,
230                            org_id   in number,
231                            current_unit_of_measure   in varchar2 )
232 return varchar2;
233 
234 /*========================================================================
235 
236   FUNCTION  :   po_uom_convert_p()
237 
238    Created a function po_uom_convert_p which is pure function to be used in
239    the where and select clauses of a SQL stmt.bug 1365577
240    ******************************************************
241    So, any change in the po_uom_convertion proc in rvpo02
242    should be implemented in this new function.
243    ******************************************************
244 ========================================================================*/
245 function po_uom_convert_p ( from_unit  in  varchar2,
246                             to_unit    in  varchar2,
247                             item_id    in  number ) return number;
248 
249 
250 /*===========================================================================
251   PROCEDURE NAME:  get_secondary_uom()
252 
253   DESCRIPTION:
254         This function returns the primary UOM based on item_id/organization
255         for both pre-defined and one-time items
256 
257   USAGE:
258 	uom := po_uom_s.get_secondary_uom(p_item_id  in number,
259                              p_org_id   in number,
260                              x_secondary_uom_code out varchar2,
261                              x_secondary_unit_of_measure out varchar2);
262 
263   PARAMETERS:
264 	item_id		IN  number   - item id (null for one time items)
265         org_id          IN  number   - org id
266         x_secondary_uom_code OUT VARCHAR2 - items secondary uom code.
267         x_secondary_unit_of_measure OUT VARCHAR2 - items secondary unit of meas
268 
269   DESIGN REFERENCES: Generic
270 
271   ALGORITHM:
272 
273   NOTES:
274 
275   OPEN ISSUES:
276 
277   CLOSED ISSUES:
278 
279   CHANGE HISTORY:
280 	09-SEP-05	Preetam Bamb	Created
281 ===========================================================================*/
282 procedure get_secondary_uom (p_item_id  in number,
283                              p_org_id   in number,
284                              x_secondary_uom_code out NOCOPY varchar2,
285                              x_secondary_unit_of_measure out NOCOPY varchar2);
286 
287 /*===========================================================================
288   PROCEDURE NAME:  get_unit_of_measure()
289 
290   DESCRIPTION:
291         This function returns the unit of measure for the passed uom code
292 
293   USAGE:
294         uom := po_uom_s.get_unit_of_measure(
295                              p_uom_code in varchar2,
296                              x_unit_of_measure out NOCOPY varchar2);
297 
298   PARAMETERS:
299         x_uom_code IN VARCHAR2 - items secondary uom code.
300         x_unit_of_measure OUT VARCHAR2 - items secondary unit of meas
301 
302   DESIGN REFERENCES: Generic
303 
304   ALGORITHM:
305 
306   NOTES:
307 
308   OPEN ISSUES:
309 
310   CLOSED ISSUES:
311 
312   CHANGE HISTORY:
313         09-SEP-05       Preetam Bamb    Created
314 ===========================================================================*/
315 procedure get_unit_of_measure(
316                              p_uom_code in varchar2,
317                              x_unit_of_measure out NOCOPY varchar2);
318 
319 /*========================================================================
320 
321   FUNCTION  :   rti_trx_qty_to_soc_qty()
322 
323    Created a function rti_trx_qty_to_soc_qty which is pure function to be used in
324    the where and select clauses of rvtvq.lpc the lot specific UOM convertion for rti
325    source_doc_quantity
326 ========================================================================*/
327 
328 FUNCTION rti_trx_qty_to_soc_qty(P_INTERFACE_TRANSACTION_ID IN NUMBER,
329                                                   P_TO_ORG_ID                IN NUMBER,
330                                                   P_ITEM_ID                  IN NUMBER,
331                                                   P_FROM_QTY                 IN NUMBER,
332                                                   P_FROM_UOM                 IN VARCHAR2,
333                                                   P_TO_UOM                   IN VARCHAR2)  RETURN NUMBER;
334 
335 END PO_UOM_S;
336 
337