[Home] [Help]
PACKAGE BODY: APPS.PQH_WORKSHEET_FUND_SRCS_API
Source
1 Package Body pqh_WORKSHEET_FUND_SRCS_api as
2 /* $Header: pqwfsapi.pkb 115.5 2002/12/12 23:55:35 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' pqh_WORKSHEET_FUND_SRCS_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_WORKSHEET_FUND_SRC >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_WORKSHEET_FUND_SRC
13 (p_validate in boolean default false
14 ,p_worksheet_fund_src_id out nocopy number
15 ,p_worksheet_bdgt_elmnt_id in number
16 ,p_distribution_percentage in number default null
17 ,p_cost_allocation_keyflex_id in number
18 ,p_project_id in number default null
19 ,p_award_id in number default null
20 ,p_task_id in number default null
21 ,p_expenditure_type in varchar2 default null
22 ,p_organization_id in number default null
23 ,p_object_version_number out nocopy number
24 ) is
25 --
26 -- Declare cursors and local variables
27 --
28 l_worksheet_fund_src_id pqh_worksheet_fund_srcs.worksheet_fund_src_id%TYPE;
29 l_proc varchar2(72) := g_package||'create_WORKSHEET_FUND_SRC';
30 l_object_version_number pqh_worksheet_fund_srcs.object_version_number%TYPE;
31 --
32 begin
33 --
34 hr_utility.set_location('Entering:'|| l_proc, 10);
35 --
36 -- Issue a savepoint if operating in validation only mode
37 --
38 savepoint create_WORKSHEET_FUND_SRC;
39 --
40 hr_utility.set_location(l_proc, 20);
41 --
42 -- Process Logic
43 --
44 begin
45 --
46 -- Start of API User Hook for the before hook of create_WORKSHEET_FUND_SRC
47 --
48 pqh_WORKSHEET_FUND_SRCS_bk1.create_WORKSHEET_FUND_SRC_b
49 (
50 p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
51 ,p_distribution_percentage => p_distribution_percentage
52 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
53 ,p_project_id => p_project_id
54 ,p_award_id => p_award_id
55 ,p_task_id => p_task_id
56 ,p_expenditure_type => p_expenditure_type
57 ,p_organization_id => p_organization_id
58 );
59 exception
60 when hr_api.cannot_find_prog_unit then
61 hr_api.cannot_find_prog_unit_error
62 (
63 p_module_name => 'CREATE_WORKSHEET_FUND_SRC'
64 ,p_hook_type => 'BP'
65 );
66 --
67 -- End of API User Hook for the before hook of create_WORKSHEET_FUND_SRC
68 --
69 end;
70 --
71 PQH_WFS_ins.ins
72 (
73 p_worksheet_fund_src_id => l_worksheet_fund_src_id
74 ,p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
75 ,p_distribution_percentage => p_distribution_percentage
76 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
77 ,p_project_id => p_project_id
78 ,p_award_id => p_award_id
79 ,p_task_id => p_task_id
80 ,p_expenditure_type => p_expenditure_type
81 ,p_organization_id => p_organization_id
82 ,p_object_version_number => l_object_version_number
83 );
84 --
85 begin
86 --
87 -- Start of API User Hook for the after hook of create_WORKSHEET_FUND_SRC
88 --
89 pqh_WORKSHEET_FUND_SRCS_bk1.create_WORKSHEET_FUND_SRC_a
90 (
91 p_worksheet_fund_src_id => l_worksheet_fund_src_id
92 ,p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
93 ,p_distribution_percentage => p_distribution_percentage
94 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
95 ,p_project_id => p_project_id
96 ,p_award_id => p_award_id
97 ,p_task_id => p_task_id
98 ,p_expenditure_type => p_expenditure_type
99 ,p_organization_id => p_organization_id
100 ,p_object_version_number => l_object_version_number
101 );
102 exception
103 when hr_api.cannot_find_prog_unit then
104 hr_api.cannot_find_prog_unit_error
105 (p_module_name => 'CREATE_WORKSHEET_FUND_SRC'
106 ,p_hook_type => 'AP'
107 );
108 --
109 -- End of API User Hook for the after hook of create_WORKSHEET_FUND_SRC
110 --
111 end;
112 --
113 hr_utility.set_location(l_proc, 60);
114 --
115 -- When in validation only mode raise the Validate_Enabled exception
116 --
117 if p_validate then
118 raise hr_api.validate_enabled;
119 end if;
120 --
121 -- Set all output arguments
122 --
123 p_worksheet_fund_src_id := l_worksheet_fund_src_id;
124 p_object_version_number := l_object_version_number;
125 --
126 hr_utility.set_location(' Leaving:'||l_proc, 70);
127 --
128 exception
129 --
130 when hr_api.validate_enabled then
131 --
132 -- As the Validate_Enabled exception has been raised
133 -- we must rollback to the savepoint
134 --
135 ROLLBACK TO create_WORKSHEET_FUND_SRC;
136 --
137 -- Only set output warning arguments
138 -- (Any key or derived arguments must be set to null
139 -- when validation only mode is being used.)
140 --
141 p_worksheet_fund_src_id := null;
142 p_object_version_number := null;
143 hr_utility.set_location(' Leaving:'||l_proc, 80);
144 --
145 when others then
146 p_worksheet_fund_src_id := null;
147 p_object_version_number := null;
148 --
149 -- A validation or unexpected error has occured
150 --
151 ROLLBACK TO create_WORKSHEET_FUND_SRC;
152 raise;
153 --
154 end create_WORKSHEET_FUND_SRC;
155 -- ----------------------------------------------------------------------------
156 -- |------------------------< update_WORKSHEET_FUND_SRC >--- ------------------|
157 -- ----------------------------------------------------------------------------
158 --
159 procedure update_WORKSHEET_FUND_SRC
160 (p_validate in boolean default false
161 ,p_worksheet_fund_src_id in number
162 ,p_worksheet_bdgt_elmnt_id in number default hr_api.g_number
163 ,p_distribution_percentage in number default hr_api.g_number
164 ,p_cost_allocation_keyflex_id in number default hr_api.g_number
165 ,p_project_id in number default hr_api.g_number
166 ,p_award_id in number default hr_api.g_number
167 ,p_task_id in number default hr_api.g_number
168 ,p_expenditure_type in varchar2 default hr_api.g_varchar2
169 ,p_organization_id in number default hr_api.g_number
170 ,p_object_version_number in out nocopy number
171 ) is
172 --
173 -- Declare cursors and local variables
174 --
175 l_proc varchar2(72) := g_package||'update_WORKSHEET_FUND_SRC';
176 l_object_version_number pqh_worksheet_fund_srcs.object_version_number%TYPE;
177 --
178 begin
179 --
180 hr_utility.set_location('Entering:'|| l_proc, 10);
181 --
182 -- Issue a savepoint if operating in validation only mode
183 --
184 savepoint update_WORKSHEET_FUND_SRC;
185 --
186 hr_utility.set_location(l_proc, 20);
187 --
188 -- Process Logic
189 --
190 l_object_version_number := p_object_version_number;
191 --
192 begin
193 --
194 -- Start of API User Hook for the before hook of update_WORKSHEET_FUND_SRC
195 --
196 pqh_WORKSHEET_FUND_SRCS_bk2.update_WORKSHEET_FUND_SRC_b
197 (
198 p_worksheet_fund_src_id => p_worksheet_fund_src_id
199 ,p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
200 ,p_distribution_percentage => p_distribution_percentage
201 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
202 ,p_project_id => p_project_id
203 ,p_award_id => p_award_id
204 ,p_task_id => p_task_id
205 ,p_expenditure_type => p_expenditure_type
206 ,p_organization_id => p_organization_id
207 ,p_object_version_number => p_object_version_number
208 );
209 exception
210 when hr_api.cannot_find_prog_unit then
211 hr_api.cannot_find_prog_unit_error
212 (p_module_name => 'UPDATE_WORKSHEET_FUND_SRC'
213 ,p_hook_type => 'BP'
214 );
215 --
216 -- End of API User Hook for the before hook of update_WORKSHEET_FUND_SRC
217 --
218 end;
219 --
220 PQH_WFS_upd.upd
221 (
222 p_worksheet_fund_src_id => p_worksheet_fund_src_id
223 ,p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
224 ,p_distribution_percentage => p_distribution_percentage
225 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
226 ,p_project_id => p_project_id
227 ,p_award_id => p_award_id
228 ,p_task_id => p_task_id
229 ,p_expenditure_type => p_expenditure_type
230 ,p_organization_id => p_organization_id
231 ,p_object_version_number => l_object_version_number
232 );
233 --
234 begin
235 --
236 -- Start of API User Hook for the after hook of update_WORKSHEET_FUND_SRC
237 --
238 pqh_WORKSHEET_FUND_SRCS_bk2.update_WORKSHEET_FUND_SRC_a
239 (
240 p_worksheet_fund_src_id => p_worksheet_fund_src_id
241 ,p_worksheet_bdgt_elmnt_id => p_worksheet_bdgt_elmnt_id
242 ,p_distribution_percentage => p_distribution_percentage
243 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
244 ,p_project_id => p_project_id
245 ,p_award_id => p_award_id
246 ,p_task_id => p_task_id
247 ,p_expenditure_type => p_expenditure_type
248 ,p_organization_id => p_organization_id
249 ,p_object_version_number => l_object_version_number
250 );
251 exception
252 when hr_api.cannot_find_prog_unit then
253 hr_api.cannot_find_prog_unit_error
254 (p_module_name => 'UPDATE_WORKSHEET_FUND_SRC'
255 ,p_hook_type => 'AP'
256 );
257 --
258 -- End of API User Hook for the after hook of update_WORKSHEET_FUND_SRC
259 --
260 end;
261 --
262 hr_utility.set_location(l_proc, 60);
263 --
264 -- When in validation only mode raise the Validate_Enabled exception
265 --
266 if p_validate then
267 raise hr_api.validate_enabled;
268 end if;
269 --
270 -- Set all output arguments
271 --
272 p_object_version_number := l_object_version_number;
273 --
274 hr_utility.set_location(' Leaving:'||l_proc, 70);
275 --
276 exception
277 --
278 when hr_api.validate_enabled then
279 --
280 -- As the Validate_Enabled exception has been raised
281 -- we must rollback to the savepoint
282 --
283 ROLLBACK TO update_WORKSHEET_FUND_SRC;
284 --
285 -- Only set output warning arguments
286 -- (Any key or derived arguments must be set to null
287 -- when validation only mode is being used.)
288 --
289 hr_utility.set_location(' Leaving:'||l_proc, 80);
290 --
291 when others then
292 p_object_version_number := l_object_version_number;
293 --
294 -- A validation or unexpected error has occured
295 --
296 ROLLBACK TO update_WORKSHEET_FUND_SRC;
297 raise;
298 --
299 end update_WORKSHEET_FUND_SRC;
300 -- ----------------------------------------------------------------------------
301 -- |------------------------< delete_WORKSHEET_FUND_SRC >----------------------|
302 -- ----------------------------------------------------------------------------
303 --
304 procedure delete_WORKSHEET_FUND_SRC
305 (p_validate in boolean default false
306 ,p_worksheet_fund_src_id in number
307 ,p_object_version_number in number
308 ) is
309 --
310 -- Declare cursors and local variables
311 --
312 l_proc varchar2(72) := g_package||'delete_WORKSHEET_FUND_SRC';
313 l_object_version_number pqh_worksheet_fund_srcs.object_version_number%TYPE;
314 --
315 begin
316 --
317 hr_utility.set_location('Entering:'|| l_proc, 10);
318 --
319 -- Issue a savepoint if operating in validation only mode
320 --
321 savepoint delete_WORKSHEET_FUND_SRC;
322 --
323 hr_utility.set_location(l_proc, 20);
324 --
325 -- Process Logic
326 --
327 l_object_version_number := p_object_version_number;
328 --
329 --
330 begin
331 --
332 -- Start of API User Hook for the before hook of delete_WORKSHEET_FUND_SRC
333 --
334 pqh_WORKSHEET_FUND_SRCS_bk3.delete_WORKSHEET_FUND_SRC_b
335 (
336 p_worksheet_fund_src_id => p_worksheet_fund_src_id
337 ,p_object_version_number => p_object_version_number
338 );
339 exception
340 when hr_api.cannot_find_prog_unit then
341 hr_api.cannot_find_prog_unit_error
342 (p_module_name => 'DELETE_WORKSHEET_FUND_SRC'
343 ,p_hook_type => 'BP'
344 );
345 --
346 -- End of API User Hook for the before hook of delete_WORKSHEET_FUND_SRC
347 --
348 end;
349 --
350 PQH_WFS_del.del
351 (
352 p_worksheet_fund_src_id => p_worksheet_fund_src_id
353 ,p_object_version_number => l_object_version_number
354 );
355 --
356 begin
357 --
358 -- Start of API User Hook for the after hook of delete_WORKSHEET_FUND_SRC
359 --
360 pqh_WORKSHEET_FUND_SRCS_bk3.delete_WORKSHEET_FUND_SRC_a
361 (
362 p_worksheet_fund_src_id => p_worksheet_fund_src_id
363 ,p_object_version_number => l_object_version_number
364 );
365 exception
366 when hr_api.cannot_find_prog_unit then
367 hr_api.cannot_find_prog_unit_error
368 (p_module_name => 'DELETE_WORKSHEET_FUND_SRC'
369 ,p_hook_type => 'AP'
370 );
371 --
372 -- End of API User Hook for the after hook of delete_WORKSHEET_FUND_SRC
373 --
374 end;
375 --
376 hr_utility.set_location(l_proc, 60);
377 --
378 -- When in validation only mode raise the Validate_Enabled exception
379 --
380 if p_validate then
381 raise hr_api.validate_enabled;
382 end if;
383 --
384 hr_utility.set_location(' Leaving:'||l_proc, 70);
385 --
386 exception
387 --
388 when hr_api.validate_enabled then
389 --
390 -- As the Validate_Enabled exception has been raised
391 -- we must rollback to the savepoint
392 --
393 ROLLBACK TO delete_WORKSHEET_FUND_SRC;
394 --
395 -- Only set output warning arguments
396 -- (Any key or derived arguments must be set to null
397 -- when validation only mode is being used.)
398 --
399 --
400 when others then
401 --
402 -- A validation or unexpected error has occured
403 --
404 ROLLBACK TO delete_WORKSHEET_FUND_SRC;
405 raise;
406 --
407 end delete_WORKSHEET_FUND_SRC;
408 --
409 -- ----------------------------------------------------------------------------
410 -- |-------------------------------< lck >------------------------------------|
411 -- ----------------------------------------------------------------------------
412 --
413 procedure lck
414 (
415 p_worksheet_fund_src_id in number
416 ,p_object_version_number in number
417 ) is
418 --
419 --
420 -- Declare cursors and local variables
421 --
422 l_proc varchar2(72) := g_package||'lck';
423 --
424 begin
425 --
426 hr_utility.set_location('Entering:'|| l_proc, 10);
427 --
428 PQH_WFS_shd.lck
429 (
430 p_worksheet_fund_src_id => p_worksheet_fund_src_id
431 ,p_object_version_number => p_object_version_number
432 );
433 --
434 hr_utility.set_location(' Leaving:'||l_proc, 70);
435 --
436 end lck;
437 --
438 end pqh_WORKSHEET_FUND_SRCS_api;