DBA Data[Home] [Help]

PACKAGE: APPS.PO_VENDORS_SV

Source


1 PACKAGE PO_VENDORS_SV as
2 /* $Header: POXVDVES.pls 120.1 2005/06/24 01:52:25 vsanjay noship $*/
3 
4 /*===========================================================================
5   FUNCTION NAME:	val_vendor()
6 
7   DESCRIPTION:		This function checks whether a given Supplier is
8 			still active.
9 
10 
11   PARAMETERS:		X_vendor_id IN NUMBER
12 
13   RETURN TYPE:		BOOLEAN
14 
15   DESIGN REFERENCES:
16 
17   ALGORITHM:
18 
19   NOTES:
20 
21   OPEN ISSUES:
22 
23   CLOSED ISSUES:
24 
25   CHANGE HISTORY:	Created 	09-JUL-1995	LBROADBE
26 			Changed to	14-AUG-1995	LBROADBE
27 			Function
28 ===========================================================================*/
29 FUNCTION val_vendor(X_vendor_id IN NUMBER) return BOOLEAN;
30 
31 /*===========================================================================
32   PROCEDURE NAME:	get_vendor_defaults()
33 
34 
35   DESCRIPTION:    Get the Vendor attributes for a given vendor_id.
36                   If there is a default Vendor Site for this Vendor,
37                      get the vendor_site info.
38 
39                   If there is no default vendor site, do not bother to validate
40                   the vendor attributes right now.They will probably be overwritten by
41                   the Vendor Site info.
42 
43                   If there exists a default Vendor Site info,
44 
45                   ( The validation logic first checks if the value stored at the
46                   vendor site level is valid; Only if teh vendor site info is not
47                   valid, should we use the value stored at the vendor level)
48 
49                   Validate the invoice currency_code,
50                                fob lookupcode,
51                                freight_terms lookup code,
52                                ship_via_lookup code,
53                                terms_id.
54                   Get the validated code's displayed value.
55                   Validate the Ship-To Location and get its attributes
56                   Validate the Bill-to location and get its attributes.
57 
58 
59 
60   PARAMETERS:
61 
62   DESIGN REFERENCES:	POXPOMPO.doc
63 
64 
65   ALGORITHM:
66 
67   NOTES:
68 
69   OPEN ISSUES:
70 
71   CLOSED ISSUES:
72 
73   CHANGE HISTORY: Sudha Iyer      04/95		Created.
74 		  Melissa Snyder  11/14/95	Added X_document_type
75 						parameter.
76 
77 ===============================================================================*/
78 
79  procedure get_vendor_defaults ( X_vendor_id IN NUMBER,
80                                   X_org_id IN number,
81                                   X_set_of_books_id IN number,
82                                   X_res_fob IN OUT NOCOPY varchar2 ,
83                                   X_res_ship_via IN OUT NOCOPY varchar2 ,
84                                   X_res_freight_terms IN OUT NOCOPY varchar2 ,
85                                   X_res_terms_id  IN OUT NOCOPY number ,
86                                   X_vendor_site_id IN OUT NOCOPY number ,
87                                   X_vendor_site_code IN OUT NOCOPY VARCHAR2,
88                                   X_fob_dsp IN OUT NOCOPY varchar2,
89                                   X_ship_via_dsp IN OUT NOCOPY varchar2,
90                                   X_freight_terms_dsp IN OUT NOCOPY varchar2,
91                                   X_terms_dsp  IN OUT NOCOPY varchar2,
92                                   X_res_ship_to_loc_id  IN OUT NOCOPY number,
93                                   X_ship_to_loc_dsp IN OUT NOCOPY varchar2,
94                                   X_ship_org_code IN OUT NOCOPY varchar2,
95                                   X_ship_org_name IN OUT NOCOPY varchar2,
96                                   X_ship_org_id  IN OUT NOCOPY number,
97                                   X_res_bill_to_loc_id IN OUT NOCOPY number,
98                                   X_bill_to_loc_dsp IN OUT NOCOPY varchar2 ,
99                                   X_res_invoice_currency_code IN OUT NOCOPY varchar2,
100                                   X_type_1099 IN OUT NOCOPY varchar2,
101                                   X_receipt_required_flag IN OUT NOCOPY varchar2,
102                                   X_vendor_contact_id IN OUT NOCOPY number,
103                                   X_vendor_contact_name IN OUT NOCOPY varchar2,
104                                   X_inspection_required_flag IN OUT NOCOPY varchar2,
105 				  X_document_type IN varchar2);
106 
107 /*===========================================================================
108  PROCEDURE NAME:	get_vendor_info()
109 
110   DESCRIPTION:  Given a vendor id, this procedure returns the
111                 relevant attributes of that vendor.
112 
113 
114   PARAMETERS:
115 
116   DESIGN REFERENCES:	POXPOMPO.doc
117 
118 
119   ALGORITHM:
120 
121   NOTES:
122 
123   OPEN ISSUES:
124 
125   CLOSED ISSUES:
126 
127   CHANGE HISTORY: Sudha Iyer         04/95
128 
129 ===============================================================================*/
130 
131  procedure get_vendor_info(X_vendor_id IN number,
132                            X_ship_to_location_id IN OUT NOCOPY number,
133                            X_bill_to_location_id IN OUT NOCOPY number,
134                            X_ship_via_lookup_code IN OUT NOCOPY varchar2,
135                            X_fob_lookup_code IN OUT NOCOPY varchar2,
136                            X_freight_terms_lookup_code IN OUT NOCOPY varchar2,
137                            X_terms_id IN OUT NOCOPY number,
138                            X_type_1099  IN OUT NOCOPY varchar2,
139                            X_hold_flag IN OUT NOCOPY  varchar2,
140                            X_invoice_currency_code IN OUT NOCOPY varchar2,
141                            X_receipt_required_flag IN OUT NOCOPY varchar2,
142                            X_num_1099 IN OUT NOCOPY varchar2,
143                            X_vat_registration_num  IN OUT NOCOPY varchar2,
144                            X_inspection_required_flag IN OUT NOCOPY varchar2 );
145 
146 
147 /*===========================================================================
148  PROCEDURE NAME:	val_fob()
149 
150   DESCRIPTION:     This procedure decides if the given fob lookup code
151                    is valid (ie., if it is still an active lookupcode)
152 
153 
154   PARAMETERS:
155 
156   DESIGN REFERENCES:	POXPOMPO.doc
157 
158 
159   ALGORITHM:
160 
161   NOTES:
162 
163   OPEN ISSUES:
164 
165   CLOSED ISSUES:
166 
167   CHANGE HISTORY: Sudha Iyer         04/95
168 
169 ===============================================================================*/
170  procedure val_fob( X_temp_fob_lookup_code IN varchar2,
171                     X_res_fob IN OUT NOCOPY varchar2 );
172 
173 /*===========================================================================
174  PROCEDURE NAME:	val_freight_terms()
175 
176   DESCRIPTION:     This procedure decides if the given freight terms lookup code
177                    is valid (ie., if it is still an active lookupcode)
178 
179 
180   PARAMETERS:
181 
182   DESIGN REFERENCES:	POXPOMPO.doc
183 
184 
185   ALGORITHM:
186 
187   NOTES:
188 
189   OPEN ISSUES:
190 
191   CLOSED ISSUES:
192 
193   CHANGE HISTORY: Sudha Iyer         04/95
194 
195 ===============================================================================*/
196  procedure val_freight_terms( X_temp_freight_terms IN varchar2,
197                               X_res_freight_terms IN OUT NOCOPY varchar2) ;
198 
199 /*===========================================================================
200  PROCEDURE NAME:	val_freight_carrier()
201 
202   DESCRIPTION:     This procedure decides if the given freight carrier
203                    is valid (ie., if it is still an active lookupcode)
204 
205 
206   PARAMETERS:
207 
208   DESIGN REFERENCES:	POXPOMPO.doc
209 
210 
211   ALGORITHM:
212 
213   NOTES:
214 
215   OPEN ISSUES:
216 
217   CLOSED ISSUES:
218 
219   CHANGE HISTORY: Sudha Iyer         04/95
220 
221 ===============================================================================*/
222  procedure val_freight_carrier(X_temp_ship_via IN varchar2,
223                                X_org_id IN number,
224                                X_res_ship_via IN OUT NOCOPY varchar2);
225 
226 PROCEDURE get_terms_conditions                                    -- <GA FPI>
227 (   p_po_header_id              IN         PO_HEADERS_ALL.po_header_id%TYPE
228 ,   x_terms_id                  OUT NOCOPY PO_HEADERS_ALL.terms_id%TYPE
229 ,   x_ship_via_lookup_code      OUT NOCOPY PO_HEADERS_ALL.ship_via_lookup_code%TYPE
230 ,   x_fob_lookup_code           OUT NOCOPY PO_HEADERS_ALL.fob_lookup_code%TYPE
231 ,   x_freight_terms_lookup_code OUT NOCOPY PO_HEADERS_ALL.freight_terms_lookup_code%TYPE
232 ,   x_shipping_control          OUT NOCOPY PO_HEADERS_ALL.shipping_control%TYPE    -- <INBOUND LOGISTICS FPJ>
233 );
234 
235 /* INBOUND LOGISTICS FPJ START */
236 /**
237 * Private Procedure: val_shipping_control
238 * Requires: None
239 * Modifies: None
240 * Effects: Decides if the given shipping control is valid, i.e. if it's still
241 *   an active lookup code
242 *   IF p_temp_shipping_control is valide
243 *       RETURN p_temp_shipping_control
244 *   ELSE
245 *       RETURN NULL
246 * Returns: x_res_shipping_control
247 */
248 
249 PROCEDURE val_shipping_control
250 (
251     p_temp_shipping_control    IN               VARCHAR2,
252     x_res_shipping_control     IN OUT NOCOPY    VARCHAR2
253 );
254 /* INBOUND LOGISTICS FPJ END */
255 
256 /*===========================================================================
257  PROCEDURE NAME:	get_displayed_values()
258 
259   DESCRIPTION:     This procedure gets the displayed values for the
260                    following lookup codes: FOB,
261                                            Freight Terms,
262                                            Ship Via ( Freight Carrier),
263                                            Payment Terms.
264                    It calls the PO_CORE_S package to get the FOB and Freight
265                    Terms display.
266 
267 
268 
269   PARAMETERS:
270 
271   DESIGN REFERENCES:	POXPOMPO.doc
272 
273 
274   ALGORITHM:
275 
276   NOTES:
277 
278   OPEN ISSUES:
279 
280   CLOSED ISSUES:
281 
282   CHANGE HISTORY: Sudha Iyer         04/95
283 
284 ===============================================================================*/
285 
286  procedure get_displayed_values (X_res_fob IN varchar2, X_res_freight_terms IN varchar2,
287                                  X_res_ship_via IN varchar2, X_res_terms_id IN number,
288                                  X_fob_dsp IN OUT NOCOPY varchar2, X_freight_terms_dsp IN OUT NOCOPY varchar2,
289                                  X_ship_via_dsp IN OUT NOCOPY varchar2, X_terms_dsp IN OUT NOCOPY varchar2,
290                                  X_org_id IN number);
291 
292 FUNCTION get_terms_dsp                                           -- <GA FPI>
293 (   p_terms_id           IN      AP_TERMS.term_id%TYPE
294 ) RETURN AP_TERMS.name%TYPE;
295 
296 
297 /*===========================================================================
298  PROCEDURE NAME:	get_ship_to_loc_attributes()
299 
300   DESCRIPTION:     This procedure gets the ship to Location
301                    attributes for a given location id.
302 
303 
304   PARAMETERS:
305 
306   DESIGN REFERENCES:	POXPOMPO.doc
307 
308 
309   ALGORITHM:
310 
311   NOTES:
312 
313   OPEN ISSUES:
314 
315   CLOSED ISSUES:
316 
317   CHANGE HISTORY: Sudha Iyer         04/95
318 
319 ===============================================================================*/
320 
321  procedure get_ship_to_loc_attributes ( X_temp_ship_to_loc_id IN number, X_ship_to_loc_dsp IN OUT NOCOPY varchar2,
322                                         X_ship_org_code IN OUT NOCOPY varchar2, X_ship_org_name IN OUT NOCOPY varchar2,
323                                         X_ship_org_id IN OUT NOCOPY  number, X_set_of_books_id IN number);
324 
325 /*===========================================================================
326  PROCEDURE NAME:	get_bill_to_loc_attributes()
327 
328   DESCRIPTION:     This procedure gets the Bill to Location
329                    attributes for a given location id.
330 
331 
332   PARAMETERS:
333 
334   DESIGN REFERENCES:	POXPOMPO.doc
335 
336 
337   ALGORITHM:
338 
339   NOTES:
340 
341   OPEN ISSUES:
342 
343   CLOSED ISSUES:
344 
345   CHANGE HISTORY: Sudha Iyer         04/95
346 
347 ===============================================================================*/
348 
349  procedure get_bill_to_loc_attributes (X_temp_bill_to_loc_id IN number, X_bill_to_loc_dsp IN OUT NOCOPY varchar2);
350 
351 
352 /*===========================================================================
353   PROCEDURE NAME : get_vendor_name()
354 
355   DESCRIPTION    :  For a given Vendor Id, this procedures gets the Vendor Name.
356 
357   PARAMETERS:
358 
359   RETURN VALUE:
360 
361   DESIGN REFERENCES:	../POXPOREL.doc
362 
363   ALGORITHM:
364 
365   NOTES:
366 
367   OPEN ISSUES:
368 
369   CLOSED ISSUES:
370 
371   CHANGE HISTORY:
372 
373 ========================================================================*/
374  PROCEDURE get_vendor_name
375 		      (X_vendor_id IN NUMBER,
376 		       X_vendor_name IN OUT NOCOPY VARCHAR2);
377 
378    PROCEDURE test_get_vendor (X_vendor_id IN NUMBER);
379 
380 
381 /*===========================================================================
382   Bug #508009
383   FUNCTION NAME : get_vendor_name_func()
384 
385   DESCRIPTION    :  For a given Vendor Id, this returns  the Vendor Name.
386 
387   PARAMETERS:   NUMBER - Vendor ID
388 
389   RETURN VALUE: VARCHAR2 - Vendor Name
390 
391   DESIGN REFERENCES:
392 
393   ALGORITHM:
394 
395   NOTES:
396 
397   OPEN ISSUES:
398 
399   CLOSED ISSUES:
400 
401   CHANGE HISTORY:
402 
403 ========================================================================*/
404 
405     FUNCTION get_vendor_name_func(X_vendor_id  IN NUMBER) RETURN VARCHAR2;
406 
407 --    PRAGMA RESTRICT_REFERENCES(get_vendor_name_func, WNDS);
408 
409 
410 
411 /*===========================================================================
412   PROCEDURE NAME : get_vendor_details
413 
414   DESCRIPTION    : Obtain the  vendor name, vendor site, vendor contact
415 		   and vendor phone using the vendor id , vendor site id
416 		   and vendor contact id.
417 
418   PARAMETERS:	   x_vendor_id		IN  NUMBER
419 		   x_vendor_site_id	IN  NUMBER
420 		   x_vendor_contact_id	IN  NUMBER
421 		   x_vendor_name	OUT VARCHAR2
422 		   x_vendor_location    OUT VARCHAR2
423 		   x_vendor_contact	OUT VARCHAR2
424 		   x_vendor_phone	OUT VARCHAR2
425 
426 
427   DESIGN REFERENCES:	../POXRQERQ.doc
428 
429   ALGORITHM:
430 
431   NOTES:
432 
433   OPEN ISSUES:
434 
435   CLOSED ISSUES:
436 
437   CHANGE HISTORY:    Created 	10/21		Ramana Mulpury
438 
439 ========================================================================*/
440  PROCEDURE get_vendor_details (x_vendor_id      	IN     NUMBER,
441 		               x_vendor_site_id 	IN     NUMBER,
442 			       x_vendor_contact_id	IN     NUMBER,
443 			       x_vendor_name		IN OUT NOCOPY VARCHAR2,
444 			       x_vendor_location	IN OUT NOCOPY VARCHAR2,
445 			       x_vendor_contact		IN OUT NOCOPY VARCHAR2,
446 			       x_vendor_phone		IN OUT NOCOPY VARCHAR2);
447 
448 
449 
450 /*===========================================================================
451   PROCEDURE NAME : derive_vendor_info
452 
453   DESCRIPTION    : Accepts as input vendor record that has vendor_name, vendor_id
454                    and vendor_num. Derives values for the columns that are null.
455                    Needs atleast one column to have a value in the input.
456 
457   PARAMETERS:	   p_vendor_record  in out rcv_shipment_header_sv.VendorRecType
458 
459   DESIGN REFERENCES:
460 
461   ALGORITHM:
462 
463   NOTES:           Uses dbms_sql to create query where condition based on the input
464                    columns that have values.
465 
466   OPEN ISSUES:
467 
468   CLOSED ISSUES:
469 
470   CHANGE HISTORY:    Created 	10/24		Raj Bhakta
471 
472 ========================================================================*/
473 
474  PROCEDURE derive_vendor_info (p_vendor_record IN OUT NOCOPY RCV_SHIPMENT_HEADER_SV.VendorRecType);
475 
476 
477 /*===========================================================================
478   PROCEDURE NAME : validate_vendor_info
479 
480   DESCRIPTION    : Accepts as input vendor record that has vendor_id, vendor_name and
481                    vendor_num as components. Based on the components that have values
482                    validates for a no of conditions.
483 
484   PARAMETERS:	   p_vendor_record  in out rcv_shipment_header_sv.VendorRecType
485 
486   DESIGN REFERENCES:
487 
488   ALGORITHM:
489 
490   NOTES:           Uses dbms_sql to create query WHERE condition based on the input
491                    columns that have values.
492 
493   OPEN ISSUES:
494 
495   CLOSED ISSUES:
496 
497   CHANGE HISTORY:    Created 	10/24		Raj Bhakta
498 
499 ========================================================================*/
500 
501  PROCEDURE validate_vendor_info (p_vendor_record IN OUT NOCOPY RCV_SHIPMENT_HEADER_SV.VendorRecType);
502 
503 END PO_VENDORS_SV;