DBA Data[Home] [Help]

PACKAGE: APPS.BEN_BPL_SHD

Source


1 Package ben_bpl_shd as
2 /* $Header: bebplrhi.pkh 120.0.12010000.1 2008/07/29 10:58:50 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   bnft_prvdd_ldgr_id                number(15),
11   effective_start_date              date,
12   effective_end_date                date,
13   prtt_ro_of_unusd_amt_flag         varchar2(9),      -- Increased length
14   frftd_val                         number,
15   prvdd_val                         number,
16   used_val                          number,
17   bnft_prvdr_pool_id                number(15),
18   acty_base_rt_id                   number(15),
19   per_in_ler_id                   number(15),
20   prtt_enrt_rslt_id                 number(15),
21   business_group_id                 number(15),
22   bpl_attribute_category            varchar2(30),
23   bpl_attribute1                    varchar2(150),
24   bpl_attribute2                    varchar2(150),
25   bpl_attribute3                    varchar2(150),
26   bpl_attribute4                    varchar2(150),
27   bpl_attribute5                    varchar2(150),
28   bpl_attribute6                    varchar2(150),
29   bpl_attribute7                    varchar2(150),
30   bpl_attribute8                    varchar2(150),
31   bpl_attribute9                    varchar2(150),
32   bpl_attribute10                   varchar2(150),
33   bpl_attribute11                   varchar2(150),
34   bpl_attribute12                   varchar2(150),
35   bpl_attribute13                   varchar2(150),
36   bpl_attribute14                   varchar2(150),
37   bpl_attribute15                   varchar2(150),
38   bpl_attribute16                   varchar2(150),
39   bpl_attribute17                   varchar2(150),
40   bpl_attribute18                   varchar2(150),
41   bpl_attribute19                   varchar2(150),
42   bpl_attribute20                   varchar2(150),
43   bpl_attribute21                   varchar2(150),
44   bpl_attribute22                   varchar2(150),
45   bpl_attribute23                   varchar2(150),
46   bpl_attribute24                   varchar2(150),
47   bpl_attribute25                   varchar2(150),
48   bpl_attribute26                   varchar2(150),
49   bpl_attribute27                   varchar2(150),
50   bpl_attribute28                   varchar2(150),
51   bpl_attribute29                   varchar2(150),
52   bpl_attribute30                   varchar2(150),
53   object_version_number             number(9),
54   cash_recd_val                     number,
55   rld_up_val                        number,
56   acty_ref_perd_cd                  varchar2(30),
57   cmcd_frftd_val                    number,
58   cmcd_prvdd_val                    number,
59   cmcd_rld_up_val                   number,
60   cmcd_used_val                     number,
61   cmcd_cash_recd_val                number,
62   cmcd_ref_perd_cd                  varchar2(30),
63   ann_frftd_val                     number,
64   ann_prvdd_val                     number,
65   ann_rld_up_val                    number,
66   ann_used_val                      number,
67   ann_cash_recd_val                 number
68   );
69 --
70 -- ----------------------------------------------------------------------------
71 -- |           Global Definitions - Internal Development Use Only             |
72 -- ----------------------------------------------------------------------------
73 --
74 g_old_rec  g_rec_type;                            -- Global record definition
75 g_api_dml  boolean;                               -- Global api dml status
76 --
77 -- ----------------------------------------------------------------------------
78 -- |------------------------< return_api_dml_status >-------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start Of Comments}
81 --
82 -- Description:
83 --   This function will return the current g_api_dml private global
84 --   boolean status.
85 --   The g_api_dml status determines if at the time of the function
86 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
87 --   is being issued from within an api.
88 --   If the status is TRUE then a dml statement is being issued from
89 --   within this entity api.
90 --   This function is primarily to support database triggers which
91 --   need to maintain the object_version_number for non-supported
92 --   dml statements (i.e. dml statement issued outside of the api layer).
93 --
94 -- Prerequisites:
95 --   None.
96 --
97 -- In Parameters:
98 --   None.
99 --
100 -- Post Success:
101 --   Processing continues.
102 --   If the function returns a TRUE value then, dml is being executed from
103 --   within this api.
104 --
105 -- Post Failure:
106 --   None.
107 --
108 -- Access Status:
109 --   Internal Row Handler Use Only.
110 --
111 -- {End Of Comments}
112 -- ----------------------------------------------------------------------------
113 Function return_api_dml_status Return Boolean;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |---------------------------< constraint_error >---------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 --   This procedure is called when a constraint has been violated (i.e.
122 --   The exception 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).
125 --   The exceptions can only be raised as follows:
126 --   1) A check constraint can only be violated during an INSERT or UPDATE
127 --      dml operation.
128 --   2) A parent integrity constraint can only be violated during an
129 --      INSERT or UPDATE dml operation.
130 --   3) A child integrity constraint can only be violated during an
131 --      DELETE dml operation.
132 --   4) A unique integrity constraint can only be violated during INSERT or
133 --      UPDATE dml operation.
134 --
135 -- Prerequisites:
136 --   1) Either hr_api.check_integrity_violated,
137 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
138 --      hr_api.unique_integrity_violated has been raised with the subsequent
139 --      stripping of the constraint name from the generated error message
140 --      text.
141 --   2) Standalone validation test which corresponds with a constraint error.
142 --
143 -- In Parameter:
144 --   p_constraint_name is in upper format and is just the constraint name
145 --   (e.g. not prefixed by brackets, schema owner etc).
146 --
147 -- Post Success:
148 --   Development dependant.
149 --
150 -- Post Failure:
151 --   Developement dependant.
152 --
153 -- Developer Implementation Notes:
154 --   For each constraint being checked the hr system package failure message
155 --   has been generated as a template only. These system error messages should
156 --   be modified as required (i.e. change the system failure message to a user
157 --   friendly defined error message).
158 --
159 -- Access Status:
160 --   Internal Development Use Only.
161 --
162 -- {End Of Comments}
163 -- ----------------------------------------------------------------------------
164 Procedure constraint_error
165             (p_constraint_name in all_constraints.constraint_name%TYPE);
166 --
167 -- ----------------------------------------------------------------------------
168 -- |-----------------------------< api_updating >-----------------------------|
169 -- ----------------------------------------------------------------------------
170 -- {Start Of Comments}
171 --
172 -- Description:
173 --   This function is used to populate the g_old_rec record with the current
174 --   row from the database for the specified primary key provided that the
175 --   primary key exists, and is valid, and does not already match the current
176 --   g_old_rec.
177 --   The function will always return a TRUE value if the g_old_rec is
178 --   populated with the current row. A FALSE value will be returned if all of
179 --   the primary key arguments are null.
180 --
181 -- Prerequisites:
182 --   None.
183 --
184 -- In Parameters:
185 --
186 -- Post Success:
187 --   A value of TRUE will be returned indiciating that the g_old_rec is
188 --   current.
189 --   A value of FALSE will be returned if all of the primary key arguments
190 --   have a null value (this indicates that the row has not be inserted into
191 --   the Schema), and therefore could never have a corresponding row.
192 --
193 -- Post Failure:
194 --   A failure can only occur under two circumstances:
195 --   1) The primary key is invalid (i.e. a row does not exist for the
196 --      specified primary key values).
197 --   2) If an object_version_number exists but is NOT the same as the current
198 --      g_old_rec value.
199 --
200 -- Developer Implementation Notes:
201 --   None.
202 --
203 -- Access Status:
204 --   Internal Development Use Only.
205 --
206 -- {End Of Comments}
207 -- ----------------------------------------------------------------------------
208 Function api_updating
209   (p_effective_date		in date,
210    p_bnft_prvdd_ldgr_id		in number,
211    p_object_version_number	in number
212   ) Return Boolean;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |--------------------------< find_dt_del_modes >---------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   This procedure is used to determine what datetrack delete modes are
221 --   allowed as of the effective date for this entity. The procedure will
222 --   return a corresponding Boolean value for each of the delete modes
223 --   available where TRUE indicates that the corresponding delete mode is
224 --   available.
225 --
226 -- Prerequisites:
227 --   None.
228 --
229 -- In Parameters:
230 --   p_effective_date
231 --     Specifies the date at which the datetrack modes will be operated on.
232 --   p_base_key_value
233 --     Specifies the primary key value for this datetrack entity.
234 --     (E.g. For this entity the assignment of the argument would be:
235 --           p_base_key_value = :bnft_prvdd_ldgr_id).
236 --
237 -- Post Success:
238 --   Processing continues.
239 --
240 -- Post Failure:
241 --   Failure might occur if for the specified effective date and primary key
242 --   value a row doesn't exist.
243 --
244 -- Developer Implementation Notes:
245 --   This procedure could require changes if this entity has any sepcific
246 --   delete restrictions.
247 --   For example, this entity might disallow the datetrack delete mode of
248 --   ZAP. To implement this you would have to set and return a Boolean value
249 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
250 --
251 -- Access Status:
252 --   Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure find_dt_del_modes
257 	(p_effective_date	in  date,
258 	 p_base_key_value	in  number,
259 	 p_zap		 out nocopy boolean,
260 	 p_delete	 out nocopy boolean,
261 	 p_future_change out nocopy boolean,
262 	 p_delete_next_change out nocopy boolean);
263 --
264 -- ----------------------------------------------------------------------------
265 -- |--------------------------< find_dt_upd_modes >---------------------------|
266 -- ----------------------------------------------------------------------------
267 -- {Start Of Comments}
268 --
269 -- Description:
270 --   This procedure is used to determine what datetrack update modes are
271 --   allowed as of the effective date for this entity. The procedure will
272 --   return a corresponding Boolean value for each of the update modes
273 --   available where TRUE indicates that the corresponding update mode
274 --   is available.
275 --
276 -- Prerequisites:
277 --   None.
278 --
279 -- In Parameters:
280 --   p_effective_date
281 --     Specifies the date at which the datetrack modes will be operated on.
282 --   p_base_key_value
283 --     Specifies the primary key value for this datetrack entity.
284 --     (E.g. For this entity the assignment of the argument would be:
285 --           p_base_key_value = :bnft_prvdd_ldgr_id).
286 --
287 -- Post Success:
288 --   Processing continues.
289 --
290 -- Post Failure:
291 --   Failure might occur if for the specified effective date and primary key
292 --   value a row doesn't exist.
293 --
294 -- Developer Implementation Notes:
295 --   This procedure could require changes if this entity has any sepcific
296 --   delete restrictions.
297 --   For example, this entity might disallow the datetrack update mode of
298 --   UPDATE. To implement this you would have to set and return a Boolean
299 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
300 --
301 -- Access Status:
302 --   Internal Development Use Only.
303 --
304 -- {End Of Comments}
305 -- ----------------------------------------------------------------------------
306 Procedure find_dt_upd_modes
307 	(p_effective_date	in  date,
308 	 p_base_key_value	in  number,
309 	 p_correction	 out nocopy boolean,
310 	 p_update	 out nocopy boolean,
311 	 p_update_override out nocopy boolean,
312 	 p_update_change_insert out nocopy boolean);
313 --
314 -- ----------------------------------------------------------------------------
315 -- |------------------------< upd_effective_end_date >------------------------|
316 -- ----------------------------------------------------------------------------
317 -- {Start Of Comments}
318 --
319 -- Description:
320 --   This procedure will update the specified datetrack row with the
321 --   specified new effective end date. The object version number is also
322 --   set to the next object version number. DateTrack modes which call
323 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
324 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
325 --   This is an internal datetrack maintenance procedure which should
326 --   not be modified in anyway.
327 --
328 -- Prerequisites:
329 --   None.
330 --
331 -- In Parameters:
332 --   p_new_effective_end_date
333 --     Specifies the new effective end date which will be set for the
334 --     row as of the effective date.
335 --   p_base_key_value
336 --     Specifies the primary key value for this datetrack entity.
337 --     (E.g. For this entity the assignment of the argument would be:
338 --           p_base_key_value = :bnft_prvdd_ldgr_id).
339 --
340 -- Post Success:
341 --   The specified row will be updated with the new effective end date and
342 --   object_version_number.
343 --
344 -- Post Failure:
345 --   Failure might occur if for the specified effective date and primary key
346 --   value a row doesn't exist.
347 --
348 -- Developer Implementation Notes:
349 --   This is an internal datetrack maintenance procedure which should
350 --   not be modified in anyway.
351 --
352 -- Access Status:
353 --   Internal Row Handler Use Only.
354 --
355 -- {End Of Comments}
356 -- ----------------------------------------------------------------------------
357 Procedure upd_effective_end_date
358 	(p_effective_date		in date,
359 	 p_base_key_value		in number,
360 	 p_new_effective_end_date	in date,
361 	 p_validation_start_date	in date,
362 	 p_validation_end_date		in date,
363          p_object_version_number       out nocopy number);
364 --
365 -- ----------------------------------------------------------------------------
366 -- |---------------------------------< lck >----------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
372 --   following processing
369 --
370 -- Description:
371 --   The Lck process for datetrack is complicated and comprises of the
373 --   The processing steps are as follows:
374 --   1) The row to be updated or deleted must be locked.
375 --      By locking this row, the g_old_rec record data type is populated.
376 --   2) If a comment exists the text is selected from hr_comments.
377 --   3) The datetrack mode is then validated to ensure the operation is
378 --      valid. If the mode is valid the validation start and end dates for
379 --      the mode will be derived and returned. Any required locking is
380 --      completed when the datetrack mode is validated.
381 --
382 -- Prerequisites:
383 --   When attempting to call the lck procedure the object version number,
384 --   primary key, effective date and datetrack mode must be specified.
385 --
386 -- In Parameters:
387 --   p_effective_date
388 --     Specifies the date of the datetrack update operation.
389 --   p_datetrack_mode
390 --     Determines the datetrack update or delete mode.
391 --
392 -- Post Success:
393 --   On successful completion of the Lck process the row to be updated or
394 --   deleted will be locked and selected into the global data structure
395 --   g_old_rec.
396 --
397 -- Post Failure:
398 --   The Lck process can fail for three reasons:
399 --   1) When attempting to lock the row the row could already be locked by
400 --      another user. This will raise the HR_Api.Object_Locked exception.
401 --   2) The row which is required to be locked doesn't exist in the HR Schema.
402 --      This error is trapped and reported using the message name
403 --      'HR_7220_INVALID_PRIMARY_KEY'.
404 --   3) The row although existing in the HR Schema has a different object
405 --      version number than the object version number specified.
406 --      This error is trapped and reported using the message name
407 --      'HR_7155_OBJECT_INVALID'.
408 --
409 -- Developer Implementation Notes:
410 --   None.
411 --
412 -- Access Status:
413 --   Internal Development Use Only.
414 --
415 -- {End Of Comments}
416 -- ----------------------------------------------------------------------------
417 Procedure lck
418 	(p_effective_date	 in  date,
419 	 p_datetrack_mode	 in  varchar2,
420 	 p_bnft_prvdd_ldgr_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_bnft_prvdd_ldgr_id            in number,
459 	p_effective_start_date          in date,
460 	p_effective_end_date            in date,
461 	p_prtt_ro_of_unusd_amt_flag     in varchar2,
462 	p_frftd_val                     in number,
463 	p_prvdd_val                     in number,
464 	p_used_val                      in number,
465 	p_bnft_prvdr_pool_id            in number,
466 	p_acty_base_rt_id               in number,
467 	p_per_in_ler_id               in number,
468 	p_prtt_enrt_rslt_id             in number,
469 	p_business_group_id             in number,
470 	p_bpl_attribute_category        in varchar2,
471 	p_bpl_attribute1                in varchar2,
472 	p_bpl_attribute2                in varchar2,
473 	p_bpl_attribute3                in varchar2,
474 	p_bpl_attribute4                in varchar2,
475 	p_bpl_attribute5                in varchar2,
476 	p_bpl_attribute6                in varchar2,
477 	p_bpl_attribute7                in varchar2,
478 	p_bpl_attribute8                in varchar2,
479 	p_bpl_attribute9                in varchar2,
480 	p_bpl_attribute10               in varchar2,
481 	p_bpl_attribute11               in varchar2,
482 	p_bpl_attribute12               in varchar2,
483 	p_bpl_attribute13               in varchar2,
484 	p_bpl_attribute14               in varchar2,
485 	p_bpl_attribute15               in varchar2,
486 	p_bpl_attribute16               in varchar2,
487 	p_bpl_attribute17               in varchar2,
488 	p_bpl_attribute18               in varchar2,
489 	p_bpl_attribute19               in varchar2,
490 	p_bpl_attribute20               in varchar2,
491 	p_bpl_attribute21               in varchar2,
492 	p_bpl_attribute22               in varchar2,
493 	p_bpl_attribute23               in varchar2,
494 	p_bpl_attribute24               in varchar2,
495 	p_bpl_attribute25               in varchar2,
496 	p_bpl_attribute26               in varchar2,
497 	p_bpl_attribute27               in varchar2,
498 	p_bpl_attribute28               in varchar2,
499 	p_bpl_attribute29               in varchar2,
500 	p_bpl_attribute30               in varchar2,
501 	p_object_version_number         in number,
502 	p_cash_recd_val                 in number,
503 	p_rld_up_val                    in number,
504 	p_acty_ref_perd_cd              in   varchar2,
505 	p_cmcd_frftd_val                in   number,
506 	p_cmcd_prvdd_val                in   number,
507 	p_cmcd_rld_up_val               in   number,
508 	p_cmcd_used_val                 in   number,
509 	p_cmcd_cash_recd_val            in   number,
510 	p_cmcd_ref_perd_cd              in   varchar2,
511 	p_ann_frftd_val                 in   number,
512 	p_ann_prvdd_val                 in   number,
513 	p_ann_rld_up_val                in   number,
514 	p_ann_used_val                  in   number,
515 	p_ann_cash_recd_val             in   number)
516 	Return g_rec_type;
517 --
518 end ben_bpl_shd;