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