102:
103: BEGIN
104:
105: l_procedure := g_package || 'check_record_exists';
106: g_debug := hr_utility.debug_enabled;
107: g_debug := TRUE;
108:
109: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
110:
110:
111: IF p_org_info_type_code = 'PER_CONT_AREA_CONT_BASE_CN' THEN
112:
113: IF g_debug THEN
114: hr_utility.trace('Checking contribution base setup');
115: END IF;
116:
117: OPEN csr_check_cont_base_setup;
118: FETCH csr_check_cont_base_setup INTO l_rec_count;
122: FETCH csr_future_rec_cont_base INTO l_fut_date;
123: CLOSE csr_future_rec_cont_base;
124:
125: IF g_debug THEN
126: hr_utility.trace('Ended Checking contribution base setup');
127: END IF;
128:
129: ELSIF p_org_info_type_code ='PER_CONT_AREA_PHF_SI_RATES_CN' THEN
130:
128:
129: ELSIF p_org_info_type_code ='PER_CONT_AREA_PHF_SI_RATES_CN' THEN
130:
131: IF g_debug THEN
132: hr_utility.trace('Checking PHF/SI rates setup');
133: END IF;
134:
135: OPEN csr_check_phf_si_rates_setup;
136: FETCH csr_check_phf_si_rates_setup INTO l_rec_count;
140: FETCH csr_future_rec_phfsi_base INTO l_fut_date;
141: CLOSE csr_future_rec_phfsi_base;
142:
143: IF g_debug THEN
144: hr_utility.trace('Ended Checking PHF/SI Rates setup');
145: END IF;
146:
147: END IF;
148:
148:
149: IF l_rec_count > 0 THEN
150:
151: IF g_debug THEN
152: hr_utility.trace('Duplicate Record Exists');
153: END IF;
154:
155: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
156: hr_utility.raise_error;
151: IF g_debug THEN
152: hr_utility.trace('Duplicate Record Exists');
153: END IF;
154:
155: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
156: hr_utility.raise_error;
157:
158: ELSIF l_fut_date IS NOT NULL THEN
159:
152: hr_utility.trace('Duplicate Record Exists');
153: END IF;
154:
155: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
156: hr_utility.raise_error;
157:
158: ELSIF l_fut_date IS NOT NULL THEN
159:
160: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
159:
160: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
161:
162: IF g_debug THEN
163: hr_utility.trace('Duplicate Record Exists');
164: END IF;
165:
166: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
167: END IF;
162: IF g_debug THEN
163: hr_utility.trace('Duplicate Record Exists');
164: END IF;
165:
166: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
167: END IF;
168: hr_utility.raise_error;
169: END IF;
170:
164: END IF;
165:
166: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
167: END IF;
168: hr_utility.raise_error;
169: END IF;
170:
171: hr_cn_api.set_location(g_debug,'Leaving ' || l_procedure,30);
172:
220:
221: BEGIN
222:
223: l_procedure := g_package || 'check_term_stat_info';
224: g_debug := hr_utility.debug_enabled;
225: g_debug := TRUE;
226:
227:
228: OPEN c_term_info_setup;
235:
236: hr_cn_api.set_location(g_debug,' l_rec_count : '|| l_rec_count, 20);
237:
238: IF l_rec_count > 0 THEN
239: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
240: hr_utility.raise_error;
241: ELSIF l_fut_date IS NOT NULL THEN
242: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
243: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
236: hr_cn_api.set_location(g_debug,' l_rec_count : '|| l_rec_count, 20);
237:
238: IF l_rec_count > 0 THEN
239: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
240: hr_utility.raise_error;
241: ELSIF l_fut_date IS NOT NULL THEN
242: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
243: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
244: hr_utility.raise_error;
239: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
240: hr_utility.raise_error;
241: ELSIF l_fut_date IS NOT NULL THEN
242: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
243: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
244: hr_utility.raise_error;
245: END IF;
246:
247: END IF;
240: hr_utility.raise_error;
241: ELSIF l_fut_date IS NOT NULL THEN
242: IF p_effective_end_date >= l_fut_date OR p_effective_end_date IS NULL THEN
243: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
244: hr_utility.raise_error;
245: END IF;
246:
247: END IF;
248:
284: l_procedure VARCHAR2(100);
285:
286: BEGIN
287: l_procedure := g_package || 'check_single_record';
288: g_debug := hr_utility.debug_enabled;
289: g_debug := TRUE;
290:
291: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
292:
291: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
292:
293: IF p_org_info_type_code = 'PER_PHF_STAT_INFO_CN' THEN
294: IF g_debug THEN
295: hr_utility.trace(' =======================================================');
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
292:
293: IF p_org_info_type_code = 'PER_PHF_STAT_INFO_CN' THEN
294: IF g_debug THEN
295: hr_utility.trace(' =======================================================');
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
300: hr_utility.trace(' =======================================================');
293: IF p_org_info_type_code = 'PER_PHF_STAT_INFO_CN' THEN
294: IF g_debug THEN
295: hr_utility.trace(' =======================================================');
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
300: hr_utility.trace(' =======================================================');
301: END IF;
294: IF g_debug THEN
295: hr_utility.trace(' =======================================================');
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
300: hr_utility.trace(' =======================================================');
301: END IF;
302:
295: hr_utility.trace(' =======================================================');
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
300: hr_utility.trace(' =======================================================');
301: END IF;
302:
303: OPEN c_phf_high_limit_exempt_setup;
296: hr_utility.trace(' . p_org_information_id : '||p_org_information_id);
297: hr_utility.trace(' . p_organization_id : '||p_organization_id );
298: hr_utility.trace(' . p_org_info_type_code : '||p_org_info_type_code);
299: hr_utility.trace(' . p_org_information1 : '||p_org_information1);
300: hr_utility.trace(' =======================================================');
301: END IF;
302:
303: OPEN c_phf_high_limit_exempt_setup;
304: FETCH c_phf_high_limit_exempt_setup INTO l_rec_count;
307: END IF;
308:
309: IF l_rec_count > 0 THEN
310: IF g_debug THEN
311: hr_utility.trace('=========================================================');
312: hr_utility.trace('message_name'||'PER_7901_SYS_DUPLICATE_RECORDS');
313: hr_utility.trace('=========================================================');
314: END IF;
315: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
308:
309: IF l_rec_count > 0 THEN
310: IF g_debug THEN
311: hr_utility.trace('=========================================================');
312: hr_utility.trace('message_name'||'PER_7901_SYS_DUPLICATE_RECORDS');
313: hr_utility.trace('=========================================================');
314: END IF;
315: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
316: hr_utility.raise_error;
309: IF l_rec_count > 0 THEN
310: IF g_debug THEN
311: hr_utility.trace('=========================================================');
312: hr_utility.trace('message_name'||'PER_7901_SYS_DUPLICATE_RECORDS');
313: hr_utility.trace('=========================================================');
314: END IF;
315: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
316: hr_utility.raise_error;
317: END IF;
311: hr_utility.trace('=========================================================');
312: hr_utility.trace('message_name'||'PER_7901_SYS_DUPLICATE_RECORDS');
313: hr_utility.trace('=========================================================');
314: END IF;
315: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
316: hr_utility.raise_error;
317: END IF;
318:
319: hr_cn_api.set_location(g_debug,'Leaving ' || l_procedure,30);
312: hr_utility.trace('message_name'||'PER_7901_SYS_DUPLICATE_RECORDS');
313: hr_utility.trace('=========================================================');
314: END IF;
315: hr_utility.set_message(800,'PER_7901_SYS_DUPLICATE_RECORDS');
316: hr_utility.raise_error;
317: END IF;
318:
319: hr_cn_api.set_location(g_debug,'Leaving ' || l_procedure,30);
320:
340: E_INVALID_FORMAT_ERR EXCEPTION;
341: BEGIN
342:
343: l_procedure := g_package || 'validate_date';
344: g_debug := hr_utility.debug_enabled;
345:
346: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
347:
348: IF p_effective_end_date IS NOT NULL THEN
357: END IF;
358:
359: EXCEPTION
360: WHEN E_INVALID_FORMAT_ERR THEN
361: hr_utility.set_message(800,'PER_CN_INCORRECT_DATES');
362: hr_cn_api.set_location(g_debug,l_procedure,40);
363: hr_utility.raise_error;
364:
365: END validate_date;
359: EXCEPTION
360: WHEN E_INVALID_FORMAT_ERR THEN
361: hr_utility.set_message(800,'PER_CN_INCORRECT_DATES');
362: hr_cn_api.set_location(g_debug,l_procedure,40);
363: hr_utility.raise_error;
364:
365: END validate_date;
366:
367:
412:
413: BEGIN
414:
415: l_procedure := g_package || 'check_cn_org_internal';
416: g_debug := hr_utility.debug_enabled;
417:
418: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
419:
420:
465: /* Changes for bug 6943573 end */
466: ELSIF p_org_info_type_code = 'PER_CONT_AREA_CONT_BASE_CN' THEN
467:
468: IF g_debug THEN
469: hr_utility.trace('Validating Effective Start Date and Effective End Date');
470: END IF;
471:
472: l_start_date := fnd_date.canonical_to_date(p_org_information15);
473: l_end_date := fnd_date.canonical_to_date(NVL(p_org_information16,'4712/12/31 00:00:00'));
474: validate_date(l_start_date
475: ,l_end_date);
476:
477: IF g_debug THEN
478: hr_utility.trace('Checking for Duplicate Record');
479: END IF;
480:
481: check_record_exists(p_org_information_id => p_org_information_id
482: ,p_organization_id => p_organization_id
489: ,p_effective_end_date => l_end_date
490: );
491:
492: IF g_debug THEN
493: hr_utility.trace('Calling pay_cn_deductions.check_cont_base_setup');
494: END IF;
495:
496: pay_cn_deductions.check_cont_base_setup
497: (p_organization_id => p_organization_id
520:
521: ELSIF p_org_info_type_code = 'PER_CONT_AREA_PHF_SI_RATES_CN' THEN
522:
523: IF g_debug THEN
524: hr_utility.trace('Validating Effective Start Date and Effective End Date');
525: END IF;
526:
527: l_start_date := fnd_date.canonical_to_date(p_org_information10);
528: l_end_date := fnd_date.canonical_to_date(p_org_information11);
529: validate_date(l_start_date
530: ,l_end_date);
531:
532: IF g_debug THEN
533: hr_utility.trace('Checking for Duplicate Record');
534: END IF;
535:
536: check_record_exists(p_org_information_id => p_org_information_id
537: ,p_organization_id => p_organization_id
544: ,p_effective_end_date => l_end_date
545: );
546:
547: IF g_debug THEN
548: hr_utility.trace('Calling pay_cn_deductions.check_phf_si_rates_setup');
549: END IF;
550:
551: pay_cn_deductions.check_phf_si_rates_setup
552: (p_organization_id => p_organization_id
606: l_procedure VARCHAR2(100);
607:
608: BEGIN
609: l_procedure := g_package || 'check_cn_org_info_type_create';
610: g_debug := hr_utility.debug_enabled;
611:
612: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
613:
614: -- Call check_cn_org_internal
643:
644: hr_cn_api.set_location(g_debug,l_procedure,20);
645:
646: IF g_debug THEN
647: hr_utility.trace('Message => ' || g_message_name);
648: END IF;
649:
650: hr_cn_api.raise_message(800
651: ,g_message_name
743:
744: BEGIN
745:
746: l_procedure := g_package || 'check_cn_org_info_type_update';
747: g_debug := hr_utility.debug_enabled;
748:
749: hr_cn_api.set_location(g_debug,'Entering ' || l_procedure,10);
750:
751: OPEN csr_org_info;