1 PACKAGE gl_budget_utils_pkg AS
2 /* $Header: glubdmss.pls 120.7 2005/05/05 01:35:43 kvora ship $ */
3 --
4 -- Package
5 -- gl_budget_utils_pkg
6 -- Purpose
7 -- To contain various budget utilities
8 -- History
9 -- 10-18-93 D. J. Ogg Created
10
11 --
12 -- Procedure
13 -- get_current_budget
14 -- Purpose
15 -- Returns the Name and ID of the current budget as well as if
16 -- it required budget journals.
17 -- History
18 -- 10-25-93 D. J. Ogg Created
19 -- Arguments
20 -- x_ledger_id Ledger id
21 -- x_budget_version_id Budget version ID of the current budget
22 -- x_budget_name Name of the current budget
23 -- x_bj_required Whether or not budget journals are required
24 -- Example
25 -- gl_budget_utils_pkg.get_current_budget(2, bv_id, bname, bj_required)
26 -- Notes
27 --
28 PROCEDURE get_current_budget(
29 x_ledger_id NUMBER,
30 x_budget_version_id IN OUT NOCOPY NUMBER,
31 x_budget_name IN OUT NOCOPY VARCHAR2,
32 x_bj_required IN OUT NOCOPY VARCHAR2);
33
34 --
35 -- Procedure
36 -- is_funding_budget
37 -- Purpose
38 -- Returns TRUE if the budget is being used as a funding budget, or
39 -- FALSE otherwise.
40 -- History
41 -- 10-25-93 D. J. Ogg Created
42 -- Arguments
43 -- x_ledger_id Ledger to be checked.
44 -- x_funct_curr Functional currency of SOB.
45 -- budget_version_id ID of budget to be checked.
46 -- Example
47 -- gl_budget_utils_pkg.is_funding_budget(2, 'USD', 1000)
48 -- Notes
49 --
50 FUNCTION is_funding_budget(
51 x_ledger_id NUMBER,
52 x_funct_curr VARCHAR2,
53 x_budget_version_id NUMBER) RETURN BOOLEAN;
54
55 --
56 -- Procedure
57 -- is_master_budget
58 -- Purpose
59 -- Returns TRUE if the budget is being used as master budget, or
60 -- FALSE otherwise.
61 -- History
62 -- 10-25-93 D. J. Ogg Created
63 -- Arguments
64 -- budget_id ID of budget to be checked.
65 -- Example
66 -- gl_budget_utils_pkg.is_master_budget(1000)
67 -- Notes
68 --
69 FUNCTION is_master_budget(
70 budget_id NUMBER) RETURN BOOLEAN;
71
72 --
73 -- Procedure
74 -- frozen_budget
75 -- Purpose
76 -- Returns TRUE if the budget is frozen, or
77 -- FALSE otherwise.
78 -- History
79 -- 05-05-94 D. J. Ogg Created
80 -- Arguments
81 -- budget_version_id ID of budget to be checked.
82 -- Example
83 -- gl_budget_utils_pkg.frozen_budget(1000)
84 -- Notes
85 --
86 FUNCTION frozen_budget(budget_version_id NUMBER) RETURN BOOLEAN;
87
88 --
89 -- Procedure
90 -- frozen_budget_entity
91 -- Purpose
92 -- Returns TRUE if the budget entity is frozen for a particular
93 -- budget, or FALSE otherwise.
94 -- History
95 -- 05-05-94 D. J. Ogg Created
96 -- Arguments
97 -- budget_version_id ID of budget to be checked.
98 -- budget_entity_id ID of budget entity to be checked.
99 -- Example
100 -- gl_budget_utils_pkg.frozen_budget_entity(1000, 999)
101 -- Notes
102 --
103 FUNCTION frozen_budget_entity(budget_version_id NUMBER,
104 budget_entity_id NUMBER) RETURN BOOLEAN;
105
106 --
107 -- Procedure
108 -- frozen_account
109 -- Purpose
110 -- Returns TRUE if the code combination is frozen for a given budget
111 -- and budget entity, or FALSE otherwise.
112 -- History
113 -- 05-05-94 D. J. Ogg Created
114 -- Arguments
115 -- coa_id Chart of Accounts ID
116 -- budget_version_id ID of budget to be checked.
117 -- budget_entity_id ID of budget entity to be checked.
118 -- code_combination_id ID of code combination to be checked.
119 -- Example
120 -- gl_budget_utils_pkg.frozen_account(1000, 999, 2343)
121 -- Notes
122 --
123 FUNCTION frozen_account(coa_id NUMBER,
124 budget_version_id NUMBER,
125 budget_entity_id NUMBER,
126 code_combination_id NUMBER,
127 ledger_id NUMBER,
128 currency_code VARCHAR2) RETURN BOOLEAN;
129
130 --
131 -- Procedure
132 -- validate_budget_account
133 -- Purpose
134 -- Returns 'A' if the account is not assigned to a budget
135 -- organization with the given currency, 'O' if the
136 -- budget organization is frozen, 'F' if the account is frozen,
137 -- and 'Z' if none of the above is true
138 -- History
139 -- 05-06-94 D. J. Ogg Created
140 -- Arguments
141 -- lgr_id Ledger Id
142 -- coa_id Chart of Accounts ID
143 -- budget_version_id ID of budget to be examined
144 -- code_combination_id ID of code combination to be checked.
145 -- currency_code ID of currency of the assignment
146 -- return_code The returned value
147 -- budget_entity_id ID of budget organization that
148 -- the code combination is assigned to
149 -- for the given currency
150 -- budget_entity The name of the above organization
151 -- password_flag A flag indicating whether or not
152 -- the above organization requires a
153 -- password.
154 -- encrypted_password The encrypted password of the
155 -- above organization
156 -- status_code The status of the budget organization
157 -- Example
158 -- gl_budget_utils_pkg.validate_budget_account(100, 999, 2343, 'USD',
159 -- rcode, beid, bename,
160 -- pwdflag, encpwd, xstatus);
161 -- Notes
162 --
163 PROCEDURE validate_budget_account(lgr_id NUMBER,
164 coa_id NUMBER,
165 budget_version_id NUMBER,
166 code_combination_id NUMBER,
167 currency_code VARCHAR2,
168 return_code IN OUT NOCOPY VARCHAR2,
169 budget_entity_id IN OUT NOCOPY NUMBER,
170 budget_entity IN OUT NOCOPY VARCHAR2,
171 password_flag IN OUT NOCOPY VARCHAR2,
172 encrypted_password IN OUT NOCOPY VARCHAR2,
173 status_code IN OUT NOCOPY VARCHAR2);
174
175
176 -- Procedure
177 -- get_unique_id
178 -- Purpose
179 -- retrieves the unique range id from sequence gl_budget_frozen_ranges_s
180 -- Arguments
181 -- none
182 -- Example
183 -- range_id := gl_budget_utils_pkg.get_unique_id;
184
185 FUNCTION get_unique_id RETURN number;
186
187 -- Function
188 -- get_opyr_per_range
189 -- Purpose
190 -- Return the first period year, name and num; and the last period year,
191 -- name and num in the open fiscal year(s).
192 -- Arguments
193 -- budget_version_id ID of budget to be examined
194 -- Example
195 -- get_opyr_per_range (999, start_per_year, start_per_name, start_per_num,
196 -- end_per_year, end_per_name, end_per_num);
197 --
198 -- Notes
199 --
200 FUNCTION get_opyr_per_range ( x_budget_version_id IN NUMBER,
201 x_start_period_year IN OUT NOCOPY NUMBER,
202 x_start_period_name IN OUT NOCOPY VARCHAR2,
203 x_start_period_num IN OUT NOCOPY NUMBER,
204 x_end_period_year IN OUT NOCOPY NUMBER,
205 x_end_period_name IN OUT NOCOPY VARCHAR2,
206 x_end_period_num IN OUT NOCOPY NUMBER)
207 RETURN BOOLEAN;
208
209 -- Procedure
210 -- validate_budget
211 -- Purpose
212 -- validate attributes Require_Budget_Journals_Flag,
213 -- First_Valid_Period_Name, and
214 -- Last_Valid_Period_Name.
215 -- raise exceptions if validation fails
216 --
217
218 PROCEDURE validate_budget(
219 X_Rowid IN OUT NOCOPY VARCHAR2,
220 X_Budget_Type VARCHAR2,
221 X_Budget_Name VARCHAR2,
222 X_Ledger_Id NUMBER,
223 X_Status VARCHAR2,
224 X_Date_Created DATE,
225 X_Require_Budget_Journals_Flag VARCHAR2,
226 X_Current_Version_Id NUMBER DEFAULT NULL,
227 X_Latest_Opened_Year NUMBER DEFAULT NULL,
228 X_First_Valid_Period_Name VARCHAR2 DEFAULT NULL,
229 X_Last_Valid_Period_Name VARCHAR2 DEFAULT NULL,
230 X_Description VARCHAR2 DEFAULT NULL,
231 X_Date_Closed DATE DEFAULT NULL,
232 X_Attribute1 VARCHAR2 DEFAULT NULL,
233 X_Attribute2 VARCHAR2 DEFAULT NULL,
234 X_Attribute3 VARCHAR2 DEFAULT NULL,
235 X_Attribute4 VARCHAR2 DEFAULT NULL,
236 X_Attribute5 VARCHAR2 DEFAULT NULL,
237 X_Attribute6 VARCHAR2 DEFAULT NULL,
238 X_Attribute7 VARCHAR2 DEFAULT NULL,
239 X_Attribute8 VARCHAR2 DEFAULT NULL,
240 X_Context VARCHAR2 DEFAULT NULL,
241 X_User_Id NUMBER,
242 X_Login_Id NUMBER,
243 X_Date DATE,
244 X_Budget_Version_Id NUMBER,
245 X_Master_Budget_Version_Id NUMBER DEFAULT NULL);
246
247 END gl_budget_utils_pkg;