125: AND upper(BankParty.party_name) = upper(l_bank_name)
126: AND BankParty.party_id <> p_temp_id;
127:
128: BEGIN
129: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_bank (+)');
130:
131: -- Fetching the bank country
132: OPEN c_country;
133: FETCH c_country INTO l_country;
252: l_pos NUMBER;
253: l_org_id_str VARCHAR2(30);
254: l_found VARCHAR2(1);
255: BEGIN
256: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_org (+)');
257: x_out := 1;
258: l_found := 'N';
259:
260: l_org_list := MO_UTILS.get_org_list(p_security_profile_id, p_org_classification);
314: FROM fnd_currencies fc
315: WHERE fc.currency_code = p_currency_code;
316: l_dummy NUMBER := 0;
317: BEGIN
318: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_currency (+)');
319:
320: -- initialize API return status to success.
321: x_return_status := fnd_api.g_ret_sts_success;
322:
364: AND bank_account_id <> NVL(p_account_id, -1);
365: --AND (rowid <> l_rowid OR l_rowid IS NULL);
366:
367: BEGIN
368: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_name (+)');
369:
370: -- initialize API return status to success.
371: x_return_status := fnd_api.g_ret_sts_success;
372: /*
412: l_country_chk_reqd BOOLEAN;
413: l_iban_len NUMBER;
414: l_country_name VARCHAR2(50);
415: BEGIN
416: cep_standard.debug('>>CE_BANK_ACCCOUNT_VALIDATION.validate_iban_length');
417: cep_standard.debug('Xi_country_code - '||Xi_country_code);
418: cep_standard.debug('IBAN length - '||Xi_len);
419: l_valid_iban := false;
420: l_country_chk_reqd := true;
413: l_iban_len NUMBER;
414: l_country_name VARCHAR2(50);
415: BEGIN
416: cep_standard.debug('>>CE_BANK_ACCCOUNT_VALIDATION.validate_iban_length');
417: cep_standard.debug('Xi_country_code - '||Xi_country_code);
418: cep_standard.debug('IBAN length - '||Xi_len);
419: l_valid_iban := false;
420: l_country_chk_reqd := true;
421: xo_return_status := fnd_api.g_ret_sts_success;
414: l_country_name VARCHAR2(50);
415: BEGIN
416: cep_standard.debug('>>CE_BANK_ACCCOUNT_VALIDATION.validate_iban_length');
417: cep_standard.debug('Xi_country_code - '||Xi_country_code);
418: cep_standard.debug('IBAN length - '||Xi_len);
419: l_valid_iban := false;
420: l_country_chk_reqd := true;
421: xo_return_status := fnd_api.g_ret_sts_success;
422: l_iban_len := Xi_len;
524: END;
525: fnd_message.set_name('CE', 'CE_INVALID_IBAN_LEN_EU');
526: fnd_message.set_token('LENGTH', l_iban_len);
527: fnd_message.set_token('COUNTRY_NAME', l_country_name);
528: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_LEN_EU');
529: ELSE
530: fnd_message.set_name('CE', 'CE_INVALID_IBAN_LEN'); -- Bug 8946879
531: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_LEN');
532: END IF;
527: fnd_message.set_token('COUNTRY_NAME', l_country_name);
528: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_LEN_EU');
529: ELSE
530: fnd_message.set_name('CE', 'CE_INVALID_IBAN_LEN'); -- Bug 8946879
531: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_LEN');
532: END IF;
533: fnd_msg_pub.add;
534: END IF;
535: cep_standard.debug('xo_return_status - '||xo_return_status);
531: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_LEN');
532: END IF;
533: fnd_msg_pub.add;
534: END IF;
535: cep_standard.debug('xo_return_status - '||xo_return_status);
536: cep_standard.debug('<
538: /*Bug 16507244 code change 1/2 end*/
539:
532: END IF;
533: fnd_msg_pub.add;
534: END IF;
535: cep_standard.debug('xo_return_status - '||xo_return_status);
536: cep_standard.debug('<
538: /*Bug 16507244 code change 1/2 end*/
539:
540: /*=======================================================================+
569: l_checkSum NUMBER;
570: l_multiplier NUMBER;
571: l_product NUMBER; -- Bug 10363417
572: BEGIN
573: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_IBAN (+)');
574: -- initialize API return status to success.
575: x_return_status := fnd_api.g_ret_sts_success;
576:
577: -- step 1: remove spaces from the left and right only for p_IBAN
579:
580: new_IBAN :=rtrim(ltrim(p_IBAN,' '),' ');
581: p_IBAN_OUT := null;
582:
583: cep_standard.debug('p_IBAN='||p_IBAN);
584: cep_standard.debug('new_IBAN='||new_IBAN);
585: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
586:
587: l_var := '9';
580: new_IBAN :=rtrim(ltrim(p_IBAN,' '),' ');
581: p_IBAN_OUT := null;
582:
583: cep_standard.debug('p_IBAN='||p_IBAN);
584: cep_standard.debug('new_IBAN='||new_IBAN);
585: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
586:
587: l_var := '9';
588: l_len := LENGTH(new_IBAN);
581: p_IBAN_OUT := null;
582:
583: cep_standard.debug('p_IBAN='||p_IBAN);
584: cep_standard.debug('new_IBAN='||new_IBAN);
585: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
586:
587: l_var := '9';
588: l_len := LENGTH(new_IBAN);
589: --
593: -- 2) The third and fourth characters are numbers
594: l_str1_2 := SUBSTR(new_IBAN, 1, 2);
595: l_str3_4 := upper(SUBSTR(new_IBAN, 3, 2));
596:
597: cep_standard.debug('l_str1_2='||l_str1_2);
598: cep_standard.debug('l_str3_4='||l_str3_4);
599:
600: IF (TRANSLATE(l_str1_2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '99999999999999999999999999') <> '99') THEN
601: fnd_message.set_name('CE', 'CE_IBAN_FIRST_2_CHAR'); -- Bug 8946879
594: l_str1_2 := SUBSTR(new_IBAN, 1, 2);
595: l_str3_4 := upper(SUBSTR(new_IBAN, 3, 2));
596:
597: cep_standard.debug('l_str1_2='||l_str1_2);
598: cep_standard.debug('l_str3_4='||l_str3_4);
599:
600: IF (TRANSLATE(l_str1_2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '99999999999999999999999999') <> '99') THEN
601: fnd_message.set_name('CE', 'CE_IBAN_FIRST_2_CHAR'); -- Bug 8946879
602: fnd_msg_pub.add;
600: IF (TRANSLATE(l_str1_2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '99999999999999999999999999') <> '99') THEN
601: fnd_message.set_name('CE', 'CE_IBAN_FIRST_2_CHAR'); -- Bug 8946879
602: fnd_msg_pub.add;
603: x_return_status := fnd_api.g_ret_sts_error;
604: cep_standard.debug('validate_IBAN: CE_IBAN_FIRST_2_CHAR l_str1_2= '||l_str1_2); -- Bug 8946879
605: END IF;
606:
607: IF (TRANSLATE(l_str3_4, '0123456789', '9999999999') <> '99') THEN
608: fnd_message.set_name('CE', 'CE_IBAN_FIRST_34_CHAR'); -- Bug 8946879
607: IF (TRANSLATE(l_str3_4, '0123456789', '9999999999') <> '99') THEN
608: fnd_message.set_name('CE', 'CE_IBAN_FIRST_34_CHAR'); -- Bug 8946879
609: fnd_msg_pub.add;
610: x_return_status := fnd_api.g_ret_sts_error;
611: cep_standard.debug('validate_IBAN: CE_IBAN_FIRST_34_CHAR l_str3_4= '||l_str3_4); -- Bug 8946879
612: END IF;
613: /*Bug 16507244 code change 2/2*/
614: --
615: -- step 3: IBAN length validation
626: <> RPAD(l_var, l_len, '9') THEN
627: fnd_message.set_name('CE', 'CE_INVALID_IBAN_FORMAT');
628: fnd_msg_pub.add;
629: x_return_status := fnd_api.g_ret_sts_error;
630: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_FORMAT');
631: ELSE
632: --
633: l_temp1 := SUBSTR(new_IBAN, 1, 4);
634: l_temp2 := SUBSTR(new_IBAN, 5, l_len);
665: IF l_mod <> 1 THEN
666: fnd_message.set_name('CE', 'CE_INVALID_IBAN_CHKSUM'); -- Bug 8946879
667: fnd_msg_pub.add;
668: x_return_status := fnd_api.g_ret_sts_error;
669: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_CHKSUM'); -- Bug 8946879
670: ELSE
671: -- IF (new_IBAN <> p_IBAN) then Bug 6658562
672: cep_standard.debug('new_IBAN <> p_IBAN');
673: p_IBAN_OUT := new_IBAN;
668: x_return_status := fnd_api.g_ret_sts_error;
669: cep_standard.debug('validate_IBAN: CE_INVALID_IBAN_CHKSUM'); -- Bug 8946879
670: ELSE
671: -- IF (new_IBAN <> p_IBAN) then Bug 6658562
672: cep_standard.debug('new_IBAN <> p_IBAN');
673: p_IBAN_OUT := new_IBAN;
674: cep_standard.debug('p_IBAN='||p_IBAN);
675: cep_standard.debug('new_IBAN='||new_IBAN);
676: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
670: ELSE
671: -- IF (new_IBAN <> p_IBAN) then Bug 6658562
672: cep_standard.debug('new_IBAN <> p_IBAN');
673: p_IBAN_OUT := new_IBAN;
674: cep_standard.debug('p_IBAN='||p_IBAN);
675: cep_standard.debug('new_IBAN='||new_IBAN);
676: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
677: -- END IF;
678: END IF;
671: -- IF (new_IBAN <> p_IBAN) then Bug 6658562
672: cep_standard.debug('new_IBAN <> p_IBAN');
673: p_IBAN_OUT := new_IBAN;
674: cep_standard.debug('p_IBAN='||p_IBAN);
675: cep_standard.debug('new_IBAN='||new_IBAN);
676: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
677: -- END IF;
678: END IF;
679: END IF;
672: cep_standard.debug('new_IBAN <> p_IBAN');
673: p_IBAN_OUT := new_IBAN;
674: cep_standard.debug('p_IBAN='||p_IBAN);
675: cep_standard.debug('new_IBAN='||new_IBAN);
676: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
677: -- END IF;
678: END IF;
679: END IF;
680: cep_standard.debug('end');
676: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
677: -- END IF;
678: END IF;
679: END IF;
680: cep_standard.debug('end');
681: cep_standard.debug('p_IBAN='||p_IBAN);
682: cep_standard.debug('new_IBAN='||new_IBAN);
683: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
684: END IF;
677: -- END IF;
678: END IF;
679: END IF;
680: cep_standard.debug('end');
681: cep_standard.debug('p_IBAN='||p_IBAN);
682: cep_standard.debug('new_IBAN='||new_IBAN);
683: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
684: END IF;
685: END validate_IBAN;
678: END IF;
679: END IF;
680: cep_standard.debug('end');
681: cep_standard.debug('p_IBAN='||p_IBAN);
682: cep_standard.debug('new_IBAN='||new_IBAN);
683: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
684: END IF;
685: END validate_IBAN;
686:
679: END IF;
680: cep_standard.debug('end');
681: cep_standard.debug('p_IBAN='||p_IBAN);
682: cep_standard.debug('new_IBAN='||new_IBAN);
683: cep_standard.debug('p_IBAN_OUT='||p_IBAN_OUT);
684: END IF;
685: END validate_IBAN;
686:
687: /*=======================================================================+
703: x_return_status IN OUT NOCOPY VARCHAR2 ) IS
704:
705:
706: BEGIN
707: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
708: -- initialize API return status to success.
709: x_return_status := fnd_api.g_ret_sts_success;
710:
711: cep_standard.debug('p_ap='||p_ap);
707: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
708: -- initialize API return status to success.
709: x_return_status := fnd_api.g_ret_sts_success;
710:
711: cep_standard.debug('p_ap='||p_ap);
712: cep_standard.debug('p_ar='||p_ar);
713: cep_standard.debug('p_pay='||p_pay);
714: cep_standard.debug('p_xtr='||p_xtr);
715:
708: -- initialize API return status to success.
709: x_return_status := fnd_api.g_ret_sts_success;
710:
711: cep_standard.debug('p_ap='||p_ap);
712: cep_standard.debug('p_ar='||p_ar);
713: cep_standard.debug('p_pay='||p_pay);
714: cep_standard.debug('p_xtr='||p_xtr);
715:
716:
709: x_return_status := fnd_api.g_ret_sts_success;
710:
711: cep_standard.debug('p_ap='||p_ap);
712: cep_standard.debug('p_ar='||p_ar);
713: cep_standard.debug('p_pay='||p_pay);
714: cep_standard.debug('p_xtr='||p_xtr);
715:
716:
717: IF (p_ap IS NULL OR p_ap = 'N') AND
710:
711: cep_standard.debug('p_ap='||p_ap);
712: cep_standard.debug('p_ar='||p_ar);
713: cep_standard.debug('p_pay='||p_pay);
714: cep_standard.debug('p_xtr='||p_xtr);
715:
716:
717: IF (p_ap IS NULL OR p_ap = 'N') AND
718: (p_ar IS NULL OR p_ar = 'N') AND
748: p_xtr IN VARCHAR2,
749: x_return_status IN OUT NOCOPY VARCHAR2 ) IS
750:
751: BEGIN
752: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
753: -- initialize API return status to success.
754: x_return_status := fnd_api.g_ret_sts_success;
755: cep_standard.debug('p_short_account_name='||p_short_account_name);
756: cep_standard.debug('p_xtr='||p_xtr);
751: BEGIN
752: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
753: -- initialize API return status to success.
754: x_return_status := fnd_api.g_ret_sts_success;
755: cep_standard.debug('p_short_account_name='||p_short_account_name);
756: cep_standard.debug('p_xtr='||p_xtr);
757:
758:
759: IF (p_short_account_name IS NULL) AND (p_xtr IS NOT NULL) AND (p_xtr <> 'N') THEN
752: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
753: -- initialize API return status to success.
754: x_return_status := fnd_api.g_ret_sts_success;
755: cep_standard.debug('p_short_account_name='||p_short_account_name);
756: cep_standard.debug('p_xtr='||p_xtr);
757:
758:
759: IF (p_short_account_name IS NULL) AND (p_xtr IS NOT NULL) AND (p_xtr <> 'N') THEN
760: fnd_message.set_name('CE', 'CE_SHORT_ACCOUNT_NAME_REQUIRED');
786: p_end_date IN DATE,
787: x_return_status IN OUT NOCOPY VARCHAR2) IS
788:
789: BEGIN
790: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_end_date (+)');
791: -- initialize API return status to success.
792: x_return_status := fnd_api.g_ret_sts_success;
793:
794:
894:
895: BEGIN
896:
897: BEGIN
898: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.get_org_type (+)');
899:
900: --/* 1/13/05 no bg
901: OPEN bg;
902:
900: --/* 1/13/05 no bg
901: OPEN bg;
902:
903: FETCH bg INTO bg_org;
904: cep_standard.debug('bg_org='||bg_org);
905: IF bg%NOTFOUND THEN
906: bg_org := null;
907: END IF;
908: CLOSE bg;
910:
911: /* 3/24/05 no le
912: OPEN le;
913: FETCH le INTO le_org;
914: cep_standard.debug('le_org='||le_org);
915: IF le%NOTFOUND THEN
916: le_org := null;
917: END IF;
918: CLOSE le;
918: CLOSE le;
919: */
920: OPEN ou;
921: FETCH ou INTO ou_org;
922: cep_standard.debug('ou_org='||ou_org);
923: IF ou%NOTFOUND THEN
924: ou_org := null;
925: END IF;
926: CLOSE ou;
930: org_type1 := bg_org || ou_org;
931:
932: org_type := substr(org_type1,1,(length(org_type1)-2));
933:
934: cep_standard.debug('org_type='||org_type);
935:
936: EXCEPTION
937: WHEN no_data_found THEN
938: org_type := NULL;
942: RETURN org_type;
943:
944: EXCEPTION
945: WHEN OTHERS THEN
946: cep_standard.debug('EXCEPTION: Get_Org_Type');
947: RAISE;
948: END Get_Org_Type;
949:
950:
978: AND organization_id = p_org_id;
979:
980: BEGIN
981: BEGIN
982: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.get_org_type_code (+)');
983:
984: OPEN bg;
985:
986: FETCH bg INTO bg_org;
983:
984: OPEN bg;
985:
986: FETCH bg INTO bg_org;
987: cep_standard.debug('bg_org='||bg_org);
988: IF bg%NOTFOUND THEN
989: bg_org := null;
990: END IF;
991: CLOSE bg;
991: CLOSE bg;
992:
993: OPEN ou;
994: FETCH ou INTO ou_org;
995: cep_standard.debug('ou_org='||ou_org);
996: IF ou%NOTFOUND THEN
997: ou_org := null;
998: END IF;
999: CLOSE ou;
1001: org_type := bg_org || ou_org;
1002:
1003: --org_type := substr(org_type1,1,(length(org_type1)-2));
1004:
1005: cep_standard.debug('org_type='||org_type);
1006:
1007: EXCEPTION
1008: WHEN no_data_found THEN
1009: org_type := NULL;
1013: RETURN org_type;
1014:
1015: EXCEPTION
1016: WHEN OTHERS THEN
1017: cep_standard.debug('EXCEPTION: Get_Org_Type_Code');
1018: RAISE;
1019: END Get_Org_Type_Code;
1020:
1021:
1050:
1051: org_type VARCHAR2(240);
1052:
1053: BEGIN
1054: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
1055: -- initialize API return status to success.
1056: x_return_status := fnd_api.g_ret_sts_success;
1057:
1058: cep_standard.debug('p_ap='||p_ap);
1054: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_account_use (+)');
1055: -- initialize API return status to success.
1056: x_return_status := fnd_api.g_ret_sts_success;
1057:
1058: cep_standard.debug('p_ap='||p_ap);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1061: cep_standard.debug('p_xtr='||p_xtr);
1062: cep_standard.debug('p_org_id='||p_org_id);
1055: -- initialize API return status to success.
1056: x_return_status := fnd_api.g_ret_sts_success;
1057:
1058: cep_standard.debug('p_ap='||p_ap);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1061: cep_standard.debug('p_xtr='||p_xtr);
1062: cep_standard.debug('p_org_id='||p_org_id);
1063:
1056: x_return_status := fnd_api.g_ret_sts_success;
1057:
1058: cep_standard.debug('p_ap='||p_ap);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1061: cep_standard.debug('p_xtr='||p_xtr);
1062: cep_standard.debug('p_org_id='||p_org_id);
1063:
1064: /*// orgType: LE - Legal Entity
1057:
1058: cep_standard.debug('p_ap='||p_ap);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1061: cep_standard.debug('p_xtr='||p_xtr);
1062: cep_standard.debug('p_org_id='||p_org_id);
1063:
1064: /*// orgType: LE - Legal Entity
1065: // BG - Business Group
1058: cep_standard.debug('p_ap='||p_ap);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1061: cep_standard.debug('p_xtr='||p_xtr);
1062: cep_standard.debug('p_org_id='||p_org_id);
1063:
1064: /*// orgType: LE - Legal Entity
1065: // BG - Business Group
1066: // OU - Operating Unit
1204: WHERE ft.territory_code = p_country_code;
1205: l_dummy NUMBER(1) := 0;
1206: BEGIN
1207: IF l_DEBUG in ('Y', 'C') THEN
1208: cep_standard.debug('>>CE_BANK_AND_ACCOUNT_VALIDATION.validate_country.');
1209: END IF;
1210:
1211: OPEN c_country;
1212: FETCH c_country INTO l_dummy;
1217: END IF;
1218: CLOSE c_country;
1219:
1220: IF l_DEBUG in ('Y', 'C') THEN
1221: cep_standard.debug('<
1223: END validate_country;
1224:
1225: /*=======================================================================+
1265: p_cur varchar2(5);
1266: p_ap_def number;
1267: p_xtr_def number;
1268: BEGIN
1269: cep_standard.debug('>>CE_BANK_AND_ACCOUNT_VALIDATION.validate_def_settlement');
1270: -- initialize API return status to success.
1271: x_return_status := fnd_api.g_ret_sts_success;
1272:
1273: -- Initialize message list if p_init_msg_list is set to TRUE.
1274: IF FND_API.to_Boolean(p_init_msg_list) THEN
1275: FND_MSG_PUB.initialize;
1276: END IF;
1277: IF l_DEBUG in ('Y', 'C') THEN
1278: cep_standard.debug(' P_INIT_MSG_LIST: '|| P_INIT_MSG_LIST);
1279: END IF;
1280:
1281: IF (p_bank_account_id is not null) then
1282: select currency_code into p_cur
1335: IF x_msg_count > 0 THEN
1336: x_return_status := fnd_api.g_ret_sts_error;
1337: END IF;
1338: --IF l_DEBUG in ('Y', 'C') THEN
1339: cep_standard.debug(' P_COUNT: '|| x_msg_count);
1340:
1341:
1342: cep_standard.debug('<
1338: --IF l_DEBUG in ('Y', 'C') THEN
1339: cep_standard.debug(' P_COUNT: '|| x_msg_count);
1340:
1341:
1342: cep_standard.debug('<
1344:
1345: EXCEPTION
1346: WHEN OTHERS THEN
1444: AND NVL(org_id, legal_entity_id) = p_org_le_id
1445: AND bank_acct_use_id <> NVL(p_acct_use_id, -1);
1446:
1447: BEGIN
1448: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.validate_unique_org_access(+)');
1449:
1450: -- initialize API return status to success.
1451: x_return_status := fnd_api.g_ret_sts_success;
1452:
1497: p_pay_doc_count number;
1498: p_ap_doc_cat_count number;
1499:
1500: BEGIN
1501: cep_standard.debug('>>CE_BANK_AND_ACCOUNT_VALIDATION.get_pay_doc_cat');
1502: cep_standard.debug('P_PAYMENT_DOCUMENT_ID=' ||P_PAYMENT_DOCUMENT_ID
1503: ||', P_PAYMENT_METHOD_CODE='||P_PAYMENT_METHOD_CODE
1504: ||', P_BANK_ACCT_USE_ID='||P_BANK_ACCT_USE_ID );
1505:
1498: p_ap_doc_cat_count number;
1499:
1500: BEGIN
1501: cep_standard.debug('>>CE_BANK_AND_ACCOUNT_VALIDATION.get_pay_doc_cat');
1502: cep_standard.debug('P_PAYMENT_DOCUMENT_ID=' ||P_PAYMENT_DOCUMENT_ID
1503: ||', P_PAYMENT_METHOD_CODE='||P_PAYMENT_METHOD_CODE
1504: ||', P_BANK_ACCT_USE_ID='||P_BANK_ACCT_USE_ID );
1505:
1506: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1509: select count(*) into p_pay_doc_count
1510: from ce_payment_documents
1511: where PAYMENT_DOCUMENT_ID = P_PAYMENT_DOCUMENT_ID;
1512:
1513: cep_standard.debug('p_pay_doc_count='||p_pay_doc_count );
1514:
1515: if (p_pay_doc_count = 1) then
1516: select nvl(PAYMENT_DOC_CATEGORY, '-1')
1517: into P_PAYMENT_DOC_CATEGORY_CODE
1521: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1522: end if;
1523: END IF;
1524:
1525: cep_standard.debug('ce_payment_documents P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1526:
1527: IF (P_PAYMENT_DOC_CATEGORY_CODE = '-1') THEN
1528: IF (P_PAYMENT_METHOD_CODE is not null and P_BANK_ACCT_USE_ID is not null) THEN
1529: select count(*) into p_ap_doc_cat_count
1540: else
1541: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1542: end if;
1543:
1544: cep_standard.debug('ce_ap_pm_doc_categories P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1545:
1546: END IF;
1547: END IF;
1548:
1552: select nvl(PAYMENT_DOC_CATEGORY, '-1')
1553: into P_PAYMENT_DOC_CATEGORY_CODE
1554: from ce_bank_acct_uses_all
1555: where BANK_ACCT_USE_ID = P_BANK_ACCT_USE_ID;
1556: cep_standard.debug('ce_bank_acct_uses_all P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1557: END IF;
1558: END IF;
1559:
1560: cep_standard.debug('P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1556: cep_standard.debug('ce_bank_acct_uses_all P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1557: END IF;
1558: END IF;
1559:
1560: cep_standard.debug('P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1561:
1562: cep_standard.debug('<
1564: EXCEPTION
1558: END IF;
1559:
1560: cep_standard.debug('P_PAYMENT_DOC_CATEGORY_CODE='||P_PAYMENT_DOC_CATEGORY_CODE );
1561:
1562: cep_standard.debug('<
1564: EXCEPTION
1565: WHEN NO_DATA_FOUND THEN
1566: cep_standard.debug('no data found');
1562: cep_standard.debug('<
1564: EXCEPTION
1565: WHEN NO_DATA_FOUND THEN
1566: cep_standard.debug('no data found');
1567: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1568: WHEN TOO_MANY_ROWS THEN
1569: cep_standard.debug('too_many_rows');
1570: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1565: WHEN NO_DATA_FOUND THEN
1566: cep_standard.debug('no data found');
1567: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1568: WHEN TOO_MANY_ROWS THEN
1569: cep_standard.debug('too_many_rows');
1570: P_PAYMENT_DOC_CATEGORY_CODE := '-1';
1571: WHEN OTHERS THEN
1572: FND_MESSAGE.Set_Name('CE', 'CE_UNHANDLED_EXCEPTION');
1573: FND_MESSAGE.Set_Token('PROCEDURE', 'CE_BANK_AND_ACCOUNT_VALIDATION.get_pay_doc_cat');
1614: and oi.organization_id = p_org_id;
1615:
1616: BEGIN
1617: BEGIN
1618: cep_standard.debug('CE_BANK_AND_ACCOUNT_VALIDATION.get_org_type_code_isetup (+)');
1619:
1620: OPEN bg;
1621:
1622: FETCH bg INTO bg_org;
1619:
1620: OPEN bg;
1621:
1622: FETCH bg INTO bg_org;
1623: cep_standard.debug('bg_org='||bg_org);
1624: IF bg%NOTFOUND THEN
1625: bg_org := null;
1626: END IF;
1627: CLOSE bg;
1627: CLOSE bg;
1628:
1629: OPEN ou;
1630: FETCH ou INTO ou_org;
1631: cep_standard.debug('ou_org='||ou_org);
1632: IF ou%NOTFOUND THEN
1633: ou_org := null;
1634: END IF;
1635: CLOSE ou;
1635: CLOSE ou;
1636:
1637: org_type := bg_org || ou_org;
1638:
1639: cep_standard.debug('org_type='||org_type);
1640:
1641: EXCEPTION
1642: WHEN no_data_found THEN
1643: org_type := NULL;
1647: RETURN org_type;
1648:
1649: EXCEPTION
1650: WHEN OTHERS THEN
1651: cep_standard.debug('EXCEPTION: Get_Org_Type_Code_Isetup');
1652: RAISE;
1653: END Get_Org_Type_Code_Isetup;
1654:
1655: END CE_BANK_AND_ACCOUNT_VALIDATION;