DBA Data[Home] [Help]

PACKAGE: APPS.PAY_OPM_SHD

Source


1 Package pay_opm_shd AUTHID CURRENT_USER as
2 /* $Header: pyopmrhi.pkh 120.1 2005/08/30 07:52:36 pgongada noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (org_payment_method_id           number(9)
10   ,effective_start_date            date
11   ,effective_end_date              date
12   ,business_group_id               number(15)
13   ,external_account_id             number(9)
14   ,currency_code                   varchar2(15)
15   ,payment_type_id                 number(9)
16   ,defined_balance_id              number(9)
17   ,org_payment_method_name         varchar2(80)
18   ,comment_id                      number(15)
19   ,comments                        varchar2(2000)    -- pseudo column
20   ,attribute_category              varchar2(30)
21   ,attribute1                      varchar2(150)
22   ,attribute2                      varchar2(150)
23   ,attribute3                      varchar2(150)
24   ,attribute4                      varchar2(150)
25   ,attribute5                      varchar2(150)
26   ,attribute6                      varchar2(150)
27   ,attribute7                      varchar2(150)
28   ,attribute8                      varchar2(150)
29   ,attribute9                      varchar2(150)
30   ,attribute10                     varchar2(150)
31   ,attribute11                     varchar2(150)
32   ,attribute12                     varchar2(150)
33   ,attribute13                     varchar2(150)
34   ,attribute14                     varchar2(150)
35   ,attribute15                     varchar2(150)
36   ,attribute16                     varchar2(150)
37   ,attribute17                     varchar2(150)
38   ,attribute18                     varchar2(150)
39   ,attribute19                     varchar2(150)
40   ,attribute20                     varchar2(150)
41   ,pmeth_information_category      varchar2(30)
42   ,pmeth_information1              varchar2(150)
43   ,pmeth_information2              varchar2(150)
44   ,pmeth_information3              varchar2(150)
45   ,pmeth_information4              varchar2(150)
46   ,pmeth_information5              varchar2(150)
47   ,pmeth_information6              varchar2(150)
48   ,pmeth_information7              varchar2(150)
49   ,pmeth_information8              varchar2(150)
50   ,pmeth_information9              varchar2(150)
51   ,pmeth_information10             varchar2(150)
52   ,pmeth_information11             varchar2(150)
53   ,pmeth_information12             varchar2(150)
54   ,pmeth_information13             varchar2(150)
55   ,pmeth_information14             varchar2(150)
56   ,pmeth_information15             varchar2(150)
57   ,pmeth_information16             varchar2(150)
58   ,pmeth_information17             varchar2(150)
59   ,pmeth_information18             varchar2(150)
60   ,pmeth_information19             varchar2(150)
61   ,pmeth_information20             varchar2(150)
62   ,object_version_number           number(9)
63   ,transfer_to_gl_flag             varchar2(30)
64   ,cost_payment                    varchar2(30)
65   ,cost_cleared_payment            varchar2(30)
66   ,cost_cleared_void_payment       varchar2(30)
67   ,exclude_manual_payment          varchar2(30)
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
174 --   current row from the database for the specified primary key
175 --   provided that the primary key exists and is valid and does not
176 --   already match the current g_old_rec. The function will always return
177 --   a TRUE value if the g_old_rec is populated with the current row.
178 --   A FALSE value will be returned if all of the primary key arguments
179 --   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
188 --   is 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_org_payment_method_id            in number
211   ,p_object_version_number            in number
212   ) Return Boolean;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |---------------------------< find_dt_upd_modes >--------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   This procedure is used to determine what datetrack update 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 update modes
223 --   available where TRUE indicates that the corresponding update mode
224 --   is 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 = :org_payment_method_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 update mode of
248 --   UPDATE. To implement this you would have to set and return a Boolean
249 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
250 --
251 -- Access Status:
252 --   Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure find_dt_upd_modes
257   (p_effective_date         in         date
258   ,p_base_key_value         in         number
259   ,p_correction             out nocopy boolean
260   ,p_update                 out nocopy boolean
261   ,p_update_override        out nocopy boolean
262   ,p_update_change_insert   out nocopy boolean
263   );
264 --
265 -- ----------------------------------------------------------------------------
266 -- |---------------------------< find_dt_del_modes >--------------------------|
267 -- ----------------------------------------------------------------------------
268 -- {Start Of Comments}
269 --
270 -- Description:
271 --   This procedure is used to determine what datetrack delete modes are
272 --   allowed as of the effective date for this entity. The procedure will
273 --   return a corresponding Boolean value for each of the delete modes
274 --   available where TRUE indicates that the corresponding delete mode is
275 --   available.
276 --
277 -- Prerequisites:
278 --   None.
279 --
280 -- In Parameters:
281 --   p_effective_date
282 --     Specifies the date at which the datetrack modes will be operated on.
283 --   p_base_key_value
284 --     Specifies the primary key value for this datetrack entity.
285 --     (E.g. For this entity the assignment of the argument would be:
286 --           p_base_key_value = :org_payment_method_id).
287 --
288 -- Post Success:
289 --   Processing continues.
290 --
291 -- Post Failure:
292 --   Failure might occur if for the specified effective date and primary key
293 --   value a row doesn't exist.
294 --
295 -- Developer Implementation Notes:
296 --   This procedure could require changes if this entity has any sepcific
297 --   delete restrictions.
298 --   For example, this entity might disallow the datetrack delete mode of
299 --   ZAP. To implement this you would have to set and return a Boolean value
300 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
301 --
302 -- Access Status:
303 --   Internal Development Use Only.
304 --
305 -- {End Of Comments}
306 -- ----------------------------------------------------------------------------
307 Procedure find_dt_del_modes
308   (p_effective_date        in         date
309   ,p_base_key_value        in         number
310   ,p_zap                   out nocopy boolean
311   ,p_delete                out nocopy boolean
312   ,p_future_change         out nocopy boolean
313   ,p_delete_next_change    out nocopy boolean
314   );
315 --
316 -- ----------------------------------------------------------------------------
317 -- |-----------------------< upd_effective_end_date >-------------------------|
318 -- ----------------------------------------------------------------------------
319 -- {Start Of Comments}
320 --
321 -- Description:
322 --   This procedure will update the specified datetrack row with the
323 --   specified new effective end date. The object version number is also
324 --   set to the next object version number. DateTrack modes which call
325 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
326 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
327 --   This is an internal datetrack maintenance procedure which should
328 --   not be modified in anyway.
329 --
330 -- Prerequisites:
331 --   None.
332 --
333 -- In Parameters:
334 --   p_new_effective_end_date
335 --     Specifies the new effective end date which will be set for the
336 --     row as of the effective date.
337 --   p_base_key_value
338 --     Specifies the primary key value for this datetrack entity.
339 --     (E.g. For this entity the assignment of the argument would be:
340 --           p_base_key_value = :org_payment_method_id).
341 --
342 -- Post Success:
343 --   The specified row will be updated with the new effective end date and
344 --   object_version_number.
345 --
346 -- Post Failure:
350 -- Developer Implementation Notes:
347 --   Failure might occur if for the specified effective date and primary key
348 --   value a row doesn't exist.
349 --
351 --   This is an internal datetrack maintenance procedure which should
352 --   not be modified in anyway.
353 --
354 -- Access Status:
355 --   Internal Row Handler Use Only.
356 --
357 -- {End Of Comments}
358 -- ----------------------------------------------------------------------------
359 Procedure upd_effective_end_date
360   (p_effective_date         in         date
361   ,p_base_key_value         in         number
362   ,p_new_effective_end_date in         date
363   ,p_validation_start_date  in         date
364   ,p_validation_end_date    in         date
365   ,p_object_version_number  out nocopy number
366   );
367 --
368 -- ----------------------------------------------------------------------------
369 -- |---------------------------------< lck >----------------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 --   The Lck process for datetrack is complicated and comprises of the
375 --   following processing
376 --   The processing steps are as follows:
377 --   1) The row to be updated or deleted must be locked.
378 --      By locking this row, the g_old_rec record data type is populated.
379 --   2) If a comment exists the text is selected from hr_comments.
380 --   3) The datetrack mode is then validated to ensure the operation is
381 --      valid. If the mode is valid the validation start and end dates for
382 --      the mode will be derived and returned. Any required locking is
383 --      completed when the datetrack mode is validated.
384 --
385 -- Prerequisites:
386 --   When attempting to call the lck procedure the object version number,
387 --   primary key, effective date and datetrack mode must be specified.
388 --
389 -- In Parameters:
390 --   p_effective_date
391 --     Specifies the date of the datetrack update operation.
392 --   p_datetrack_mode
393 --     Determines the datetrack update or delete mode.
394 --
395 -- Post Success:
396 --   On successful completion of the Lck process the row to be updated or
397 --   deleted will be locked and selected into the global data structure
398 --   g_old_rec.
399 --
400 -- Post Failure:
401 --   The Lck process can fail for three reasons:
402 --   1) When attempting to lock the row the row could already be locked by
403 --      another user. This will raise the HR_Api.Object_Locked exception.
404 --   2) The row which is required to be locked doesn't exist in the HR Schema.
405 --      This error is trapped and reported using the message name
406 --      'HR_7220_INVALID_PRIMARY_KEY'.
407 --   3) The row although existing in the HR Schema has a different object
408 --      version number than the object version number specified.
409 --      This error is trapped and reported using the message name
410 --      'HR_7155_OBJECT_INVALID'.
411 --
412 -- Developer Implementation Notes:
413 --   None.
414 --
415 -- Access Status:
416 --   Internal Development Use Only.
417 --
418 -- {End Of Comments}
419 -- ----------------------------------------------------------------------------
420 Procedure lck
421   (p_effective_date                   in         date
422   ,p_datetrack_mode                   in         varchar2
423   ,p_org_payment_method_id            in         number
424   ,p_object_version_number            in         number
425   ,p_validation_start_date            out nocopy date
426   ,p_validation_end_date              out nocopy date
427   );
428 --
429 -- ----------------------------------------------------------------------------
430 -- |-----------------------------< convert_args >-----------------------------|
431 -- ----------------------------------------------------------------------------
432 -- {Start Of Comments}
433 --
434 -- Description:
435 --   This function is used to turn attribute parameters into the record
436 --   structure parameter g_rec_type.
437 --
438 -- Prerequisites:
439 --   This is a private function and can only be called from the ins or upd
440 --   attribute processes.
441 --
442 -- In Parameters:
443 --
444 -- Post Success:
445 --   A returning record structure will be returned.
446 --
447 -- Post Failure:
448 --   No direct error handling is required within this function.  Any possible
449 --   errors within this function will be a PL/SQL value error due to conversion
450 --   of datatypes or data lengths.
451 --
452 -- Developer Implementation Notes:
453 --   None.
454 --
455 -- Access Status:
456 --   Internal Row Handler Use Only.
457 --
458 -- {End Of Comments}
459 -- ----------------------------------------------------------------------------
460 Function convert_args
461   (p_org_payment_method_id          in number
462   ,p_effective_start_date           in date
463   ,p_effective_end_date             in date
464   ,p_business_group_id              in number
465   ,p_external_account_id            in number
466   ,p_currency_code                  in varchar2
467   ,p_payment_type_id                in number
468   ,p_defined_balance_id             in number
469   ,p_org_payment_method_name        in varchar2
470   ,p_comment_id                     in number
471   ,p_comments                       in varchar2
475   ,p_attribute3                     in varchar2
472   ,p_attribute_category             in varchar2
473   ,p_attribute1                     in varchar2
474   ,p_attribute2                     in varchar2
476   ,p_attribute4                     in varchar2
477   ,p_attribute5                     in varchar2
478   ,p_attribute6                     in varchar2
479   ,p_attribute7                     in varchar2
480   ,p_attribute8                     in varchar2
481   ,p_attribute9                     in varchar2
482   ,p_attribute10                    in varchar2
483   ,p_attribute11                    in varchar2
484   ,p_attribute12                    in varchar2
485   ,p_attribute13                    in varchar2
486   ,p_attribute14                    in varchar2
487   ,p_attribute15                    in varchar2
488   ,p_attribute16                    in varchar2
489   ,p_attribute17                    in varchar2
490   ,p_attribute18                    in varchar2
491   ,p_attribute19                    in varchar2
492   ,p_attribute20                    in varchar2
493   ,p_pmeth_information_category     in varchar2
494   ,p_pmeth_information1             in varchar2
495   ,p_pmeth_information2             in varchar2
496   ,p_pmeth_information3             in varchar2
497   ,p_pmeth_information4             in varchar2
498   ,p_pmeth_information5             in varchar2
499   ,p_pmeth_information6             in varchar2
500   ,p_pmeth_information7             in varchar2
501   ,p_pmeth_information8             in varchar2
502   ,p_pmeth_information9             in varchar2
503   ,p_pmeth_information10            in varchar2
504   ,p_pmeth_information11            in varchar2
505   ,p_pmeth_information12            in varchar2
506   ,p_pmeth_information13            in varchar2
507   ,p_pmeth_information14            in varchar2
508   ,p_pmeth_information15            in varchar2
509   ,p_pmeth_information16            in varchar2
510   ,p_pmeth_information17            in varchar2
511   ,p_pmeth_information18            in varchar2
512   ,p_pmeth_information19            in varchar2
513   ,p_pmeth_information20            in varchar2
514   ,p_object_version_number          in number
515   ,p_transfer_to_gl_flag            in varchar2
516   ,p_cost_payment                   in varchar2
517   ,p_cost_cleared_payment           in varchar2
518   ,p_cost_cleared_void_payment      in varchar2
519   ,p_exclude_manual_payment         in varchar2
520   )
521   Return g_rec_type;
522 --
523 end pay_opm_shd;