[Home] [Help]
PACKAGE: APPS.PAY_FR_DB_PAY_SETUP
Source
1 package pay_fr_db_pay_setup AUTHID CURRENT_USER as
2 /* $Header: pyfrsetp.pkh 120.0 2005/05/29 05:09:41 appldev noship $ */
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 30-JUL-2003 ASNELL 115.3 Recloned from pypsetup.pkh to
126 keep in step
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 )
183 RETURN number;
184 --..
185 --.
186 ---------------------------- create_input_value -----------------------------
187 /*
188 NAME
189 create_input_value
190 DESCRIPTION
191 This is a function that creates an input value for an element according to
192 the parameters passed to it.
193 NOTES
194 If the input value is a PAY_VALUE then balance feeds fed by the same
195 classification as that of the element will be created.
196 */
197 --
198 FUNCTION create_input_value(p_element_name varchar2,
199 p_name varchar2,
200 p_uom varchar2 default null,
201 p_uom_code varchar2 default null,
202 p_mandatory_flag varchar2 default 'N',
203 p_generate_db_item_flag varchar2 default 'N',
204 p_default_value varchar2 default NULL,
205 p_min_value varchar2 default NULL,
206 p_max_value varchar2 default NULL,
207 p_warning_or_error varchar2 default NULL,
208 p_warn_or_error_code varchar2 default NULL,
209 p_lookup_type varchar2 default NULL,
210 p_formula_id number default NULL,
211 p_hot_default_flag varchar2 default 'N',
212 p_display_sequence number,
213 p_business_group_name varchar2 default NULL,
214 p_effective_start_date date default NULL,
215 p_effective_end_date date default NULL,
216 p_legislation_code varchar2 default NULL)
217 RETURN number;
218 --..
219 --.
220 -------------------------------- create_payroll -----------------------------
221 /*
222 NAME
223 create_payroll
224 DESCRIPTION
225 This function creates a payroll and passes back the payroll_id for future
226 reference.
227 NOTES
228 On creation it will create a calendar for the payroll.
229 */
230 --
231 FUNCTION create_payroll(p_payroll_name varchar2,
232 p_number_of_years number,
233 p_period_type varchar2,
234 p_first_period_end_date date,
235 p_dflt_payment_method varchar2 default NULL,
236 p_pay_date_offset number default 0,
237 p_direct_deposit_date_offset number default 0,
238 p_pay_advice_date_offset number default 0,
239 p_cut_off_date_offset number default 0,
240 p_consolidation_set_name varchar2,
241 p_negative_pay_allowed_flag varchar2 default 'N',
242 p_organization_name varchar2 default NULL,
243 p_midpoint_offset number default 0,
244 p_workload_shifting_level varchar2 default 'N',
245 p_cost_all_keyflex_id number default NULL,
246 p_gl_set_of_books_id number default NULL,
247 p_soft_coding_keyflex_id number default NULL,
248 p_effective_start_date date default NULL,
249 p_effective_end_date date default NULL,
250 p_business_group_name varchar2)
251 RETURN number;
252 --..
253 --.
254 ---------------------------- create_consoldation_set ------------------------
255 /*
256 NAME
257 create_consoldation_set
258 DESCRIPTION
259 This function creates a consolidation set and passes back the
260 consolidation_set_id for future use.
261 NOTES
262 */
263 --
264 FUNCTION create_consolidation_set(p_consolidation_set_name varchar2,
265 p_business_group_name varchar2)
266 RETURN number;
267 --..
268 --.
269 -------------------------- create_owner_definitions --------------------------
270 /*
271 NAME
272 create_owner_definitions
273 DESCRIPTION
274 This procedure populates the product name for the current session into the
275 owner defintions table. This mis used when creating startup data to
276 identify which products the data is for.
277 NOTES
278 */
279 --
280 PROCEDURE create_owner_definitions(p_app_short_name varchar2);
281 --..
282 --.
283 -------------------------- set_session_dates ---------------------------------
284 /*
285 NAME
286 set_session_date
287 DESCRIPTION
288 Sets the session date for use in creating date tracked information
289 NOTES
290 */
291 --
292 PROCEDURE set_session_date(p_session_date date);
296 /*
293 --..
294 --.
295 -------------------------- create_element_link -------------------------------
297 NAME
298 create_element_link
299 DESCRIPTION
300 This procedure creates sn element link for an element type.
301 NOTES
302 */
303 --
304 FUNCTION create_element_link(p_payroll_name varchar2 default NULL,
305 p_job_name varchar2 default NULL,
306 p_position_name varchar2 default NULL,
307 p_people_group_name varchar2 default NULL,
308 p_cost_all_keyflex_id number default NULL,
309 p_organization_name varchar2 default NULL,
310 p_element_name varchar2,
311 p_location_id number default NULL,
312 p_grade_name varchar2 default NULL,
313 p_balancing_keyflex_id number default NULL,
314 p_element_set_id number default NULL,
315 p_costable_type varchar2 default 'N',
316 p_link_to_all_pyrlls_fl varchar2 default 'N',
317 p_multiply_value_flag varchar2 default 'N',
318 p_standard_link_flag varchar2 default NULL,
319 p_transfer_to_gl_flag varchar2 default 'N',
320 p_qual_age number default NULL,
321 p_qual_lngth_of_service number default NULL,
322 p_qual_units varchar2 default NULL,
323 p_effective_start_date date default NULL,
324 p_effective_end_date date default NULL,
325 p_business_group_name varchar2)
326 RETURN number;
327 --..
328 --.
329 --------------------------- create_balance_type ------------------------------
330 /*
331 NAME
332 create_balance_type
333 DESCRIPTION
334 Creates a new balance.
335 NOTES
336 */
337 --
338 FUNCTION create_balance_type(p_balance_name varchar2,
339 p_uom varchar2,
340 p_uom_code varchar2 default NULL,
341 p_ass_remuneration_flag varchar2 default 'N',
342 p_currency_code varchar2 default NULL,
343 p_reporting_name varchar2 default NULL,
344 p_business_group_name varchar2 default NULL,
345 p_legislation_code varchar2 default NULL,
346 p_legislation_subgroup varchar2 default NULL,
347 p_balance_category varchar2 default null,
348 p_bc_leg_code varchar2 default null,
349 p_effective_date date default null,
350 p_base_balance_name varchar2 default null,
351 p_primary_element_name varchar2 default null,
352 p_primary_iv_name varchar2 default null)
353 RETURN number;
354 --..
355 --.
356 ----------------------- create_balance_classification ------------------------
357 /*
358 NAME
359 create_balance_classification
360 DESCRIPTION
361 This procedure adds a new classification to the balance.
362 NOTES
363 Balance feeds will be created for any elements with a PAY VALUE that matches
364 the balance.
365 */
366 --
367 PROCEDURE create_balance_classification
368 (p_balance_name varchar2,
369 p_balance_classification varchar2,
370 p_scale varchar2,
371 p_business_group_name varchar2 default NULL,
372 p_legislation_code varchar2 default NULL);
373 --..
374 --.
375 --------------------------- create_defined_balance ---------------------------
376 /*
377 NAME
378 create_defined_balance
379 DESCRIPTION
380 Associates a balance with a dimension.
381 NOTES
382 */
383 --
384 PROCEDURE create_defined_balance
385 (p_balance_name varchar2,
386 p_balance_dimension varchar2,
387 p_frce_ltst_balance_flag varchar2 default 'N',
388 p_business_group_name varchar2 default NULL,
389 p_legislation_code varchar2 default NULL,
390 p_save_run_bal varchar2 default null,
391 p_effective_date date default null);
392 --..
393
394 --.
395 ------------------------ insert_customize_restriction ------------------------
396 /*
397 NAME
398 insert_customize_restriction
399 DESCRIPTION
400 Creates a new customize restriction type.
401 NOTES
402 This function returns the customized_restriction_id of the row it has
403 created and inserted into pay_customized_restrictions.
404 */
405 --
406 FUNCTION insert_customize_restriction
407 ( p_business_group_id number default NULL,
411 p_standard_form_title varchar2,
408 p_name varchar2,
409 p_form_name varchar2,
410 p_query_form_title varchar2,
412 p_enabled_flag varchar2 default 'N',
413 p_legislation_subgroup varchar2 default NULL,
414 p_legislation_code varchar2 default NULL
415 ) return number;
416 --
417 ------------------------- insert_restriction_values --------------------------
418 /*
419 NAME
420 insert_restriction_values
421 DESCRIPTION
422 This procedure adds a new restriction value for the specified customization
423 restriction.
424 NOTES */
425 --
426 PROCEDURE insert_restriction_values
427 ( p_customized_restriction_id number,
428 p_restriction_code varchar2,
429 p_value varchar2
430 );
431
432 --..
433 --.
434 ------------------------ get_default_currency ------------------------
435 /*
436 NAME
437 get_default_currency
438 DESCRIPTION
439 Fetches the default currency for a given legislation.
440 NOTES
441 This function returns the default currency code from the 'DC'
442 legislation rule. If not found then fetches the enabled currency
443 from fnd_currencies table.
444 */
445 --
446 FUNCTION get_default_currency
447 (p_rule_type in varchar2 default 'DC'
448 ,p_legislation_code in varchar2
449 ) return varchar2;
450
451 --..
452
453 end pay_fr_db_pay_setup;