1 PACKAGE PO_LOCATIONS_S AUTHID CURRENT_USER AS
2 /* $Header: POXCOL2S.pls 115.4 2002/12/27 20:55:30 anhuang ship $*/
3
4 /* create client package */
5 /*
6 PACKAGE PO_LOCATIONS_S IS
7 */
8
9 /*===========================================================================
10 PACKAGE NAME: PO_LOCATIONS_S
11
12 DESCRIPTION:
13
14 CLIENT/SERVER: Server
15
16 LIBRARY NAME
17
18 OWNER: Thomas Cai
19
20 PROCEDURE/FUNCTION NAMES:
21 val_location()
22 get_loc_attributes();
23 get_tax_name();
24 val_if_inventory_destination()
25 val_ship_to_site_in_org()
26 val_receipt_site_in_org ()
27 get_ship_to_location()
28 derive_location_info()
29 validate_location_info()
30 validate_tax_info()
31 po_predel_validation()
32
33 HISTORY:
34 3/22/95 tc all algorithms are added.
35 5/4/95 si added get_loc_attributes procedure.
36 5/4/95 si added the show errors part of the spec.
37 10/25/96 rb added derive_location_info and validate_location_info
38 3/3/99 ayeung added po_predel_validation()
39 ===========================================================================*/
40 /*===========================================================================
41 FUNCTION NAME: get_ship_to_location()
42
43 DESCRIPTION: This procedure returns a ship-to location ID for
44 a given deliver-to location ID. It also verifies
45 whether this ship-to is still active, and returns
46 TRUE or FALSE accordingly.
47
48
49 PARAMETERS: X_deliver_to_loc_id IN NUMBER,
50 X_ship_to_loc_id IN OUT NUMBER
51
52 RETURN TYPE: BOOLEAN
53
54 DESIGN REFERENCES:
55
56 ALGORITHM:
57
58 NOTES:
59
60 OPEN ISSUES:
61
62 CLOSED ISSUES:
63
64 CHANGE HISTORY: Created 10-JUL-1995 LBROADBE
65 ===========================================================================*/
66 FUNCTION get_ship_to_location(X_deliver_to_loc_id IN NUMBER,
67 X_ship_to_loc_id IN OUT NOCOPY NUMBER) return BOOLEAN;
68
69 /*===========================================================================
70 FUNCTION NAME: val_location()
71
72 DESCRIPTION:
73 Validate necessary fields are filled in, based on destination type.
74 Expense and Shopfloor
75 - Require deliver-to location
76 message RCV_ALL_MISSING_DELIVER_TO
77 Receiving
78 - Require transfer to another receiving location
79 message RCV_ALL_MISSING_RECEIVE_TO
80
81 Return 0 for failure, 1 for success.
82
83 PARAMETERS:
84 x_location_id IN NUMBER,
85 x_destination_type IN VARCHAR2,
86 x_organization_id IN NUMBER,
87
88
89 DESIGN REFERENCES: RCVRCERC.dd
90 RCVTXERT.dd
91
92 ALGORITHM:
93 if location_id is null then
94 case x_destination_type
95 :if = receiving then
96 return fail1
97 :if = expense or shopfloor or inventory then
98 return fail2
99 end case
100
101 return ok.
102
103 NOTES:
104
105 OPEN ISSUES:
106 1. When Oracle Inventory creates a receipt header for an in-transit
107 shipment, get destincation type from receiving shipment line which
108 is pre-populated. Check with Oracle Inventory.
109
110 CLOSED ISSUES:
111
112 CHANGE HISTORY:
113 ===========================================================================*/
114
115 FUNCTION val_location
116 (
117 x_location_id IN NUMBER,
118 x_destination_type IN VARCHAR2,
119 x_organization_id IN NUMBER
120 )
121 RETURN NUMBER;
122
123 /*===========================================================================
124 PROCEDURE NAME: get_location_attributes()
125
126 DESCRIPTION: Given a location id, get the location_code and
127 inventory_org_id.
128
129
130 PARAMETERS:
131
132 DESIGN REFERENCES: POXPOMPO.doc
133
134
135 ALGORITHM:
136
137 NOTES:
138
139 OPEN ISSUES:
140
141 CLOSED ISSUES:
142
143 CHANGE HISTORY: Sudha Iyer 05/95
144
145 ===============================================================================*/
146
147 procedure get_loc_attributes ( X_temp_loc_id IN number, X_loc_dsp IN OUT NOCOPY varchar2,
148 X_org_id IN OUT NOCOPY number);
149
150 /*===========================================================================
151 PROCEDURE NAME: get_tax_name()
152
153 DESCRIPTION: Given a location id, get the tax_name associated with it.
154
155
156 PARAMETERS:
157
158 DESIGN REFERENCES: POXPOREL.doc
159
160
161 ALGORITHM:
162
163 NOTES:
164
165 OPEN ISSUES:
166
167 CLOSED ISSUES:
168
169 CHANGE HISTORY: Sudha Iyer 06/95
170
171 ===============================================================================*/
172
173
174 procedure get_tax_name ( X_location_id IN NUMBER,
175 X_org_id IN NUMBER,
176 X_tax_name IN OUT NOCOPY VARCHAR2);
177
178
179
180 /*===========================================================================
181 PROCEDURE NAME: get_loc_org ()
182
183 DESCRIPTION: Given a location and the set of books, this
184 procedure provides the organization.
185
186 PARAMETERS: x_location_id IN NUMBER
187 x_sob_id IN NUMBER
188 x_org_id IN OUT NUMBER
189 x_org_name IN OUT VARCHAR2
190
191 DESIGN REFERENCES: POXRQERQ.doc
192
193
194 ALGORITHM:
195
196 NOTES:
197
198 OPEN ISSUES:
199
200 CLOSED ISSUES:
201
202 CHANGE HISTORY: Ramana Y. Mulpury 06/95
203
204 ===============================================================================*/
205
206
207 procedure get_loc_org ( X_location_id IN NUMBER,
208 X_sob_id IN NUMBER,
209 X_org_id IN OUT NOCOPY NUMBER,
210 X_org_code IN OUT NOCOPY VARCHAR2,
211 X_org_name IN OUT NOCOPY VARCHAR2);
212
213
214 /*===========================================================================
215 PROCEDURE NAME: val_if_inventory_destination
216
217 DESCRIPTION: Check if there are any inventory final destinations
218 either on the po or in-transit shipment. If there
219 are then you need to get the latest implemented
220 item rev if it is under item rev control
221
222 PARAMETERS: X_item_id IN NUMBER,
223 X_organization_id IN NUMBER
224 X_item_revision IN OUT VARCHAR2,
225 X_rev_exists OUT BOOLEAN
226
227 DESIGN REFERENCES: ../RCVRCERC.dd
228
229 ALGORITHM:
230
231 NOTES:
232
233 OPEN ISSUES:
234
235 CLOSED ISSUES:
236
237 CHANGE HISTORY: Created 27-JUN-95 GKELLNER
238 ===========================================================================*/
239
240 FUNCTION val_if_inventory_destination (
241 X_line_location_id IN NUMBER,
242 X_shipment_line_id IN NUMBER)
243 RETURN BOOLEAN;
244
245
246
247
248 /*===========================================================================
249 PROCEDURE NAME: get_location_code()
250
251 DESCRIPTION: This procedure provides the location_code
252 based on the location id.
253
254
255 PARAMETERS: x_location_id IN NUMBER
256 x_location_code IN OUT VARCHAR2
257
258 DESIGN REFERENCES: POXRQERQ.doc
259
260
261 ALGORITHM:
262
263 NOTES:
264
265 OPEN ISSUES:
266
267 CLOSED ISSUES:
268
269 CHANGE HISTORY: Ramana Y. Mulpury 06/23
270
271 ===============================================================================*/
272
273 procedure get_location_code ( x_location_id IN NUMBER,
274 x_location_code IN OUT NOCOPY VARCHAR2);
275
276
277 FUNCTION get_location_code -- <2699404>
278 ( p_location_id IN HR_LOCATIONS.location_id%TYPE
279 ) RETURN HR_LOCATIONS.location_code%TYPE;
280
281
282 /*===========================================================================
283 PROCEDURE NAME: val_ship_to_site_in_org()
284
285 DESCRIPTION: Validates if the given location is an active ship_to_site
286 in the given org.
287 This procedure is currently being called during autocreate of
288 a PO shipment.
289
290
291 PARAMETERS:
292
293 DESIGN REFERENCES:
294
295
296 ALGORITHM:
297
298 NOTES:
299
300 OPEN ISSUES:
301
302 CLOSED ISSUES:
303
304 CHANGE HISTORY: Sudha Iyer 07/95
305
306 ===============================================================================*/
307
308
309 FUNCTION val_ship_to_site_in_org
310 ( x_location_id IN NUMBER,
311 x_organization_id IN NUMBER
312 )
313 RETURN BOOLEAN;
314
315
316 /*===========================================================================
317 PROCEDURE NAME: val_receipt_site_in_org
318
319 DESCRIPTION: Validates if the given location is an active receiving site
320 in the given org.
321 This procedure is currently being called for receiving
322 validation
323
324
325 PARAMETERS:
326
327 DESIGN REFERENCES:
328
329
330 ALGORITHM:
331
332 NOTES:
333
334 OPEN ISSUES:
335
336 CLOSED ISSUES:
337
338 CHANGE HISTORY: Sudha Iyer 07/95
339
340 ===============================================================================*/
341
342
343 FUNCTION val_receipt_site_in_org
344 ( x_location_id IN NUMBER,
345 x_organization_id IN NUMBER
346 )
347 RETURN BOOLEAN;
348
349
350
351 /*===========================================================================
352 PROCEDURE NAME: derive_location_info()
353
354 DESCRIPTION: Derives information about the missing components of
355 location record based on the components that have values.
356
357
358 PARAMETERS: p_loc_record IN OUT RCV_SHIPMENT_HEADER_SV.LocRecType
359
360 DESIGN REFERENCES:
361
362 ALGORITHM:
363
364 NOTES: uses dbms_sql to create the WHERE clause based on the
365 components of p_loc_record that have values
366
367 OPEN ISSUES:
368
369 CLOSED ISSUES:
370
371 CHANGE HISTORY: 10/25/96 Raj Bhakta
372
373 ===============================================================================*/
374
375 PROCEDURE derive_location_info(p_loc_record IN OUT NOCOPY RCV_SHIPMENT_OBJECT_SV.Location_id_record_type);
376
377
378 /*===========================================================================
379 PROCEDURE NAME: validate_location_info()
380
381 DESCRIPTION: Validate the components of location record based on the
382 components that have values. Returns error status and
383 error messages based on diff tests.
384
385
386 PARAMETERS: p_loc_record IN OUT RCV_SHIPMENT_HEADER_SV.LocRecType
387
388 DESIGN REFERENCES:
389
390 ALGORITHM:
391
392 NOTES: uses dbms_sql to create the WHERE clause based on the
393 components of p_loc_record that have values
394
395 OPEN ISSUES:
396
397 CLOSED ISSUES:
398
399 CHANGE HISTORY: 10/25/96 Raj Bhakta
400
401 ===============================================================================*/
402
403 PROCEDURE validate_location_info(p_loc_record IN OUT NOCOPY RCV_SHIPMENT_OBJECT_SV.Location_id_record_type);
404
405 /*===========================================================================
406 PROCEDURE NAME: validate_tax_info()
407
408 DESCRIPTION: Validate the components of tax record based on the
409 components that have values. Returns error status and
410 error messages based on diff tests.
411
412
413 PARAMETERS: p_tax_rec IN OUT RCV_SHIPMENT_HEADER_SV.TaxRecType
414
415 DESIGN REFERENCES:
416
417 ALGORITHM:
418
419 NOTES:
420
421 OPEN ISSUES:
422
423 CLOSED ISSUES:
424
425 CHANGE HISTORY: 10/29/96 Raj Bhakta Created
426
427 ===============================================================================*/
428
429 PROCEDURE validate_tax_info(p_tax_rec IN OUT NOCOPY RCV_SHIPMENT_HEADER_SV.TaxRecType);
430
431
432 /*===========================================================================
433 PROCEDURE NAME: po_predel_validation()
434
435 DESCRIPTION: This procedure is used primarily by the HR Location form
436 (PERWSLOC) to validate any locations that can be deleted
437 from the database. It checks for any location that is
438 currently in use in the PO, RCV, CHV base tables
439
440
441 PARAMETERS: p_location_id IN NUMBER
442
443 DESIGN REFERENCES:
444
445 ALGORITHM:
446
447 NOTES:
448
449 OPEN ISSUES:
450
451 CLOSED ISSUES:
452
453 CHANGE HISTORY: 03/03/99 Andrew Yeung Created
454
455 =============================================================================*/
456
457 PROCEDURE PO_PREDEL_VALIDATION(p_location_id IN NUMBER);
458
459
460 END PO_LOCATIONS_S;
461