1: PACKAGE BODY EC_Trading_Partner_PVT AS
2: -- $Header: ECVTPXFB.pls 120.4 2006/04/27 04:23:00 arsriniv ship $
3:
4: -- ***********************************************
5: -- procedure Get_TP_Address
69: and hcp.contact_point_type = 'EDI';
70:
71: BEGIN
72:
73: EC_DEBUG.PUSH('EC_Trading_Partner_PVT.Get_TP_Address');
74: EC_DEBUG.PL(3, 'API version : ',p_api_version_number);
75: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
76: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
77: EC_DEBUG.PL(3, 'p_validation_level: ',p_validation_level);
108:
109: p_return_status := FND_API.G_RET_STS_SUCCESS;
110:
111:
112: if ( p_info_type = EC_Trading_Partner_PVT.G_CUSTOMER)
113: then
114: for addr in ra_add
115: loop
116: l_entity_id := addr.cust_account_id;
118: l_entity_address_id := addr.cust_acct_site_id;
119: EC_DEBUG.PL(3, 'l_entity_address_id: ',l_entity_address_id);
120: end loop;
121:
122: elsif (p_info_type = EC_Trading_Partner_PVT.G_SUPPLIER)
123: then
124: for site in po_site
125: loop
126: l_entity_id := site.vendor_id;
128: l_entity_address_id := site.vendor_site_id;
129: EC_DEBUG.PL(3, 'l_entity_address_id: ',l_entity_address_id);
130: end loop;
131:
132: elsif (p_info_type = EC_Trading_Partner_PVT.G_BANK)
133: then
134: for bank in ap_bank
135: loop
136: l_entity_id := -1;
144:
145: if l_entity_id is NULL
146: and l_entity_address_id is NULL
147: then
148: p_return_status := EC_Trading_Partner_PVT.G_TP_NOT_FOUND;
149: fnd_message.set_name('EC','ECE_TP_NOT_FOUND');
150: p_msg_data := fnd_message.get;
151: else
152: p_entity_id := l_entity_id;
192: p_count => p_msg_count,
193: p_data => p_msg_data
194: );
195:
196: EC_DEBUG.POP('EC_Trading_Partner_PVT.Get_TP_Address');
197: EXCEPTION
198:
199: WHEN FND_API.G_EXC_ERROR THEN
200:
312: and hcp.contact_point_type = 'EDI';
313:
314: BEGIN
315:
316: EC_DEBUG.PUSH('EC_Trading_Partner_PVT.Get_TP_Address_Ref');
317: EC_DEBUG.PL(3, 'API version : ',p_api_version_number);
318: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
319: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
320: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
351:
352: p_return_status := FND_API.G_RET_STS_SUCCESS;
353:
354:
355: if ( p_info_type = EC_Trading_Partner_PVT.G_CUSTOMER)
356: then
357: for addr in ra_add
358: loop
359: l_entity_id := addr.cust_account_id;
361: EC_DEBUG.PL(3, 'l_entity_id: ',l_entity_id);
362: EC_DEBUG.PL(3, 'l_entity_address_id: ',l_entity_address_id);
363: end loop;
364:
365: elsif (p_info_type = EC_Trading_Partner_PVT.G_SUPPLIER)
366: then
367: for site in po_site
368: loop
369: l_entity_id := site.vendor_id;
371: EC_DEBUG.PL(3, 'l_entity_id: ',l_entity_id);
372: EC_DEBUG.PL(3, 'l_entity_address_id: ',l_entity_address_id);
373: end loop;
374:
375: elsif (p_info_type = EC_Trading_Partner_PVT.G_BANK)
376: then
377: for bank in ap_bank
378: loop
379: l_entity_id := -1;
387:
388: if l_entity_id is NULL
389: and l_entity_address_id is NULL
390: then
391: p_return_status := EC_Trading_Partner_PVT.G_TP_NOT_FOUND;
392: fnd_message.set_name('EC','ECE_TP_NOT_FOUND');
393: p_msg_data := fnd_message.get;
394: else
395: p_entity_id := l_entity_id;
432: p_count => p_msg_count,
433: p_data => p_msg_data
434: );
435:
436: EC_DEBUG.POP('EC_Trading_Partner_PVT.Get_TP_Address_Ref');
437: EXCEPTION
438:
439: WHEN FND_API.G_EXC_ERROR THEN
440:
544: and hcp.contact_point_type = 'EDI';
545:
546: BEGIN
547:
548: EC_DEBUG.PUSH('EC_Trading_Partner_PVT.Get_TP_Location_Code');
549: EC_DEBUG.PL(3, 'API version : ',p_api_version_number);
550: EC_DEBUG.PL(3, 'p_init_msg_list: ',p_init_msg_list);
551: EC_DEBUG.PL(3, 'p_simulate: ',p_simulate);
552: EC_DEBUG.PL(3, 'p_commit: ',p_commit);
581:
582: p_return_status := FND_API.G_RET_STS_SUCCESS;
583:
584:
585: if ( p_info_type = EC_Trading_Partner_PVT.G_CUSTOMER)
586: then
587: for addr in ra_add loop
588: l_location_code_ext := addr.ece_tp_location_code;
589: p_reference_ext1 := addr.tp_reference_ext1;
593: EC_DEBUG.PL(3, 'addr.tp_reference_ext2',addr.tp_reference_ext2);
594: end loop;
595:
596:
597: elsif (p_info_type = EC_Trading_Partner_PVT.G_SUPPLIER)
598: then
599: for site in po_site loop
600: l_location_code_ext := site.ece_tp_location_code;
601: p_reference_ext1 := site.tp_reference_ext1;
603: EC_DEBUG.PL(3, 'site.tp_reference_ext1',site.tp_reference_ext1);
604: EC_DEBUG.PL(3, 'site.tp_reference_ext2',site.tp_reference_ext2);
605: end loop;
606:
607: elsif (p_info_type = EC_Trading_Partner_PVT.G_BANK)
608: then
609: for bank in ap_bank loop
610: l_location_code_ext := bank.edi_ece_tp_location_code;
611: p_reference_ext1 := bank.tp_reference_ext1;
618: end if;
619:
620: if l_location_code_ext is NULL
621: then
622: p_return_status := EC_Trading_Partner_PVT.G_TP_NOT_FOUND;
623: fnd_message.set_name('EC','ECE_TP_NOT_FOUND');
624: p_msg_data := fnd_message.get;
625: EC_DEBUG.PL(3, 'p_msg_data',p_msg_data);
626: else
664: p_count => p_msg_count,
665: p_data => p_msg_data
666: );
667:
668: EC_DEBUG.POP('EC_Trading_Partner_PVT.Get_TP_Location_Code');
669: EXCEPTION
670:
671: WHEN FND_API.G_EXC_ERROR THEN
672:
775: and hrl.location_id = p_entity_id;
776:
777: BEGIN
778:
779: EC_DEBUG.PUSH('EC_Trading_Partner_PVT.IS_ENTITY_ENABLED');
780: EC_DEBUG.PL(3, 'p_transaction_type: ',p_transaction_type);
781: EC_DEBUG.PL(3, 'p_transaction_subtype: ',p_transaction_subtype);
782: EC_DEBUG.PL(3, 'p_entity_type: ',p_entity_type);
783: EC_DEBUG.PL(3, 'p_entity_id: ',p_entity_id);
808:
809: p_return_status := FND_API.G_RET_STS_SUCCESS;
810:
811:
812: if ( p_entity_type = EC_Trading_Partner_PVT.G_CUSTOMER)
813: then
814: for addr in type_customer loop
815: x_tp_detail_id := addr.tp_detail_id;
816: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
814: for addr in type_customer loop
815: x_tp_detail_id := addr.tp_detail_id;
816: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
817: end loop;
818: elsif (p_entity_type = EC_Trading_Partner_PVT.G_SUPPLIER)
819: then
820: for addr in type_supplier loop
821: x_tp_detail_id := addr.tp_detail_id;
822: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
820: for addr in type_supplier loop
821: x_tp_detail_id := addr.tp_detail_id;
822: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
823: end loop;
824: elsif (p_entity_type = EC_Trading_Partner_PVT.G_BANK)
825: then
826: for addr in type_bank loop
827: x_tp_detail_id := addr.tp_detail_id;
828: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
826: for addr in type_bank loop
827: x_tp_detail_id := addr.tp_detail_id;
828: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
829: end loop;
830: elsif (p_entity_type = EC_Trading_Partner_PVT.G_LOCATION)
831: then
832: for addr in type_location loop
833: x_tp_detail_id := addr.tp_detail_id;
834: EC_DEBUG.PL(3, 'x_tp_detail_id: ',x_tp_detail_id);
861: p_count => p_msg_count,
862: p_data => p_msg_data
863: );
864:
865: EC_DEBUG.POP('EC_Trading_Partner_PVT.IS_ENTITY_ENABLED');
866: EXCEPTION
867: WHEN FND_API.G_EXC_ERROR THEN
868:
869: Rollback to Get_TP_Location_Code_PVT;
912:
913: END IS_ENTITY_ENABLED;
914:
915:
916: END EC_Trading_Partner_PVT;
917: