1 PACKAGE PO_UOM_S as
2 /* $Header: RCVTXU1S.pls 120.1 2005/09/12 11:54:42 pbamb noship $*/
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 /*===========================================================================
87 PROCEDURE NAME: val_uom_conversion()
88
89 DESCRIPTION:
90 o PRO - For each match record, we check if there is a uom conversion
91 defined between purchasing order and receipt. if not defined,
92 the match will be rejected.
93 PARAMETERS:
94
95 DESIGN REFERENCES: RCVRCMUR.dd
96
97 ALGORITHM:
98
99 NOTES:
100
101 OPEN ISSUES:
102
103 CLOSED ISSUES:
104
105 CHANGE HISTORY:
106 ===========================================================================*/
107
108 PROCEDURE val_uom_conversion;
109
110 /*===========================================================================
111 PROCEDURE NAME: po_uom_conversion()
112
113 DESCRIPTION:
114 This is the PO uom conversion procedure
115 It needs to be
116 changed to call the Inventory stored procedure once Inventory is done
117 creating it.
118
119 USAGE:
120 po_uom_s.po_uom_conversion ( from_unit varchar2, to_unit varchar2, item_id number, uom_rate out number )
121
122 PARAMETERS:
123 from_unit IN varchar2 - source unit of measure
124 to_unit IN varchar2 - destination unit of measure
125 item_id IN number - item id (null for one time items)
126 uom_rate OUT number - conversion rate between the two units
127
128 DESIGN REFERENCES: Generic
129
130 ALGORITHM:
131
132 NOTES:
133
134 OPEN ISSUES:
135
136 CLOSED ISSUES:
137
138 CHANGE HISTORY:
139 17-MAR-95 Sanjay Kothary Created
140 ===========================================================================*/
141
142 procedure po_uom_conversion ( from_unit in varchar2,
143 to_unit in varchar2,
144 item_id in number,
145 uom_rate out NOCOPY number );
146 /*===========================================================================
147 PROCEDURE NAME: po_uom_convert ()
148
149 DESCRIPTION:
150 This is the PO uom conversion procedure that returns a the conversion
151 rate from the function
152 It needs to be
153 changed to call the Inventory stored procedure once Inventory is done
154 creating it.
155
156 USAGE:
157 conv_rate := po_uom_s.po_uom_convert ( from_unit varchar2,
158 to_unit varchar2,
159 item_id number );
160
161 PARAMETERS:
162 from_unit IN varchar2 - source unit of measure
163 to_unit IN varchar2 - destination unit of measure
164 item_id IN number - item id (null for one time items)
165
166 RETURNS:
167
168 conversion_rate NUMBER - conversion rate between the two units
169
170 DESIGN REFERENCES: Generic
171
172 ALGORITHM:
173
174 NOTES:
175
176 OPEN ISSUES:
177
178 CLOSED ISSUES:
179
180 CHANGE HISTORY:
181 17-MAR-95 Sanjay Kothary Created
182 ===========================================================================*/
183 function po_uom_convert ( from_unit in varchar2,
184 to_unit in varchar2,
185 item_id in number ) return number;
186
187
188 /*===========================================================================
189 PROCEDURE NAME: get_primary_uom()
190
191 DESCRIPTION:
192 This function returns the primary UOM based on item_id/organization
193 for both pre-defined and one-time items
194
195 USAGE:
196 uom := po_uom_s.get_primary_uom ( item_id number, org_id number,
197 current_unit_of_measure varchar2 )
198
199 PARAMETERS:
200 item_id IN number - item id (null for one time items)
201 org_id IN number - org id
202 current_unit_of_measure IN VARCHAR2 - currently defined uom on trx.
203
204 RETURNS:
205
206 primary_uom - VARCHAR2 - Primary UOM for given item and org
207
208 DESIGN REFERENCES: Generic
209
210 ALGORITHM:
211
212 NOTES:
213
214 OPEN ISSUES:
215
216 CLOSED ISSUES:
217
218 CHANGE HISTORY:
219 17-MAR-95 Sanjay Kothary Created
220 ===========================================================================*/
221 function get_primary_uom ( item_id in number,
222 org_id in number,
223 current_unit_of_measure in varchar2 )
224 return varchar2;
225
226 /*========================================================================
227
228 FUNCTION : po_uom_convert_p()
229
230 Created a function po_uom_convert_p which is pure function to be used in
231 the where and select clauses of a SQL stmt.bug 1365577
232 ******************************************************
233 So, any change in the po_uom_convertion proc in rvpo02
234 should be implemented in this new function.
235 ******************************************************
236 ========================================================================*/
237 function po_uom_convert_p ( from_unit in varchar2,
238 to_unit in varchar2,
239 item_id in number ) return number;
240
241
242 /*===========================================================================
243 PROCEDURE NAME: get_secondary_uom()
244
245 DESCRIPTION:
246 This function returns the primary UOM based on item_id/organization
247 for both pre-defined and one-time items
248
249 USAGE:
250 uom := po_uom_s.get_secondary_uom(p_item_id in number,
251 p_org_id in number,
252 x_secondary_uom_code out varchar2,
253 x_secondary_unit_of_measure out varchar2);
254
255 PARAMETERS:
256 item_id IN number - item id (null for one time items)
257 org_id IN number - org id
258 x_secondary_uom_code OUT VARCHAR2 - items secondary uom code.
259 x_secondary_unit_of_measure OUT VARCHAR2 - items secondary unit of meas
260
261 DESIGN REFERENCES: Generic
262
263 ALGORITHM:
264
265 NOTES:
266
267 OPEN ISSUES:
268
269 CLOSED ISSUES:
270
271 CHANGE HISTORY:
272 09-SEP-05 Preetam Bamb Created
273 ===========================================================================*/
274 procedure get_secondary_uom (p_item_id in number,
275 p_org_id in number,
276 x_secondary_uom_code out NOCOPY varchar2,
277 x_secondary_unit_of_measure out NOCOPY varchar2);
278
279 /*===========================================================================
280 PROCEDURE NAME: get_unit_of_measure()
281
282 DESCRIPTION:
283 This function returns the unit of measure for the passed uom code
284
285 USAGE:
286 uom := po_uom_s.get_unit_of_measure(
287 p_uom_code in varchar2,
288 x_unit_of_measure out NOCOPY varchar2);
289
290 PARAMETERS:
291 x_uom_code IN VARCHAR2 - items secondary uom code.
292 x_unit_of_measure OUT VARCHAR2 - items secondary unit of meas
293
294 DESIGN REFERENCES: Generic
295
296 ALGORITHM:
297
298 NOTES:
299
300 OPEN ISSUES:
301
302 CLOSED ISSUES:
303
304 CHANGE HISTORY:
305 09-SEP-05 Preetam Bamb Created
306 ===========================================================================*/
307 procedure get_unit_of_measure(
308 p_uom_code in varchar2,
309 x_unit_of_measure out NOCOPY varchar2);
310 END PO_UOM_S;