DBA Data[Home] [Help]

PACKAGE: APPS.HR_CLE_SHD

Source


1 Package hr_cle_shd as
2 /* $Header: hrclerhi.pkh 120.0 2005/05/30 23:14:31 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (soc_ins_contr_lvls_id           number(15)
10   ,organization_id                 number(15)
11   ,normal_percentage               number(11,2)       -- Increased length
12   ,normal_amount                   number(22,2)
13   ,increased_percentage            number(11,2)       -- Increased length
14   ,increased_amount                number(22,2)
15   ,reduced_percentage              number(11,2)       -- Increased length
16   ,reduced_amount                  number(22,2)
17   ,effective_start_date            date
18   ,effective_end_date              date
19   ,attribute_category              varchar2(30)
20   ,attribute1                      varchar2(150)
21   ,attribute2                      varchar2(150)
22   ,attribute3                      varchar2(150)
23   ,attribute4                      varchar2(150)
24   ,attribute5                      varchar2(150)
25   ,attribute6                      varchar2(150)
26   ,attribute7                      varchar2(150)
27   ,attribute8                      varchar2(150)
28   ,attribute9                      varchar2(150)
29   ,attribute10                     varchar2(150)
30   ,attribute11                     varchar2(150)
31   ,attribute12                     varchar2(150)
32   ,attribute13                     varchar2(150)
33   ,attribute14                     varchar2(150)
34   ,attribute15                     varchar2(150)
35   ,attribute16                     varchar2(150)
36   ,attribute17                     varchar2(150)
37   ,attribute18                     varchar2(150)
38   ,attribute19                     varchar2(150)
39   ,attribute20                     varchar2(150)
40   ,object_version_number           number(9)
41   ,attribute21                     varchar2(150)
42   ,attribute22                     varchar2(150)
43   ,attribute23                     varchar2(150)
44   ,attribute24                     varchar2(150)
45   ,attribute25                     varchar2(150)
46   ,attribute26                     varchar2(150)
47   ,attribute27                     varchar2(150)
48   ,attribute28                     varchar2(150)
49   ,attribute29                     varchar2(150)
50   ,attribute30                     varchar2(150)
51   ,flat_tax_limit_per_month	   number(11,2) --
52   ,flat_tax_limit_per_year	   number(11,2)
53   ,min_increased_contribution	   number(11,2)
54   ,max_increased_contribution	   number(11,2)
55   ,month1			   varchar2(30)
56   ,month1_min_contribution	   number(11,2)
57   ,month1_max_contribution	   number(11,2)
58   ,month2			   varchar2(30)
59   ,month2_min_contribution	   number(11,2)
60   ,month2_max_contribution	   number(11,2)
61   ,employee_contribution	   number(11,2)
62   ,contribution_level_type  		   varchar2(30)
63   );
64 --
65 -- ----------------------------------------------------------------------------
66 -- |           Global Definitions - Internal Development Use Only             |
67 -- ----------------------------------------------------------------------------
68 --
69 g_old_rec  g_rec_type;                            -- Global record definition
70 --
71 -- ----------------------------------------------------------------------------
72 -- |---------------------------< constraint_error >---------------------------|
73 -- ----------------------------------------------------------------------------
74 -- {Start Of Comments}
75 --
76 -- Description:
77 --   This procedure is called when a constraint has been violated (i.e.
78 --   The exception hr_api.check_integrity_violated,
79 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
80 --   hr_api.unique_integrity_violated has been raised).
81 --   The exceptions can only be raised as follows:
82 --   1) A check constraint can only be violated during an INSERT or UPDATE
83 --      dml operation.
84 --   2) A parent integrity constraint can only be violated during an
85 --      INSERT or UPDATE dml operation.
86 --   3) A child integrity constraint can only be violated during an
87 --      DELETE dml operation.
88 --   4) A unique integrity constraint can only be violated during INSERT or
89 --      UPDATE dml operation.
90 --
91 -- Prerequisites:
92 --   1) Either hr_api.check_integrity_violated,
93 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
94 --      hr_api.unique_integrity_violated has been raised with the subsequent
95 --      stripping of the constraint name from the generated error message
96 --      text.
97 --   2) Standalone validation test which corresponds with a constraint error.
98 --
99 -- In Parameter:
100 --   p_constraint_name is in upper format and is just the constraint name
101 --   (e.g. not prefixed by brackets, schema owner etc).
102 --
103 -- Post Success:
104 --   Development dependant.
105 --
106 -- Post Failure:
107 --   Developement dependant.
108 --
109 -- Developer Implementation Notes:
110 --   For each constraint being checked the hr system package failure message
111 --   has been generated as a template only. These system error messages should
112 --   be modified as required (i.e. change the system failure message to a user
113 --   friendly defined error message).
114 --
115 -- Access Status:
116 --   Internal Development Use Only.
117 --
118 -- {End Of Comments}
119 -- ----------------------------------------------------------------------------
120 Procedure constraint_error
121   (p_constraint_name in all_constraints.constraint_name%TYPE);
122 --
123 -- ----------------------------------------------------------------------------
124 -- |-----------------------------< api_updating >-----------------------------|
125 -- ----------------------------------------------------------------------------
126 --  {Start Of Comments}
127 --
128 -- Description:
129 --   This function is used to populate the g_old_rec record with the
130 --   current row from the database for the specified primary key
131 --   provided that the primary key exists and is valid and does not
132 --   already match the current g_old_rec. The function will always return
133 --   a TRUE value if the g_old_rec is populated with the current row.
134 --   A FALSE value will be returned if all of the primary key arguments
135 --   are null.
136 --
137 -- Prerequisites:
138 --   None.
139 --
140 -- In Parameters:
141 --
142 -- Post Success:
143 --   A value of TRUE will be returned indiciating that the g_old_rec
144 --   is current.
145 --   A value of FALSE will be returned if all of the primary key arguments
146 --   have a null value (this indicates that the row has not be inserted into
147 --   the Schema), and therefore could never have a corresponding row.
148 --
149 -- Post Failure:
150 --   A failure can only occur under two circumstances:
151 --   1) The primary key is invalid (i.e. a row does not exist for the
152 --      specified primary key values).
153 --   2) If an object_version_number exists but is NOT the same as the current
154 --      g_old_rec value.
155 --
156 -- Developer Implementation Notes:
157 --   None.
158 --
159 -- Access Status:
160 --   Internal Development Use Only.
161 --
162 -- {End Of Comments}
163 -- ----------------------------------------------------------------------------
164 Function api_updating
165   (p_effective_date                   in date
166   ,p_soc_ins_contr_lvls_id            in number
167   ,p_object_version_number            in number
168   ) Return Boolean;
169 --
170 -- ----------------------------------------------------------------------------
171 -- |---------------------------< find_dt_upd_modes >--------------------------|
172 -- ----------------------------------------------------------------------------
173 -- {Start Of Comments}
174 --
175 -- Description:
176 --   This procedure is used to determine what datetrack update modes are
177 --   allowed as of the effective date for this entity. The procedure will
178 --   return a corresponding Boolean value for each of the update modes
179 --   available where TRUE indicates that the corresponding update mode
180 --   is available.
181 --
182 -- Prerequisites:
183 --   None.
184 --
185 -- In Parameters:
186 --   p_effective_date
187 --     Specifies the date at which the datetrack modes will be operated on.
188 --   p_base_key_value
189 --     Specifies the primary key value for this datetrack entity.
190 --     (E.g. For this entity the assignment of the argument would be:
191 --           p_base_key_value = :soc_ins_contr_lvls_id).
192 --
193 -- Post Success:
194 --   Processing continues.
195 --
196 -- Post Failure:
197 --   Failure might occur if for the specified effective date and primary key
198 --   value a row doesn't exist.
199 --
200 -- Developer Implementation Notes:
201 --   This procedure could require changes if this entity has any sepcific
202 --   delete restrictions.
203 --   For example, this entity might disallow the datetrack update mode of
204 --   UPDATE. To implement this you would have to set and return a Boolean
205 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
206 --
207 -- Access Status:
208 --   Internal Development Use Only.
209 --
210 -- {End Of Comments}
211 -- ----------------------------------------------------------------------------
212 Procedure find_dt_upd_modes
213   (p_effective_date         in date
214   ,p_base_key_value         in number
215   ,p_correction             out nocopy boolean
216   ,p_update                 out nocopy boolean
217   ,p_update_override        out nocopy boolean
218   ,p_update_change_insert   out nocopy boolean
219   );
220 --
221 -- ----------------------------------------------------------------------------
222 -- |---------------------------< find_dt_del_modes >--------------------------|
223 -- ----------------------------------------------------------------------------
224 -- {Start Of Comments}
225 --
226 -- Description:
227 --   This procedure is used to determine what datetrack delete modes are
228 --   allowed as of the effective date for this entity. The procedure will
229 --   return a corresponding Boolean value for each of the delete modes
230 --   available where TRUE indicates that the corresponding delete mode is
231 --   available.
232 --
233 -- Prerequisites:
234 --   None.
235 --
236 -- In Parameters:
237 --   p_effective_date
238 --     Specifies the date at which the datetrack modes will be operated on.
239 --   p_base_key_value
240 --     Specifies the primary key value for this datetrack entity.
241 --     (E.g. For this entity the assignment of the argument would be:
242 --           p_base_key_value = :soc_ins_contr_lvls_id).
243 --
244 -- Post Success:
245 --   Processing continues.
246 --
247 -- Post Failure:
248 --   Failure might occur if for the specified effective date and primary key
249 --   value a row doesn't exist.
250 --
251 -- Developer Implementation Notes:
252 --   This procedure could require changes if this entity has any sepcific
253 --   delete restrictions.
254 --   For example, this entity might disallow the datetrack delete mode of
255 --   ZAP. To implement this you would have to set and return a Boolean value
256 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
257 --
258 -- Access Status:
259 --   Internal Development Use Only.
260 --
261 -- {End Of Comments}
262 -- ----------------------------------------------------------------------------
263 Procedure find_dt_del_modes
264   (p_effective_date        in date
265   ,p_base_key_value        in number
266   ,p_zap                   out nocopy boolean
267   ,p_delete                out nocopy boolean
268   ,p_future_change         out nocopy boolean
269   ,p_delete_next_change    out nocopy boolean
270   );
271 --
272 -- ----------------------------------------------------------------------------
273 -- |-----------------------< upd_effective_end_date >-------------------------|
274 -- ----------------------------------------------------------------------------
275 -- {Start Of Comments}
276 --
277 -- Description:
278 --   This procedure will update the specified datetrack row with the
279 --   specified new effective end date. The object version number is also
280 --   set to the next object version number. DateTrack modes which call
281 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
282 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
283 --   This is an internal datetrack maintenance procedure which should
284 --   not be modified in anyway.
285 --
286 -- Prerequisites:
287 --   None.
288 --
289 -- In Parameters:
290 --   p_new_effective_end_date
291 --     Specifies the new effective end date which will be set for the
292 --     row as of the effective date.
293 --   p_base_key_value
294 --     Specifies the primary key value for this datetrack entity.
295 --     (E.g. For this entity the assignment of the argument would be:
296 --           p_base_key_value = :soc_ins_contr_lvls_id).
297 --
298 -- Post Success:
299 --   The specified row will be updated with the new effective end date and
300 --   object_version_number.
301 --
302 -- Post Failure:
303 --   Failure might occur if for the specified effective date and primary key
304 --   value a row doesn't exist.
305 --
306 -- Developer Implementation Notes:
307 --   This is an internal datetrack maintenance procedure which should
308 --   not be modified in anyway.
309 --
310 -- Access Status:
311 --   Internal Row Handler Use Only.
312 --
313 -- {End Of Comments}
314 -- ----------------------------------------------------------------------------
315 Procedure upd_effective_end_date
316   (p_effective_date         in date
317   ,p_base_key_value         in number
318   ,p_new_effective_end_date in date
319   ,p_validation_start_date  in date
320   ,p_validation_end_date    in date
321   ,p_object_version_number  out nocopy number
322   );
323 --
324 -- ----------------------------------------------------------------------------
325 -- |---------------------------------< lck >----------------------------------|
326 -- ----------------------------------------------------------------------------
327 -- {Start Of Comments}
328 --
329 -- Description:
330 --   The Lck process for datetrack is complicated and comprises of the
331 --   following processing
332 --   The processing steps are as follows:
333 --   1) The row to be updated or deleted must be locked.
334 --      By locking this row, the g_old_rec record data type is populated.
335 --   2) If a comment exists the text is selected from hr_comments.
336 --   3) The datetrack mode is then validated to ensure the operation is
337 --      valid. If the mode is valid the validation start and end dates for
338 --      the mode will be derived and returned. Any required locking is
339 --      completed when the datetrack mode is validated.
340 --
341 -- Prerequisites:
345 -- In Parameters:
342 --   When attempting to call the lck procedure the object version number,
343 --   primary key, effective date and datetrack mode must be specified.
344 --
346 --   p_effective_date
347 --     Specifies the date of the datetrack update operation.
348 --   p_datetrack_mode
349 --     Determines the datetrack update or delete mode.
350 --
351 -- Post Success:
352 --   On successful completion of the Lck process the row to be updated or
353 --   deleted will be locked and selected into the global data structure
354 --   g_old_rec.
355 --
356 -- Post Failure:
357 --   The Lck process can fail for three reasons:
358 --   1) When attempting to lock the row the row could already be locked by
359 --      another user. This will raise the HR_Api.Object_Locked exception.
360 --   2) The row which is required to be locked doesn't exist in the HR Schema.
361 --      This error is trapped and reported using the message name
362 --      'HR_7220_INVALID_PRIMARY_KEY'.
363 --   3) The row although existing in the HR Schema has a different object
364 --      version number than the object version number specified.
365 --      This error is trapped and reported using the message name
366 --      'HR_7155_OBJECT_INVALID'.
367 --
368 -- Developer Implementation Notes:
369 --   None.
370 --
371 -- Access Status:
372 --   Internal Development Use Only.
373 --
374 -- {End Of Comments}
375 -- ----------------------------------------------------------------------------
376 Procedure lck
377   (p_effective_date                   in date
378   ,p_datetrack_mode                   in varchar2
379   ,p_soc_ins_contr_lvls_id            in number
380   ,p_object_version_number            in number
381   ,p_validation_start_date            out nocopy date
382   ,p_validation_end_date              out nocopy date
383   );
384 --
385 -- ----------------------------------------------------------------------------
386 -- |-----------------------------< convert_args >-----------------------------|
387 -- ----------------------------------------------------------------------------
388 -- {Start Of Comments}
389 --
390 -- Description:
391 --   This function is used to turn attribute parameters into the record
392 --   structure parameter g_rec_type.
393 --
394 -- Prerequisites:
395 --   This is a private function and can only be called from the ins or upd
396 --   attribute processes.
397 --
398 -- In Parameters:
399 --
400 -- Post Success:
401 --   A returning record structure will be returned.
402 --
403 -- Post Failure:
404 --   No direct error handling is required within this function.  Any possible
405 --   errors within this function will be a PL/SQL value error due to
406 --   conversion of datatypes or data lengths.
407 --
408 -- Developer Implementation Notes:
409 --   None.
410 --
411 -- Access Status:
412 --   Internal Row Handler Use Only.
413 --
414 -- {End Of Comments}
415 -- ----------------------------------------------------------------------------
416 Function convert_args
417   (p_soc_ins_contr_lvls_id          in number
418   ,p_organization_id                in number
419   ,p_normal_percentage              in number
420   ,p_normal_amount                  in number
421   ,p_increased_percentage           in number
422   ,p_increased_amount               in number
423   ,p_reduced_percentage             in number
424   ,p_reduced_amount                 in number
425   ,p_effective_start_date           in date
426   ,p_effective_end_date             in date
427   ,p_attribute_category             in varchar2
428   ,p_attribute1                     in varchar2
429   ,p_attribute2                     in varchar2
430   ,p_attribute3                     in varchar2
431   ,p_attribute4                     in varchar2
432   ,p_attribute5                     in varchar2
433   ,p_attribute6                     in varchar2
434   ,p_attribute7                     in varchar2
435   ,p_attribute8                     in varchar2
436   ,p_attribute9                     in varchar2
437   ,p_attribute10                    in varchar2
438   ,p_attribute11                    in varchar2
439   ,p_attribute12                    in varchar2
440   ,p_attribute13                    in varchar2
441   ,p_attribute14                    in varchar2
442   ,p_attribute15                    in varchar2
443   ,p_attribute16                    in varchar2
444   ,p_attribute17                    in varchar2
445   ,p_attribute18                    in varchar2
446   ,p_attribute19                    in varchar2
447   ,p_attribute20                    in varchar2
448   ,p_object_version_number          in number
449   ,p_attribute21                    in varchar2
450   ,p_attribute22                    in varchar2
451   ,p_attribute23                    in varchar2
452   ,p_attribute24                    in varchar2
453   ,p_attribute25                    in varchar2
454   ,p_attribute26                    in varchar2
455   ,p_attribute27                    in varchar2
456   ,p_attribute28                    in varchar2
457   ,p_attribute29                    in varchar2
458   ,p_attribute30                    in varchar2
459   ,p_flat_tax_limit_per_month	    in number
460   ,p_flat_tax_limit_per_year	    in number
461   ,p_min_increased_contribution     in number
462   ,p_max_increased_contribution     in number
463   ,p_month1			    in varchar2
467   ,p_month2_min_contribution        in number
464   ,p_month1_min_contribution        in number
465   ,p_month1_max_contribution        in number
466   ,p_month2			    in varchar2
468   ,p_month2_max_contribution        in number
469   ,p_employee_contribution	    in number
470   ,p_contribution_level_type  		    in varchar2
471   )
472   Return g_rec_type;
473 --
474 end hr_cle_shd;