1 PACKAGE ARP_LEGAL_ENTITY_UTIL AS
2 /* $Header: ARXLEUTS.pls 120.6 2006/06/02 12:35:39 mraymond noship $ */
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 /*============================================+
58 | FUNCTION Get_Default_LE_ID
59 |
60 | DESCRIPTION
61 | Public Function which returns the default legal entity ID
62 | if there is only 1 Le returned from the Legal Entity View.
63 |
64 | PARAMETERS
65 | p_org_id NUMBER
66 | p_sob_id NUMBER
67 |
68 | MODIFICATION HISTORY
69 | DATE Author Description of Changes
70 | 19-May-2005 MRAYMOND Created
71 |
72 *===========================================================================*/
73
74 FUNCTION Get_Default_LE_ID(p_org_id NUMBER,
75 p_sob_id NUMBER ) RETURN NUMBER;
76
77
78 /*============================================+
79 | FUNCTION Get_Default_LE_Name
80 |
81 | DESCRIPTION
82 | Public Function which returns the default legal entity name
83 | if there is only 1 Le returned from the Legal Entity View.
84 |
85 | PARAMETERS
86 | p_org_id NUMBER
87 | p_sob_id NUMBER
88 |
89 | MODIFICATION HISTORY
90 | DATE Author Description of Changes
91 | 13-May-2005 Debbie Sue Jancis Created
92 |
93 *===========================================================================*/
94
95 FUNCTION Get_Default_LE_Name(p_org_id NUMBER,
96 p_sob_id NUMBER ) RETURN VARCHAR2;
97
98 /*============================================+
99 | FUNCTION Is_LE_Subscriber
100 |
101 | DESCRIPTION
102 | Public Function which returns True if the Subscriber is LE
103 | and FALSE if the Subscriber is OU
104 |
105 | PARAMETERS
106 |
107 | MODIFICATION HISTORY
108 | DATE Author Description of Changes
109 | 02-Sep-2005 Debbie Sue Jancis Created
110 |
111 *===========================================================================*/
112 FUNCTION Is_LE_Subscriber RETURN BOOLEAN;
113
114 /*============================================+
115 | FUNCTION get_default_legal_context
116 |
117 | DESCRIPTION
118 | Public Function which returns the default legal entity
119 | from the default_legal_context in HR_OPERATING_UNITS.
120 | Note that this function will always return an LE, and
121 | never give any indication that there are multiple LEs
122 | within this OU.
123 |
124 | PARAMETERS
125 | p_org_id NUMBER
126 |
127 | MODIFICATION HISTORY
128 | DATE Author Description of Changes
129 | 01-JUN-2006 MRAYMOND Created
130 |
131 *===========================================================================*/
132
133 FUNCTION get_default_legal_context(p_org_id NUMBER) RETURN NUMBER;
134
135 END ARP_Legal_Entity_util;