DBA Data[Home] [Help]

PACKAGE: APPS.PAY_CPT_SHD

Source


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