287: -- == given date_start exists.
288: IF cel_earlier_child_exists%FOUND THEN
289: CLOSE cel_earlier_child_exists;
290: --
291: hr_utility.set_message(
292: applid => 800,
293: l_message_name => 'PER_6549_INVALD_REL_START_DATE');
294: --
295: hr_utility.raise_error;
291: hr_utility.set_message(
292: applid => 800,
293: l_message_name => 'PER_6549_INVALD_REL_START_DATE');
294: --
295: hr_utility.raise_error;
296: END IF;
297: -- ==
298:
299: CLOSE cel_earlier_child_exists;
309: -- == given date_end exists.
310: IF cel_later_child_exists%FOUND THEN
311: CLOSE cel_later_child_exists;
312: --
313: hr_utility.set_message(
314: applid => 800,
315: l_message_name => 'PER_50044_INVALID_REL_END_DATE');
316: --
317: hr_utility.raise_error;
313: hr_utility.set_message(
314: applid => 800,
315: l_message_name => 'PER_50044_INVALID_REL_END_DATE');
316: --
317: hr_utility.raise_error;
318: END IF;
319: -- ==
320:
321: CLOSE cel_later_child_exists;
586: ,p_contact_relationship_id => X_contact_relationship_id
587: ,p_date_start => X_date_start
588: ,p_date_end => X_date_end
589: ) THEN
590: hr_utility.set_message(800,'PER_6996_REL_CURR_EXISTS');
591: hr_utility.raise_error;
592: END IF;
593: --
594: INSERT INTO PER_CONTACT_RELATIONSHIPS(
587: ,p_date_start => X_date_start
588: ,p_date_end => X_date_end
589: ) THEN
590: hr_utility.set_message(800,'PER_6996_REL_CURR_EXISTS');
591: hr_utility.raise_error;
592: END IF;
593: --
594: INSERT INTO PER_CONTACT_RELATIONSHIPS(
595: contact_relationship_id,
761: p_effective_date => NVL(x_date_start,SYSDATE));
762: --
763: -- End of Fix for 1408379
764: --
765: hr_utility.set_location('Insert_contact',1);
766: OPEN C;
767: FETCH C INTO X_Rowid;
768: IF (C%NOTFOUND) THEN
769: CLOSE C;
1142: -- the security list maintenance must be done for all
1143: -- inserts (note CWK are done in their own API anyway, not here)
1144: --
1145:
1146: hr_utility.set_location('pecon01t.insert_row',70);
1147: --
1148: -- Bug 4295302
1149: --
1150: l_ppf_ler_new_rec.business_group_id := x_business_group_id;
1215: hr_security_internal.populate_new_person
1216: (p_business_group_id=>x_business_group_id
1217: ,p_person_id =>l_person_id);
1218: --
1219: hr_utility.set_location('pecon01t.insert_row',75);
1220: --
1221: --
1222: /* BEGIN OF PARTY_ID WORK */
1223: /* This is being commented out as part of TCA party unmerge. This part of the code
1231: CLOSE c_person;
1232: --
1233: per_hrtca_merge.create_tca_person(p_rec => l_person);
1234: --
1235: hr_utility.set_location('UPDATING party id',10);
1236: --
1237: -- Now assign the resulting party id back to the record.
1238: --
1239: IF x_party_id IS NULL THEN
1243: END IF;
1244: --
1245: */
1246: /* END OF PARTY ID WORK */
1247: hr_utility.set_location('Insert_person',2);
1248: OPEN C;
1249: FETCH C INTO l_Rowid;
1250: IF (C%NOTFOUND) THEN
1251: CLOSE C;
1264: AND active_flag = 'Y'
1265: AND system_person_type = 'OTHER';
1266: EXCEPTION
1267: WHEN NO_DATA_FOUND THEN
1268: hr_utility.set_message(801, 'HR_7513_PER_TYPE_INVALID');
1269: hr_utility.raise_error;
1270: END;
1271: l_person_type_id := X_Person_Type_Id;
1272: ELSE
1265: AND system_person_type = 'OTHER';
1266: EXCEPTION
1267: WHEN NO_DATA_FOUND THEN
1268: hr_utility.set_message(801, 'HR_7513_PER_TYPE_INVALID');
1269: hr_utility.raise_error;
1270: END;
1271: l_person_type_id := X_Person_Type_Id;
1272: ELSE
1273: l_person_type_id := hr_person_type_usage_info.get_default_person_type_id
1297: ,p_person_id => X_Person_Id
1298: ,p_date_start => X_date_start
1299: ,p_date_end => X_date_end
1300: ) THEN
1301: hr_utility.set_message(801,'PER_7125_EMP_CON_PRIMARY');
1302: hr_utility.raise_error;
1303: END IF;
1304: --
1305: -- 2073795: added validation for X_Contact_Person_Id. If the form has previously failed a multi
1298: ,p_date_start => X_date_start
1299: ,p_date_end => X_date_end
1300: ) THEN
1301: hr_utility.set_message(801,'PER_7125_EMP_CON_PRIMARY');
1302: hr_utility.raise_error;
1303: END IF;
1304: --
1305: -- 2073795: added validation for X_Contact_Person_Id. If the form has previously failed a multi
1306: -- record insert, it still passes id values and person is not created. This is a problem.
1344: --
1345: l_contact_type := X_Contact_Type;
1346: l_person_id := X_Person_Id;
1347: l_contact_person_id := X_Contact_Person_Id;
1348: hr_utility.set_location('X_cont_type : '||X_Contact_Type,10);
1349: hr_utility.set_location('X_Mirr_type : '||X_Mirror_Type,20);
1350: hr_utility.set_location('X_Cont_per_id : '||TO_CHAR(X_Contact_Person_Id),30);
1351:
1352: --
1345: l_contact_type := X_Contact_Type;
1346: l_person_id := X_Person_Id;
1347: l_contact_person_id := X_Contact_Person_Id;
1348: hr_utility.set_location('X_cont_type : '||X_Contact_Type,10);
1349: hr_utility.set_location('X_Mirr_type : '||X_Mirror_Type,20);
1350: hr_utility.set_location('X_Cont_per_id : '||TO_CHAR(X_Contact_Person_Id),30);
1351:
1352: --
1353: -- Insert the Mirror Relationship
1346: l_person_id := X_Person_Id;
1347: l_contact_person_id := X_Contact_Person_Id;
1348: hr_utility.set_location('X_cont_type : '||X_Contact_Type,10);
1349: hr_utility.set_location('X_Mirr_type : '||X_Mirror_Type,20);
1350: hr_utility.set_location('X_Cont_per_id : '||TO_CHAR(X_Contact_Person_Id),30);
1351:
1352: --
1353: -- Insert the Mirror Relationship
1354: --
1904: check_primary_contact(p_rowid => X_Rowid
1905: ,p_person_id => X_Person_Id
1906: ,p_date_start => X_date_start
1907: ,p_date_end => X_date_end) THEN
1908: hr_utility.set_message(801,'PER_7125_EMP_CON_PRIMARY');
1909: hr_utility.raise_error;
1910: END IF;
1911: --
1912: -- Call to sequence number validation
1905: ,p_person_id => X_Person_Id
1906: ,p_date_start => X_date_start
1907: ,p_date_end => X_date_end) THEN
1908: hr_utility.set_message(801,'PER_7125_EMP_CON_PRIMARY');
1909: hr_utility.raise_error;
1910: END IF;
1911: --
1912: -- Call to sequence number validation
1913: --
1926: ,p_contact_relationship_id => X_contact_relationship_id
1927: ,p_date_start => X_date_start
1928: ,p_date_end => X_date_end
1929: ) THEN
1930: hr_utility.set_message(800,'PER_6996_REL_CURR_EXISTS');
1931: hr_utility.raise_error;
1932: END IF;
1933: --
1934: /*
1927: ,p_date_start => X_date_start
1928: ,p_date_end => X_date_end
1929: ) THEN
1930: hr_utility.set_message(800,'PER_6996_REL_CURR_EXISTS');
1931: hr_utility.raise_error;
1932: END IF;
1933: --
1934: /*
1935: -- Bug.3207660
2350: FETCH Benificiary INTO l_beneficiary_exists;
2351: CLOSE Benificiary;
2352: --
2353: IF l_beneficiary_exists = 'Y' THEN
2354: hr_utility.set_message(801,'HR_7993_CONTACT_BENEFIT_EXISTS');
2355: hr_utility.raise_error;
2356: END IF;
2357: --Changes for Bug no 5415267 ends here
2358:
2351: CLOSE Benificiary;
2352: --
2353: IF l_beneficiary_exists = 'Y' THEN
2354: hr_utility.set_message(801,'HR_7993_CONTACT_BENEFIT_EXISTS');
2355: hr_utility.raise_error;
2356: END IF;
2357: --Changes for Bug no 5415267 ends here
2358:
2359: -- if the person is a Contact Only then
2369: FETCH Personal_Analyses INTO l_pa_exists;
2370: CLOSE Personal_Analyses;
2371: --
2372: IF l_pa_exists = 'Y' THEN
2373: hr_utility.set_message(801,'HR_51600_EMP_SIT_EXIST');
2374: hr_utility.raise_error;
2375: END IF;
2376: --
2377: OPEN Address;
2370: CLOSE Personal_Analyses;
2371: --
2372: IF l_pa_exists = 'Y' THEN
2373: hr_utility.set_message(801,'HR_51600_EMP_SIT_EXIST');
2374: hr_utility.raise_error;
2375: END IF;
2376: --
2377: OPEN Address;
2378: FETCH Address INTO l_address_exists;
2378: FETCH Address INTO l_address_exists;
2379: CLOSE Address;
2380: --
2381: IF l_address_exists = 'Y' THEN
2382: hr_utility.set_message(801,'PER_7101_EMP_ENTER_DEL_ADDR');
2383: hr_utility.raise_error;
2384: END IF;
2385: --
2386:
2379: CLOSE Address;
2380: --
2381: IF l_address_exists = 'Y' THEN
2382: hr_utility.set_message(801,'PER_7101_EMP_ENTER_DEL_ADDR');
2383: hr_utility.raise_error;
2384: END IF;
2385: --
2386:
2387: OPEN COBRA;
2388: FETCH COBRA INTO l_cobra_exists;
2389: CLOSE COBRA;
2390: --
2391: IF l_cobra_exists = 'Y' THEN
2392: hr_utility.set_message(801,'HR_6975_CONTACT_COBRA_EXISTS');
2393: hr_utility.raise_error;
2394: END IF;
2395: --
2396: -- Check to see if Personal Payment Method exists
2389: CLOSE COBRA;
2390: --
2391: IF l_cobra_exists = 'Y' THEN
2392: hr_utility.set_message(801,'HR_6975_CONTACT_COBRA_EXISTS');
2393: hr_utility.raise_error;
2394: END IF;
2395: --
2396: -- Check to see if Personal Payment Method exists
2397: -- where contact is the Payee.
2448: OPEN csr_seq;
2449: FETCH csr_seq INTO l_sequence_number;
2450: IF csr_seq%FOUND THEN
2451: CLOSE csr_seq;
2452: hr_utility.set_message('800','PER_52509_USE_SEQ_NO');
2453: hr_utility.raise_error;
2454: ELSE
2455: OPEN csr_seq_others;
2456: FETCH csr_seq_others INTO l_sequence_other;
2449: FETCH csr_seq INTO l_sequence_number;
2450: IF csr_seq%FOUND THEN
2451: CLOSE csr_seq;
2452: hr_utility.set_message('800','PER_52509_USE_SEQ_NO');
2453: hr_utility.raise_error;
2454: ELSE
2455: OPEN csr_seq_others;
2456: FETCH csr_seq_others INTO l_sequence_other;
2457: IF csr_seq_others%FOUND THEN
2455: OPEN csr_seq_others;
2456: FETCH csr_seq_others INTO l_sequence_other;
2457: IF csr_seq_others%FOUND THEN
2458: CLOSE csr_seq_others;
2459: hr_utility.set_message('800','PER_52510_DIFF_SEQ_NO');
2460: hr_utility.raise_error;
2461: END IF;
2462: END IF;
2463: ELSIF p_sequence_number <> l_old_seq_number THEN
2456: FETCH csr_seq_others INTO l_sequence_other;
2457: IF csr_seq_others%FOUND THEN
2458: CLOSE csr_seq_others;
2459: hr_utility.set_message('800','PER_52510_DIFF_SEQ_NO');
2460: hr_utility.raise_error;
2461: END IF;
2462: END IF;
2463: ELSIF p_sequence_number <> l_old_seq_number THEN
2464: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2460: hr_utility.raise_error;
2461: END IF;
2462: END IF;
2463: ELSIF p_sequence_number <> l_old_seq_number THEN
2464: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2465: hr_utility.raise_error;
2466: END IF;
2467: ELSIF l_old_seq_number IS NOT NULL THEN
2468: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2461: END IF;
2462: END IF;
2463: ELSIF p_sequence_number <> l_old_seq_number THEN
2464: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2465: hr_utility.raise_error;
2466: END IF;
2467: ELSIF l_old_seq_number IS NOT NULL THEN
2468: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2469: hr_utility.raise_error;
2464: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2465: hr_utility.raise_error;
2466: END IF;
2467: ELSIF l_old_seq_number IS NOT NULL THEN
2468: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2469: hr_utility.raise_error;
2470: END IF;
2471: END chk_sequence_number;
2472: --
2465: hr_utility.raise_error;
2466: END IF;
2467: ELSIF l_old_seq_number IS NOT NULL THEN
2468: hr_utility.set_message('800','PER_52511_SEQ_NO_UPD');
2469: hr_utility.raise_error;
2470: END IF;
2471: END chk_sequence_number;
2472: --
2473: -- Update Contact Person details
2889: , l_previous_last_name, l_email_address, l_employee_number
2890: , l_applicant_number, l_npw_number;
2891: EXIT WHEN Lock_Person_Row%NOTFOUND;
2892:
2893: hr_utility.set_location('update_contact.update_person',10);
2894:
2895: hr_person_name.derive_person_names -- #3889584
2896: (p_format_name => NULL, -- generate all names
2897: p_business_group_id => x_business_group_id,
3058: local_name = l_local_name,
3059: order_name = l_order_name
3060:
3061: WHERE ROWID = CHARTOROWID(l_rowid);
3062: hr_utility.set_location('update_contact.update_person',20);
3063:
3064:
3065: IF (SQL%NOTFOUND) THEN
3066: RAISE NO_DATA_FOUND;
3066: RAISE NO_DATA_FOUND;
3067: END IF;
3068: --
3069: -- PTU changes
3070: hr_utility.set_location('update_contact.update_person',30);
3071:
3072: --
3073: hr_per_type_usage_internal.maintain_person_type_usage
3074: (p_effective_date => X_Session_Date
3076: ,p_person_type_id => X_Person_Type_Id
3077: ,p_datetrack_update_mode => 'CORRECTION' --since the person record is only corrected too
3078: );
3079: --
3080: hr_utility.set_location('update_contact.update_person',40);
3081:
3082: -- end of PTU changes
3083: --
3084:
3102: --
3103: fetch c_person into l_person;
3104: --
3105: close c_person;
3106: hr_utility.set_location('update_person - before TCA update',100);
3107: hr_utility.set_location('update_person - party_id='||l_person.party_id,200);
3108: hr_utility.set_location('update_person - first_name='||l_person.first_name,200);
3109: --
3110: per_hrtca_merge.update_tca_person(p_Rec => l_person);
3103: fetch c_person into l_person;
3104: --
3105: close c_person;
3106: hr_utility.set_location('update_person - before TCA update',100);
3107: hr_utility.set_location('update_person - party_id='||l_person.party_id,200);
3108: hr_utility.set_location('update_person - first_name='||l_person.first_name,200);
3109: --
3110: per_hrtca_merge.update_tca_person(p_Rec => l_person);
3111: --
3104: --
3105: close c_person;
3106: hr_utility.set_location('update_person - before TCA update',100);
3107: hr_utility.set_location('update_person - party_id='||l_person.party_id,200);
3108: hr_utility.set_location('update_person - first_name='||l_person.first_name,200);
3109: --
3110: per_hrtca_merge.update_tca_person(p_Rec => l_person);
3111: --
3112: hr_utility.set_location('update_person - after TCA update',300);
3108: hr_utility.set_location('update_person - first_name='||l_person.first_name,200);
3109: --
3110: per_hrtca_merge.update_tca_person(p_Rec => l_person);
3111: --
3112: hr_utility.set_location('update_person - after TCA update',300);
3113: end if;
3114: CLOSE Lock_Person_Row;
3115: END Update_Person;
3116: ---------------------------------------------
3122: -- i.e. check whether the Contact Only flag = 'Y' and if it is then
3123: -- check that the actual values have changed on the person record
3124: -- for the current person record
3125: --
3126: hr_utility.set_location('per_contact_relationships_pkg.update_contact',1);
3127: IF X_Contact_Only = 'Y' THEN
3128: -- bug fix 4281500 starts here --
3129: -- check if there exist a reslationship record with end date
3130: -- earlier than new DOB.
3133: open csr_chk_rel;
3134: fetch csr_chk_rel into l_con_rel_id;
3135: if csr_chk_rel%found then
3136: close csr_chk_rel;
3137: hr_utility.set_message(
3138: applid => 800,
3139: l_message_name => 'PER_449600_INVALD_DOB');
3140: --
3141: hr_utility.raise_error;
3137: hr_utility.set_message(
3138: applid => 800,
3139: l_message_name => 'PER_449600_INVALD_DOB');
3140: --
3141: hr_utility.raise_error;
3142: end if;
3143: close csr_chk_rel;
3144: end if;
3145:
3155: -- called REENTRY_FLAG = 1 and the check is performed. If we need to
3156: -- ask the question set REENTRY_FLAG = 2 and exit.
3157: -- The second time in will happen if the update is to proceed.
3158: --
3159: hr_utility.trace('Calling Check_For_Person_Rows');
3160: IF X_Reentry_Flag = 1 THEN
3161: OPEN Check_For_Person_Rows;
3162: FETCH Check_For_Person_Rows INTO l_others_exist;
3163: CLOSE Check_For_Person_Rows;
3166: X_Reentry_Flag := 2;
3167: RETURN;
3168: END IF;
3169: END IF;
3170: hr_utility.set_location('update_contact',2);
3171: Update_Person;
3172: -- bug fix 4281500 starts here --
3173: -- call to update the relationship records
3174: -- having start date earlier than date of birth
3248: END IF;
3249: END IF;
3250: --
3251: --
3252: hr_utility.set_location('update_contact',3);
3253:
3254: /*IF (SQL%NOTFOUND) THEN
3255: RAISE NO_DATA_FOUND;
3256: END IF;*/-- fix for bug 4763755.