30: l_api_updating boolean;
31: l_valid varchar2(1);
32: --
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: open csr_get_template_info;
36: fetch csr_get_template_info
37: into p_template_id;
38: close csr_get_template_info;
35: open csr_get_template_info;
36: fetch csr_get_template_info
37: into p_template_id;
38: close csr_get_template_info;
39: hr_utility.set_location(' Leaving:'||l_proc, 15);
40: End get_template_info;
41: -- ----------------------------------------------------------------------------
42: -- |-----------------------< chk_non_updateable_args >------------------------|
43: -- ----------------------------------------------------------------------------
61: l_api_updating boolean;
62: l_disallow varchar2(1);
63: --
64: Begin
65: hr_utility.set_location('Entering:'||l_proc, 5);
66: l_api_updating := pay_sbf_shd.api_updating
67: (p_balance_feed_id => p_rec.balance_feed_id
68: ,p_object_version_number => p_rec.object_version_number
69: );
67: (p_balance_feed_id => p_rec.balance_feed_id
68: ,p_object_version_number => p_rec.object_version_number
69: );
70: if not l_api_updating then
71: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
72: hr_utility.set_message_token('PROCEDURE', l_proc);
73: hr_utility.set_message_token('STEP', '10');
74: hr_utility.raise_error;
75: end if;
68: ,p_object_version_number => p_rec.object_version_number
69: );
70: if not l_api_updating then
71: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
72: hr_utility.set_message_token('PROCEDURE', l_proc);
73: hr_utility.set_message_token('STEP', '10');
74: hr_utility.raise_error;
75: end if;
76: --
69: );
70: if not l_api_updating then
71: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
72: hr_utility.set_message_token('PROCEDURE', l_proc);
73: hr_utility.set_message_token('STEP', '10');
74: hr_utility.raise_error;
75: end if;
76: --
77: hr_utility.set_location(l_proc, 15);
70: if not l_api_updating then
71: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
72: hr_utility.set_message_token('PROCEDURE', l_proc);
73: hr_utility.set_message_token('STEP', '10');
74: hr_utility.raise_error;
75: end if;
76: --
77: hr_utility.set_location(l_proc, 15);
78: --
73: hr_utility.set_message_token('STEP', '10');
74: hr_utility.raise_error;
75: end if;
76: --
77: hr_utility.set_location(l_proc, 15);
78: --
79: -- Check that the update is actually allowed.
80: --
81: open csr_disallow_update;
80: --
81: open csr_disallow_update;
82: fetch csr_disallow_update into l_disallow;
83: if csr_disallow_update%found then
84: hr_utility.set_location(l_proc, 20);
85: close csr_disallow_update;
86: fnd_message.set_name('PAY', 'PAY_50104_SBF_CORE_ROW_EXISTS');
87: fnd_message.raise_error;
88: end if;
92: --
93: if nvl(p_rec.input_value_id, hr_api.g_number) <>
94: nvl(pay_sbf_shd.g_old_rec.input_value_id, hr_api.g_number)
95: then
96: hr_utility.set_location(l_proc, 25);
97: l_argument := 'p_input_value_id';
98: raise l_error;
99: end if;
100: hr_utility.set_location(' Leaving:'||l_proc, 40);
96: hr_utility.set_location(l_proc, 25);
97: l_argument := 'p_input_value_id';
98: raise l_error;
99: end if;
100: hr_utility.set_location(' Leaving:'||l_proc, 40);
101: exception
102: when l_error then
103: hr_api.argument_changed_error
104: (p_api_name => l_proc
103: hr_api.argument_changed_error
104: (p_api_name => l_proc
105: ,p_argument => l_argument);
106: when others then
107: hr_utility.set_location('Leaving:'||l_proc, 45);
108: raise;
109: End chk_non_updateable_args;
110: -- ----------------------------------------------------------------------------
111: -- |---------------------------< chk_input_value_id >-------------------------|
124: l_proc varchar2(72) := g_package||'chk_input_value_id';
125: l_exists varchar2(1);
126: --
127: Begin
128: hr_utility.set_location('Entering:'||l_proc, 5);
129: --
130: -- Check that the input value is not null.
131: --
132: hr_api.mandatory_arg_error
139: --
140: open csr_input_value_exists;
141: fetch csr_input_value_exists into l_exists;
142: if csr_input_value_exists%notfound then
143: hr_utility.set_location(' Leaving:'||l_proc, 10);
144: close csr_input_value_exists;
145: fnd_message.set_name('PAY', 'PAY_50098_ETM_INVALID_INP_VAL');
146: fnd_message.raise_error;
147: end if;
145: fnd_message.set_name('PAY', 'PAY_50098_ETM_INVALID_INP_VAL');
146: fnd_message.raise_error;
147: end if;
148: close csr_input_value_exists;
149: hr_utility.set_location(' Leaving:'||l_proc, 15);
150: End chk_input_value_id;
151: -- ----------------------------------------------------------------------------
152: -- |--------------------------< chk_balance_type_id >-------------------------|
153: -- ----------------------------------------------------------------------------
186: l_exists varchar2(1);
187: l_api_updating boolean;
188: --
189: Begin
190: hr_utility.set_location('Entering:'||l_proc, 5);
191: l_api_updating := pay_sbf_shd.api_updating
192: (p_balance_feed_id => p_balance_feed_id
193: ,p_object_version_number => p_object_version_number
194: );
208: --
209: -- Only one of the balance name and balance_type_id may be not null.
210: --
211: elsif p_balance_type_id is not null then
212: hr_utility.set_location(' Leaving:'||l_proc, 15);
213: fnd_message.set_name('PAY', 'PAY_50105_SBF_ID_TYPE_NOT_NULL');
214: fnd_message.raise_error;
215: end if;
216: --
221: --
222: open csr_compatible;
223: fetch csr_compatible into l_okay;
224: if csr_compatible%notfound then
225: hr_utility.set_location(' Leaving:'||l_proc, 20);
226: close csr_compatible;
227: fnd_message.set_name('PAY', 'PAY_50106_SBF_UOM_MISMATCH');
228: fnd_message.raise_error;
229: end if;
234: --
235: open csr_exists;
236: fetch csr_exists into l_exists;
237: if csr_exists%found then
238: hr_utility.set_location(' Leaving:'||l_proc, 25);
239: close csr_exists;
240: fnd_message.set_name('PAY', 'PAY_50107_SBF_FEED_EXISTS');
241: fnd_message.raise_error;
242: end if;
242: end if;
243: close csr_exists;
244: end if;
245: end if;
246: hr_utility.set_location(' Leaving:'||l_proc, 30);
247: End chk_balance_type_id;
248: -- ----------------------------------------------------------------------------
249: -- |----------------------------< chk_balance_name >--------------------------|
250: -- ----------------------------------------------------------------------------
270: l_exists varchar2(1);
271: l_api_updating boolean;
272: --
273: Begin
274: hr_utility.set_location('Entering:'||l_proc, 5);
275: l_api_updating := pay_sbf_shd.api_updating
276: (p_balance_feed_id => p_balance_feed_id
277: ,p_object_version_number => p_object_version_number
278: );
298: --
299: open csr_exists;
300: fetch csr_exists into l_exists;
301: if csr_exists%found then
302: hr_utility.set_location(' Leaving:'||l_proc, 20);
303: close csr_exists;
304: fnd_message.set_name('PAY', 'PAY_50107_SBF_FEED_EXISTS');
305: fnd_message.raise_error;
306: end if;
306: end if;
307: close csr_exists;
308: end if;
309: end if;
310: hr_utility.set_location(' Leaving:'||l_proc, 25);
311: End chk_balance_name;
312: -- ----------------------------------------------------------------------------
313: -- |-----------------------------< chk_scale >--------------------------------|
314: -- ----------------------------------------------------------------------------
320: l_proc varchar2(72) := g_package||'chk_scale';
321: l_api_updating boolean;
322: --
323: Begin
324: hr_utility.set_location('Entering:'||l_proc, 5);
325: l_api_updating := pay_sbf_shd.api_updating
326: (p_balance_feed_id => p_balance_feed_id
327: ,p_object_version_number => p_object_version_number
328: );
341: --
342: -- Check that scale is valid.
343: --
344: if p_scale <> 1 and p_scale <> -1 then
345: hr_utility.set_location(' Leaving:'||l_proc, 10);
346: fnd_message.set_name('PAY', 'PAY_50089_ETM_INVALID_SCALE');
347: fnd_message.set_token('POSITIVE', 1);
348: fnd_message.set_token('NEGATIVE', -1);
349: fnd_message.raise_error;
348: fnd_message.set_token('NEGATIVE', -1);
349: fnd_message.raise_error;
350: end if;
351: end if;
352: hr_utility.set_location(' Leaving:'||l_proc, 15);
353: End chk_scale;
354: -- ----------------------------------------------------------------------------
355: -- |-------------------------< chk_exclusion_rule_id >------------------------|
356: -- ----------------------------------------------------------------------------
373: l_api_updating boolean;
374: l_valid varchar2(1);
375: --
376: Begin
377: hr_utility.set_location('Entering:'||l_proc, 5);
378: l_api_updating := pay_sbf_shd.api_updating
379: (p_balance_feed_id => p_balance_feed_id
380: ,p_object_version_number => p_object_version_number
381: );
386: if p_exclusion_rule_id is not null then
387: open csr_exclusion_rule_id_valid;
388: fetch csr_exclusion_rule_id_valid into l_valid;
389: if csr_exclusion_rule_id_valid%notfound then
390: hr_utility.set_location('Leaving:'||l_proc, 10);
391: close csr_exclusion_rule_id_valid;
392: fnd_message.set_name('PAY', 'PAY_50100_ETM_INVALID_EXC_RULE');
393: fnd_message.raise_error;
394: end if;
394: end if;
395: close csr_exclusion_rule_id_valid;
396: end if;
397: end if;
398: hr_utility.set_location(' Leaving:'||l_proc, 15);
399: End chk_exclusion_rule_id;
400: -- ----------------------------------------------------------------------------
401: -- |------------------------------< chk_delete >------------------------------|
402: -- ----------------------------------------------------------------------------
416: l_error exception;
417: l_exists varchar2(1);
418: --
419: Begin
420: hr_utility.set_location('Entering:'||l_proc, 5);
421: --
422: open csr_core_objects;
423: fetch csr_core_objects into l_exists;
424: if csr_core_objects%found then
421: --
422: open csr_core_objects;
423: fetch csr_core_objects into l_exists;
424: if csr_core_objects%found then
425: hr_utility.set_location(' Leaving:'||l_proc, 10);
426: close csr_core_objects;
427: raise l_error;
428: end if;
429: close csr_core_objects;
426: close csr_core_objects;
427: raise l_error;
428: end if;
429: close csr_core_objects;
430: hr_utility.set_location(' Leaving:'||l_proc, 15);
431: exception
432: when l_error then
433: fnd_message.set_name('PAY', 'PAY_50108_SBF_INVALID_DELETE');
434: fnd_message.raise_error;
432: when l_error then
433: fnd_message.set_name('PAY', 'PAY_50108_SBF_INVALID_DELETE');
434: fnd_message.raise_error;
435: when others then
436: hr_utility.set_location(' Leaving:'||l_proc, 20);
437: raise;
438: End chk_delete;
439: -- ----------------------------------------------------------------------------
440: -- |---------------------------< insert_validate >----------------------------|
444: l_proc varchar2(72) := g_package||'insert_validate';
445: l_template_id number;
446: --
447: Begin
448: hr_utility.set_location('Entering:'||l_proc, 5);
449: --
450: -- Call all supporting business operations
451: --
452: chk_input_value_id(p_rec.input_value_id);
485: ,p_balance_feed_id => p_rec.balance_feed_id
486: ,p_object_version_number => p_rec.object_version_number
487: );
488: --
489: hr_utility.set_location(' Leaving:'||l_proc, 10);
490: End insert_validate;
491: --
492: -- ----------------------------------------------------------------------------
493: -- |---------------------------< update_validate >----------------------------|
497: l_proc varchar2(72) := g_package||'update_validate';
498: l_template_id number;
499: --
500: Begin
501: hr_utility.set_location('Entering:'||l_proc, 5);
502: --
503: -- Call all supporting business operations
504: --
505: chk_non_updateable_args(p_rec);
538: ,p_balance_feed_id => p_rec.balance_feed_id
539: ,p_object_version_number => p_rec.object_version_number
540: );
541: --
542: hr_utility.set_location(' Leaving:'||l_proc, 10);
543: End update_validate;
544: --
545: -- ----------------------------------------------------------------------------
546: -- |---------------------------< delete_validate >----------------------------|
549: --
550: l_proc varchar2(72) := g_package||'delete_validate';
551: --
552: Begin
553: hr_utility.set_location('Entering:'||l_proc, 5);
554: --
555: -- Call all supporting business operations
556: --
557: chk_delete(p_rec.balance_feed_id);
555: -- Call all supporting business operations
556: --
557: chk_delete(p_rec.balance_feed_id);
558: --
559: hr_utility.set_location(' Leaving:'||l_proc, 10);
560: End delete_validate;
561: --
562: end pay_sbf_bus;