1 PACKAGE ARP_LEGAL_ENTITY_UTIL AUTHID CURRENT_USER AS
2 /* $Header: ARXLEUTS.pls 120.6.12010000.2 2009/06/03 09:03:36 rvelidi ship $ */
3
4 TYPE r_legal_entity_name IS TABLE OF VARCHAR2(240);
5 TYPE r_legal_entity_id IS TABLE OF NUMBER;
6
7 /* Global variables for caching default LE */
8 g_org_id NUMBER;
9 g_sob_id NUMBER;
10 g_le_id NUMBER;
11 g_org_id_dlc NUMBER;
12 g_le_id_dlc NUMBER;
13
14 /*============================================+
15 | FUNCTION Get_LE_Name()
16 |
17 | DESCRIPTION
18 | Public Function which will get the LE Name based upon
19 | the legal entity id
20 |
21 | PARAMETERS
22 |
23 | MODIFICATION HISTORY
24 | DATE Author Description of Changes
25 | 14-Apr-2005 Debbie Sue Jancis Created
26 |
27 *===========================================================================*/
28 FUNCTION Get_LE_Name (p_legal_entity_id NUMBER,
29 p_sob_id NUMBER) RETURN VARCHAR2;
30
31 /*============================================+
32 | FUNCTION Get_Default_LE
33 |
34 | DESCRIPTION
35 | Public Function which returns the default legal entity
36 | for a transaction based on the customers, trx_type, and batch_source.
37 | Provided that LEs have been migrated/updated on the various levels,
38 | this function should always return an LE ID.
39 |
40 | PARAMETERS
41 | p_sold_to_cust NUMBER
42 | p_bill_to_cust NUMBER
43 | p_trx_type_id NUMBER
44 | p_batch_source_id NUMBER
45 |
46 | MODIFICATION HISTORY
47 | DATE Author Description of Changes
48 | 28-Apr-2005 Michael S. Raymond Created
49 |
50 *===========================================================================*/
51
52 FUNCTION Get_Default_LE(p_sold_to_cust_id NUMBER,
53 p_bill_to_cust_id NUMBER,
54 p_trx_type_id NUMBER,
55 p_batch_source_id NUMBER) RETURN NUMBER;
56
57 -- bug 8516757
58 FUNCTION Get_Default_LE(p_sold_to_cust_id NUMBER,
59 p_bill_to_cust_id NUMBER,
60 p_trx_type_id NUMBER,
61 p_batch_source_id NUMBER,
62 p_org_id NUMBER) RETURN NUMBER;
63
64
65
66 /*============================================+
67 | FUNCTION Get_Default_LE_ID
68 |
69 | DESCRIPTION
70 | Public Function which returns the default legal entity ID
71 | if there is only 1 Le returned from the Legal Entity View.
72 |
73 | PARAMETERS
74 | p_org_id NUMBER
75 | p_sob_id NUMBER
76 |
77 | MODIFICATION HISTORY
78 | DATE Author Description of Changes
79 | 19-May-2005 MRAYMOND Created
80 |
81 *===========================================================================*/
82
83 FUNCTION Get_Default_LE_ID(p_org_id NUMBER,
84 p_sob_id NUMBER ) RETURN NUMBER;
85
86
87 /*============================================+
88 | FUNCTION Get_Default_LE_Name
89 |
90 | DESCRIPTION
91 | Public Function which returns the default legal entity name
92 | if there is only 1 Le returned from the Legal Entity View.
93 |
94 | PARAMETERS
95 | p_org_id NUMBER
96 | p_sob_id NUMBER
97 |
98 | MODIFICATION HISTORY
99 | DATE Author Description of Changes
100 | 13-May-2005 Debbie Sue Jancis Created
101 |
102 *===========================================================================*/
103
104 FUNCTION Get_Default_LE_Name(p_org_id NUMBER,
105 p_sob_id NUMBER ) RETURN VARCHAR2;
106
107 /*============================================+
108 | FUNCTION Is_LE_Subscriber
109 |
110 | DESCRIPTION
111 | Public Function which returns True if the Subscriber is LE
112 | and FALSE if the Subscriber is OU
113 |
114 | PARAMETERS
115 |
116 | MODIFICATION HISTORY
117 | DATE Author Description of Changes
118 | 02-Sep-2005 Debbie Sue Jancis Created
119 |
120 *===========================================================================*/
121 FUNCTION Is_LE_Subscriber RETURN BOOLEAN;
122
123 /*============================================+
124 | FUNCTION get_default_legal_context
125 |
126 | DESCRIPTION
127 | Public Function which returns the default legal entity
128 | from the default_legal_context in HR_OPERATING_UNITS.
129 | Note that this function will always return an LE, and
130 | never give any indication that there are multiple LEs
131 | within this OU.
132 |
133 | PARAMETERS
134 | p_org_id NUMBER
135 |
136 | MODIFICATION HISTORY
137 | DATE Author Description of Changes
138 | 01-JUN-2006 MRAYMOND Created
139 |
140 *===========================================================================*/
141
142 FUNCTION get_default_legal_context(p_org_id NUMBER) RETURN NUMBER;
143
144 END ARP_Legal_Entity_util;