1 PACKAGE pay_fed_shd AS
2 /* $Header: pyfedrhi.pkh 120.0.12000000.2 2007/05/01 22:39:23 ahanda noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 emp_fed_tax_rule_id number(9),
11 effective_start_date date,
12 effective_end_date date,
13 assignment_id number(9),
14 sui_state_code varchar2(9), -- Increased length
15 sui_jurisdiction_code varchar2(11),
16 business_group_id number(15),
17 additional_wa_amount number(11,2),
18 filing_status_code varchar2(30),
19 fit_override_amount number(11,2),
20 fit_override_rate number(11,2), -- Increased length
21 withholding_allowances number(11), -- Increased length
22 cumulative_taxation varchar2(30),
23 eic_filing_status_code varchar2(30),
24 fit_additional_tax number(11,2),
25 fit_exempt varchar2(30),
26 futa_tax_exempt varchar2(30),
27 medicare_tax_exempt varchar2(30),
28 ss_tax_exempt varchar2(30),
29 wage_exempt varchar2(30),
30 statutory_employee varchar2(30),
31 w2_filed_year number(11), -- Increased length
32 supp_tax_override_rate number(11,2), -- Increased length
33 excessive_wa_reject_date date,
34 object_version_number number(9),
35 attribute_category varchar2(30),
36 attribute1 varchar2(150),
37 attribute2 varchar2(150),
38 attribute3 varchar2(150),
39 attribute4 varchar2(150),
40 attribute5 varchar2(150),
41 attribute6 varchar2(150),
42 attribute7 varchar2(150),
43 attribute8 varchar2(150),
44 attribute9 varchar2(150),
45 attribute10 varchar2(150),
46 attribute11 varchar2(150),
47 attribute12 varchar2(150),
48 attribute13 varchar2(150),
49 attribute14 varchar2(150),
50 attribute15 varchar2(150),
51 attribute16 varchar2(150),
52 attribute17 varchar2(150),
53 attribute18 varchar2(150),
54 attribute19 varchar2(150),
55 attribute20 varchar2(150),
56 attribute21 varchar2(150),
57 attribute22 varchar2(150),
58 attribute23 varchar2(150),
59 attribute24 varchar2(150),
60 attribute25 varchar2(150),
61 attribute26 varchar2(150),
62 attribute27 varchar2(150),
63 attribute28 varchar2(150),
64 attribute29 varchar2(150),
65 attribute30 varchar2(150),
66 fed_information_category varchar2(30),
67 fed_information1 varchar2(150),
68 fed_information2 varchar2(150),
69 fed_information3 varchar2(150),
70 fed_information4 varchar2(150),
71 fed_information5 varchar2(150),
72 fed_information6 varchar2(150),
73 fed_information7 varchar2(150),
74 fed_information8 varchar2(150),
75 fed_information9 varchar2(150),
76 fed_information10 varchar2(150),
77 fed_information11 varchar2(150),
78 fed_information12 varchar2(150),
79 fed_information13 varchar2(150),
80 fed_information14 varchar2(150),
81 fed_information15 varchar2(150),
82 fed_information16 varchar2(150),
83 fed_information17 varchar2(150),
84 fed_information18 varchar2(150),
85 fed_information19 varchar2(150),
86 fed_information20 varchar2(150),
87 fed_information21 varchar2(150),
88 fed_information22 varchar2(150),
89 fed_information23 varchar2(150),
90 fed_information24 varchar2(150),
91 fed_information25 varchar2(150),
92 fed_information26 varchar2(150),
93 fed_information27 varchar2(150),
94 fed_information28 varchar2(150),
95 fed_information29 varchar2(150),
96 fed_information30 varchar2(150)
97 );
98 --
99 -- ----------------------------------------------------------------------------
100 -- | Global Definitions - Internal Development Use Only |
101 -- ----------------------------------------------------------------------------
102 --
103 g_old_rec g_rec_type; -- Global record definition
104 g_api_dml boolean; -- Global api dml status
105 --
106 -- ----------------------------------------------------------------------------
107 -- |------------------------< return_api_dml_status >-------------------------|
108 -- ----------------------------------------------------------------------------
109 -- {Start Of Comments}
110 --
111 -- Description:
112 -- This function will return the current g_api_dml private global
113 -- boolean status.
114 -- The g_api_dml status determines if at the time of the function
115 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
116 -- is being issued from within an api.
117 -- If the status is TRUE then a dml statement is being issued from
118 -- within this entity api.
119 -- This function is primarily to support database triggers which
120 -- need to maintain the object_version_number for non-supported
121 -- dml statements (i.e. dml statement issued outside of the api layer).
122 --
123 -- Prerequisites:
124 -- None.
125 --
126 -- In Parameters:
127 -- None.
128 --
129 -- Post Success:
130 -- Processing continues.
131 -- If the function returns a TRUE value then, dml is being executed from
132 -- within this api.
133 --
134 -- Post Failure:
135 -- None.
136 --
137 -- Access Status:
138 -- Internal Row Handler Use Only.
139 --
140 -- {End Of Comments}
141 -- ----------------------------------------------------------------------------
142 Function return_api_dml_status Return Boolean;
143 --
144 -- ----------------------------------------------------------------------------
145 -- |---------------------------< constraint_error >---------------------------|
146 -- ----------------------------------------------------------------------------
147 -- {Start Of Comments}
148 --
149 -- Description:
150 -- This procedure is called when a constraint has been violated (i.e.
151 -- The exception hr_api.check_integrity_violated,
152 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
153 -- hr_api.unique_integrity_violated has been raised).
154 -- The exceptions can only be raised as follows:
155 -- 1) A check constraint can only be violated during an INSERT or UPDATE
156 -- dml operation.
157 -- 2) A parent integrity constraint can only be violated during an
158 -- INSERT or UPDATE dml operation.
159 -- 3) A child integrity constraint can only be violated during an
160 -- DELETE dml operation.
161 -- 4) A unique integrity constraint can only be violated during INSERT or
162 -- UPDATE dml operation.
163 --
164 -- Prerequisites:
165 -- 1) Either hr_api.check_integrity_violated,
166 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
167 -- hr_api.unique_integrity_violated has been raised with the subsequent
168 -- stripping of the constraint name from the generated error message
169 -- text.
170 -- 2) Standalone validation test which corresponds with a constraint error.
171 --
172 -- In Parameter:
173 -- p_constraint_name is in upper format and is just the constraint name
174 -- (e.g. not prefixed by brackets, schema owner etc).
175 --
176 -- Post Success:
177 -- Development dependant.
178 --
179 -- Post Failure:
180 -- Developement dependant.
181 --
182 -- Developer Implementation Notes:
183 -- For each constraint being checked the hr system package failure message
184 -- has been generated as a template only. These system error messages should
185 -- be modified as required (i.e. change the system failure message to a user
186 -- friendly defined error message).
187 --
188 -- Access Status:
189 -- Internal Development Use Only.
190 --
191 -- {End Of Comments}
192 -- ----------------------------------------------------------------------------
193 Procedure constraint_error
194 (p_constraint_name in all_constraints.constraint_name%TYPE);
195 --
196 -- ----------------------------------------------------------------------------
197 -- |-----------------------------< api_updating >-----------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 -- This function is used to populate the g_old_rec record with the current
203 -- row from the database for the specified primary key provided that the
204 -- primary key exists, and is valid, and does not already match the current
205 -- g_old_rec.
206 -- The function will always return a TRUE value if the g_old_rec is
207 -- populated with the current row. A FALSE value will be returned if all of
208 -- the primary key arguments are null.
209 --
210 -- Prerequisites:
211 -- None.
212 --
213 -- In Parameters:
214 --
215 -- Post Success:
216 -- A value of TRUE will be returned indiciating that the g_old_rec is
217 -- current.
218 -- A value of FALSE will be returned if all of the primary key arguments
219 -- have a null value (this indicates that the row has not be inserted into
220 -- the Schema), and therefore could never have a corresponding row.
221 --
222 -- Post Failure:
223 -- A failure can only occur under two circumstances:
224 -- 1) The primary key is invalid (i.e. a row does not exist for the
225 -- specified primary key values).
226 -- 2) If an object_version_number exists but is NOT the same as the current
227 -- g_old_rec value.
228 --
229 -- Developer Implementation Notes:
230 -- None.
231 --
232 -- Access Status:
233 -- Internal Development Use Only.
234 --
235 -- {End Of Comments}
236 -- ----------------------------------------------------------------------------
237 Function api_updating
238 (p_effective_date in date,
239 p_emp_fed_tax_rule_id in number,
240 p_object_version_number in number
241 ) Return Boolean;
242 --
243 -- ----------------------------------------------------------------------------
244 -- |--------------------------< find_dt_del_modes >---------------------------|
245 -- ----------------------------------------------------------------------------
246 -- {Start Of Comments}
247 --
248 -- Description:
249 -- This procedure is used to determine what datetrack delete modes are
250 -- allowed as of the effective date for this entity. The procedure will
251 -- return a corresponding Boolean value for each of the delete modes
252 -- available where TRUE indicates that the corresponding delete mode is
253 -- available.
254 --
255 -- Prerequisites:
256 -- None.
257 --
258 -- In Parameters:
259 -- p_effective_date
260 -- Specifies the date at which the datetrack modes will be operated on.
261 -- p_base_key_value
262 -- Specifies the primary key value for this datetrack entity.
263 -- (E.g. For this entity the assignment of the argument would be:
264 -- p_base_key_value = :emp_fed_tax_rule_id).
265 --
266 -- Post Success:
267 -- Processing continues.
268 --
269 -- Post Failure:
270 -- Failure might occur if for the specified effective date and primary key
271 -- value a row doesn't exist.
272 --
273 -- Developer Implementation Notes:
274 -- This procedure could require changes if this entity has any sepcific
275 -- delete restrictions.
276 -- For example, this entity might disallow the datetrack delete mode of
277 -- ZAP. To implement this you would have to set and return a Boolean value
278 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
279 --
280 -- Access Status:
281 -- Internal Development Use Only.
282 --
283 -- {End Of Comments}
284 -- ----------------------------------------------------------------------------
285 Procedure find_dt_del_modes
286 (p_effective_date in date,
287 p_base_key_value in number,
288 p_zap out nocopy boolean,
289 p_delete out nocopy boolean,
290 p_future_change out nocopy boolean,
291 p_delete_next_change out nocopy boolean);
292 --
293 -- ----------------------------------------------------------------------------
294 -- |--------------------------< find_dt_upd_modes >---------------------------|
295 -- ----------------------------------------------------------------------------
296 -- {Start Of Comments}
297 --
298 -- Description:
299 -- This procedure is used to determine what datetrack update modes are
300 -- allowed as of the effective date for this entity. The procedure will
301 -- return a corresponding Boolean value for each of the update modes
302 -- available where TRUE indicates that the corresponding update mode
303 -- is available.
304 --
305 -- Prerequisites:
306 -- None.
307 --
308 -- In Parameters:
309 -- p_effective_date
310 -- Specifies the date at which the datetrack modes will be operated on.
311 -- p_base_key_value
312 -- Specifies the primary key value for this datetrack entity.
313 -- (E.g. For this entity the assignment of the argument would be:
314 -- p_base_key_value = :emp_fed_tax_rule_id).
315 --
316 -- Post Success:
317 -- Processing continues.
318 --
319 -- Post Failure:
320 -- Failure might occur if for the specified effective date and primary key
321 -- value a row doesn't exist.
322 --
323 -- Developer Implementation Notes:
324 -- This procedure could require changes if this entity has any sepcific
325 -- delete restrictions.
326 -- For example, this entity might disallow the datetrack update mode of
327 -- UPDATE. To implement this you would have to set and return a Boolean
328 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
329 --
330 -- Access Status:
331 -- Internal Development Use Only.
332 --
333 -- {End Of Comments}
334 -- ----------------------------------------------------------------------------
335 Procedure find_dt_upd_modes
336 (p_effective_date in date,
337 p_base_key_value in number,
338 p_correction out nocopy boolean,
339 p_update out nocopy boolean,
340 p_update_override out nocopy boolean,
341 p_update_change_insert out nocopy boolean);
342 --
343 -- ----------------------------------------------------------------------------
344 -- |------------------------< upd_effective_end_date >------------------------|
345 -- ----------------------------------------------------------------------------
346 -- {Start Of Comments}
347 --
348 -- Description:
349 -- This procedure will update the specified datetrack row with the
350 -- specified new effective end date. The object version number is also
354 -- This is an internal datetrack maintenance procedure which should
351 -- set to the next object version number. DateTrack modes which call
352 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
353 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
355 -- not be modified in anyway.
356 --
357 -- Prerequisites:
358 -- None.
359 --
360 -- In Parameters:
361 -- p_new_effective_end_date
362 -- Specifies the new effective end date which will be set for the
363 -- row as of the effective date.
364 -- p_base_key_value
365 -- Specifies the primary key value for this datetrack entity.
366 -- (E.g. For this entity the assignment of the argument would be:
367 -- p_base_key_value = :emp_fed_tax_rule_id).
368 --
369 -- Post Success:
370 -- The specified row will be updated with the new effective end date and
371 -- object_version_number.
372 --
373 -- Post Failure:
374 -- Failure might occur if for the specified effective date and primary key
375 -- value a row doesn't exist.
376 --
377 -- Developer Implementation Notes:
378 -- This is an internal datetrack maintenance procedure which should
379 -- not be modified in anyway.
380 --
381 -- Access Status:
382 -- Internal Row Handler Use Only.
383 --
384 -- {End Of Comments}
385 -- ----------------------------------------------------------------------------
386 Procedure upd_effective_end_date
387 (p_effective_date in date,
388 p_base_key_value in number,
389 p_new_effective_end_date in date,
390 p_validation_start_date in date,
391 p_validation_end_date in date,
392 p_object_version_number out nocopy number);
393 --
394 -- ----------------------------------------------------------------------------
395 -- |---------------------------------< lck >----------------------------------|
396 -- ----------------------------------------------------------------------------
397 -- {Start Of Comments}
398 --
399 -- Description:
400 -- The Lck process for datetrack is complicated and comprises of the
401 -- following processing
402 -- The processing steps are as follows:
403 -- 1) The row to be updated or deleted must be locked.
404 -- By locking this row, the g_old_rec record data type is populated.
405 -- 2) If a comment exists the text is selected from hr_comments.
406 -- 3) The datetrack mode is then validated to ensure the operation is
407 -- valid. If the mode is valid the validation start and end dates for
408 -- the mode will be derived and returned. Any required locking is
409 -- completed when the datetrack mode is validated.
410 --
411 -- Prerequisites:
412 -- When attempting to call the lck procedure the object version number,
413 -- primary key, effective date and datetrack mode must be specified.
414 --
415 -- In Parameters:
416 -- p_effective_date
417 -- Specifies the date of the datetrack update operation.
418 -- p_datetrack_mode
419 -- Determines the datetrack update or delete mode.
420 --
421 -- Post Success:
422 -- On successful completion of the Lck process the row to be updated or
423 -- deleted will be locked and selected into the global data structure
424 -- g_old_rec.
425 --
426 -- Post Failure:
427 -- The Lck process can fail for three reasons:
428 -- 1) When attempting to lock the row the row could already be locked by
429 -- another user. This will raise the HR_Api.Object_Locked exception.
430 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
431 -- This error is trapped and reported using the message name
432 -- 'HR_7220_INVALID_PRIMARY_KEY'.
433 -- 3) The row although existing in the HR Schema has a different object
434 -- version number than the object version number specified.
435 -- This error is trapped and reported using the message name
436 -- 'HR_7155_OBJECT_INVALID'.
437 --
438 -- Developer Implementation Notes:
439 -- None.
440 --
441 -- Access Status:
442 -- Internal Development Use Only.
443 --
444 -- {End Of Comments}
445 -- ----------------------------------------------------------------------------
446 Procedure lck
447 (p_effective_date in date,
448 p_datetrack_mode in varchar2,
449 p_emp_fed_tax_rule_id in number,
450 p_object_version_number in number,
451 p_validation_start_date out nocopy date,
452 p_validation_end_date out nocopy date);
453 --
454 -- ----------------------------------------------------------------------------
455 -- |-----------------------------< convert_args >-----------------------------|
456 -- ----------------------------------------------------------------------------
457 -- {Start Of Comments}
458 --
459 -- Description:
460 -- This function is used to turn attribute parameters into the record
461 -- structure parameter g_rec_type.
462 --
463 -- Prerequisites:
464 -- This is a private function and can only be called from the ins or upd
465 -- attribute processes.
466 --
467 -- In Parameters:
468 --
469 -- Post Success:
470 -- A returning record structure will be returned.
471 --
472 -- Post Failure:
473 -- No direct error handling is required within this function. Any possible
474 -- errors within this function will be a PL/SQL value error due to conversion
478 -- None.
475 -- of datatypes or data lengths.
476 --
477 -- Developer Implementation Notes:
479 --
480 -- Access Status:
481 -- Internal Row Handler Use Only.
482 --
483 -- {End Of Comments}
484 -- ----------------------------------------------------------------------------
485 Function convert_args
486 (
487 p_emp_fed_tax_rule_id in number,
488 p_effective_start_date in date,
489 p_effective_end_date in date,
490 p_assignment_id in number,
491 p_sui_state_code in varchar2,
492 p_sui_jurisdiction_code in varchar2,
493 p_business_group_id in number,
494 p_additional_wa_amount in number,
495 p_filing_status_code in varchar2,
496 p_fit_override_amount in number,
497 p_fit_override_rate in number,
498 p_withholding_allowances in number,
499 p_cumulative_taxation in varchar2,
500 p_eic_filing_status_code in varchar2,
501 p_fit_additional_tax in number,
502 p_fit_exempt in varchar2,
503 p_futa_tax_exempt in varchar2,
504 p_medicare_tax_exempt in varchar2,
505 p_ss_tax_exempt in varchar2,
506 p_wage_exempt in varchar2,
507 p_statutory_employee in varchar2,
508 p_w2_filed_year in number,
509 p_supp_tax_override_rate in number,
510 p_excessive_wa_reject_date in date,
511 p_object_version_number in number,
512 p_attribute_category in varchar2,
513 p_attribute1 in varchar2,
514 p_attribute2 in varchar2,
515 p_attribute3 in varchar2,
516 p_attribute4 in varchar2,
517 p_attribute5 in varchar2,
518 p_attribute6 in varchar2,
519 p_attribute7 in varchar2,
520 p_attribute8 in varchar2,
521 p_attribute9 in varchar2,
522 p_attribute10 in varchar2,
523 p_attribute11 in varchar2,
524 p_attribute12 in varchar2,
525 p_attribute13 in varchar2,
526 p_attribute14 in varchar2,
527 p_attribute15 in varchar2,
528 p_attribute16 in varchar2,
529 p_attribute17 in varchar2,
530 p_attribute18 in varchar2,
531 p_attribute19 in varchar2,
532 p_attribute20 in varchar2,
533 p_attribute21 in varchar2,
534 p_attribute22 in varchar2,
535 p_attribute23 in varchar2,
536 p_attribute24 in varchar2,
537 p_attribute25 in varchar2,
538 p_attribute26 in varchar2,
539 p_attribute27 in varchar2,
540 p_attribute28 in varchar2,
541 p_attribute29 in varchar2,
542 p_attribute30 in varchar2,
543 p_fed_information_category in varchar2,
544 p_fed_information1 in varchar2,
545 p_fed_information2 in varchar2,
546 p_fed_information3 in varchar2,
547 p_fed_information4 in varchar2,
548 p_fed_information5 in varchar2,
549 p_fed_information6 in varchar2,
550 p_fed_information7 in varchar2,
551 p_fed_information8 in varchar2,
552 p_fed_information9 in varchar2,
553 p_fed_information10 in varchar2,
554 p_fed_information11 in varchar2,
555 p_fed_information12 in varchar2,
556 p_fed_information13 in varchar2,
557 p_fed_information14 in varchar2,
558 p_fed_information15 in varchar2,
559 p_fed_information16 in varchar2,
560 p_fed_information17 in varchar2,
561 p_fed_information18 in varchar2,
562 p_fed_information19 in varchar2,
563 p_fed_information20 in varchar2,
564 p_fed_information21 in varchar2,
565 p_fed_information22 in varchar2,
566 p_fed_information23 in varchar2,
567 p_fed_information24 in varchar2,
568 p_fed_information25 in varchar2,
569 p_fed_information26 in varchar2,
570 p_fed_information27 in varchar2,
571 p_fed_information28 in varchar2,
572 p_fed_information29 in varchar2,
573 p_fed_information30 in varchar2
574 )
575 Return g_rec_type;
576 --
577 end pay_fed_shd;