1 Package pay_ppm_ins as
2 /* $Header: pyppmrhi.pkh 120.0 2005/05/29 07:42:59 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |-------------------------------< ins_lck >--------------------------------|
6 -- ----------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- The ins_lck process has one main function to perform. When inserting
11 -- a datetracked row, we must validate the DT mode.
12 -- be manipulated.
13 --
14 -- Pre Conditions:
15 -- This procedure can only be called for the datetrack mode of INSERT.
16 --
17 -- In Arguments:
18 --
19 -- Post Success:
20 -- On successful completion of the ins_lck process the parental
21 -- datetracked rows will be locked providing the p_enforce_foreign_locking
22 -- argument value is TRUE.
23 -- If the p_enforce_foreign_locking argument value is FALSE then the
24 -- parential rows are not locked.
25 --
26 -- Post Failure:
27 -- The Lck process can fail for:
28 -- 1) When attempting to lock the row the row could already be locked by
29 -- another user. This will raise the HR_Api.Object_Locked exception.
30 -- 2) When attempting to the lock the parent which doesn't exist.
31 -- For the entity to be locked the parent must exist!
32 --
33 -- Developer Implementation Notes:
34 -- None.
35 --
36 -- Access Status:
37 -- Internal Table Handler Use Only.
38 --
39 -- {End Of Comments}
40 -- ----------------------------------------------------------------------------
41 Procedure ins_lck
42 (p_effective_date in date
43 ,p_datetrack_mode in varchar2
44 ,p_rec in pay_ppm_shd.g_rec_type
45 ,p_validation_start_date out nocopy date
46 ,p_validation_end_date out nocopy date
47 );
48 -- ----------------------------------------------------------------------------
49 -- |------------------------------< insert_dml >------------------------------|
50 -- ----------------------------------------------------------------------------
51 -- {Start Of Comments}
52 --
53 -- Description:
54 -- This procedure calls the dt_insert_dml control logic which handles
55 -- the actual datetrack dml.
56 --
57 -- Pre Conditions:
58 -- This is an internal private procedure which must be called from the ins
59 -- procedure and must have all mandatory arguments set (except the
60 -- object_version_number which is initialised within the dt_insert_dml
61 -- procedure).
62 --
63 -- In Arguments:
64 -- A Pl/Sql record structre.
65 --
66 -- Post Success:
67 -- Processing contines.
68 --
69 -- Post Failure:
70 -- No specific error handling is required within this procedure.
71 --
72 -- Developer Implementation Notes:
73 -- None.
74 --
75 -- Access Status:
76 -- Internal Table Handler Use Only.
77 --
78 -- {End Of Comments}
79 -- ----------------------------------------------------------------------------
80 Procedure insert_dml
81 (p_rec in out nocopy pay_ppm_shd.g_rec_type,
82 p_effective_date in date,
83 p_datetrack_mode in varchar2,
84 p_validation_start_date in date,
85 p_validation_end_date in date);
86 --
87 -- ----------------------------------------------------------------------------
88 -- |---------------------------------< ins >----------------------------------|
89 -- ----------------------------------------------------------------------------
90 -- {Start Of Comments}
91 --
92 -- Description:
93 -- This procedure is the record interface for the insert business process
94 -- for the specified entity. The role of this process is to insert a fully
95 -- validated row, into the HR schema passing back to the calling process,
96 -- any system generated values (e.g. primary and object version number
97 -- attributes). This process is the main backbone of the ins business
98 -- process. The processing of this procedure is as follows:
99 -- 1) If the p_validate argument has been set to true then a savepoint is
100 -- issued.
101 -- 2) We must lock parent rows (if any exist).
102 -- 3) The controlling validation process insert_validate is then executed
103 -- which will execute all private and public validation business rule
104 -- processes.
105 -- 4) The pre_insert business process is then executed which enables any
106 -- logic to be processed before the insert dml process is executed.
107 -- 5) The insert_dml process will physical perform the insert dml into the
108 -- specified entity.
109 -- 6) The post_insert business process is then executed which enables any
110 -- logic to be processed after the insert dml process.
111 -- 7) If the p_validate argument has been set to true an exception is raised
112 -- which is handled and processed by performing a rollback to the
113 -- savepoint which was issued at the beginning of the Ins process.
114 --
115 -- Pre Conditions:
116 -- The main arguments to the business process have to be in the record
117 -- format.
118 -- The following attributes in p_rec are mandatory:
119 -- personal_payment_method_id, assignment_id, business_group_id,
120 -- org_payment_method_id, effective_start_date, effective_end_date
121 --
122 -- In Arguments:
123 -- p_effective_date
124 -- Specifies the date of the datetrack insert operation.
125 -- p_validate
126 -- Determines if the business process is to be validated. Setting this
127 -- boolean value to true will invoke the process to be validated. The
128 -- default is false. The validation is controlled by a savepoint and
129 -- rollback mechanism. The savepoint is issued at the beginning of the
130 -- business process and is rollbacked at the end of the business process
131 -- when all the processing has been completed. The rollback is controlled
132 -- by raising and handling the exception hr_api.validate_enabled. We use
133 -- the exception because, by raising the exception with the business
134 -- process, we can exit successfully without having any of the 'OUT'
135 -- arguments being set.
136 --
137 -- Post Success:
138 -- A fully validated row will be inserted into the specified entity
139 -- without being committed. If the p_validate argument has been set to true
140 -- then all the work will be rolled back.
141 -- The primary key and object version number details for the inserted
142 -- personal payment method record will be returned in p_rec
143 --
144 -- Post Failure:
145 -- If an error has occurred, an error message will be supplied with the work
146 -- rolled back.
147 -- A failure will occur if any of the following conditions are found:
148 -- 1) All of the mandatory arguments have not been set
149 -- 2) A row does not exist in per_assignments_f for the value in
150 -- p_rec.assignment_id as of the current effective date
151 -- 3) The value in p_rec.org_payment_method_id is not valid for the
152 -- assignments related payroll id, as of p_effective_start_date
153 -- 4) The value in p_rec.org_payment_method_id is not valid for the
154 -- related payment type
155 -- 5) The balance type related to the value in
156 -- p_rec.personal_payment_method_id is
157 -- non-remunerative and the value in p_rec.amount is not null
158 -- 6) The balance type related to the value in
159 -- p_rec.personal_payment_method_id is
160 -- non-remunerative and the value in p_rec.percentage is not 100
161 -- 7) The value in p_rec.percentage is not null and the value in
162 -- p_rec.amount is not null
163 -- 8) The value in p_rec.percentage is null and the value in
164 -- p_rec.amount is null
165 -- 9) The value in p_rec.amount is less than 0
166 -- 10) The value in p_rec.percentage is not between 0 and 100
167 -- 11) The related payment type is magnetic tape and the value in
168 -- p_rec.external_account_id is null
169 -- 12) The value in p_rec.external_account_id is not null and it does
170 -- not exist in PAY_EXTERNAL_ACCOUNTS
171 -- 13) The value in p_rec.priority is null
172 -- 14) The balance type related to the value in
173 -- p_rec.personal_payment_method_id is Remunerative and
174 -- the value in p_rec.priority is not an integer between 1 and 99
175 -- 15) The balance type related to the value in
176 -- p_rec.personal_payment_method_id is Non_Remunerative and
177 -- the value in p_rec.priority is not 1
178 -- 16) The balance type related to the value in
179 -- p_rec.personal_payment_method_id is Remunerative and
180 -- the value in p_rec.priority is not unique between
181 -- VALIDATION_START_DATE and VALIDATION_END_DATE
182 --
183 -- Developer Implementation Notes:
184 -- None.
185 --
186 -- Access Status:
187 -- Internal Development Use Only.
188 --
189 -- {End Of Comments}
190 -- ----------------------------------------------------------------------------
191 Procedure ins
192 (
193 p_rec in out nocopy pay_ppm_shd.g_rec_type,
194 p_effective_date in date,
195 p_validate in boolean default false
196 );
197 --
198 -- ----------------------------------------------------------------------------
199 -- |---------------------------------< ins >----------------------------------|
200 -- ----------------------------------------------------------------------------
201 -- {Start Of Comments}
202 --
203 -- Description:
204 -- This procedure is the attribute interface for the insert business
205 -- process for the specified entity and is the outermost layer. The role
206 -- of this process is to insert a fully validated row into the HR schema
207 -- passing back to the calling process, any system generated values
208 -- (e.g. object version number attributes).The processing of this
209 -- procedure is as follows:
210 -- 1) The attributes are converted into a local record structure by
211 -- calling the convert_args function.
212 -- 2) After the conversion has taken place, the corresponding record ins
213 -- interface business process is executed.
214 -- 3) OUT arguments are then set to their corresponding record arguments.
215 --
216 -- Pre Conditions:
217 --
218 -- In Arguments:
219 -- p_effective_date
220 -- Specifies the date of the datetrack insert operation.
221 -- p_validate
222 -- Determines if the business process is to be validated. Setting this
223 -- Boolean value to true will invoke the process to be validated.
224 -- The default is false.
225 --
226 -- Post Success:
227 -- A fully validated row will be inserted for the specified entity
228 -- without being committed (or rollbacked depending on the p_validate
229 -- status).
230 --
231 -- Post Failure:
232 -- If an error has occurred, an error message will be supplied with the work
233 -- rolled back. Refer to the ins record interface for details of possible
234 -- failures
235 --
236 -- Developer Implementation Notes:
237 -- None.
238 --
239 -- Access Status:
240 -- Internal Development Use Only.
241 --
242 -- {End Of Comments}
243 -- ----------------------------------------------------------------------------
244 Procedure ins
245 (
246 p_personal_payment_method_id out nocopy number,
247 p_effective_start_date out nocopy date,
248 p_effective_end_date out nocopy date,
249 p_business_group_id in number,
250 p_external_account_id in number default null,
251 p_assignment_id in number,
252 p_run_type_id in number default null,
253 p_org_payment_method_id in number,
254 p_amount in number default null,
255 p_comment_id out nocopy number,
256 p_comments in varchar2 default null,
257 p_percentage in number default null,
258 p_priority in number default null,
259 p_attribute_category in varchar2 default null,
260 p_attribute1 in varchar2 default null,
261 p_attribute2 in varchar2 default null,
262 p_attribute3 in varchar2 default null,
263 p_attribute4 in varchar2 default null,
264 p_attribute5 in varchar2 default null,
265 p_attribute6 in varchar2 default null,
266 p_attribute7 in varchar2 default null,
267 p_attribute8 in varchar2 default null,
268 p_attribute9 in varchar2 default null,
269 p_attribute10 in varchar2 default null,
270 p_attribute11 in varchar2 default null,
271 p_attribute12 in varchar2 default null,
272 p_attribute13 in varchar2 default null,
273 p_attribute14 in varchar2 default null,
274 p_attribute15 in varchar2 default null,
275 p_attribute16 in varchar2 default null,
276 p_attribute17 in varchar2 default null,
277 p_attribute18 in varchar2 default null,
278 p_attribute19 in varchar2 default null,
279 p_attribute20 in varchar2 default null,
280 p_object_version_number out nocopy number,
281 p_payee_type in varchar2 default null,
282 p_payee_id in number default null,
283 p_effective_date in date,
284 p_validate in boolean default false,
285 p_ppm_information_category in varchar2 default null,
286 p_ppm_information1 in varchar2 default null,
287 p_ppm_information2 in varchar2 default null,
288 p_ppm_information3 in varchar2 default null,
289 p_ppm_information4 in varchar2 default null,
290 p_ppm_information5 in varchar2 default null,
291 p_ppm_information6 in varchar2 default null,
292 p_ppm_information7 in varchar2 default null,
293 p_ppm_information8 in varchar2 default null,
294 p_ppm_information9 in varchar2 default null,
295 p_ppm_information10 in varchar2 default null,
296 p_ppm_information11 in varchar2 default null,
297 p_ppm_information12 in varchar2 default null,
298 p_ppm_information13 in varchar2 default null,
299 p_ppm_information14 in varchar2 default null,
300 p_ppm_information15 in varchar2 default null,
301 p_ppm_information16 in varchar2 default null,
302 p_ppm_information17 in varchar2 default null,
303 p_ppm_information18 in varchar2 default null,
304 p_ppm_information19 in varchar2 default null,
305 p_ppm_information20 in varchar2 default null,
306 p_ppm_information21 in varchar2 default null,
307 p_ppm_information22 in varchar2 default null,
308 p_ppm_information23 in varchar2 default null,
309 p_ppm_information24 in varchar2 default null,
310 p_ppm_information25 in varchar2 default null,
311 p_ppm_information26 in varchar2 default null,
312 p_ppm_information27 in varchar2 default null,
313 p_ppm_information28 in varchar2 default null,
314 p_ppm_information29 in varchar2 default null,
315 p_ppm_information30 in varchar2 default null
316 );
317 --
318 end pay_ppm_ins;