[Home] [Help]
PACKAGE BODY: APPS.PY_DK_TAX_CARD
Source
1 PACKAGE BODY py_dk_tax_card AS
2 /* $Header: pydktaxc.pkb 120.5.12010000.2 2008/08/06 07:06:00 ubhat ship $ */
3 --
4 -- Package Variables
5 --
6 g_package CONSTANT varchar2(33) := ' hr_dk_taxcard_api.';
7 g_debug BOOLEAN := hr_utility.debug_enabled;
8 --
9 -- ----------------------------------------------------------------------------
10 -- |--------------------------< create_taxcard >----------------------------|
11 -- ----------------------------------------------------------------------------
12 -- {Start Of Comments}
13 --
14 -- Description:
15 -- This API will insert a tax card entry for a Norway Assignment.
16 -- This API delegates to the create_element_entry procedure of the
17 -- pay_element_entry_api package.
18 --
19 -- Prerequisites:
20 -- The element entry (of element type 'Tax Card') and the corresponding
21 -- element link should exist for the given assignment and business group.
22 --
23 -- In Parameters:
24 -- Name Reqd Type Description
25 -- p_legislation_code Yes VARCHAR2 Legislation code.
26 -- p_effective_date Yes DATE The effective date of the
27 -- change.
28 -- p_assignment_id Yes VARCHAR2 Id of the assignment.
29 -- p_person_id Yes VARCHAR2 Id of the person.
30 -- p_business_group_id Yes VARCHAR2 Id of the business group.
31 -- p_tax_free_threshold NUMBER Element entry value.
32 -- p_weekly_td NUMBER Element entry value.
33 -- p_daily_td DATE Element entry value.
34 -- p_registration_date DATE Element entry value.
35 -- p_method_of_receipt VARCHAR2 Element entry value.
36 -- p_tax_card_type VARCHAR2 Element entry value.
37 -- p_tax_percentage VARCHAR2 Element entry value.
38 -- p_monthly_td VARCHAR2 Element entry value.
39 -- p_biweekly_td VARCHAR2 Element entry value.
40 -- p_date_returned DATE Element entry value.
41 -- p_element_entry_id VARCHAR2 Id of the element entry.
42 -- p_element_link_id VARCHAR2 Id of the element link.
43 --
44 --
45 -- Post Success:
46 --
47 -- The API successfully updates the tax card entry.
48 --
49 -- Post Failure:
50 -- The API will raise an error.
51 --
52 -- Access Status:
53 -- Private. For Internal Development Use only.
54 --
55 -- {End Of Comments}
56 --
57 PROCEDURE insert_taxcard (
58 p_legislation_code IN VARCHAR2
59 ,p_effective_date IN DATE
60 ,p_assignment_id IN VARCHAR2
61 ,p_person_id IN VARCHAR2
62 ,p_business_group_id IN VARCHAR2
63 ,p_tax_free_threshold IN NUMBER DEFAULT NULL
64 ,p_weekly_td IN NUMBER DEFAULT NULL
65 ,p_daily_td IN NUMBER DEFAULT NULL
66 ,p_registration_date IN DATE DEFAULT NULL
67 ,p_method_of_receipt IN VARCHAR2 DEFAULT NULL
68 ,p_tax_card_type IN VARCHAR2 DEFAULT NULL
69 ,p_tax_percentage IN NUMBER DEFAULT NULL
70 ,p_monthly_td IN NUMBER DEFAULT NULL
71 ,p_biweekly_td IN NUMBER DEFAULT NULL
72 ,p_date_returned IN DATE DEFAULT NULL)
73 IS
74 -- Declarations here
75 l_start_date DATE;
76 l_end_date DATE;
77 l_warning BOOLEAN;
78 l_element_entry_id NUMBER(15);
79 l_tax_percentage pay_element_entry_values_f.screen_entry_value%TYPE;
80 l_ovn NUMBER(9);
81 l_element_link_id pay_element_links_f.element_link_id%TYPE;
82 l_element_type_id pay_element_types_f.element_type_id%TYPE;
83 l_input_value_id1 pay_input_values_f.input_value_id%TYPE;
84 l_input_value_id2 pay_input_values_f.input_value_id%TYPE;
85 l_input_value_id3 pay_input_values_f.input_value_id%TYPE;
86 l_input_value_id4 pay_input_values_f.input_value_id%TYPE;
87 l_input_value_id5 pay_input_values_f.input_value_id%TYPE;
88 l_input_value_id6 pay_input_values_f.input_value_id%TYPE;
89 l_input_value_id7 pay_input_values_f.input_value_id%TYPE;
90 l_input_value_id8 pay_input_values_f.input_value_id%TYPE;
91 l_input_value_id9 pay_input_values_f.input_value_id%TYPE;
92 l_input_value_id10 pay_input_values_f.input_value_id%TYPE;
93 l_input_value_id11 pay_input_values_f.input_value_id%TYPE;
94 -- Added for Flugger fix
95 l_element_name_tl PAY_ELEMENT_TYPES_F_TL.element_name%TYPE;
96
97
98 CURSOR input_values_csr IS
99 SELECT
100 et.element_type_id,
101 MIN(DECODE(iv.name, 'Method of Receipt', iv.input_value_id, null)) iv1,
102 MIN(DECODE(iv.name, 'Tax Card Type', iv.input_value_id, null)) iv2,
103 MIN(DECODE(iv.name, 'Tax Percentage', iv.input_value_id, null)) iv3,
104 MIN(DECODE(iv.name, 'Tax Free Threshold', iv.input_value_id, null)) iv4,
105 MIN(DECODE(iv.name, 'Monthly Tax Deduction', iv.input_value_id, null)) iv5,
106 MIN(DECODE(iv.name, 'Bi Weekly Tax Deduction', iv.input_value_id, null)) iv6,
107 MIN(DECODE(iv.name, 'Weekly Tax Deduction', iv.input_value_id, null)) iv7,
108 MIN(DECODE(iv.name, 'Daily Tax Deduction', iv.input_value_id, null)) iv8,
109 MIN(DECODE(iv.name, 'Registration Date', iv.input_value_id, null)) iv9,
110 MIN(DECODE(iv.name, 'Date Returned', iv.input_value_id, null)) iv10,
111 MIN(DECODE(iv.name, 'Tax Card Requisition Status', iv.input_value_id, null)) iv11
112 FROM
113 pay_element_types_f et,
114 pay_input_values_f iv
115 WHERE et.element_name = 'Tax Card'
116 AND et.legislation_code = 'DK'
117 AND et.business_group_id is null
118 AND fnd_date.canonical_to_date(p_effective_date) BETWEEN
119 et.effective_start_date AND et.effective_end_date
120 AND iv.element_type_id = et.element_type_id
121 AND fnd_date.canonical_to_date(p_effective_date)
122 BETWEEN iv.effective_start_date AND iv.effective_end_date
123 GROUP BY
124 et.element_type_id;
125 l_proc varchar2(72) := g_package||'insert_taxcard';
126
127 /* Modified for unique constraint (APPLSYS.FND_SESSIONS_U1) violated. */
128
129 CURSOR CSR_CHECK_FND_SESSION
130 is
131 select session_id
132 from fnd_sessions
133 where session_id = userenv('sessionid')
134 and effective_date = p_effective_date;
135
136 LCSR_CHECK_FND_SESSION CSR_CHECK_FND_SESSION%ROWTYPE;
137
138 BEGIN
139
140 if g_debug then
141 hr_utility.set_location('Entering:'|| l_proc, 1);
142 end if;
143 --Insert row into fnd_Sessions table.
144
145 OPEN CSR_CHECK_FND_SESSION;
146 FETCH CSR_CHECK_FND_SESSION INTO LCSR_CHECK_FND_SESSION;
147
148 /* Modified for unique constraint (APPLSYS.FND_SESSIONS_U1) violated. */
149
150 IF CSR_CHECK_FND_SESSION%notfound THEN
151 INSERT INTO fnd_sessions(session_id,effective_date) VALUES(userenv('sessionid'), p_effective_date);
152 END IF;
153 CLOSE CSR_CHECK_FND_SESSION;
154
155 /* Fix for bug 6004991, ref bug fix 5951490 */
156 -- fetch element link id
157
158 --Added for Flugger fix
159 select ELEMENTTL.element_name
160 into l_element_name_tl
161 from PAY_ELEMENT_TYPES_F_TL ELEMENTTL, PAY_ELEMENT_TYPES_F ELEMENT
162 where ELEMENT.ELEMENT_TYPE_ID = ELEMENTTL.ELEMENT_TYPE_ID
163 and ELEMENT.LEGISLATION_CODE ='DK'
164 and ELEMENT.ELEMENT_NAME = 'Tax Card'
165 AND ELEMENTTL.LANGUAGE = USERENV('LANG');
166
167 l_element_link_id := pay_dk_tc_dp_upload.get_element_link_id(
168 p_assignment_id, p_business_group_id,
169 (p_effective_date),
170 l_element_name_tl);
171
172 if g_debug then
173 hr_utility.set_location('Entering:'|| l_proc, 3);
174 end if;
175
176 -- fetch all input value id's
177 OPEN input_values_csr;
178 FETCH input_values_csr INTO l_element_type_id, l_input_value_id1, l_input_value_id2,
179 l_input_value_id3, l_input_value_id4, l_input_value_id5, l_input_value_id6,
180 l_input_value_id7, l_input_value_id8, l_input_value_id9,l_input_value_id10,l_input_value_id11;
181 CLOSE input_values_csr;
182
183
184 if g_debug then
185 hr_utility.set_location('Entering:'|| l_proc, 6);
186 end if;
187 --If taxcard type is "NTC", then the tax percentage need not be stored.
188 IF p_tax_card_type = 'NTC' then
189 l_tax_percentage := null;
190 ELSE
191 l_tax_percentage := p_tax_percentage;
192 END IF;
193
194 if g_debug then
195 hr_utility.set_location('Entering:'|| l_proc, 7);
196 end if;
197
198
199 -- insert records into pay_element_entries_f and pay_element_entry_values_f
200 pay_element_entry_api.create_element_entry
201 (p_effective_date => p_effective_date
202 ,p_business_group_id => p_business_group_id
203 ,p_assignment_id => p_assignment_id
204 ,p_element_link_id => l_element_link_id
205 ,p_entry_type => 'E'
206 ,p_input_value_id1 => l_input_value_id1
207 ,p_input_value_id2 => l_input_value_id2
208 ,p_input_value_id3 => l_input_value_id3
209 ,p_input_value_id4 => l_input_value_id4
210 ,p_input_value_id5 => l_input_value_id5
211 ,p_input_value_id6 => l_input_value_id6
212 ,p_input_value_id7 => l_input_value_id7
213 ,p_input_value_id8 => l_input_value_id8
214 ,p_input_value_id9 => l_input_value_id9
215 ,p_input_value_id10 => l_input_value_id10
216 ,p_input_value_id11 => l_input_value_id11
217 ,p_entry_value1 => p_method_of_receipt
218 ,p_entry_value2 => p_tax_card_type
219 ,p_entry_value3 => p_tax_percentage
220 ,p_entry_value4 => p_tax_free_threshold
221 ,p_entry_value5 => p_monthly_td
222 ,p_entry_value6 => p_biweekly_td
223 ,p_entry_value7 => p_weekly_td
224 ,p_entry_value8 => p_daily_td
225 /* Modified for bug fix 4604457 */
226 /*fnd_date_to_canonical removed */
227 ,p_entry_value9 => (p_registration_date)
228 ,p_entry_value10 => (p_date_returned)
229 ,p_entry_value11 => 'UPLOAD COMPLETE' /*Added for the tax card requisition enhacement*/
230 ,p_effective_start_date => l_start_date
231 ,p_effective_end_date => l_end_date
232 ,p_element_entry_id => l_element_entry_id
233 ,p_object_version_number => l_ovn
234 ,p_create_warning => l_warning
235 );
236
237
238 if g_debug then
239 hr_utility.set_location('Entering:'|| l_proc, 10);
240 end if;
241
242 -- Do not COMMIT here. COMMIT should be done thru the OAF Application only.
243 EXCEPTION
244 WHEN OTHERS THEN
245 hr_utility.set_location('Error message : '||SQLERRM, 11);
246 RAISE;
247 END insert_taxcard;
248 --
249 -- ----------------------------------------------------------------------------
250 -- |--------------------------< update_taxcard >----------------------------|
251 -- ----------------------------------------------------------------------------
252 -- {Start Of Comments}
253 --
254 -- Description:
255 -- This API will update the tax card entry for a Norway Assignment.
256 -- This API delegates to the update_element_entry procedure of the
257 -- pay_element_entry_api package.
258 --
259 -- Prerequisites:
260 -- The element entry (of element type 'Tax Card') and the corresponding
261 -- element link should exist for the given assignment and business group.
262 --
263 -- In Parameters:
264 -- Name Reqd Type Description
265 -- p_legislation_code Yes VARCHAR2 Legislation code.
266 -- p_effective_date Yes DATE The effective date of the
267 -- change.
268 -- p_assignment_id Yes VARCHAR2 Id of the assignment.
269 -- p_person_id Yes VARCHAR2 Id of the person.
270 -- p_business_group_id Yes VARCHAR2 Id of the business group.
271 -- p_tax_free_threshold NUMBER Element entry value.
272 -- p_weekly_td NUMBER Element entry value.
273 -- p_daily_td DATE Element entry value.
274 -- p_registration_date DATE Element entry value.
275 -- p_method_of_receipt VARCHAR2 Element entry value.
276 -- p_tax_card_type VARCHAR2 Element entry value.
277 -- p_tax_percentage VARCHAR2 Element entry value.
278 -- p_monthly_td VARCHAR2 Element entry value.
279 -- p_biweekly_td VARCHAR2 Element entry value.
280 -- p_date_returned DATE Element entry value.
281 -- p_element_entry_id VARCHAR2 Id of the element entry.
282 -- p_element_link_id VARCHAR2 Id of the element link.
283 -- p_object_version_number Yes VARCHAR2 Version number of the element
284 -- entry record.
285 -- p_input_value_id1 VARCHAR2 Id of the input value 1 for the
286 -- element.
287 -- p_input_value_id2 VARCHAR2 Id of the input value 2 for the
288 -- element.
289 -- p_input_value_id3 VARCHAR2 Id of the input value 3 for the
290 -- element.
291 -- p_input_value_id4 VARCHAR2 Id of the input value 4 for the
292 -- element.
293 -- p_input_value_id5 VARCHAR2 Id of the input value 5 for the
294 -- element.
295 -- p_input_value_id6 VARCHAR2 Id of the input value 6 for the
296 -- element.
297 -- p_input_value_id7 VARCHAR2 Id of the input value 7 for the
298 -- element.
299 -- p_input_value_id8 VARCHAR2 Id of the input value 8 for the
300 -- element.
301 -- p_input_value_id9 VARCHAR2 Id of the input value 9 for the
302 -- element.
303 -- p_datetrack_update_mode VARCHAR2 The date track update mode for
304 -- the record
305 --
306 -- Post Success:
307 --
308 -- The API successfully updates the tax card entry.
309 --
310 -- Post Failure:
311 -- The API will raise an error.
312 --
313 -- Access Status:
314 -- Private. For Internal Development Use only.
315 --
316 -- {End Of Comments}
317 --
318 PROCEDURE update_taxcard (
319 p_legislation_code IN VARCHAR2
320 ,p_effective_date IN DATE
321 ,p_assignment_id IN VARCHAR2
322 ,p_person_id IN VARCHAR2
323 ,p_business_group_id IN VARCHAR2
324 ,p_tax_free_threshold IN NUMBER DEFAULT NULL
325 ,p_weekly_td IN NUMBER DEFAULT NULL
326 ,p_daily_td IN NUMBER DEFAULT NULL
327 ,p_registration_date IN DATE DEFAULT NULL
328 ,p_method_of_receipt IN VARCHAR2 DEFAULT NULL
329 ,p_tax_card_type IN VARCHAR2 DEFAULT NULL
330 ,p_tax_percentage IN NUMBER DEFAULT NULL
331 ,p_monthly_td IN NUMBER DEFAULT NULL
332 ,p_biweekly_td IN NUMBER DEFAULT NULL
333 ,p_date_returned IN DATE DEFAULT NULL
334 ,p_element_entry_id IN VARCHAR2
335 ,p_element_link_id IN VARCHAR2
336 ,p_object_version_number IN VARCHAR2
337 ,p_input_value_id1 IN VARCHAR2 DEFAULT NULL
338 ,p_input_value_id2 IN VARCHAR2 DEFAULT NULL
339 ,p_input_value_id3 IN VARCHAR2 DEFAULT NULL
340 ,p_input_value_id4 IN VARCHAR2 DEFAULT NULL
341 ,p_input_value_id5 IN VARCHAR2 DEFAULT NULL
342 ,p_input_value_id6 IN VARCHAR2 DEFAULT NULL
343 ,p_input_value_id7 IN VARCHAR2 DEFAULT NULL
344 ,p_input_value_id8 IN VARCHAR2 DEFAULT NULL
345 ,p_input_value_id9 IN VARCHAR2 DEFAULT NULL
346 ,p_input_value_id10 IN VARCHAR2 DEFAULT NULL
347 ,p_datetrack_update_mode IN VARCHAR2 DEFAULT NULL
348 ) IS
349
350 l_start_date DATE;
351 l_end_date DATE;
352 l_warning BOOLEAN;
353 l_element_entry_id NUMBER(15);
354 l_ovn NUMBER(9);
355 l_tax_percentage pay_element_entry_values_f.screen_entry_value%TYPE;
356
357 l_proc varchar2(72) := g_package||'update_taxcard';
358 BEGIN
359 if g_debug then
360 hr_utility.set_location('Entering:'|| l_proc, 1);
361 end if;
362
363 --l_start_date := sysdate;
364 l_element_entry_id := to_number(p_element_entry_id);
365 l_ovn := to_number(p_object_version_number);
366
367
368 --If taxcard type is "NTC" , then the tax percentage need not be stored.
369 if p_tax_card_type = 'NTC' then
370 l_tax_percentage := null;
371 else
372 l_tax_percentage := p_tax_percentage;
373 end if;
374
375 if g_debug then
376 hr_utility.set_location('Entering:'|| l_proc, 2);
377 end if;
378
379 -- insert records into pay_element_entries_f and pay_element_entry_values_f
380 /* Modified for to_number to fnd_number.canonical_to_number */
381 pay_element_entry_api.update_element_entry
382 (p_validate => FALSE
383 ,p_object_version_number => l_ovn
384 ,p_update_warning => l_warning
385 ,p_datetrack_update_mode => p_datetrack_update_mode
386 ,p_effective_date => p_effective_date
387 ,p_business_group_id => p_business_group_id
388 ,p_input_value_id1 => p_input_value_id1
389 ,p_input_value_id2 => p_input_value_id2
390 ,p_input_value_id3 => p_input_value_id3
391 ,p_input_value_id4 => p_input_value_id4
392 ,p_input_value_id5 => p_input_value_id5
393 ,p_input_value_id6 => p_input_value_id6
394 ,p_input_value_id7 => p_input_value_id7
395 ,p_input_value_id8 => p_input_value_id8
396 ,p_input_value_id9 => p_input_value_id9
397 ,p_input_value_id10 => p_input_value_id10
398 ,p_entry_value1 => p_method_of_receipt
399 ,p_entry_value2 => p_tax_card_type
400 ,p_entry_value3 => fnd_number.canonical_to_number(l_tax_percentage)
401 ,p_entry_value4 => fnd_number.canonical_to_number(p_tax_free_threshold)
402 ,p_entry_value5 => fnd_number.canonical_to_number(p_monthly_td)
403 ,p_entry_value6 => fnd_number.canonical_to_number(p_biweekly_td)
404 ,p_entry_value7 => fnd_number.canonical_to_number(p_weekly_td)
405 ,p_entry_value8 => fnd_number.canonical_to_number(p_daily_td)
406 ,p_entry_value9 => (p_registration_date)
407 ,p_entry_value10 => (p_date_returned)
408 ,p_effective_start_date => l_start_date
409 ,p_effective_end_date => l_end_date
410 ,p_element_entry_id => l_element_entry_id
411 ,p_cost_allocation_keyflex_id => hr_api.g_number
412 ,p_updating_action_id => hr_api.g_number
413 ,p_original_entry_id => hr_api.g_number
414 ,p_creator_type => hr_api.g_varchar2
415 ,p_comment_id => hr_api.g_number
416 ,p_creator_id => hr_api.g_number
417 ,p_reason => hr_api.g_varchar2
418 ,p_subpriority => hr_api.g_number
419 ,p_date_earned => hr_api.g_date
420 ,p_personal_payment_method_id => hr_api.g_number
421 ,p_attribute_category => hr_api.g_varchar2
422 ,p_attribute1 => hr_api.g_varchar2
423 ,p_attribute2 => hr_api.g_varchar2
424 ,p_attribute3 => hr_api.g_varchar2
425 ,p_attribute4 => hr_api.g_varchar2
426 ,p_attribute5 => hr_api.g_varchar2
427 ,p_attribute6 => hr_api.g_varchar2
428 ,p_attribute7 => hr_api.g_varchar2
429 ,p_attribute8 => hr_api.g_varchar2
430 ,p_attribute9 => hr_api.g_varchar2
431 ,p_attribute10 => hr_api.g_varchar2
432 ,p_attribute11 => hr_api.g_varchar2
433 ,p_attribute12 => hr_api.g_varchar2
434 ,p_attribute13 => hr_api.g_varchar2
435 ,p_attribute14 => hr_api.g_varchar2
436 ,p_attribute15 => hr_api.g_varchar2
437 ,p_attribute16 => hr_api.g_varchar2
438 ,p_attribute17 => hr_api.g_varchar2
439 ,p_attribute18 => hr_api.g_varchar2
440 ,p_attribute19 => hr_api.g_varchar2
441 ,p_attribute20 => hr_api.g_varchar2
442 ,p_updating_action_type => hr_api.g_varchar2
443 ,p_entry_information_category => hr_api.g_varchar2
444 ,p_entry_information1 => hr_api.g_varchar2
445 ,p_entry_information2 => hr_api.g_varchar2
446 ,p_entry_information3 => hr_api.g_varchar2
447 ,p_entry_information4 => hr_api.g_varchar2
448 ,p_entry_information5 => hr_api.g_varchar2
449 ,p_entry_information6 => hr_api.g_varchar2
450 ,p_entry_information7 => hr_api.g_varchar2
451 ,p_entry_information8 => hr_api.g_varchar2
452 ,p_entry_information9 => hr_api.g_varchar2
453 ,p_entry_information10 => hr_api.g_varchar2
454 ,p_entry_information11 => hr_api.g_varchar2
455 ,p_entry_information12 => hr_api.g_varchar2
456 ,p_entry_information13 => hr_api.g_varchar2
457 ,p_entry_information14 => hr_api.g_varchar2
458 ,p_entry_information15 => hr_api.g_varchar2
459 ,p_entry_information16 => hr_api.g_varchar2
460 ,p_entry_information17 => hr_api.g_varchar2
461 ,p_entry_information18 => hr_api.g_varchar2
462 ,p_entry_information19 => hr_api.g_varchar2
463 ,p_entry_information20 => hr_api.g_varchar2
464 ,p_entry_information21 => hr_api.g_varchar2
465 ,p_entry_information22 => hr_api.g_varchar2
466 ,p_entry_information23 => hr_api.g_varchar2
467 ,p_entry_information24 => hr_api.g_varchar2
468 ,p_entry_information25 => hr_api.g_varchar2
469 ,p_entry_information26 => hr_api.g_varchar2
470 ,p_entry_information27 => hr_api.g_varchar2
471 ,p_entry_information28 => hr_api.g_varchar2
472 ,p_entry_information29 => hr_api.g_varchar2
473 ,p_entry_information30 => hr_api.g_varchar2);
474
475 if g_debug then
476 hr_utility.set_location('Entering:'|| l_proc, 3);
477 end if;
478 -- Do not COMMIT here. COMMIT should be done from the OAF Application Only.
479 EXCEPTION
480 WHEN OTHERS THEN
481 hr_utility.set_location('Error message : '||SQLERRM, 12);
482 RAISE;
483 END update_taxcard;
484 --
485 -- ----------------------------------------------------------------------------
486 -- |--------------------------< find_dt_upd_modes >----------------------------|
487 -- ----------------------------------------------------------------------------
488 -- {Start Of Comments}
489 --
490 -- Description:
491 -- This API returns the DT modes for pay_element_entries_f for a given
492 -- element_entry_id (base key value) on a specified date
493 --
494 -- Prerequisites:
495 -- The element_entry (p_base_key_value) must exist as of the effective date
496 -- of the change (p_effective_date).
497 --
498 -- In Parameters:
499 -- Name Reqd Type Description
500 -- p_effective_date Yes DATE The effective date of the
501 -- change.
502 -- p_base_key_value Yes NUMBER ID of the element entry.
503 --
504 --
505 -- Post Success:
506 --
507 -- The API sets the following out parameters:
508 --
509 -- Name Type Description
510 -- p_correction BOOLEAN True if correction mode is valid.
511 -- p_update BOOLEAN True if update mode is valid.
512 -- p_update_override BOOLEAN True if update override mode is valid.
513 -- p_update_change_insert BOOLEAN True if update change insert mode is
514 -- valid.
515 -- p_update_start_date DATE Start date for Update record.
516 -- p_update_end_date DATE End date for Update record.
517 -- p_override_start_date DATE Start date for Override.
518 -- p_override_end_date DATE End date for Overrride.
519 -- p_upd_chg_start_date DATE Start date for Update Change.
520 -- p_upd_chg_end_date DATE End date for Update Change.
521
522 -- Post Failure:
523 -- The API will raise an error.
524 --
525 -- Access Status:
526 -- Private. For Internal Development Use only.
527 --
528 -- {End Of Comments}
529 --
530 PROCEDURE find_dt_upd_modes
531 (p_effective_date IN DATE
532 ,p_base_key_value IN NUMBER
533 ,p_correction OUT NOCOPY BOOLEAN
534 ,p_update OUT NOCOPY BOOLEAN
535 ,p_update_override OUT NOCOPY BOOLEAN
536 ,p_update_change_insert OUT NOCOPY BOOLEAN
537 ,p_correction_start_date OUT NOCOPY DATE
538 ,p_correction_end_date OUT NOCOPY DATE
539 ,p_update_start_date OUT NOCOPY DATE
540 ,p_update_end_date OUT NOCOPY DATE
541 ,p_override_start_date OUT NOCOPY DATE
542 ,p_override_end_date OUT NOCOPY DATE
543 ,p_upd_chg_start_date OUT NOCOPY DATE
544 ,p_upd_chg_end_date OUT NOCOPY DATE
545 ) IS
546
547 l_proc varchar2(72) := g_package||'find_dt_upd_modes';
548
549 BEGIN
550 if g_debug then
551 hr_utility.set_location('Entering:'|| l_proc, 1);
552 end if;
553 --
554 -- Call the corresponding datetrack api
555 --
556 dt_api.find_dt_upd_modes_and_dates(
557 p_effective_date => p_effective_date
558 ,p_base_table_name => 'pay_element_entries_f'
559 ,p_base_key_column => 'ELEMENT_ENTRY_ID'
560 ,p_base_key_value => p_base_key_value
561 ,p_correction => p_correction
562 ,p_update => p_update
563 ,p_update_override => p_update_override
564 ,p_update_change_insert => p_update_change_insert
565 ,p_correction_start_date => p_correction_start_date
566 ,p_correction_end_date => p_correction_end_date
567 ,p_update_start_date => p_update_start_date
568 ,p_update_end_date => p_update_end_date
569 ,p_override_start_date => p_override_start_date
570 ,p_override_end_date => p_override_end_date
571 ,p_upd_chg_start_date => p_upd_chg_start_date
572 ,p_upd_chg_end_date => p_upd_chg_end_date);
573 if g_debug then
574 hr_utility.set_location('Entering:'|| l_proc, 2);
575 end if;
576 --
577 --hr_utility.set_location(' Leaving:'||l_proc, 10);
578 EXCEPTION
579 WHEN OTHERS THEN
580 RAISE;
581 END find_dt_upd_modes;
582 --
583 -- -----------------------------------------------------------------------------
584 -- |--------------------------< get_global_value >-----------------------------|
585 -- -----------------------------------------------------------------------------
586 --
587 -- {Start of Comments}
588 --
589 -- Description:
590 -- Returns the value for the global on a given date.
591 --
592 -- Prerequisites:
593 -- None
594 --
595 -- In Parameters
596 -- Name Reqd Type Description
597 -- p_global_name Yes VARCHAR2 Assignment id
598 -- p_legislation_code Yes VARCHAR2 Legislation Code
599 -- p_effective_date Yes DATE Effective date
600 --
601 -- Post Success:
602 -- The value of the global of type FF_GLOBALS_F.GLOBAL_VALUE is returned
603 --
604 -- Post Failure:
605 -- An error is raised
606 --
607 -- Access Status:
608 -- Internal Development Use Only
609 --
610 -- {End of Comments}
611 --
612 FUNCTION get_global_value(
613 p_global_name VARCHAR2,
614 p_legislation_code VARCHAR2,
615 p_effective_date DATE)
616 RETURN ff_globals_f.global_value%TYPE IS
617
618 CURSOR csr_globals IS
619 SELECT global_value
620 FROM ff_globals_f
621 WHERE global_name = p_global_name
622 AND legislation_code = p_legislation_code
623 AND business_group_id IS NULL
624 AND p_effective_date BETWEEN effective_start_date AND effective_end_date;
625
626 l_global_value ff_globals_f.global_value%TYPE;
627 l_proc varchar2(72) := g_package||'get_global_value';
628
629 BEGIN
630 if g_debug then
631 hr_utility.set_location('Entering:'|| l_proc, 1);
632 end if;
633
634 OPEN csr_globals;
635 FETCH csr_globals INTO l_global_value;
636 CLOSE csr_globals;
637
638 if g_debug then
639 hr_utility.set_location('Entering:'|| l_proc, 2);
640 end if;
641
642 RETURN l_global_value;
643 END get_global_value;
644
645 END py_dk_tax_card;