[Home] [Help]
PACKAGE BODY: APPS.HR_ORGANIZATIONS_SV1
Source
1 PACKAGE BODY HR_ORGANIZATIONS_SV1 AS
2 /* $Header: POXPIOGB.pls 115.0 99/07/17 01:49:25 porting ship $ */
3
4 /*================================================================
5
6 FUNCTION NAME: val_inv_organization_id()
7
8 ==================================================================*/
9 FUNCTION val_inv_organization_id(x_inv_organization_id IN NUMBER)
10 RETURN BOOLEAN IS
11
12 x_progress varchar2(3) := null;
13 x_temp binary_integer := 0;
14
15 BEGIN
16 x_progress := '010';
17
18 /* check to see if there are x_inv_organization_id exists in
19 org_organization_definitions table */
20
21 SELECT count(*)
22 INTO x_temp
23 FROM org_organization_definitions
24 WHERE organization_id = x_inv_organization_id
25 AND sysdate < nvl(disable_date, sysdate+1)
26 AND inventory_enabled_flag = 'Y';
27
28 IF x_temp = 0 THEN
29 RETURN FALSE; /* validation fails */
30 ELSE
31 RETURN TRUE; /* validation success */
32 END IF;
33
34 EXCEPTION
35 WHEN others THEN
36 po_message_s.sql_error
37 ('val_inv_organization_id', x_progress, sqlcode);
38 raise;
39 END val_inv_organization_id;
40
41
42 /*================================================================
43
44 FUNCTION NAME: derive_organization_id()
45
46 ==================================================================*/
47 FUNCTION derive_organization_id(X_organization_code IN VARCHAR2)
48 return NUMBER IS
49
50 X_progress varchar2(3) := NULL;
51 X_organization_id_v number := NULL;
52
53 BEGIN
54
55 X_progress := '010';
56
57 /* get the organization_id form org_organization_definitions
58 table based on organization_code */
59
60 SELECT organization_id
61 INTO X_organization_id_v
62 FROM org_organization_definitions
63 WHERE organization_code = X_organization_code
64 AND sysdate < nvl(disable_date, sysdate+1)
65 AND inventory_enabled_flag = 'Y';
66
67 RETURN X_organization_id_v;
68
69 EXCEPTION
70
71 When no_data_found then
72 RETURN NULL;
73 When others then
74 po_message_s.sql_error('derive_organization_id',X_progress, sqlcode);
75 raise;
76
77 END derive_organization_id;
78 END HR_ORGANIZATIONS_SV1;