63: );
64: END IF;
65:
66: hz_party_contact_v2pub.create_org_contact
67: (p_init_msg_list => fnd_api.g_false,
68: p_org_contact_rec => l_org_contact_rec,
69: x_return_status => x_return_status,
70: x_msg_count => x_msg_count,
71: x_msg_data => x_msg_data,
82: p_msg_count => x_msg_count,
83: p_msg_data => x_msg_data
84: );
85:
86: IF x_return_status = fnd_api.g_ret_sts_success THEN
87: x_rel_party_id := l_rel_party_id;
88: END IF;
89:
90: END create_org_contact_private;
175: );
176: END IF;
177:
178: hz_party_v2pub.create_person
179: (p_init_msg_list => fnd_api.g_false,
180: p_person_rec => l_person_rec,
181: p_party_usage_code => 'SUPPLIER_CONTACT',
182: x_return_status => x_return_status,
183: x_msg_count => x_msg_count,
201: p_msg_count => x_msg_count,
202: p_msg_data => x_msg_data
203: );
204:
205: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
206: /* Added for bug 7366321 */
207: if nvl(l_hzprofile_changed,'N') = 'Y' then
208: fnd_profile.put('HZ_GENERATE_PARTY_NUMBER', l_hzprofile_value);
209: l_hzprofile_changed := 'N';
225: x_rel_party_id => l_rel_party_id,
226: p_department => p_department
227: );
228:
229: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
230: ROLLBACK TO create_supplier_contact_sp;
231: RETURN;
232: END IF;
233:
252: x_msg_data => x_msg_data
253: );
254:
255: IF x_return_status IS NULL OR
256: x_return_status <> fnd_api.g_ret_sts_success THEN
257: ROLLBACK TO create_supplier_contact_sp;
258: RETURN;
259: END IF;
260:
279: x_msg_data => x_msg_data
280: );
281:
282: IF x_return_status IS NULL OR
283: x_return_status <> fnd_api.g_ret_sts_success THEN
284: ROLLBACK TO create_supplier_contact_sp;
285: RETURN;
286: END IF;
287:
303: x_msg_data => x_msg_data
304: );
305:
306: IF x_return_status IS NULL OR
307: x_return_status <> fnd_api.g_ret_sts_success THEN
308: ROLLBACK TO create_supplier_contact_sp;
309: RETURN;
310: END IF;
311:
330: x_msg_data => x_msg_data
331: );
332:
333: IF x_return_status IS NULL OR
334: x_return_status <> fnd_api.g_ret_sts_success THEN
335: ROLLBACK TO create_supplier_contact_sp;
336: RETURN;
337: END IF;
338:
354: x_msg_data => x_msg_data
355: );
356:
357: IF x_return_status IS NULL OR
358: x_return_status <> fnd_api.g_ret_sts_success THEN
359: ROLLBACK TO create_supplier_contact_sp;
360: RETURN;
361: END IF;
362:
368: l_hzprofile_changed := 'N';
369: end if;
370: /* End */
371: ROLLBACK TO create_supplier_contact_sp;
372: x_return_status := fnd_api.g_ret_sts_unexp_error;
373: x_msg_count := 1;
374: x_msg_data := Sqlerrm;
375: pos_log.log_sqlerrm('POSCONTB', 'in create_supplier_contact');
376:
423: p_fax_number IN VARCHAR2 DEFAULT NULL,
424: p_email_address IN VARCHAR2 DEFAULT NULL,
425: p_inactive_date IN DATE DEFAULT NULL,
426: --Start Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
427: p_party_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
424: p_email_address IN VARCHAR2 DEFAULT NULL,
425: p_inactive_date IN DATE DEFAULT NULL,
426: --Start Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
427: p_party_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
425: p_inactive_date IN DATE DEFAULT NULL,
426: --Start Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
427: p_party_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
433: --End Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
426: --Start Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
427: p_party_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
433: --End Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
434: p_person_party_obversion_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
427: p_party_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
433: --End Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
434: p_person_party_obversion_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
435: x_return_status OUT nocopy VARCHAR2,
428: p_email_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
429: p_phone_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
433: --End Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
434: p_person_party_obversion_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
435: x_return_status OUT nocopy VARCHAR2,
436: x_msg_count OUT nocopy NUMBER,
430: p_fax_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
431: p_rel_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
432: p_cont_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
433: --End Bug 6620664 - Handling Concurrent Updates on ContactDirectory, BusinessClassifications ans Accounting pages
434: p_person_party_obversion_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
435: x_return_status OUT nocopy VARCHAR2,
436: x_msg_count OUT nocopy NUMBER,
437: x_msg_data OUT nocopy VARCHAR2,
438: p_department IN VARCHAR2 DEFAULT NULL,
439: p_alt_contact_name IN VARCHAR2 DEFAULT NULL,
440: p_alt_area_code IN VARCHAR2 DEFAULT NULL,
441: p_alt_phone_number IN VARCHAR2 DEFAULT NULL,
442: p_url IN VARCHAR2 DEFAULT NULL,
443: p_url_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
444: p_altphone_obj_version_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM
445: )
446: IS
447: CURSOR l_contact_party_cur IS
440: p_alt_area_code IN VARCHAR2 DEFAULT NULL,
441: p_alt_phone_number IN VARCHAR2 DEFAULT NULL,
442: p_url IN VARCHAR2 DEFAULT NULL,
443: p_url_object_version_number IN NUMBER DEFAULT fnd_api.G_NULL_NUM,
444: p_altphone_obj_version_num IN NUMBER DEFAULT fnd_api.G_NULL_NUM
445: )
446: IS
447: CURSOR l_contact_party_cur IS
448: SELECT person_first_name,
525: FETCH l_contact_party_cur INTO l_contact_party_rec;
526:
527: IF l_contact_party_cur%notfound THEN
528: CLOSE l_contact_party_cur;
529: x_return_status := fnd_api.g_ret_sts_error;
530: x_msg_count := 1;
531: x_msg_data := 'invalid contact party_id ' || p_contact_party_id;
532: RETURN;
533: END IF;
531: x_msg_data := 'invalid contact party_id ' || p_contact_party_id;
532: RETURN;
533: END IF;
534: /* Bug 7027825 Start */
535: IF(p_person_party_obversion_num=fnd_api.G_NULL_NUM) THEN
536: l_person_party_obversion_num := l_contact_party_rec.object_version_number;
537: ELSE
538: l_person_party_obversion_num := p_person_party_obversion_num;
539: END IF ;
554: x_return_status => x_return_status,
555: x_msg_count => x_msg_count,
556: x_msg_data => x_msg_data
557: );
558: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
559: ROLLBACK TO update_supplier_contact_sp;
560: RETURN;
561: END IF;
562:
568: l_rel_rec.end_date := p_inactive_date;
569: end if;
570:
571: /* Start Bug 6620664 */
572: IF(p_party_object_version_number = fnd_api.G_NULL_NUM) THEN
573: l_party_object_version_number := l_rec2.rel_party_obj_ver_num;
574: ELSE
575: l_party_object_version_number := p_party_object_version_number;
576: END IF;
574: ELSE
575: l_party_object_version_number := p_party_object_version_number;
576: END IF;
577:
578: IF(p_rel_object_version_number = fnd_api.G_NULL_NUM) THEN
579: l_rel_object_version_number := l_rec2.rel_object_version_number;
580: ELSE
581: l_rel_object_version_number := p_rel_object_version_number;
582: END IF;
580: ELSE
581: l_rel_object_version_number := p_rel_object_version_number;
582: END IF;
583:
584: IF(p_cont_object_version_number = fnd_api.G_NULL_NUM) THEN
585: l_cont_object_version_number := l_rec2.cont_object_version_number;
586: ELSE
587: l_cont_object_version_number := p_cont_object_version_number;
588: END IF;
607: ELSE
608: l_org_contact_rec.job_title := p_job_title;
609: /* Bug 9850943 Start */
610: IF p_job_title IS NULL THEN
611: l_org_contact_rec.job_title:=FND_API.G_MISS_CHAR;
612: END IF;
613: /* Bug 9850943 End */
614: END IF;
615: IF ((l_rec2.department IS NULL AND p_department IS NULL) OR
619: ELSE
620: l_org_contact_rec.department := p_department;
621: /* Bug 9850943 Start */
622: IF p_department IS NULL THEN
623: l_org_contact_rec.department:=FND_API.G_MISS_CHAR;
624: END IF;
625: /* Bug 9850943 End */
626: END IF;
627: l_org_contact_rec.party_rel_rec := l_rel_rec;
627: l_org_contact_rec.party_rel_rec := l_rel_rec;
628: l_org_contact_rec.org_contact_id := l_rec2.org_contact_id;
629:
630: hz_party_contact_v2pub.update_org_contact
631: (p_init_msg_list => fnd_api.g_true,
632: p_org_contact_rec => l_org_contact_rec,
633: --Start Bug 6620664
634: p_cont_object_version_number => l_cont_object_version_number, --l_rec2.cont_object_version_number,
635: p_rel_object_version_number => l_rel_object_version_number, --l_rec2.rel_object_version_number,
638: x_return_status => x_return_status,
639: x_msg_count => x_msg_count,
640: x_msg_data => x_msg_data
641: );
642: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
643: ROLLBACK TO update_supplier_contact_sp;
644: RETURN;
645: END IF;
646: END IF;
657: x_rel_party_id => l_rel_party_id,
658: p_department => p_department
659: );
660:
661: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
662: --ROLLBACK TO create_supplier_contact_sp;
663: ROLLBACK TO update_supplier_contact_sp;
664: RETURN;
665: END IF;
693:
694: NULL; -- no change for party
695:
696: ELSE
697: l_person_rec.person_first_name := nvl(p_first_name, fnd_api.g_miss_char);
698: l_person_rec.person_last_name := p_last_name;
699: l_person_rec.person_middle_name := nvl(p_middle_name, fnd_api.g_miss_char);
700: l_person_rec.person_pre_name_adjunct := nvl(p_contact_title, fnd_api.g_miss_char);
701: l_party_rec.party_id := p_contact_party_id;
695:
696: ELSE
697: l_person_rec.person_first_name := nvl(p_first_name, fnd_api.g_miss_char);
698: l_person_rec.person_last_name := p_last_name;
699: l_person_rec.person_middle_name := nvl(p_middle_name, fnd_api.g_miss_char);
700: l_person_rec.person_pre_name_adjunct := nvl(p_contact_title, fnd_api.g_miss_char);
701: l_party_rec.party_id := p_contact_party_id;
702: l_person_rec.party_rec := l_party_rec;
703: l_person_rec.known_as := nvl(p_alt_contact_name, fnd_api.g_miss_char);
696: ELSE
697: l_person_rec.person_first_name := nvl(p_first_name, fnd_api.g_miss_char);
698: l_person_rec.person_last_name := p_last_name;
699: l_person_rec.person_middle_name := nvl(p_middle_name, fnd_api.g_miss_char);
700: l_person_rec.person_pre_name_adjunct := nvl(p_contact_title, fnd_api.g_miss_char);
701: l_party_rec.party_id := p_contact_party_id;
702: l_person_rec.party_rec := l_party_rec;
703: l_person_rec.known_as := nvl(p_alt_contact_name, fnd_api.g_miss_char);
704: l_person_rec.person_title := p_job_title;
699: l_person_rec.person_middle_name := nvl(p_middle_name, fnd_api.g_miss_char);
700: l_person_rec.person_pre_name_adjunct := nvl(p_contact_title, fnd_api.g_miss_char);
701: l_party_rec.party_id := p_contact_party_id;
702: l_person_rec.party_rec := l_party_rec;
703: l_person_rec.known_as := nvl(p_alt_contact_name, fnd_api.g_miss_char);
704: l_person_rec.person_title := p_job_title;
705:
706: /* Bug 7027825 , For Updating A Person Party Type We need to pass the object version number of the
707: PERSON record ,So changed the below object version number parameter to l_person_party_obversion_num */
706: /* Bug 7027825 , For Updating A Person Party Type We need to pass the object version number of the
707: PERSON record ,So changed the below object version number parameter to l_person_party_obversion_num */
708:
709: hz_party_v2pub.update_person
710: (p_init_msg_list => fnd_api.g_true,
711: p_person_rec => l_person_rec,
712: p_party_object_version_number => l_person_party_obversion_num,
713: x_profile_id => l_profile_id,
714: x_return_status => x_return_status,
715: x_msg_count => x_msg_count,
716: x_msg_data => x_msg_data
717: );
718:
719: IF x_return_status IS NULL OR x_return_status <> fnd_api.g_ret_sts_success THEN
720: ROLLBACK TO update_supplier_contact_sp;
721: RETURN;
722: END IF;
723: END IF;
737: x_msg_data => x_msg_data
738: );
739:
740: IF x_return_status IS NULL OR
741: x_return_status <> fnd_api.g_ret_sts_success THEN
742: --ROLLBACK TO create_supplier_contact_sp;
743: ROLLBACK TO update_supplier_contact_sp;
744: RETURN;
745: END IF;
759: x_msg_data => x_msg_data
760: );
761:
762: IF x_return_status IS NULL OR
763: x_return_status <> fnd_api.g_ret_sts_success THEN
764: --ROLLBACK TO create_supplier_contact_sp;
765: ROLLBACK TO update_supplier_contact_sp;
766: RETURN;
767: END IF;
791: x_msg_data => x_msg_data
792: );
793:
794: IF x_return_status IS NULL OR
795: x_return_status <> fnd_api.g_ret_sts_success THEN
796: ROLLBACK TO update_supplier_contact_sp;
797: RETURN;
798: END IF;
799:
807: x_msg_data => x_msg_data
808: );
809:
810: IF x_return_status IS NULL OR
811: x_return_status <> fnd_api.g_ret_sts_success THEN
812: ROLLBACK TO update_supplier_contact_sp;
813: RETURN;
814: END IF;
815:
922:
923:
924: /* Bug 9576302 End */
925: IF x_return_status IS NULL OR
926: x_return_status <> fnd_api.g_ret_sts_success THEN
927: --ROLLBACK TO create_supplier_contact_sp;
928: ROLLBACK TO update_supplier_contact_sp;
929: RETURN;
930: END IF;
931:
932: EXCEPTION
933: WHEN OTHERS THEN
934: ROLLBACK TO update_supplier_contact_sp;
935: x_return_status := fnd_api.g_ret_sts_unexp_error;
936: x_msg_count := 1;
937: x_msg_data := Sqlerrm;
938: pos_log.log_sqlerrm('POSCONTB', 'in update_supplier_contact');
939: