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