DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_SET_INS

Source


1 Package Body pay_set_ins as
2 /* $Header: pysetrhi.pkb 120.0 2005/05/29 08:39:23 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pay_set_ins.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< insert_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml insert logic. The processing of
17 --   this procedure are as follows:
18 --   1) Initialise the object_version_number to 1 if the object_version_number
19 --      is defined as an attribute for this entity.
20 --      perform dml).
21 --   3) To insert the row into the schema.
22 --   4) To trap any constraint violations that may have occurred.
23 --   5) To raise any other errors.
24 --
25 -- Prerequisites:
26 --   This is an internal private procedure which must be called from the ins
27 --   procedure and must have all mandatory attributes set (except the
28 --   object_version_number which is initialised within this procedure).
29 --
30 -- In Parameters:
31 --   A Pl/Sql record structre.
32 --
33 -- Post Success:
34 --   The specified row will be inserted into the schema.
35 --
36 -- Post Failure:
37 --   On the insert dml failure it is important to note that we always reset the
38 --   If a check, unique or parent integrity constraint violation is raised the
39 --   constraint_error procedure will be called.
40 --   If any other error is reported, the error will be raised after the
41 --
42 -- Developer Implementation Notes:
43 --   None.
44 --
45 -- Access Status:
46 --   Internal Row Handler Use Only.
47 --
48 -- {End Of Comments}
49 -- ----------------------------------------------------------------------------
50 Procedure insert_dml(p_rec in out nocopy pay_set_shd.g_rec_type) is
51 --
52   l_proc  varchar2(72) := g_package||'insert_dml';
53 --
54 Begin
55   hr_utility.set_location('Entering:'||l_proc, 5);
56   p_rec.object_version_number := 1;  -- Initialise the object version
57   --
58   --
59   -- Insert the row into: pay_shadow_element_types
60   --
61   insert into pay_shadow_element_types
62   (	element_type_id,
63 	template_id,
64 	classification_name,
65 	additional_entry_allowed_flag,
66 	adjustment_only_flag,
67 	closed_for_entry_flag,
68 	element_name,
69 	indirect_only_flag,
70 	multiple_entries_allowed_flag,
71 	multiply_value_flag,
72 	post_termination_rule,
73 	process_in_run_flag,
74 	relative_processing_priority,
75 	processing_type,
76 	standard_link_flag,
77 	input_currency_code,
78 	output_currency_code,
79 	benefit_classification_name,
80 	description,
81 	qualifying_age,
82 	qualifying_length_of_service,
83 	qualifying_units,
84 	reporting_name,
85 	attribute_category,
86 	attribute1,
87 	attribute2,
88 	attribute3,
89 	attribute4,
90 	attribute5,
91 	attribute6,
92 	attribute7,
93 	attribute8,
94 	attribute9,
95 	attribute10,
96 	attribute11,
97 	attribute12,
98 	attribute13,
99 	attribute14,
100 	attribute15,
101 	attribute16,
102 	attribute17,
103 	attribute18,
104 	attribute19,
105 	attribute20,
106 	element_information_category,
107 	element_information1,
108 	element_information2,
109 	element_information3,
110 	element_information4,
111 	element_information5,
112 	element_information6,
113 	element_information7,
114 	element_information8,
115 	element_information9,
116 	element_information10,
117 	element_information11,
118 	element_information12,
119 	element_information13,
120 	element_information14,
121 	element_information15,
122 	element_information16,
123 	element_information17,
124 	element_information18,
125 	element_information19,
126 	element_information20,
127 	third_party_pay_only_flag,
128 	skip_formula,
129 	payroll_formula_id,
130 	exclusion_rule_id,
131         iterative_flag,
132         iterative_priority,
133         iterative_formula_name,
134         process_mode,
135         grossup_flag,
136         advance_indicator,
137         advance_payable,
138         advance_deduction,
139         process_advance_entry,
140         proration_group,
141         proration_formula,
142         recalc_event_group,
143         once_each_period_flag,
144 	object_version_number
145   )
146   Values
147   (	p_rec.element_type_id,
148 	p_rec.template_id,
149 	p_rec.classification_name,
150 	p_rec.additional_entry_allowed_flag,
151 	p_rec.adjustment_only_flag,
152 	p_rec.closed_for_entry_flag,
153 	p_rec.element_name,
154 	p_rec.indirect_only_flag,
155 	p_rec.multiple_entries_allowed_flag,
156 	p_rec.multiply_value_flag,
157 	p_rec.post_termination_rule,
158 	p_rec.process_in_run_flag,
159 	p_rec.relative_processing_priority,
160 	p_rec.processing_type,
161 	p_rec.standard_link_flag,
162 	p_rec.input_currency_code,
163 	p_rec.output_currency_code,
164 	p_rec.benefit_classification_name,
165 	p_rec.description,
166 	p_rec.qualifying_age,
167 	p_rec.qualifying_length_of_service,
168 	p_rec.qualifying_units,
169 	p_rec.reporting_name,
170 	p_rec.attribute_category,
171 	p_rec.attribute1,
172 	p_rec.attribute2,
173 	p_rec.attribute3,
174 	p_rec.attribute4,
175 	p_rec.attribute5,
176 	p_rec.attribute6,
177 	p_rec.attribute7,
178 	p_rec.attribute8,
179 	p_rec.attribute9,
180 	p_rec.attribute10,
181 	p_rec.attribute11,
182 	p_rec.attribute12,
183 	p_rec.attribute13,
184 	p_rec.attribute14,
185 	p_rec.attribute15,
186 	p_rec.attribute16,
187 	p_rec.attribute17,
188 	p_rec.attribute18,
189 	p_rec.attribute19,
190 	p_rec.attribute20,
191 	p_rec.element_information_category,
192 	p_rec.element_information1,
193 	p_rec.element_information2,
194 	p_rec.element_information3,
195 	p_rec.element_information4,
196 	p_rec.element_information5,
197 	p_rec.element_information6,
198 	p_rec.element_information7,
199 	p_rec.element_information8,
200 	p_rec.element_information9,
201 	p_rec.element_information10,
202 	p_rec.element_information11,
203 	p_rec.element_information12,
204 	p_rec.element_information13,
205 	p_rec.element_information14,
206 	p_rec.element_information15,
207 	p_rec.element_information16,
208 	p_rec.element_information17,
209 	p_rec.element_information18,
210 	p_rec.element_information19,
211 	p_rec.element_information20,
212 	p_rec.third_party_pay_only_flag,
213 	p_rec.skip_formula,
214 	p_rec.payroll_formula_id,
215 	p_rec.exclusion_rule_id,
216         p_rec.iterative_flag,
217         p_rec.iterative_priority,
218         p_rec.iterative_formula_name,
219         p_rec.process_mode,
220         p_rec.grossup_flag,
221         p_rec.advance_indicator,
222         p_rec.advance_payable,
223         p_rec.advance_deduction,
224         p_rec.process_advance_entry,
225         p_rec.proration_group,
226         p_rec.proration_formula,
227         p_rec.recalc_event_group,
228         p_rec.once_each_period_flag,
229 	p_rec.object_version_number
230   );
231   --
232   --
233   hr_utility.set_location(' Leaving:'||l_proc, 10);
234 Exception
235   When hr_api.check_integrity_violated Then
236     -- A check constraint has been violated
237     pay_set_shd.constraint_error
238       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
239   When hr_api.parent_integrity_violated Then
240     -- Parent integrity has been violated
241     pay_set_shd.constraint_error
242       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
243   When hr_api.unique_integrity_violated Then
244     -- Unique integrity has been violated
245     pay_set_shd.constraint_error
246       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
247   When Others Then
248     Raise;
249 End insert_dml;
250 --
251 -- ----------------------------------------------------------------------------
252 -- |------------------------------< pre_insert >------------------------------|
253 -- ----------------------------------------------------------------------------
254 -- {Start Of Comments}
255 --
256 -- Description:
257 --   This private procedure contains any processing which is required before
258 --   the insert dml. Presently, if the entity has a corresponding primary
259 --   key which is maintained by an associating sequence, the primary key for
260 --   the entity will be populated with the next sequence value in
261 --   preparation for the insert dml.
262 --
263 -- Prerequisites:
264 --   This is an internal procedure which is called from the ins procedure.
265 --
266 -- In Parameters:
267 --   A Pl/Sql record structre.
268 --
269 -- Post Success:
270 --   Processing continues.
271 --
272 -- Post Failure:
273 --   If an error has occurred, an error message and exception will be raised
274 --   but not handled.
275 --
276 -- Developer Implementation Notes:
277 --   Any pre-processing required before the insert dml is issued should be
278 --   coded within this procedure. As stated above, a good example is the
279 --   generation of a primary key number via a corresponding sequence.
280 --   It is important to note that any 3rd party maintenance should be reviewed
281 --   before placing in this procedure.
282 --
283 -- Access Status:
284 --   Internal Row Handler Use Only.
285 --
286 -- {End Of Comments}
287 -- ----------------------------------------------------------------------------
288 Procedure pre_insert(p_rec  in out nocopy pay_set_shd.g_rec_type) is
289 --
290   l_proc  varchar2(72) := g_package||'pre_insert';
291 --
292   Cursor C_Sel1 is select pay_shadow_element_types_s.nextval from sys.dual;
293 --
294 Begin
295   hr_utility.set_location('Entering:'||l_proc, 5);
296   --
297   --
298   -- Select the next sequence number
299   --
300   Open C_Sel1;
301   Fetch C_Sel1 Into p_rec.element_type_id;
302   Close C_Sel1;
303   --
304   hr_utility.set_location(' Leaving:'||l_proc, 10);
305 End pre_insert;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |-----------------------------< post_insert >------------------------------|
309 -- ----------------------------------------------------------------------------
310 -- {Start Of Comments}
311 --
312 -- Description:
313 --   This private procedure contains any processing which is required after the
314 --   insert dml.
315 --
316 -- Prerequisites:
317 --   This is an internal procedure which is called from the ins procedure.
318 --
319 -- In Parameters:
320 --   A Pl/Sql record structre.
321 --
322 -- Post Success:
323 --   Processing continues.
324 --
325 -- Post Failure:
326 --   If an error has occurred, an error message and exception will be raised
327 --   but not handled.
328 --
329 -- Developer Implementation Notes:
330 --   Any post-processing required after the insert dml is issued should be
331 --   coded within this procedure. It is important to note that any 3rd party
332 --   maintenance should be reviewed before placing in this procedure.
333 --
334 -- Access Status:
335 --   Internal Row Handler Use Only.
336 --
337 -- {End Of Comments}
338 -- ----------------------------------------------------------------------------
339 Procedure post_insert(p_rec in pay_set_shd.g_rec_type) is
340 --
341   l_proc  varchar2(72) := g_package||'post_insert';
342 --
343 Begin
347 End post_insert;
344   hr_utility.set_location('Entering:'||l_proc, 5);
345   --
346   hr_utility.set_location(' Leaving:'||l_proc, 10);
348 --
349 -- ----------------------------------------------------------------------------
350 -- |---------------------------------< ins >----------------------------------|
351 -- ----------------------------------------------------------------------------
352 Procedure ins
353   (p_effective_date in            date
354   ,p_rec            in out nocopy pay_set_shd.g_rec_type
355   ) is
356 --
357   l_proc  varchar2(72) := g_package||'ins';
358 --
359 Begin
360   hr_utility.set_location('Entering:'||l_proc, 5);
361   --
362   -- Call the supporting insert validate operations
363   --
364   pay_set_bus.insert_validate(p_effective_date, p_rec);
365   --
366   -- Call the supporting pre-insert operation
367   --
368   pre_insert(p_rec);
369   --
370   -- Insert the row
371   --
372   insert_dml(p_rec);
373   --
374   -- Call the supporting post-insert operation
375   --
376   post_insert(p_rec);
377 end ins;
378 --
379 -- ----------------------------------------------------------------------------
380 -- |---------------------------------< ins >----------------------------------|
381 -- ----------------------------------------------------------------------------
382 Procedure ins
383   (
384   p_element_type_id              out nocopy number,
385   p_effective_date               in date,
386   p_template_id                  in number,
387   p_classification_name          in varchar2,
388   p_additional_entry_allowed_fla in varchar2,
389   p_adjustment_only_flag         in varchar2,
390   p_closed_for_entry_flag        in varchar2,
391   p_element_name                 in varchar2,
392   p_indirect_only_flag           in varchar2,
393   p_multiple_entries_allowed_fla in varchar2,
394   p_multiply_value_flag          in varchar2,
395   p_post_termination_rule        in varchar2,
396   p_process_in_run_flag          in varchar2,
397   p_relative_processing_priority in number,
398   p_processing_type              in varchar2         default null,
399   p_standard_link_flag           in varchar2,
400   p_input_currency_code          in varchar2         default null,
401   p_output_currency_code         in varchar2         default null,
402   p_benefit_classification_name  in varchar2         default null,
403   p_description                  in varchar2         default null,
404   p_qualifying_age               in number           default null,
405   p_qualifying_length_of_service in number           default null,
406   p_qualifying_units             in varchar2         default null,
407   p_reporting_name               in varchar2         default null,
408   p_attribute_category           in varchar2         default null,
409   p_attribute1                   in varchar2         default null,
410   p_attribute2                   in varchar2         default null,
411   p_attribute3                   in varchar2         default null,
412   p_attribute4                   in varchar2         default null,
413   p_attribute5                   in varchar2         default null,
414   p_attribute6                   in varchar2         default null,
415   p_attribute7                   in varchar2         default null,
416   p_attribute8                   in varchar2         default null,
417   p_attribute9                   in varchar2         default null,
418   p_attribute10                  in varchar2         default null,
419   p_attribute11                  in varchar2         default null,
420   p_attribute12                  in varchar2         default null,
421   p_attribute13                  in varchar2         default null,
422   p_attribute14                  in varchar2         default null,
423   p_attribute15                  in varchar2         default null,
424   p_attribute16                  in varchar2         default null,
425   p_attribute17                  in varchar2         default null,
426   p_attribute18                  in varchar2         default null,
427   p_attribute19                  in varchar2         default null,
428   p_attribute20                  in varchar2         default null,
429   p_element_information_category in varchar2         default null,
430   p_element_information1         in varchar2         default null,
431   p_element_information2         in varchar2         default null,
432   p_element_information3         in varchar2         default null,
433   p_element_information4         in varchar2         default null,
434   p_element_information5         in varchar2         default null,
435   p_element_information6         in varchar2         default null,
436   p_element_information7         in varchar2         default null,
437   p_element_information8         in varchar2         default null,
438   p_element_information9         in varchar2         default null,
439   p_element_information10        in varchar2         default null,
440   p_element_information11        in varchar2         default null,
441   p_element_information12        in varchar2         default null,
442   p_element_information13        in varchar2         default null,
443   p_element_information14        in varchar2         default null,
444   p_element_information15        in varchar2         default null,
445   p_element_information16        in varchar2         default null,
446   p_element_information17        in varchar2         default null,
447   p_element_information18        in varchar2         default null,
448   p_element_information19        in varchar2         default null,
449   p_element_information20        in varchar2         default null,
450   p_third_party_pay_only_flag    in varchar2         default null,
451   p_skip_formula                 in varchar2         default null,
452   p_payroll_formula_id           in number           default null,
453   p_exclusion_rule_id            in number           default null,
454   p_iterative_flag               in varchar2         default null,
455   p_iterative_priority           in number           default null,
456   p_iterative_formula_name       in varchar2         default null,
457   p_process_mode                 in varchar2         default null,
458   p_grossup_flag                 in varchar2         default null,
459   p_advance_indicator            in varchar2         default null,
460   p_advance_payable              in varchar2         default null,
461   p_advance_deduction            in varchar2         default null,
462   p_process_advance_entry        in varchar2         default null,
463   p_proration_group              in varchar2         default null,
464   p_proration_formula            in varchar2         default null,
465   p_recalc_event_group           in varchar2         default null,
466   p_once_each_period_flag        in varchar2         default null,
467   p_object_version_number        out nocopy number
468   ) is
469 --
470   l_rec	  pay_set_shd.g_rec_type;
471   l_proc  varchar2(72) := g_package||'ins';
472 --
473 Begin
474   hr_utility.set_location('Entering:'||l_proc, 5);
475   --
476   -- Call conversion function to turn arguments into the
477   -- p_rec structure.
478   --
479   l_rec :=
480   pay_set_shd.convert_args
481   (
482   null,
483   p_template_id,
484   p_classification_name,
485   p_additional_entry_allowed_fla,
486   p_adjustment_only_flag,
487   p_closed_for_entry_flag,
488   p_element_name,
489   p_indirect_only_flag,
490   p_multiple_entries_allowed_fla,
491   p_multiply_value_flag,
492   p_post_termination_rule,
493   p_process_in_run_flag,
494   p_relative_processing_priority,
495   p_processing_type,
496   p_standard_link_flag,
497   p_input_currency_code,
498   p_output_currency_code,
499   p_benefit_classification_name,
500   p_description,
501   p_qualifying_age,
502   p_qualifying_length_of_service,
503   p_qualifying_units,
504   p_reporting_name,
505   p_attribute_category,
506   p_attribute1,
507   p_attribute2,
508   p_attribute3,
509   p_attribute4,
510   p_attribute5,
511   p_attribute6,
512   p_attribute7,
513   p_attribute8,
514   p_attribute9,
515   p_attribute10,
516   p_attribute11,
517   p_attribute12,
518   p_attribute13,
519   p_attribute14,
520   p_attribute15,
521   p_attribute16,
522   p_attribute17,
523   p_attribute18,
524   p_attribute19,
525   p_attribute20,
526   p_element_information_category,
527   p_element_information1,
528   p_element_information2,
529   p_element_information3,
530   p_element_information4,
531   p_element_information5,
532   p_element_information6,
533   p_element_information7,
534   p_element_information8,
535   p_element_information9,
536   p_element_information10,
537   p_element_information11,
538   p_element_information12,
539   p_element_information13,
540   p_element_information14,
541   p_element_information15,
542   p_element_information16,
543   p_element_information17,
544   p_element_information18,
545   p_element_information19,
546   p_element_information20,
547   p_third_party_pay_only_flag,
548   p_skip_formula,
549   p_payroll_formula_id,
550   p_exclusion_rule_id,
551   p_iterative_flag,
552   p_iterative_priority,
553   p_iterative_formula_name,
554   p_process_mode,
555   p_grossup_flag,
556   p_advance_indicator,
557   p_advance_payable,
558   p_advance_deduction,
559   p_process_advance_entry,
560   p_proration_group,
561   p_proration_formula,
562   p_recalc_event_group,
563   p_once_each_period_flag,
564   null
565   );
566   --
567   -- Having converted the arguments into the pay_set_rec
568   -- plsql record structure we call the corresponding record business process.
569   --
570   ins(p_effective_date, l_rec);
571   --
572   -- As the primary key argument(s)
573   -- are specified as an OUT's we must set these values.
574   --
575   p_element_type_id := l_rec.element_type_id;
576   p_object_version_number := l_rec.object_version_number;
577   --
578   hr_utility.set_location(' Leaving:'||l_proc, 10);
579 End ins;
580 --
581 end pay_set_ins;