1 PACKAGE BODY AP_WEB_DB_PO_INT_PKG AS
2 /* $Header: apwdbpob.pls 120.3.12020000.2 2012/07/05 14:15:28 rveliche ship $ */
3
4 --
5 -- Function Name: IsVendorValid
6 -- Author: Kristian Widjaja
7 -- Purpose: This function checks whether a given Supplier is
8 -- active as of a given date.
9 --
10 -- Input: p_vendor_id
11 -- p_effective_date
12 --
13 -- Output: 'Y' or 'N'
14 --
15 -- Notes: Bug 3215993
16 -- Inactive Employees and Contingent Workers project
17
18 FUNCTION IsVendorValid(p_vendor_id IN NUMBER,
19 p_effective_date IN DATE default SYSDATE
20 ) return VARCHAR2 IS
21
22 BEGIN
23
24 /* Check if the given Supplier is active */
25 /* We are ignoring the effective_date for now */
26 IF (PO_VENDORS_SV.val_vendor(p_vendor_id)) THEN
27 RETURN 'Y';
28 ELSE
29 RETURN 'N';
30 END IF;
31
32 END IsVendorValid;
33
34 --
35 -- Function Name: IsVendorSiteValid
36 -- Author: Kristian Widjaja
37 -- Purpose: This function checks whether a given Supplier Site is
38 -- active as of a given date.
39 --
40 -- Input: p_vendor_id
41 -- p_effective_date
42 --
43 -- Output: 'Y' or 'N'
44 --
45 -- Notes: Bug 3215993
46 -- Inactive Employees and Contingent Workers project
47
48 FUNCTION IsVendorSiteValid(p_vendor_site_id IN NUMBER,
49 p_effective_date IN DATE default SYSDATE
50 ) return VARCHAR2 IS
51
52 l_vendor_site_id NUMBER := NULL;
53
54 BEGIN
55
56 /* Check if the given Supplier Site is active. */
57 /* We are ignoring the effective date for now. */
58 /*IF (PO_VENDOR_SITES_SV.val_vendor_site_id('PO',p_vendor_site_id)) THEN
59 RETURN 'Y';
60 ELSE
61 RETURN 'N';
62 END IF;*/
63
64 SELECT vendor_site_id
65 INTO l_vendor_site_id
66 FROM po_vendor_sites
67 WHERE vendor_site_id = p_vendor_site_id
68 AND SYSDATE < NVL(inactive_date, SYSDATE + 1)
69 AND NVL(pay_site_flag,'N')='Y';
70
71 RETURN 'Y';
72
73 EXCEPTION
74 WHEN OTHERS THEN
75 RETURN 'N';
76
77 END IsVendorSiteValid;
78
79 END AP_WEB_DB_PO_INT_PKG;