DBA Data[Home] [Help]

PACKAGE: APPS.PAY_CFT_SHD

Source


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