30: -- Version Date Author Bug No. Description of Change
31: -- ------- ----------- -------- ------- -----------------------------
32: -- 115.0 06-JUN-2000 JBailie Initial Version
33: -- 115.1 21-JUL-2000 JBailie Set ship state
34: -- 115.2 27-JUL-2000 JBailie Removed hr_utility.trace_on
35: -- 115.3 29-NOV-2001 Ragovind 2129823 GSCC Compliance Check
36: -- 115.4 10-DEC-2001 Rsirigir 2107303 added this line
37: -- REM checkfile:~PROD:~PATH:~FILE
38: -- after
72: --
73: BEGIN
74: --
75: retcode := 2;
76: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
77: hr_utility.set_message_token('PROCEDURE', 'pysgbupl.'||p_procedure);
78: hr_utility.set_message_token('STEP', p_step);
79: hr_utility.raise_error;
80: --
73: BEGIN
74: --
75: retcode := 2;
76: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
77: hr_utility.set_message_token('PROCEDURE', 'pysgbupl.'||p_procedure);
78: hr_utility.set_message_token('STEP', p_step);
79: hr_utility.raise_error;
80: --
81: END local_error;
74: --
75: retcode := 2;
76: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
77: hr_utility.set_message_token('PROCEDURE', 'pysgbupl.'||p_procedure);
78: hr_utility.set_message_token('STEP', p_step);
79: hr_utility.raise_error;
80: --
81: END local_error;
82: --
75: retcode := 2;
76: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
77: hr_utility.set_message_token('PROCEDURE', 'pysgbupl.'||p_procedure);
78: hr_utility.set_message_token('STEP', p_step);
79: hr_utility.raise_error;
80: --
81: END local_error;
82: --
83: --
95: begin
96: --
97: -- Search for the defined balance in the Cache.
98: --
99: hr_utility.set_location('pysgbupl.check_balance_type', 10);
100: l_balance_type_id := null;
101: l_baltyp_name := upper(p_baltype_name);
102: l_count := 1;
103: l_found := FALSE;
102: l_count := 1;
103: l_found := FALSE;
104: while (l_count < g_nxt_free_baltyp and l_found = FALSE) loop
105: if (l_baltyp_name = g_baltyp_tbl_name(l_count)) then
106: hr_utility.set_location('pysgbupl.check_balance_type', 20);
107: l_balance_type_id := g_baltyp_tbl_id(l_count);
108: l_found := TRUE;
109: end if;
110: l_count := l_count + 1;
111: end loop;
112: --
113: -- If the balance is not in the Cache get it from the database.
114: --
115: hr_utility.set_location('pysgbupl.check_balance_type', 30);
116: if (l_found = FALSE) then
117: BEGIN
118: --
119: select balance_type_id,
131: --
132: --
133: -- Place the defined balance in cache.
134: --
135: hr_utility.set_location('pysgbupl.check_balance_type', 40);
136: g_baltyp_tbl_name(g_nxt_free_baltyp) := l_baltyp_name;
137: g_baltyp_tbl_uom(g_nxt_free_baltyp) := l_bal_uom;
138: g_baltyp_tbl_id(g_nxt_free_baltyp) := l_balance_type_id;
139: g_nxt_free_baltyp := g_nxt_free_baltyp + 1;
138: g_baltyp_tbl_id(g_nxt_free_baltyp) := l_balance_type_id;
139: g_nxt_free_baltyp := g_nxt_free_baltyp + 1;
140: --
141: EXCEPTION WHEN no_data_found THEN
142: hr_utility.trace('Error: Failure to find balance type');
143: local_error(retcode, 'check_balance_type',1);
144: --
145: END;
146: --
164: begin
165: --
166: -- Search for the defined balance in the Cache.
167: --
168: hr_utility.set_location('pysgbupl.check_balance_dim', 10);
169: l_balance_dim_id := null;
170: l_baldim_name := upper(p_baldim_name);
171: l_count := 1;
172: l_found := FALSE;
171: l_count := 1;
172: l_found := FALSE;
173: while (l_count < g_nxt_free_baldim and l_found = FALSE) loop
174: if (l_baldim_name = g_baldim_tbl_name(l_count)) then
175: hr_utility.set_location('pysgbupl.check_balance_dim', 20);
176: l_balance_dim_id := g_baldim_tbl_id(l_count);
177: l_found := TRUE;
178: end if;
179: l_count := l_count + 1;
180: end loop;
181: --
182: -- If the balance is not in the Cache get it from the database.
183: --
184: hr_utility.set_location('pysgbupl.check_balance_dim', 30);
185: if (l_found = FALSE) then
186: BEGIN
187: --
188: select balance_dimension_id
198: --
199: --
200: -- Place the defined balance in cache.
201: --
202: hr_utility.set_location('pysgbupl.check_balance_dim', 40);
203: g_baldim_tbl_name(g_nxt_free_baldim) := l_baldim_name;
204: g_baldim_tbl_id(g_nxt_free_baldim) := l_balance_dim_id;
205: g_nxt_free_baldim := g_nxt_free_baldim + 1;
206: --
204: g_baldim_tbl_id(g_nxt_free_baldim) := l_balance_dim_id;
205: g_nxt_free_baldim := g_nxt_free_baldim + 1;
206: --
207: EXCEPTION WHEN no_data_found THEN
208: hr_utility.trace('Error: Failure to find balance dimension');
209: local_error(retcode,'check_balance_dim',2);
210: --
211: END;
212: --
236: from pay_balance_batch_lines
237: where batch_id = c_batch_id;
238: --
239: BEGIN
240: hr_utility.set_location('pysgbupl.validate_batch_data', 10);
241: BEGIN /* check business group exists */
242: select hou.business_group_id,
243: hou.legislation_code
244: into l_bg_id,
250: EXCEPTION WHEN no_data_found THEN
251: local_error(retcode, 'validate_batch_data', 3);
252: END;
253: --
254: hr_utility.set_location('pysgbupl.validate_batch_data', 20);
255: for l_each_batch_rec in c_each_batch (p_batch_id) loop
256: check_balance_type(l_bt_id, l_each_batch_rec.balance_name,
257: l_bg_id,
258: l_leg_code,
309: --
310: --
311: BEGIN
312: --
313: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 10);
314: --
315: hr_utility.trace('Started Processing');
316: --
317: select pbg.business_group_id, bbh.business_group_name, pbg.currency_code
311: BEGIN
312: --
313: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 10);
314: --
315: hr_utility.trace('Started Processing');
316: --
317: select pbg.business_group_id, bbh.business_group_name, pbg.currency_code
318: into l_bg_id, l_bg_name, l_bg_currency_code
319: from pay_balance_batch_headers bbh,
322: and upper(pbg.name) = upper(bbh.business_group_name);
323: --
324: retcode := validate_batch_data (p_batch_id);
325: --
326: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 20);
327: --
328: /* calculate no of elements needed based on 15 input values per element*/
329: l_n_elems := ceil ((g_nxt_free_baltyp - 1) / p_input_value_limit);
330:
330:
331: l_bal_count := 1;
332: for i in 1 .. l_n_elems loop
333: --
334: hr_utility.trace('i='||to_char(i));
335: --
336: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 30);
337: j := 1;
338: while (l_bal_count< g_nxt_free_baltyp and j <= p_input_value_limit) loop
332: for i in 1 .. l_n_elems loop
333: --
334: hr_utility.trace('i='||to_char(i));
335: --
336: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 30);
337: j := 1;
338: while (l_bal_count< g_nxt_free_baltyp and j <= p_input_value_limit) loop
339:
340: hr_utility.trace('j='||to_char(j));
336: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 30);
337: j := 1;
338: while (l_bal_count< g_nxt_free_baltyp and j <= p_input_value_limit) loop
339:
340: hr_utility.trace('j='||to_char(j));
341:
342: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 40);
343: --
344: -- Does this balance already have an initial balance feed.
338: while (l_bal_count< g_nxt_free_baltyp and j <= p_input_value_limit) loop
339:
340: hr_utility.trace('j='||to_char(j));
341:
342: hr_utility.set_location('pysgbupl.create_bal_upl_struct', 40);
343: --
344: -- Does this balance already have an initial balance feed.
345: --
346: open csr_is_balance_fed(g_baltyp_tbl_id(l_bal_count),l_bg_id);
350: /*
351: If this is the first balance found for this element
352: create the element.
353: */
354: hr_utility.trace('Processing: '||g_baltyp_tbl_name(l_bal_count));
355:
356: if j = 1 then
357: /*
358: create an element type and name it as follows:
364: p_batch_id || -- as means to identify
365: '_' || -- elements to delete
366: to_char(i); -- by the Undo
367: --
368: hr_utility.trace ('Element Name is:' || l_element_name);
369: --
370: l_element_type_id := pay_db_pay_setup.create_element (
371: p_element_name => l_element_name,
372: p_effective_start_date => to_date('01/01/0001','DD/MM/YYYY'),
455: end loop;
456: --
457: end loop;
458: --
459: hr_utility.trace('Finished Processing');
460: commit;
461: --
462: END create_bal_upl_struct;
463: --