1 PACKAGE HR_BALANCE_FEEDS AUTHID CURRENT_USER as
2 /* $Header: pybalfed.pkh 115.2 2003/04/15 09:26:44 rthirlby ship $ */
3 --
4 /*===========================================================================+
5 | Copyright (c) 1993 Oracle Corporation |
6 | Redwood Shores, California, USA |
7 | All rights reserved. |
8 +============================================================================+
9 Name
10 hr_balance_feeds
11 Purpose
12 Maintains balances feeds. It provides functions and procedures
13 to allow the safe creation of manual balance feeds as well as
14 procedures to generate automatic balance feeds ie. when adding a
15 balance classification, adding a sub classification rule etc ...
16 Notes
17
18 History
19 01-Mar-94 J.S.Hobbs 40.0 Date created.
20 30-JUL-2002 RThirlby 115.1 Bug 2430399 Added p_mode parameter to
21 ins_bf_bal_class, so can be called from
22 hr_legislation, and not raise an error
23 in ins_bal_feed, if the feed already
24 exists.
25 14-APR-2003 RThirlby 115.2 Bug 2888183. Added p_mode parameter to
26 ins_bf_sub_class_rule and
27 ins_bf_pay_value, so they can be called
28 from hr_legislation_elements, and not
29 raise an error in ins_bal_feed, if the
30 feed already exists.
31 ============================================================================*/
32 --
33 ------------------------------------------------------------------------------
34 -- NAME --
35 -- bal_classifications_exist --
36 -- --
37 -- DESCRIPTION --
38 -- Returns TRUE if a balance classification exists. --
39 ------------------------------------------------------------------------------
40 --
41 function bal_classifications_exist
42 (
43 p_balance_type_id number
44 ) return boolean;
45 --
46 ------------------------------------------------------------------------------
47 -- NAME --
48 -- manual_bal_feeds_exist --
49 -- --
50 -- DESCRIPTION --
51 -- Returns TRUE if a manual balance feed exists. --
52 ------------------------------------------------------------------------------
53 --
54 function manual_bal_feeds_exist
55 (
56 p_balance_type_id number
57 ) return boolean;
58 --
59 ------------------------------------------------------------------------------
60 -- NAME --
61 -- lock_balance_type --
62 -- --
63 -- DESCRIPTION --
64 -- Takes a row level lock out on a specified balance type. --
65 ------------------------------------------------------------------------------
66 --
67 procedure lock_balance_type
68 (
69 p_balance_type_id number
70 );
71 --
72 ------------------------------------------------------------------------------
73 -- NAME --
74 -- bal_feed_end_date --
75 -- --
76 -- DESCRIPTION --
77 -- Returns the correct end date for a balance feed. It takes into account --
78 -- the end date of the input value and also any future balance feeds. --
79 ------------------------------------------------------------------------------
80 --
81 function bal_feed_end_date
82 (
83 p_balance_feed_id number,
84 p_balance_type_id number,
85 p_input_value_id number,
86 p_session_date date,
87 p_validation_start_date date
88 ) return date;
89 --
90 ------------------------------------------------------------------------------
91 -- NAME --
92 -- pay_value_name --
93 -- --
94 -- DESCRIPTION --
95 -- Returns the translated name for the 'Pay Value'. --
96 ------------------------------------------------------------------------------
97 --
98 function pay_value_name return varchar2;
99 --
100 ------------------------------------------------------------------------------
101 -- NAME --
102 -- ins_bf_bal_class --
103 -- --
104 -- DESCRIPTION --
105 -- Creates balance feeds when a balance classification has been added. --
106 -- Parameter p_mode added, so can be run from hr_legislation, without --
107 -- raising an error when a feed already exists. Valid modes are 'FORM' for --
108 -- original functionality, and 'STARTUP' for hr_legislation functionality. --
109 ------------------------------------------------------------------------------
110 --
111 procedure ins_bf_bal_class
112 (
113 p_balance_type_id number,
114 p_balance_classification_id number,
115 p_mode varchar2 default 'FORM'
116 );
117 --
118 ------------------------------------------------------------------------------
119 -- NAME --
120 -- upd_del_bf_bal_class --
121 -- --
122 -- DESCRIPTION --
123 -- When updating or deleting a balance classification cascade to linked --
124 -- balance feeds NB. the parameter p_mode is used to specify which ie. --
125 -- 'UPDATE' or 'DELETE'. --
126 ------------------------------------------------------------------------------
127 --
128 procedure upd_del_bf_bal_class
129 (
130 p_mode varchar2,
131 p_balance_classification_id number,
132 p_scale number
133 );
134 --
135 ------------------------------------------------------------------------------
136 -- NAME --
137 -- ins_bf_pay_value --
138 -- --
139 -- DESCRIPTION --
140 -- Creates balance feeds when a pay value is created. --
141 -- Parameter p_mode added, so can be run from hr_legislation_elements, --
142 -- without raising an error when a feed already exists. Valid modes are --
143 -- 'FORM' for original functionality, and 'STARTUP' for hr_legislation --
144 -- functionality. --
145 ------------------------------------------------------------------------------
146 --
147 procedure ins_bf_pay_value
148 (
149 p_input_value_id number
150 ,p_mode varchar2 default 'FORM'
151 );
152 --
153 ------------------------------------------------------------------------------
154 -- NAME --
155 -- ins_bf_sub_class_rule --
156 -- --
157 -- DESCRIPTION --
158 -- Creates automatic balance feeds when a sub classification rule is added. --
159 -- Parameter p_mode added, so can be run from hr_legislation_elements, --
160 -- without raising an error when a feed already exists. Valid modes are --
161 -- 'FORM' for original functionality, and 'STARTUP' for hr_legislation --
162 -- functionality. --
163 ------------------------------------------------------------------------------
164 --
165 procedure ins_bf_sub_class_rule
166 (
167 p_sub_classification_rule_id number
168 ,p_mode varchar2 default 'FORM'
169 );
170 --
171 ------------------------------------------------------------------------------
172 -- NAME --
173 -- del_bf_input_value --
174 -- --
175 -- DESCRIPTION --
176 -- Adjusts or removes balance feeds when an input value is deleted NB. --
177 -- when shortening an input value all related balance feeds are shortened. --
178 -- When extending a balance feed then only automatic balance feeds are --
179 -- extended. --
180 ------------------------------------------------------------------------------
181 --
182 procedure del_bf_input_value
183 (
184 p_input_value_id number,
185 p_dt_mode varchar2,
186 p_validation_start_date date,
187 p_validation_end_date date
188 );
189 --
190 ------------------------------------------------------------------------------
191 -- NAME --
192 -- del_bf_sub_class_rule --
193 -- --
194 -- DESCRIPTION --
195 -- Adjusts or removes balance feeds when a sub classification rule is --
196 -- deleted NB. this only affects automatic balance feeds. --
197 ------------------------------------------------------------------------------
198 --
199 procedure del_bf_sub_class_rule
200 (
201 p_sub_classification_rule_id number,
202 p_dt_mode varchar2,
203 p_validation_start_date date,
204 p_validation_end_date date
205 );
206 --
207 ------------------------------------------------------------------------------
208 -- NAME --
209 -- chk_proc_run_results --
210 -- --
211 -- DESCRIPTION --
212 -- Detects if a change in a balance feed could result in a change of a --
213 -- balance value ie. the period over which the balance feed changes --
214 -- overlaps with a processed run result NB. the change in balance feed --
215 -- couold be caused by a manual change, removing a sub classification etc.. --
216 ------------------------------------------------------------------------------
217 --
218 function bf_chk_proc_run_results
219 (
220 p_mode varchar2,
221 p_dml_mode varchar2,
222 p_balance_type_id number,
223 p_classification_id number,
224 p_balance_classification_id number,
225 p_balance_feed_id number,
226 p_sub_classification_rule_id number,
227 p_input_value_id number,
228 p_validation_start_date date,
229 p_validation_end_date date
230 ) return boolean;
231 --
232 end HR_BALANCE_FEEDS;