[Home] [Help]
PACKAGE BODY: APPS.PSP_ORGANIZATION_ACCOUNTS_SWI
Source
1 Package Body psp_organization_accounts_swi As
2 /* $Header: PSPOASWB.pls 120.0 2005/11/20 23:57 dpaudel noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'psp_organization_accounts_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------------< create_organization_account >---------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_organization_account
12 (p_validate in number default hr_api.g_false_num
13 ,p_gl_code_combination_id in number
14 ,p_project_id in number
15 ,p_expenditure_organization_id in number
16 ,p_expenditure_type in varchar2
17 ,p_task_id in number
18 ,p_award_id in number
19 ,p_comments in varchar2
20 ,p_attribute_category in varchar2
21 ,p_attribute1 in varchar2
22 ,p_attribute2 in varchar2
23 ,p_attribute3 in varchar2
24 ,p_attribute4 in varchar2
25 ,p_attribute5 in varchar2
26 ,p_attribute6 in varchar2
27 ,p_attribute7 in varchar2
28 ,p_attribute8 in varchar2
29 ,p_attribute9 in varchar2
30 ,p_attribute10 in varchar2
31 ,p_attribute11 in varchar2
32 ,p_attribute12 in varchar2
33 ,p_attribute13 in varchar2
34 ,p_attribute14 in varchar2
35 ,p_attribute15 in varchar2
36 ,p_set_of_books_id in number
37 ,p_account_type_code in varchar2
38 ,p_start_date_active in date
39 ,p_business_group_id in number
40 ,p_end_date_active in date
41 ,p_organization_id in number
42 ,p_poeta_start_date in date default null
43 ,p_poeta_end_date in date default null
44 ,p_funding_source_code in varchar2
45 ,p_object_version_number in out nocopy number
46 ,p_organization_account_id in number
47 ,p_return_status out nocopy varchar2
48 ) is
49 --
50 -- Variables for API Boolean parameters
51 l_validate boolean;
52 l_return_status boolean;
53 --
54 -- Variables for IN/OUT parameters
55 l_object_version_number number;
56 --
57 -- Other variables
58 l_organization_account_id number;
59 l_proc varchar2(72) := g_package ||'create_organization_account';
60 Begin
61 hr_utility.set_location(' Entering:' || l_proc,10);
62 --
63 -- Issue a savepoint
64 --
65 savepoint create_org_account_swi;
66 --
67 -- Initialise Multiple Message Detection
68 --
69 hr_multi_message.enable_message_list;
70 --
71 -- Remember IN OUT parameter IN values
72 --
73 l_object_version_number := p_object_version_number;
74 --
75 -- Convert constant values to their corresponding boolean value
76 --
77 l_validate :=
78 hr_api.constant_to_boolean
79 (p_constant_value => p_validate);
80 l_return_status :=
81 hr_api.constant_to_boolean
82 (p_constant_value => p_return_status);
83 --
84 -- Register Surrogate ID or user key values
85 --
86 psp_poa_ins.set_base_key_value
87 (p_organization_account_id => p_organization_account_id
88 );
89 --
90 -- Call API
91 --
92 psp_organization_accounts_api.create_organization_account
93 (p_validate => l_validate
94 ,p_gl_code_combination_id => p_gl_code_combination_id
95 ,p_project_id => p_project_id
96 ,p_expenditure_organization_id => p_expenditure_organization_id
97 ,p_expenditure_type => p_expenditure_type
98 ,p_task_id => p_task_id
99 ,p_award_id => p_award_id
100 ,p_comments => p_comments
101 ,p_attribute_category => p_attribute_category
102 ,p_attribute1 => p_attribute1
103 ,p_attribute2 => p_attribute2
104 ,p_attribute3 => p_attribute3
105 ,p_attribute4 => p_attribute4
106 ,p_attribute5 => p_attribute5
107 ,p_attribute6 => p_attribute6
108 ,p_attribute7 => p_attribute7
109 ,p_attribute8 => p_attribute8
110 ,p_attribute9 => p_attribute9
111 ,p_attribute10 => p_attribute10
112 ,p_attribute11 => p_attribute11
113 ,p_attribute12 => p_attribute12
114 ,p_attribute13 => p_attribute13
115 ,p_attribute14 => p_attribute14
116 ,p_attribute15 => p_attribute15
117 ,p_set_of_books_id => p_set_of_books_id
118 ,p_account_type_code => p_account_type_code
119 ,p_start_date_active => p_start_date_active
120 ,p_business_group_id => p_business_group_id
121 ,p_end_date_active => p_end_date_active
122 ,p_organization_id => p_organization_id
123 ,p_poeta_start_date => p_poeta_start_date
124 ,p_poeta_end_date => p_poeta_end_date
125 ,p_funding_source_code => p_funding_source_code
126 ,p_object_version_number => p_object_version_number
127 ,p_organization_account_id => l_organization_account_id
128 ,p_return_status => l_return_status
129 );
130 --
131 -- Convert API warning boolean parameter values to specific
132 -- messages and add them to Multiple Message List
133 --
134 --
135 -- Convert API non-warning boolean parameter values
136 --
137 p_return_status :=
138 hr_api.boolean_to_constant
139 (p_boolean_value => l_return_status
140 );
141 --
142 -- Derive the API return status value based on whether
143 -- messages of any type exist in the Multiple Message List.
144 -- Also disable Multiple Message Detection.
145 --
146 p_return_status := hr_multi_message.get_return_status_disable;
147 hr_utility.set_location(' Leaving:' || l_proc,20);
148 --
149 exception
150 when hr_multi_message.error_message_exist then
151 --
152 -- Catch the Multiple Message List exception which
153 -- indicates API processing has been aborted because
154 -- at least one message exists in the list.
155 --
156 rollback to create_org_account_swi;
157 --
158 -- Reset IN OUT parameters and set OUT parameters
159 --
160 p_object_version_number := l_object_version_number;
161 p_return_status := null;
162 p_return_status := hr_multi_message.get_return_status_disable;
163 hr_utility.set_location(' Leaving:' || l_proc, 30);
164 when others then
165 --
166 -- When Multiple Message Detection is enabled catch
167 -- any Application specific or other unexpected
168 -- exceptions. Adding appropriate details to the
169 -- Multiple Message List. Otherwise re-raise the
170 -- error.
171 --
172 rollback to create_org_account_swi;
173 if hr_multi_message.unexpected_error_add(l_proc) then
174 hr_utility.set_location(' Leaving:' || l_proc,40);
175 raise;
176 end if;
177 --
178 -- Reset IN OUT and set OUT parameters
179 --
180 p_object_version_number := l_object_version_number;
181 p_return_status := null;
182 p_return_status := hr_multi_message.get_return_status_disable;
183 hr_utility.set_location(' Leaving:' || l_proc,50);
184 end create_organization_account;
185 -- ----------------------------------------------------------------------------
186 -- |----------------------< delete_organization_account >---------------------|
187 -- ----------------------------------------------------------------------------
188 PROCEDURE delete_organization_account
189 (p_validate in number default hr_api.g_false_num
190 ,p_organization_account_id in number
191 ,p_object_version_number in out nocopy number
192 ,p_return_status out nocopy varchar2
193 ) is
194 --
195 -- Variables for API Boolean parameters
196 l_validate boolean;
197 l_return_status boolean;
198 --
199 -- Variables for IN/OUT parameters
200 l_object_version_number number;
201 --
202 -- Other variables
203 l_proc varchar2(72) := g_package ||'delete_organization_account';
204 Begin
205 hr_utility.set_location(' Entering:' || l_proc,10);
206 --
207 -- Issue a savepoint
208 --
209 savepoint delete_org_account_swi;
210 --
211 -- Initialise Multiple Message Detection
212 --
213 hr_multi_message.enable_message_list;
214 --
215 -- Remember IN OUT parameter IN values
216 --
217 l_object_version_number := p_object_version_number;
218 --
219 -- Convert constant values to their corresponding boolean value
220 --
221 l_validate :=
222 hr_api.constant_to_boolean
223 (p_constant_value => p_validate);
224 l_return_status :=
225 hr_api.constant_to_boolean
226 (p_constant_value => p_return_status);
227 --
228 -- Register Surrogate ID or user key values
229 --
230 --
231 -- Call API
232 --
233 psp_organization_accounts_api.delete_organization_account
234 (p_validate => l_validate
235 ,p_organization_account_id => p_organization_account_id
236 ,p_object_version_number => p_object_version_number
237 ,p_return_status => l_return_status
238 );
239 --
240 -- Convert API warning boolean parameter values to specific
241 -- messages and add them to Multiple Message List
242 --
243 --
244 -- Convert API non-warning boolean parameter values
245 --
246 p_return_status :=
247 hr_api.boolean_to_constant
248 (p_boolean_value => l_return_status
249 );
250 --
251 -- Derive the API return status value based on whether
252 -- messages of any type exist in the Multiple Message List.
253 -- Also disable Multiple Message Detection.
254 --
255 p_return_status := hr_multi_message.get_return_status_disable;
256 hr_utility.set_location(' Leaving:' || l_proc,20);
257 --
258 exception
259 when hr_multi_message.error_message_exist then
260 --
261 -- Catch the Multiple Message List exception which
262 -- indicates API processing has been aborted because
263 -- at least one message exists in the list.
264 --
265 rollback to delete_org_account_swi;
266 --
267 -- Reset IN OUT parameters and set OUT parameters
268 --
269 p_object_version_number := l_object_version_number;
270 p_return_status := null;
271 p_return_status := hr_multi_message.get_return_status_disable;
272 hr_utility.set_location(' Leaving:' || l_proc, 30);
273 when others then
274 --
275 -- When Multiple Message Detection is enabled catch
276 -- any Application specific or other unexpected
277 -- exceptions. Adding appropriate details to the
278 -- Multiple Message List. Otherwise re-raise the
279 -- error.
280 --
281 rollback to delete_org_account_swi;
282 if hr_multi_message.unexpected_error_add(l_proc) then
283 hr_utility.set_location(' Leaving:' || l_proc,40);
284 raise;
285 end if;
286 --
287 -- Reset IN OUT and set OUT parameters
288 --
289 p_object_version_number := l_object_version_number;
290 p_return_status := null;
291 p_return_status := hr_multi_message.get_return_status_disable;
292 hr_utility.set_location(' Leaving:' || l_proc,50);
293 end delete_organization_account;
294 -- ----------------------------------------------------------------------------
295 -- |----------------------< update_organization_account >---------------------|
296 -- ----------------------------------------------------------------------------
297 PROCEDURE update_organization_account
298 (p_validate in number default hr_api.g_false_num
299 ,p_organization_account_id in number
300 ,p_gl_code_combination_id in number
301 ,p_project_id in number
302 ,p_expenditure_organization_id in number
303 ,p_expenditure_type in varchar2
304 ,p_task_id in number
305 ,p_award_id in number
306 ,p_comments in varchar2
307 ,p_attribute_category in varchar2
308 ,p_attribute1 in varchar2
309 ,p_attribute2 in varchar2
310 ,p_attribute3 in varchar2
311 ,p_attribute4 in varchar2
312 ,p_attribute5 in varchar2
313 ,p_attribute6 in varchar2
314 ,p_attribute7 in varchar2
315 ,p_attribute8 in varchar2
316 ,p_attribute9 in varchar2
317 ,p_attribute10 in varchar2
318 ,p_attribute11 in varchar2
319 ,p_attribute12 in varchar2
320 ,p_attribute13 in varchar2
321 ,p_attribute14 in varchar2
322 ,p_attribute15 in varchar2
323 ,p_set_of_books_id in number
324 ,p_account_type_code in varchar2
325 ,p_start_date_active in date
326 ,p_business_group_id in number
327 ,p_end_date_active in date
328 ,p_organization_id in number
329 ,p_poeta_start_date in date default null
330 ,p_poeta_end_date in date default null
331 ,p_funding_source_code in varchar2
332 ,p_object_version_number in out nocopy number
333 ,p_return_status out nocopy varchar2
334 ) is
335 --
336 -- Variables for API Boolean parameters
337 l_validate boolean;
338 l_return_status boolean;
339 --
340 -- Variables for IN/OUT parameters
341 l_object_version_number number;
342 --
343 -- Other variables
344 l_proc varchar2(72) := g_package ||'update_organization_account';
345 Begin
346 hr_utility.set_location(' Entering:' || l_proc,10);
347 --
348 -- Issue a savepoint
349 --
350 savepoint update_org_account_swi;
351 --
352 -- Initialise Multiple Message Detection
353 --
354 hr_multi_message.enable_message_list;
355 --
356 -- Remember IN OUT parameter IN values
357 --
358 l_object_version_number := p_object_version_number;
359 --
360 -- Convert constant values to their corresponding boolean value
361 --
362 l_validate :=
363 hr_api.constant_to_boolean
364 (p_constant_value => p_validate);
365 l_return_status :=
366 hr_api.constant_to_boolean
367 (p_constant_value => p_return_status);
368 --
369 -- Register Surrogate ID or user key values
370 --
371 --
372 -- Call API
373 --
374 psp_organization_accounts_api.update_organization_account
375 (p_validate => l_validate
376 ,p_organization_account_id => p_organization_account_id
377 ,p_gl_code_combination_id => p_gl_code_combination_id
378 ,p_project_id => p_project_id
379 ,p_expenditure_organization_id => p_expenditure_organization_id
380 ,p_expenditure_type => p_expenditure_type
381 ,p_task_id => p_task_id
382 ,p_award_id => p_award_id
383 ,p_comments => p_comments
384 ,p_attribute_category => p_attribute_category
385 ,p_attribute1 => p_attribute1
386 ,p_attribute2 => p_attribute2
387 ,p_attribute3 => p_attribute3
388 ,p_attribute4 => p_attribute4
389 ,p_attribute5 => p_attribute5
390 ,p_attribute6 => p_attribute6
391 ,p_attribute7 => p_attribute7
392 ,p_attribute8 => p_attribute8
393 ,p_attribute9 => p_attribute9
394 ,p_attribute10 => p_attribute10
395 ,p_attribute11 => p_attribute11
396 ,p_attribute12 => p_attribute12
397 ,p_attribute13 => p_attribute13
398 ,p_attribute14 => p_attribute14
399 ,p_attribute15 => p_attribute15
400 ,p_set_of_books_id => p_set_of_books_id
401 ,p_account_type_code => p_account_type_code
402 ,p_start_date_active => p_start_date_active
403 ,p_business_group_id => p_business_group_id
404 ,p_end_date_active => p_end_date_active
405 ,p_organization_id => p_organization_id
406 ,p_poeta_start_date => p_poeta_start_date
407 ,p_poeta_end_date => p_poeta_end_date
408 ,p_funding_source_code => p_funding_source_code
409 ,p_object_version_number => p_object_version_number
410 ,p_return_status => l_return_status
411 );
412 --
413 -- Convert API warning boolean parameter values to specific
414 -- messages and add them to Multiple Message List
415 --
416 --
417 -- Convert API non-warning boolean parameter values
418 --
419 p_return_status :=
420 hr_api.boolean_to_constant
421 (p_boolean_value => l_return_status
422 );
423 --
424 -- Derive the API return status value based on whether
425 -- messages of any type exist in the Multiple Message List.
426 -- Also disable Multiple Message Detection.
427 --
428 p_return_status := hr_multi_message.get_return_status_disable;
429 hr_utility.set_location(' Leaving:' || l_proc,20);
430 --
431 exception
432 when hr_multi_message.error_message_exist then
433 --
434 -- Catch the Multiple Message List exception which
435 -- indicates API processing has been aborted because
436 -- at least one message exists in the list.
437 --
438 rollback to update_org_account_swi;
439 --
440 -- Reset IN OUT parameters and set OUT parameters
441 --
442 p_object_version_number := l_object_version_number;
443 p_return_status := null;
444 p_return_status := hr_multi_message.get_return_status_disable;
445 hr_utility.set_location(' Leaving:' || l_proc, 30);
446 when others then
447 --
448 -- When Multiple Message Detection is enabled catch
449 -- any Application specific or other unexpected
450 -- exceptions. Adding appropriate details to the
451 -- Multiple Message List. Otherwise re-raise the
452 -- error.
453 --
454 rollback to update_org_account_swi;
455 if hr_multi_message.unexpected_error_add(l_proc) then
456 hr_utility.set_location(' Leaving:' || l_proc,40);
457 raise;
458 end if;
459 --
460 -- Reset IN OUT and set OUT parameters
461 --
462 p_object_version_number := l_object_version_number;
463 p_return_status := null;
464 p_return_status := hr_multi_message.get_return_status_disable;
465 hr_utility.set_location(' Leaving:' || l_proc,50);
466 end update_organization_account;
467 end psp_organization_accounts_swi;