DBA Data[Home] [Help]

PACKAGE: APPS.BEN_PRY_SHD

Source


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