[Home] [Help]
PACKAGE: APPS.PAY_DB_PAY_SETUP
Source
1 package pay_db_pay_setup AUTHID CURRENT_USER as
2 /* $Header: pypsetup.pkh 120.0.12010000.1 2008/07/27 23:28:16 appldev ship $ */
3 --
4 /*
5
6 ******************************************************************
7 * *
8 * Copyright (C) 1989 Oracle Corporation UK Ltd., *
9 * Richmond, England. *
10 * *
11 * All rights reserved. *
12 * *
13 * This material has been provided pursuant to an agreement *
14 * containing restrictions on its use. The material is also *
15 * protected by copyright law. No part of this material may *
16 * be copied or distributed, transmitted or transcribed, in *
17 * any form or by any means, electronic, mechanical, magnetic, *
18 * manual, or otherwise, or disclosed to third parties without *
19 * the express written permission of Oracle Corporation UK Ltd, *
20 * Oracle Park, Bittams Lane, Guildford Road, Chertsey, Surrey, *
21 * England. *
22 * *
23 ******************************************************************
24
25 Name : pay_db_pay_setup
26
27 Description : This package holds building blocks for payroll
28
29 Uses : hr_elements
30 hr_utility
31 hr_balances
32 hr_payrolls
33
34 Used By : db_pay_vol_setup
35
36 Change List
37 -----------
38 Date Name Vers Bug No Description
39 ---- ---- ---- ------ -----------
40 22-Dec-92 J.S.Hobbs 3.0 Date Created with ;-
41 create_consolidation_set
42 create_element
43 create_input_value
44 create_payroll
45 create_balance_type
46 create_balance_classification
47 create_defined_balance
48 set_session_date
49 create_owner_definitions
50 create_element_link
51 19-Jan-93 J.S.Hobbs 3.1 Changed interface to
52 create_payroll.
53 20-Jan-92 J.S.Hobbs 3.2 Altered interface to allow the
54 passing of dates.
55 26-Jan-93 J.S.Hobbs 3.3 Changed default of mid point
56 offset to -15.
57 11-MAR-93 N Khan 3.4 added 'exit' to the end
58 27-APR-93 P.K.Attwood 3.5 Added:-
59 insert_customize_restriction
60 insert_restriction_values
61 04-AUG-93 D.E.Saxby 3.6 Removed p_legislation_code
62 from create_input_value.
63 21-Sep-93 J.S.Hobbs 40.02/ B231 Removed references to
64 30.10 SUPPLEMENTARY_RUN_FLAG.
65 Re: X12 Added
66 MULTIPLE_ENTRIES_ALLOWED_FLAG and
67 FORMULA_ID to create_element..
68 29-Sep-93 J.S.Hobbs 40.03/ X3 Added
69 30.11 ASSIGNMENT_REMUNERATION_FLAG to
70 create_balance_type.
71 08-Oct-93 D.E.Saxby 40.4/ No longer need to supply a
72 30.12 default payment method
73 for a payroll.
74 28-MAR-94 R.Neale 40.5 Added header info
75 31-MAR-94 A.McGhee 40.6 Moved header line into a
76 comment section.
77 19-JUN-95 N. Bristow 40.10 Added new parameter to
78 create_element, to indicate that
79 its a third party payment.
80 (p_third_party_pay_only)
81 15-JUL-96 S.Sinha 40.11 Added new parameter p_legislation_code
82 to create_input_value for starup logic.
83 29-Apr-01 V.Mehta 115.1 Added support for the following
84 'new' columns:
85 retro_summ_ele_id,
86 iterative_formula_id,
87 iterative_priority,
88 process_mode,
89 grossup_flag,
90 advance_indicator,
91 advance_payable,
92 advance_deduction,
93 process_advance_entry,
94 proration_group_id
95 03-JAN-02 J.Tomkins 115.2 Added dbdrv information
96 23-AUG-02 prsundar 115.4 Modified procedure create_elelment
97 to suppport the 2 newly added
98 columns proration_formula_id and
99 recalc_event_group_id on table
100 pay_element_types_f as part of
101 continuous calculation enhancement
102 03-OCT-02 M.Reid 115.5 Added uom code parameter to
103 create balance type
104 15-OCT-2002 RThirlby 115.6 Added support for new columns on
105 table pay_balance types -
106 balance_category_id, primary_
107 balance and base_balance - to
108 create_balance_type procedure.
109 Added support for save_run_balance
110 flag on pay_defined_balances to
111 create_defined_balance, either by
112 being passed in directly or
113 defaulted from category and
114 dimension.
115 17-OCT-2002 RThirlby 115.7 Overwrote 115.5 changes made by
116 M.Reid. Reinserting changes
117 and correcting version numbers.
118 12-MAR-2003 RThirlby 115.8 2831667 New parameter p_warn_error_code
119 added to create_input_value.
120 Required for MLS.
121 07-JUL-2003 Scchakra 115.9 1253330 Added function
122 get_default_currency.
123 10-JUL-2003 Scchakra 115.10 1253330 Defaulted p_rule_type to 'DC' in
124 get_default_currency.
125 24-MAY-2004 ALogue 115.11 3644216 Support of p_once_each_period_flag
126 in create_element.
127 */
128 --.
129 -------------------------------- create element -----------------------------
130 /*
131 NAME
132 create_element
133 DESCRIPTION
134 This is a function that creates an element type according to the parameters
135 passed to it.
136 NOTES
137 If the element to be created is a payroll element then it will also create a
138 default PAY_VALUE and status processing rule. Balance feeds will also be
139 created for balance fed by the same classification as that of the element.
140 */
141 --
142 FUNCTION create_element(p_element_name varchar2,
143 p_description varchar2 default NULL,
144 p_reporting_name varchar2 default NULL,
145 p_classification_name varchar2,
146 p_input_currency_code varchar2 default NULL,
147 p_output_currency_code varchar2 default NULL,
148 p_processing_type varchar2 default 'R',
149 p_mult_entries_allowed varchar2 default 'N',
150 p_formula_id number default NULL,
151 p_processing_priority number default NULL,
152 p_closed_for_entry_flag varchar2 default 'N',
153 p_standard_link_flag varchar2 default 'N',
154 p_qual_length_of_service number default NULL,
155 p_qual_units varchar2 default NULL,
156 p_qual_age number default NULL,
157 p_process_in_run_flag varchar2 default 'Y',
158 p_post_termination_rule varchar2,
159 p_indirect_only_flag varchar2 default 'N',
160 p_adjustment_only_flag varchar2 default 'N',
161 p_add_entry_allowed_flag varchar2 default 'N',
162 p_multiply_value_flag varchar2 default 'N',
163 p_effective_start_date date default NULL,
164 p_effective_end_date date default NULL,
165 p_business_group_name varchar2 default NULL,
166 p_legislation_code varchar2 default NULL,
167 p_legislation_subgroup varchar2 default NULL,
168 p_third_party_pay_only varchar2 default 'N',
169 p_retro_summ_ele_id number default null,
170 p_iterative_flag varchar2 default null,
171 p_iterative_formula_id number default null,
172 p_iterative_priority number default null,
173 p_process_mode varchar2 default null,
174 p_grossup_flag varchar2 default null,
175 p_advance_indicator varchar2 default null,
176 p_advance_payable varchar2 default null,
177 p_advance_deduction varchar2 default null,
178 p_process_advance_entry varchar2 default null,
179 p_proration_group_id number default null,
180 p_proration_formula_id number default null,
181 p_recalc_event_group_id number default null,
182 p_once_each_period_flag varchar2 default null
183 )
184 RETURN number;
185 --..
186 --.
187 ---------------------------- create_input_value -----------------------------
188 /*
189 NAME
190 create_input_value
191 DESCRIPTION
192 This is a function that creates an input value for an element according to
193 the parameters passed to it.
194 NOTES
195 If the input value is a PAY_VALUE then balance feeds fed by the same
196 classification as that of the element will be created.
197 */
198 --
199 FUNCTION create_input_value(p_element_name varchar2,
200 p_name varchar2,
201 p_uom varchar2 default null,
202 p_uom_code varchar2 default null,
203 p_mandatory_flag varchar2 default 'N',
204 p_generate_db_item_flag varchar2 default 'N',
205 p_default_value varchar2 default NULL,
206 p_min_value varchar2 default NULL,
207 p_max_value varchar2 default NULL,
208 p_warning_or_error varchar2 default NULL,
209 p_warn_or_error_code varchar2 default NULL,
210 p_lookup_type varchar2 default NULL,
211 p_formula_id number default NULL,
212 p_hot_default_flag varchar2 default 'N',
213 p_display_sequence number,
214 p_business_group_name varchar2 default NULL,
215 p_effective_start_date date default NULL,
216 p_effective_end_date date default NULL,
217 p_legislation_code varchar2 default NULL)
218 RETURN number;
219 --..
220 --.
221 -------------------------------- create_payroll -----------------------------
222 /*
223 NAME
224 create_payroll
225 DESCRIPTION
226 This function creates a payroll and passes back the payroll_id for future
227 reference.
228 NOTES
229 On creation it will create a calendar for the payroll.
230 */
231 --
232 FUNCTION create_payroll(p_payroll_name varchar2,
233 p_number_of_years number,
234 p_period_type varchar2,
235 p_first_period_end_date date,
236 p_dflt_payment_method varchar2 default NULL,
237 p_pay_date_offset number default 0,
238 p_direct_deposit_date_offset number default 0,
239 p_pay_advice_date_offset number default 0,
240 p_cut_off_date_offset number default 0,
241 p_consolidation_set_name varchar2,
242 p_negative_pay_allowed_flag varchar2 default 'N',
243 p_organization_name varchar2 default NULL,
244 p_midpoint_offset number default 0,
245 p_workload_shifting_level varchar2 default 'N',
246 p_cost_all_keyflex_id number default NULL,
247 p_gl_set_of_books_id number default NULL,
248 p_soft_coding_keyflex_id number default NULL,
249 p_effective_start_date date default NULL,
250 p_effective_end_date date default NULL,
251 p_business_group_name varchar2)
252 RETURN number;
253 --..
254 --.
255 ---------------------------- create_consoldation_set ------------------------
256 /*
257 NAME
258 create_consoldation_set
259 DESCRIPTION
260 This function creates a consolidation set and passes back the
261 consolidation_set_id for future use.
262 NOTES
263 */
264 --
265 FUNCTION create_consolidation_set(p_consolidation_set_name varchar2,
266 p_business_group_name varchar2)
270 -------------------------- create_owner_definitions --------------------------
267 RETURN number;
268 --..
269 --.
271 /*
272 NAME
273 create_owner_definitions
274 DESCRIPTION
275 This procedure populates the product name for the current session into the
276 owner defintions table. This mis used when creating startup data to
277 identify which products the data is for.
278 NOTES
279 */
280 --
281 PROCEDURE create_owner_definitions(p_app_short_name varchar2);
282 --..
283 --.
284 -------------------------- set_session_dates ---------------------------------
285 /*
286 NAME
287 set_session_date
288 DESCRIPTION
289 Sets the session date for use in creating date tracked information
290 NOTES
291 */
292 --
293 PROCEDURE set_session_date(p_session_date date);
294 --..
295 --.
296 -------------------------- create_element_link -------------------------------
297 /*
298 NAME
299 create_element_link
300 DESCRIPTION
301 This procedure creates sn element link for an element type.
302 NOTES
303 */
304 --
305 FUNCTION create_element_link(p_payroll_name varchar2 default NULL,
306 p_job_name varchar2 default NULL,
307 p_position_name varchar2 default NULL,
308 p_people_group_name varchar2 default NULL,
309 p_cost_all_keyflex_id number default NULL,
310 p_organization_name varchar2 default NULL,
311 p_element_name varchar2,
312 p_location_id number default NULL,
313 p_grade_name varchar2 default NULL,
314 p_balancing_keyflex_id number default NULL,
315 p_element_set_id number default NULL,
316 p_costable_type varchar2 default 'N',
317 p_link_to_all_pyrlls_fl varchar2 default 'N',
318 p_multiply_value_flag varchar2 default 'N',
319 p_standard_link_flag varchar2 default NULL,
320 p_transfer_to_gl_flag varchar2 default 'N',
321 p_qual_age number default NULL,
322 p_qual_lngth_of_service number default NULL,
323 p_qual_units varchar2 default NULL,
324 p_effective_start_date date default NULL,
325 p_effective_end_date date default NULL,
326 p_business_group_name varchar2)
327 RETURN number;
328 --..
329 --.
330 --------------------------- create_balance_type ------------------------------
331 /*
332 NAME
333 create_balance_type
334 DESCRIPTION
335 Creates a new balance.
336 NOTES
337 */
338 --
339 FUNCTION create_balance_type(p_balance_name varchar2,
340 p_uom varchar2,
341 p_uom_code varchar2 default NULL,
342 p_ass_remuneration_flag varchar2 default 'N',
343 p_currency_code varchar2 default NULL,
344 p_reporting_name varchar2 default NULL,
345 p_business_group_name varchar2 default NULL,
346 p_legislation_code varchar2 default NULL,
347 p_legislation_subgroup varchar2 default NULL,
348 p_balance_category varchar2 default null,
349 p_bc_leg_code varchar2 default null,
350 p_effective_date date default null,
351 p_base_balance_name varchar2 default null,
352 p_primary_element_name varchar2 default null,
353 p_primary_iv_name varchar2 default null)
354 RETURN number;
355 --..
356 --.
357 ----------------------- create_balance_classification ------------------------
358 /*
359 NAME
360 create_balance_classification
361 DESCRIPTION
362 This procedure adds a new classification to the balance.
363 NOTES
364 Balance feeds will be created for any elements with a PAY VALUE that matches
365 the balance.
366 */
367 --
368 PROCEDURE create_balance_classification
369 (p_balance_name varchar2,
370 p_balance_classification varchar2,
371 p_scale varchar2,
372 p_business_group_name varchar2 default NULL,
373 p_legislation_code varchar2 default NULL);
374 --..
375 --.
376 --------------------------- create_defined_balance ---------------------------
377 /*
378 NAME
379 create_defined_balance
380 DESCRIPTION
381 Associates a balance with a dimension.
382 NOTES
383 */
384 --
385 PROCEDURE create_defined_balance
386 (p_balance_name varchar2,
387 p_balance_dimension varchar2,
388 p_frce_ltst_balance_flag varchar2 default 'N',
389 p_business_group_name varchar2 default NULL,
390 p_legislation_code varchar2 default NULL,
391 p_save_run_bal varchar2 default null,
392 p_effective_date date default null);
393 --..
394
395 --.
396 ------------------------ insert_customize_restriction ------------------------
397 /*
398 NAME
399 insert_customize_restriction
400 DESCRIPTION
401 Creates a new customize restriction type.
402 NOTES
403 This function returns the customized_restriction_id of the row it has
404 created and inserted into pay_customized_restrictions.
405 */
406 --
407 FUNCTION insert_customize_restriction
408 ( p_business_group_id number default NULL,
409 p_name varchar2,
410 p_form_name varchar2,
411 p_query_form_title varchar2,
412 p_standard_form_title varchar2,
413 p_enabled_flag varchar2 default 'N',
414 p_legislation_subgroup varchar2 default NULL,
415 p_legislation_code varchar2 default NULL
416 ) return number;
417 --
418 ------------------------- insert_restriction_values --------------------------
419 /*
420 NAME
421 insert_restriction_values
422 DESCRIPTION
423 This procedure adds a new restriction value for the specified customization
424 restriction.
425 NOTES */
426 --
427 PROCEDURE insert_restriction_values
428 ( p_customized_restriction_id number,
429 p_restriction_code varchar2,
430 p_value varchar2
431 );
432
433 --..
434 --.
435 ------------------------ get_default_currency ------------------------
436 /*
437 NAME
438 get_default_currency
439 DESCRIPTION
440 Fetches the default currency for a given legislation.
441 NOTES
442 This function returns the default currency code from the 'DC'
443 legislation rule. If not found then fetches the enabled currency
444 from fnd_currencies table.
445 */
446 --
447 FUNCTION get_default_currency
448 (p_rule_type in varchar2 default 'DC'
449 ,p_legislation_code in varchar2
450 ) return varchar2;
451
452 --..
453
454 end pay_db_pay_setup;