DBA Data[Home] [Help]

PACKAGE: APPS.PAY_PEL_SHD

Source


1 Package pay_pel_shd as
2 /* $Header: pypelrhi.pkh 120.2.12010000.1 2008/07/27 23:21:57 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (element_link_id                 number(9)
10   ,effective_start_date            date
11   ,effective_end_date              date
12   ,payroll_id                      number(9)
13   ,job_id                          number(15)
14   ,position_id                     number(15)
15   ,people_group_id                 number(15)
16   ,cost_allocation_keyflex_id      number(9)
17   ,organization_id                 number(15)
18   ,element_type_id                 number(9)
19   ,location_id                     number(15)
20   ,grade_id                        number(15)
21   ,balancing_keyflex_id            number(9)
22   ,business_group_id               number(15)
23   ,element_set_id                  number(9)
24   ,pay_basis_id                    number(9)
25   ,costable_type                   varchar2(30)
26   ,link_to_all_payrolls_flag       varchar2(30)
27   ,multiply_value_flag             varchar2(30)
28   ,standard_link_flag              varchar2(30)
29   ,transfer_to_gl_flag             varchar2(30)
30   ,comment_id                      number(15)
31   ,comments                        varchar2(2000)    -- pseudo column
32   ,employment_category             varchar2(30)
33   ,qualifying_age                  number(9)         -- Increased length
34   ,qualifying_length_of_service    number(11,2)      -- Increased length
35   ,qualifying_units                varchar2(30)
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   ,object_version_number           number(9)
58   );
59 --
60 -- ----------------------------------------------------------------------------
61 -- |           Global Definitions - Internal Development Use Only             |
62 -- ----------------------------------------------------------------------------
63 --
64 g_old_rec  g_rec_type;                            -- Global record definition
65 -- Global table name
66 g_tab_nam  constant varchar2(30) := 'PAY_ELEMENT_LINKS_F';
67 g_api_dml  boolean;                               -- Global api dml status
68 --
69 -- ----------------------------------------------------------------------------
70 -- |------------------------< return_api_dml_status >-------------------------|
71 -- ----------------------------------------------------------------------------
72 -- {Start Of Comments}
73 --
74 -- Description:
75 --   This function will return the current g_api_dml private global
76 --   boolean status.
77 --   The g_api_dml status determines if at the time of the function
78 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
79 --   is being issued from within an api.
80 --   If the status is TRUE then a dml statement is being issued from
81 --   within this entity api.
82 --   This function is primarily to support database triggers which
83 --   need to maintain the object_version_number for non-supported
84 --   dml statements (i.e. dml statement issued outside of the api layer).
85 --
86 -- Prerequisites:
87 --   None.
88 --
89 -- In Parameters:
90 --   None.
91 --
92 -- Post Success:
93 --   Processing continues.
94 --   If the function returns a TRUE value then, dml is being executed from
95 --   within this api.
96 --
97 -- Post Failure:
98 --   None.
99 --
100 -- Access Status:
101 --   Internal Row Handler Use Only.
102 --
103 -- {End Of Comments}
104 -- ----------------------------------------------------------------------------
105 Function return_api_dml_status Return Boolean;
106 --
107 -- ----------------------------------------------------------------------------
108 -- |---------------------------< constraint_error >---------------------------|
109 -- ----------------------------------------------------------------------------
110 -- {Start Of Comments}
111 --
112 -- Description:
113 --   This procedure is called when a constraint has been violated (i.e.
114 --   The exception hr_api.check_integrity_violated,
115 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
116 --   hr_api.unique_integrity_violated has been raised).
117 --   The exceptions can only be raised as follows:
118 --   1) A check constraint can only be violated during an INSERT or UPDATE
119 --      dml operation.
120 --   2) A parent integrity constraint can only be violated during an
121 --      INSERT or UPDATE dml operation.
122 --   3) A child integrity constraint can only be violated during an
123 --      DELETE dml operation.
124 --   4) A unique integrity constraint can only be violated during INSERT or
125 --      UPDATE dml operation.
126 --
127 -- Prerequisites:
128 --   1) Either 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 with the subsequent
131 --      stripping of the constraint name from the generated error message
132 --      text.
133 --   2) Standalone validation test which corresponds with a constraint error.
134 --
135 -- In Parameter:
136 --   p_constraint_name is in upper format and is just the constraint name
137 --   (e.g. not prefixed by brackets, schema owner etc).
138 --
139 -- Post Success:
140 --   Development dependant.
141 --
142 -- Post Failure:
143 --   Developement dependant.
144 --
145 -- Developer Implementation Notes:
146 --   For each constraint being checked the hr system package failure message
147 --   has been generated as a template only. These system error messages should
148 --   be modified as required (i.e. change the system failure message to a user
149 --   friendly defined error message).
150 --
151 -- Access Status:
152 --   Internal Development Use Only.
153 --
154 -- {End Of Comments}
155 -- ----------------------------------------------------------------------------
156 Procedure constraint_error
157   (p_constraint_name in all_constraints.constraint_name%TYPE);
158 --
159 -- ----------------------------------------------------------------------------
160 -- |-----------------------------< api_updating >-----------------------------|
161 -- ----------------------------------------------------------------------------
162 --  {Start Of Comments}
163 --
164 -- Description:
165 --   This function is used to populate the g_old_rec record with the
166 --   current row from the database for the specified primary key
167 --   provided that the primary key exists and is valid and does not
168 --   already match the current g_old_rec. The function will always return
169 --   a TRUE value if the g_old_rec is populated with the current row.
170 --   A FALSE value will be returned if all of the primary key arguments
171 --   are null.
172 --
173 -- Prerequisites:
174 --   None.
175 --
176 -- In Parameters:
177 --
178 -- Post Success:
179 --   A value of TRUE will be returned indiciating that the g_old_rec
180 --   is current.
181 --   A value of FALSE will be returned if all of the primary key arguments
182 --   have a null value (this indicates that the row has not be inserted into
183 --   the Schema), and therefore could never have a corresponding row.
184 --
185 -- Post Failure:
186 --   A failure can only occur under two circumstances:
187 --   1) The primary key is invalid (i.e. a row does not exist for the
188 --      specified primary key values).
189 --   2) If an object_version_number exists but is NOT the same as the current
190 --      g_old_rec value.
191 --
192 -- Developer Implementation Notes:
193 --   None.
194 --
195 -- Access Status:
196 --   Internal Development Use Only.
197 --
198 -- {End Of Comments}
199 -- ----------------------------------------------------------------------------
200 Function api_updating
201   (p_effective_date                   in date
202   ,p_element_link_id                  in number
203   ,p_object_version_number            in number
204   ) Return Boolean;
205 --
206 -- ----------------------------------------------------------------------------
207 -- |---------------------------< find_dt_upd_modes >--------------------------|
208 -- ----------------------------------------------------------------------------
209 -- {Start Of Comments}
210 --
211 -- Description:
212 --   This procedure is used to determine what datetrack update modes are
213 --   allowed as of the effective date for this entity. The procedure will
214 --   return a corresponding Boolean value for each of the update modes
215 --   available where TRUE indicates that the corresponding update mode
216 --   is available.
217 --
218 -- Prerequisites:
219 --   None.
220 --
221 -- In Parameters:
222 --   p_effective_date
223 --     Specifies the date at which the datetrack modes will be operated on.
224 --   p_base_key_value
225 --     Specifies the primary key value for this datetrack entity.
226 --     (E.g. For this entity the assignment of the argument would be:
227 --           p_base_key_value = :element_link_id).
228 --
229 -- Post Success:
230 --   Processing continues.
231 --
232 -- Post Failure:
233 --   Failure might occur if for the specified effective date and primary key
234 --   value a row doesn't exist.
235 --
236 -- Developer Implementation Notes:
237 --   This procedure could require changes if this entity has any sepcific
238 --   delete restrictions.
239 --   For example, this entity might disallow the datetrack update mode of
240 --   UPDATE. To implement this you would have to set and return a Boolean
241 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
242 --
243 -- Access Status:
244 --   Internal Development Use Only.
245 --
246 -- {End Of Comments}
247 -- ----------------------------------------------------------------------------
248 Procedure find_dt_upd_modes
249   (p_effective_date         in date
250   ,p_base_key_value         in number
251   ,p_correction             out nocopy boolean
252   ,p_update                 out nocopy boolean
253   ,p_update_override        out nocopy boolean
254   ,p_update_change_insert   out nocopy boolean
255   );
256 --
257 -- ----------------------------------------------------------------------------
258 -- |---------------------------< find_dt_del_modes >--------------------------|
259 -- ----------------------------------------------------------------------------
260 -- {Start Of Comments}
261 --
262 -- Description:
263 --   This procedure is used to determine what datetrack delete modes are
264 --   allowed as of the effective date for this entity. The procedure will
265 --   return a corresponding Boolean value for each of the delete modes
266 --   available where TRUE indicates that the corresponding delete mode is
267 --   available.
268 --
269 -- Prerequisites:
270 --   None.
271 --
272 -- In Parameters:
273 --   p_effective_date
274 --     Specifies the date at which the datetrack modes will be operated on.
275 --   p_base_key_value
276 --     Specifies the primary key value for this datetrack entity.
277 --     (E.g. For this entity the assignment of the argument would be:
278 --           p_base_key_value = :element_link_id).
279 --
280 -- Post Success:
281 --   Processing continues.
282 --
283 -- Post Failure:
284 --   Failure might occur if for the specified effective date and primary key
285 --   value a row doesn't exist.
286 --
287 -- Developer Implementation Notes:
288 --   This procedure could require changes if this entity has any sepcific
289 --   delete restrictions.
290 --   For example, this entity might disallow the datetrack delete mode of
291 --   ZAP. To implement this you would have to set and return a Boolean value
292 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
293 --
294 -- Access Status:
295 --   Internal Development Use Only.
296 --
297 -- {End Of Comments}
298 -- ----------------------------------------------------------------------------
299 Procedure find_dt_del_modes
300   (p_effective_date        in date
301   ,p_base_key_value        in number
302   ,p_zap                   out nocopy boolean
303   ,p_delete                out nocopy boolean
304   ,p_future_change         out nocopy boolean
305   ,p_delete_next_change    out nocopy boolean
306   );
307 --
308 -- ----------------------------------------------------------------------------
309 -- |-----------------------< upd_effective_end_date >-------------------------|
310 -- ----------------------------------------------------------------------------
311 -- {Start Of Comments}
312 --
313 -- Description:
314 --   This procedure will update the specified datetrack row with the
315 --   specified new effective end date. The object version number is also
316 --   set to the next object version number. DateTrack modes which call
317 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
318 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
319 --   This is an internal datetrack maintenance procedure which should
320 --   not be modified in anyway.
321 --
322 -- Prerequisites:
323 --   None.
324 --
325 -- In Parameters:
326 --   p_new_effective_end_date
327 --     Specifies the new effective end date which will be set for the
328 --     row as of the effective date.
329 --   p_base_key_value
330 --     Specifies the primary key value for this datetrack entity.
331 --     (E.g. For this entity the assignment of the argument would be:
332 --           p_base_key_value = :element_link_id).
333 --
334 -- Post Success:
335 --   The specified row will be updated with the new effective end date and
336 --   object_version_number.
337 --
338 -- Post Failure:
339 --   Failure might occur if for the specified effective date and primary key
340 --   value a row doesn't exist.
341 --
342 -- Developer Implementation Notes:
343 --   This is an internal datetrack maintenance procedure which should
344 --   not be modified in anyway.
345 --
346 -- Access Status:
347 --   Internal Row Handler Use Only.
348 --
349 -- {End Of Comments}
350 -- ----------------------------------------------------------------------------
351 Procedure upd_effective_end_date
352   (p_effective_date         in date
353   ,p_base_key_value         in number
354   ,p_new_effective_end_date in date
355   ,p_validation_start_date  in date
356   ,p_validation_end_date    in date
357   ,p_object_version_number  out nocopy number
358   );
359 --
360 -- ----------------------------------------------------------------------------
361 -- |---------------------------------< lck >----------------------------------|
362 -- ----------------------------------------------------------------------------
363 -- {Start Of Comments}
364 --
365 -- Description:
366 --   The Lck process for datetrack is complicated and comprises of the
367 --   following processing
368 --   The processing steps are as follows:
369 --   1) The row to be updated or deleted must be locked.
370 --      By locking this row, the g_old_rec record data type is populated.
371 --   2) If a comment exists the text is selected from hr_comments.
372 --   3) The datetrack mode is then validated to ensure the operation is
373 --      valid. If the mode is valid the validation start and end dates for
374 --      the mode will be derived and returned. Any required locking is
375 --      completed when the datetrack mode is validated.
376 --
377 -- Prerequisites:
378 --   When attempting to call the lck procedure the object version number,
379 --   primary key, effective date and datetrack mode must be specified.
380 --
381 -- In Parameters:
382 --   p_effective_date
383 --     Specifies the date of the datetrack update operation.
384 --   p_datetrack_mode
385 --     Determines the datetrack update or delete mode.
386 --
387 -- Post Success:
388 --   On successful completion of the Lck process the row to be updated or
389 --   deleted will be locked and selected into the global data structure
390 --   g_old_rec.
391 --
392 -- Post Failure:
393 --   The Lck process can fail for three reasons:
394 --   1) When attempting to lock the row the row could already be locked by
395 --      another user. This will raise the HR_Api.Object_Locked exception.
396 --   2) The row which is required to be locked doesn't exist in the HR Schema.
397 --      This error is trapped and reported using the message name
398 --      'HR_7220_INVALID_PRIMARY_KEY'.
399 --   3) The row although existing in the HR Schema has a different object
400 --      version number than the object version number specified.
401 --      This error is trapped and reported using the message name
402 --      'HR_7155_OBJECT_INVALID'.
403 --
404 -- Developer Implementation Notes:
405 --   None.
406 --
407 -- Access Status:
408 --   Internal Development Use Only.
409 --
410 -- {End Of Comments}
411 -- ----------------------------------------------------------------------------
412 Procedure lck
413   (p_effective_date                   in date
414   ,p_datetrack_mode                   in varchar2
415   ,p_element_link_id                  in number
416   ,p_object_version_number            in number
417   ,p_enforce_foreign_locking          in boolean default true
418   ,p_validation_start_date            out nocopy date
419   ,p_validation_end_date              out nocopy date
420   );
421 --
422 -- ----------------------------------------------------------------------------
423 -- |-----------------------------< convert_args >-----------------------------|
424 -- ----------------------------------------------------------------------------
425 -- {Start Of Comments}
426 --
427 -- Description:
428 --   This function is used to turn attribute parameters into the record
429 --   structure parameter g_rec_type.
430 --
431 -- Prerequisites:
432 --   This is a private function and can only be called from the ins or upd
433 --   attribute processes.
434 --
435 -- In Parameters:
436 --
437 -- Post Success:
438 --   A returning record structure will be returned.
439 --
440 -- Post Failure:
441 --   No direct error handling is required within this function.  Any possible
442 --   errors within this function will be a PL/SQL value error due to
443 --   conversion of datatypes or data lengths.
444 --
445 -- Developer Implementation Notes:
446 --   None.
447 --
448 -- Access Status:
449 --   Internal Row Handler Use Only.
450 --
451 -- {End Of Comments}
452 -- ----------------------------------------------------------------------------
453 Function convert_args
454   (p_element_link_id                in number
455   ,p_effective_start_date           in date
456   ,p_effective_end_date             in date
457   ,p_payroll_id                     in number
458   ,p_job_id                         in number
459   ,p_position_id                    in number
460   ,p_people_group_id                in number
461   ,p_cost_allocation_keyflex_id     in number
462   ,p_organization_id                in number
463   ,p_element_type_id                in number
464   ,p_location_id                    in number
465   ,p_grade_id                       in number
466   ,p_balancing_keyflex_id           in number
467   ,p_business_group_id              in number
468   ,p_element_set_id                 in number
469   ,p_pay_basis_id                   in number
470   ,p_costable_type                  in varchar2
471   ,p_link_to_all_payrolls_flag      in varchar2
472   ,p_multiply_value_flag            in varchar2
473   ,p_standard_link_flag             in varchar2
474   ,p_transfer_to_gl_flag            in varchar2
475   ,p_comment_id                     in number
476   ,p_comments                       in varchar2
477   ,p_employment_category            in varchar2
478   ,p_qualifying_age                 in number
479   ,p_qualifying_length_of_service   in number
480   ,p_qualifying_units               in varchar2
481   ,p_attribute_category             in varchar2
482   ,p_attribute1                     in varchar2
483   ,p_attribute2                     in varchar2
484   ,p_attribute3                     in varchar2
485   ,p_attribute4                     in varchar2
486   ,p_attribute5                     in varchar2
487   ,p_attribute6                     in varchar2
488   ,p_attribute7                     in varchar2
489   ,p_attribute8                     in varchar2
490   ,p_attribute9                     in varchar2
491   ,p_attribute10                    in varchar2
492   ,p_attribute11                    in varchar2
493   ,p_attribute12                    in varchar2
494   ,p_attribute13                    in varchar2
495   ,p_attribute14                    in varchar2
496   ,p_attribute15                    in varchar2
497   ,p_attribute16                    in varchar2
498   ,p_attribute17                    in varchar2
499   ,p_attribute18                    in varchar2
500   ,p_attribute19                    in varchar2
501   ,p_attribute20                    in varchar2
502   ,p_object_version_number          in number
503   )
504   Return g_rec_type;
505 --
506 end pay_pel_shd;