1 Package pay_cft_shd as
2 /* $Header: pycatrhi.pkh 120.1 2005/10/05 06:45:04 saurgupt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 emp_fed_tax_inf_id number(9),
11 effective_start_date date,
12 effective_end_date date,
13 legislation_code varchar2(30),
14 assignment_id number(10),
15 business_group_id number(10),
16 employment_province varchar2(30),
17 tax_credit_amount number(11,2),
18 claim_code varchar2(30),
19 basic_exemption_flag varchar2(30),
20 additional_tax number(11,2),
21 annual_dedn number(11,2),
22 total_expense_by_commission number(11,2),
23 total_remnrtn_by_commission number(11,2),
24 prescribed_zone_dedn_amt number(11,2),
25 other_fedtax_credits varchar2(11),
26 cpp_qpp_exempt_flag varchar2(30),
27 fed_exempt_flag varchar2(30),
28 ei_exempt_flag varchar2(30),
29 tax_calc_method varchar2(30),
30 fed_override_amount number(11,2),
31 fed_override_rate number(11,2),
32 ca_tax_information_category varchar2(30),
33 ca_tax_information1 varchar2(150),
34 ca_tax_information2 varchar2(150),
35 ca_tax_information3 varchar2(150),
36 ca_tax_information4 varchar2(150),
37 ca_tax_information5 varchar2(150),
38 ca_tax_information6 varchar2(150),
39 ca_tax_information7 varchar2(150),
40 ca_tax_information8 varchar2(150),
41 ca_tax_information9 varchar2(150),
42 ca_tax_information10 varchar2(150),
43 ca_tax_information11 varchar2(150),
44 ca_tax_information12 varchar2(150),
45 ca_tax_information13 varchar2(150),
46 ca_tax_information14 varchar2(150),
47 ca_tax_information15 varchar2(150),
48 ca_tax_information16 varchar2(150),
49 ca_tax_information17 varchar2(150),
50 ca_tax_information18 varchar2(150),
51 ca_tax_information19 varchar2(150),
52 ca_tax_information20 varchar2(150),
53 ca_tax_information21 varchar2(150),
54 ca_tax_information22 varchar2(150),
55 ca_tax_information23 varchar2(150),
56 ca_tax_information24 varchar2(150),
57 ca_tax_information25 varchar2(150),
58 ca_tax_information26 varchar2(150),
59 ca_tax_information27 varchar2(150),
60 ca_tax_information28 varchar2(150),
61 ca_tax_information29 varchar2(150),
62 ca_tax_information30 varchar2(150),
63 object_version_number number(15),
64 fed_lsf_amount number(11,2)
65 );
66 --
67 -- ----------------------------------------------------------------------------
68 -- | Global Definitions - Internal Development Use Only |
69 -- ----------------------------------------------------------------------------
70 --
71 g_old_rec g_rec_type; -- Global record definition
72 g_api_dml boolean; -- Global api dml status
73 --
74 -- ----------------------------------------------------------------------------
75 -- |------------------------< return_api_dml_status >-------------------------|
76 -- ----------------------------------------------------------------------------
77 -- {Start Of Comments}
78 --
79 -- Description:
80 -- This function will return the current g_api_dml private global
81 -- boolean status.
82 -- The g_api_dml status determines if at the time of the function
83 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
84 -- is being issued from within an api.
85 -- If the status is TRUE then a dml statement is being issued from
86 -- within this entity api.
87 -- This function is primarily to support database triggers which
88 -- need to maintain the object_version_number for non-supported
89 -- dml statements (i.e. dml statement issued outside of the api layer).
90 --
91 -- Prerequisites:
92 -- None.
93 --
94 -- In Parameters:
95 -- None.
96 --
97 -- Post Success:
98 -- Processing continues.
99 -- If the function returns a TRUE value then, dml is being executed from
100 -- within this api.
101 --
102 -- Post Failure:
103 -- None.
104 --
105 -- Access Status:
106 -- Internal Row Handler Use Only.
107 --
108 -- {End Of Comments}
109 -- ----------------------------------------------------------------------------
110 Function return_api_dml_status Return Boolean;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |---------------------------< constraint_error >---------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This procedure is called when a constraint has been violated (i.e.
119 -- The exception hr_api.check_integrity_violated,
120 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
121 -- hr_api.unique_integrity_violated has been raised).
122 -- The exceptions can only be raised as follows:
123 -- 1) A check constraint can only be violated during an INSERT or UPDATE
124 -- dml operation.
125 -- 2) A parent integrity constraint can only be violated during an
126 -- INSERT or UPDATE dml operation.
127 -- 3) A child integrity constraint can only be violated during an
128 -- DELETE dml operation.
129 -- 4) A unique integrity constraint can only be violated during INSERT or
130 -- UPDATE dml operation.
131 --
132 -- Prerequisites:
133 -- 1) Either hr_api.check_integrity_violated,
134 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
135 -- hr_api.unique_integrity_violated has been raised with the subsequent
136 -- stripping of the constraint name from the generated error message
137 -- text.
138 -- 2) Standalone validation test which corresponds with a constraint error.
139 --
140 -- In Parameter:
141 -- p_constraint_name is in upper format and is just the constraint name
142 -- (e.g. not prefixed by brackets, schema owner etc).
143 --
144 -- Post Success:
145 -- Development dependant.
146 --
147 -- Post Failure:
148 -- Developement dependant.
149 --
150 -- Developer Implementation Notes:
151 -- For each constraint being checked the hr system package failure message
152 -- has been generated as a template only. These system error messages should
153 -- be modified as required (i.e. change the system failure message to a user
154 -- friendly defined error message).
155 --
156 -- Access Status:
157 -- Internal Development Use Only.
158 --
159 -- {End Of Comments}
160 -- ----------------------------------------------------------------------------
161 Procedure constraint_error
162 (p_constraint_name in all_constraints.constraint_name%TYPE);
163 --
164 -- ----------------------------------------------------------------------------
165 -- |-----------------------------< api_updating >-----------------------------|
166 -- ----------------------------------------------------------------------------
167 -- {Start Of Comments}
168 --
169 -- Description:
170 -- This function is used to populate the g_old_rec record with the current
171 -- row from the database for the specified primary key provided that the
172 -- primary key exists, and is valid, and does not already match the current
173 -- g_old_rec.
174 -- The function will always return a TRUE value if the g_old_rec is
175 -- populated with the current row. A FALSE value will be returned if all of
176 -- the primary key arguments are null.
177 --
178 -- Prerequisites:
179 -- None.
180 --
181 -- In Parameters:
182 --
183 -- Post Success:
184 -- A value of TRUE will be returned indiciating that the g_old_rec is
185 -- current.
186 -- A value of FALSE will be returned if all of the primary key arguments
187 -- have a null value (this indicates that the row has not be inserted into
188 -- the Schema), and therefore could never have a corresponding row.
189 --
190 -- Post Failure:
191 -- A failure can only occur under two circumstances:
192 -- 1) The primary key is invalid (i.e. a row does not exist for the
193 -- specified primary key values).
194 -- 2) If an object_version_number exists but is NOT the same as the current
195 -- g_old_rec value.
196 --
197 -- Developer Implementation Notes:
198 -- None.
199 --
200 -- Access Status:
201 -- Internal Development Use Only.
202 --
203 -- {End Of Comments}
204 -- ----------------------------------------------------------------------------
205 Function api_updating
206 (p_effective_date in date,
207 p_emp_fed_tax_inf_id in number,
208 p_object_version_number in number
209 ) Return Boolean;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |--------------------------< find_dt_del_modes >---------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 -- This procedure is used to determine what datetrack delete modes are
218 -- allowed as of the effective date for this entity. The procedure will
219 -- return a corresponding Boolean value for each of the delete modes
220 -- available where TRUE indicates that the corresponding delete mode is
221 -- available.
222 --
223 -- Prerequisites:
224 -- None.
225 --
226 -- In Parameters:
227 -- p_effective_date
228 -- Specifies the date at which the datetrack modes will be operated on.
229 -- p_base_key_value
230 -- Specifies the primary key value for this datetrack entity.
231 -- (E.g. For this entity the assignment of the argument would be:
232 -- p_base_key_value = :emp_fed_tax_inf_id).
233 --
234 -- Post Success:
235 -- Processing continues.
236 --
237 -- Post Failure:
238 -- Failure might occur if for the specified effective date and primary key
239 -- value a row doesn't exist.
240 --
241 -- Developer Implementation Notes:
242 -- This procedure could require changes if this entity has any sepcific
243 -- delete restrictions.
244 -- For example, this entity might disallow the datetrack delete mode of
245 -- ZAP. To implement this you would have to set and return a Boolean value
246 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
247 --
248 -- Access Status:
249 -- Internal Development Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure find_dt_del_modes
254 (p_effective_date in date,
255 p_base_key_value in number,
256 p_zap out nocopy boolean,
257 p_delete out nocopy boolean,
258 p_future_change out nocopy boolean,
259 p_delete_next_change out nocopy boolean);
260 --
261 -- ----------------------------------------------------------------------------
262 -- |--------------------------< find_dt_upd_modes >---------------------------|
263 -- ----------------------------------------------------------------------------
264 -- {Start Of Comments}
265 --
266 -- Description:
267 -- This procedure is used to determine what datetrack update modes are
268 -- allowed as of the effective date for this entity. The procedure will
269 -- return a corresponding Boolean value for each of the update modes
270 -- available where TRUE indicates that the corresponding update mode
271 -- is available.
272 --
273 -- Prerequisites:
274 -- None.
275 --
276 -- In Parameters:
277 -- p_effective_date
278 -- Specifies the date at which the datetrack modes will be operated on.
279 -- p_base_key_value
280 -- Specifies the primary key value for this datetrack entity.
281 -- (E.g. For this entity the assignment of the argument would be:
282 -- p_base_key_value = :emp_fed_tax_inf_id).
283 --
284 -- Post Success:
285 -- Processing continues.
286 --
287 -- Post Failure:
288 -- Failure might occur if for the specified effective date and primary key
289 -- value a row doesn't exist.
290 --
291 -- Developer Implementation Notes:
292 -- This procedure could require changes if this entity has any sepcific
293 -- delete restrictions.
294 -- For example, this entity might disallow the datetrack update mode of
295 -- UPDATE. To implement this you would have to set and return a Boolean
296 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
297 --
298 -- Access Status:
299 -- Internal Development Use Only.
300 --
301 -- {End Of Comments}
302 -- ----------------------------------------------------------------------------
303 Procedure find_dt_upd_modes
304 (p_effective_date in date,
305 p_base_key_value in number,
306 p_correction out nocopy boolean,
307 p_update out nocopy boolean,
308 p_update_override out nocopy boolean,
309 p_update_change_insert out nocopy boolean);
310 --
311 -- ----------------------------------------------------------------------------
312 -- |------------------------< upd_effective_end_date >------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description:
317 -- This procedure will update the specified datetrack row with the
318 -- specified new effective end date. The object version number is also
319 -- set to the next object version number. DateTrack modes which call
323 -- not be modified in anyway.
320 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
321 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
322 -- This is an internal datetrack maintenance procedure which should
324 --
325 -- Prerequisites:
326 -- None.
327 --
328 -- In Parameters:
329 -- p_new_effective_end_date
330 -- Specifies the new effective end date which will be set for the
331 -- row as of the effective date.
332 -- p_base_key_value
333 -- Specifies the primary key value for this datetrack entity.
334 -- (E.g. For this entity the assignment of the argument would be:
335 -- p_base_key_value = :emp_fed_tax_inf_id).
336 --
337 -- Post Success:
338 -- The specified row will be updated with the new effective end date and
339 -- object_version_number.
340 --
341 -- Post Failure:
342 -- Failure might occur if for the specified effective date and primary key
343 -- value a row doesn't exist.
344 --
345 -- Developer Implementation Notes:
346 -- This is an internal datetrack maintenance procedure which should
347 -- not be modified in anyway.
348 --
349 -- Access Status:
350 -- Internal Row Handler Use Only.
351 --
352 -- {End Of Comments}
353 -- ----------------------------------------------------------------------------
354 Procedure upd_effective_end_date
355 (p_effective_date in date,
356 p_base_key_value in number,
357 p_new_effective_end_date in date,
358 p_validation_start_date in date,
359 p_validation_end_date in date,
360 p_object_version_number out nocopy number);
361 --
362 -- ----------------------------------------------------------------------------
363 -- |---------------------------------< lck >----------------------------------|
364 -- ----------------------------------------------------------------------------
365 -- {Start Of Comments}
366 --
367 -- Description:
368 -- The Lck process for datetrack is complicated and comprises of the
369 -- following processing
370 -- The processing steps are as follows:
371 -- 1) The row to be updated or deleted must be locked.
372 -- By locking this row, the g_old_rec record data type is populated.
373 -- 2) If a comment exists the text is selected from hr_comments.
374 -- 3) The datetrack mode is then validated to ensure the operation is
375 -- valid. If the mode is valid the validation start and end dates for
376 -- the mode will be derived and returned. Any required locking is
377 -- completed when the datetrack mode is validated.
378 --
379 -- Prerequisites:
380 -- When attempting to call the lck procedure the object version number,
381 -- primary key, effective date and datetrack mode must be specified.
382 --
383 -- In Parameters:
384 -- p_effective_date
385 -- Specifies the date of the datetrack update operation.
386 -- p_datetrack_mode
387 -- Determines the datetrack update or delete mode.
388 --
389 -- Post Success:
390 -- On successful completion of the Lck process the row to be updated or
391 -- deleted will be locked and selected into the global data structure
392 -- g_old_rec.
393 --
394 -- Post Failure:
395 -- The Lck process can fail for three reasons:
396 -- 1) When attempting to lock the row the row could already be locked by
397 -- another user. This will raise the HR_Api.Object_Locked exception.
398 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
399 -- This error is trapped and reported using the message name
400 -- 'HR_7220_INVALID_PRIMARY_KEY'.
401 -- 3) The row although existing in the HR Schema has a different object
402 -- version number than the object version number specified.
403 -- This error is trapped and reported using the message name
404 -- 'HR_7155_OBJECT_INVALID'.
405 --
406 -- Developer Implementation Notes:
407 -- None.
408 --
409 -- Access Status:
410 -- Internal Development Use Only.
411 --
412 -- {End Of Comments}
413 -- ----------------------------------------------------------------------------
414 Procedure lck
415 (
416 p_effective_date in date,
417 p_datetrack_mode in varchar2,
418 p_emp_fed_tax_inf_id in number,
419 p_object_version_number in number,
420 p_validation_start_date out nocopy date,
421 p_validation_end_date out nocopy date);
422 --
423 -- ----------------------------------------------------------------------------
424 -- |-----------------------------< convert_args >-----------------------------|
425 -- ----------------------------------------------------------------------------
426 -- {Start Of Comments}
427 --
428 -- Description:
429 -- This function is used to turn attribute parameters into the record
430 -- structure parameter g_rec_type.
431 --
432 -- Prerequisites:
433 -- This is a private function and can only be called from the ins or upd
434 -- attribute processes.
435 --
436 -- In Parameters:
437 --
438 -- Post Success:
439 -- A returning record structure will be returned.
440 --
441 -- Post Failure:
442 -- No direct error handling is required within this function. Any possible
443 -- errors within this function will be a PL/SQL value error due to conversion
444 -- of datatypes or data lengths.
445 --
446 -- Developer Implementation Notes:
447 -- None.
448 --
452 -- {End Of Comments}
449 -- Access Status:
450 -- Internal Row Handler Use Only.
451 --
453 -- ----------------------------------------------------------------------------
454 Function convert_args
455 (
456 p_emp_fed_tax_inf_id in number,
457 p_effective_start_date in date,
458 p_effective_end_date in date,
459 p_legislation_code in varchar2,
460 p_assignment_id in number,
461 p_business_group_id in number,
462 p_employment_province in varchar2,
463 p_tax_credit_amount in number,
464 p_claim_code in varchar2,
465 p_basic_exemption_flag in varchar2,
466 p_additional_tax in number,
467 p_annual_dedn in number,
468 p_total_expense_by_commission in number,
469 p_total_remnrtn_by_commission in number,
470 p_prescribed_zone_dedn_amt in number,
471 p_other_fedtax_credits in varchar2,
472 p_cpp_qpp_exempt_flag in varchar2,
473 p_fed_exempt_flag in varchar2,
474 p_ei_exempt_flag in varchar2,
475 p_tax_calc_method in varchar2,
476 p_fed_override_amount in number,
477 p_fed_override_rate in number,
478 p_ca_tax_information_category in varchar2,
479 p_ca_tax_information1 in varchar2,
480 p_ca_tax_information2 in varchar2,
481 p_ca_tax_information3 in varchar2,
482 p_ca_tax_information4 in varchar2,
483 p_ca_tax_information5 in varchar2,
484 p_ca_tax_information6 in varchar2,
485 p_ca_tax_information7 in varchar2,
486 p_ca_tax_information8 in varchar2,
487 p_ca_tax_information9 in varchar2,
488 p_ca_tax_information10 in varchar2,
489 p_ca_tax_information11 in varchar2,
490 p_ca_tax_information12 in varchar2,
491 p_ca_tax_information13 in varchar2,
492 p_ca_tax_information14 in varchar2,
493 p_ca_tax_information15 in varchar2,
494 p_ca_tax_information16 in varchar2,
495 p_ca_tax_information17 in varchar2,
496 p_ca_tax_information18 in varchar2,
497 p_ca_tax_information19 in varchar2,
498 p_ca_tax_information20 in varchar2,
499 p_ca_tax_information21 in varchar2,
500 p_ca_tax_information22 in varchar2,
501 p_ca_tax_information23 in varchar2,
502 p_ca_tax_information24 in varchar2,
503 p_ca_tax_information25 in varchar2,
504 p_ca_tax_information26 in varchar2,
505 p_ca_tax_information27 in varchar2,
506 p_ca_tax_information28 in varchar2,
507 p_ca_tax_information29 in varchar2,
508 p_ca_tax_information30 in varchar2,
509 p_object_version_number in number,
510 p_fed_lsf_amount in number
511 )
512 Return g_rec_type;
513 --
514 end pay_cft_shd;