185: -- 14242293: Modified error message
186: if l_bank_exist = 'Y' then
187: fnd_message.set_name('CE', 'CE_BANK_EXISTS');
188: fnd_msg_pub.add;
189: x_return_status := fnd_api.G_RET_STS_ERROR;
190: else
191: x_return_status := fnd_api.G_RET_STS_SUCCESS;
192: end if;
193: EXCEPTION
187: fnd_message.set_name('CE', 'CE_BANK_EXISTS');
188: fnd_msg_pub.add;
189: x_return_status := fnd_api.G_RET_STS_ERROR;
190: else
191: x_return_status := fnd_api.G_RET_STS_SUCCESS;
192: end if;
193: EXCEPTION
194: WHEN OTHERS THEN
195: FND_MESSAGE.Set_Name('CE', 'CE_UNHANDLED_EXCEPTION');
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:
323: OPEN c_currency;
324: FETCH c_currency INTO l_dummy;
325: IF c_currency%NOTFOUND THEN
324: FETCH c_currency INTO l_dummy;
325: IF c_currency%NOTFOUND THEN
326: fnd_message.set_name('CE', 'CE_BA_INVALID_CURRENCY');
327: fnd_msg_pub.add;
328: x_return_status := fnd_api.g_ret_sts_error;
329: END IF;
330: CLOSE c_currency;
331: END validate_currency;
332:
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: /*
373: OPEN c_rowid;
374: FETCH c_rowid INTO l_rowid;
375: CLOSE c_rowid;
378: FETCH c_acct_name INTO l_dummy;
379: IF l_dummy = 'X' THEN
380: fnd_message.set_name('CE', 'CE_DUP_ACCT_NAME');
381: fnd_msg_pub.add;
382: x_return_status := fnd_api.g_ret_sts_error;
383: END IF;
384: CLOSE c_acct_name;
385:
386: EXCEPTION
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;
423: IF Xi_country_code = 'AD' AND l_iban_len <> 24 THEN
424: l_iban_len := 24;
425: ELSIF Xi_country_code = 'AT' AND l_iban_len <> 20 THEN
508: l_valid_iban := true;
509: END IF;
510:
511: IF (l_valid_iban) THEN
512: xo_return_status := fnd_api.g_ret_sts_success;
513: ELSE
514: xo_return_status := fnd_api.g_ret_sts_error;
515: IF (l_country_chk_reqd) THEN
516: BEGIN
510:
511: IF (l_valid_iban) THEN
512: xo_return_status := fnd_api.g_ret_sts_success;
513: ELSE
514: xo_return_status := fnd_api.g_ret_sts_error;
515: IF (l_country_chk_reqd) THEN
516: BEGIN
517: SELECT territory_short_name
518: INTO l_country_name
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
578: -- spaces in the middle are not removed
579:
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;
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
606:
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: --
613: /*Bug 16507244 code change 2/2*/
614: --
615: -- step 3: IBAN length validation
616: --
617: IF (x_return_status = fnd_api.g_ret_sts_success) then
618: CE_BANK_AND_ACCOUNT_VALIDATION.validate_iban_length(Xi_country_code => l_str1_2,
619: Xi_len => l_len,
620: Xo_return_status => x_return_status);
621: END IF;
619: Xi_len => l_len,
620: Xo_return_status => x_return_status);
621: END IF;
622:
623: IF (x_return_status = fnd_api.g_ret_sts_success) then
624: IF TRANSLATE(new_IBAN, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
625: '999999999999999999999999999999999999')
626: <> RPAD(l_var, l_len, '9') THEN
627: fnd_message.set_name('CE', 'CE_INVALID_IBAN_FORMAT');
625: '999999999999999999999999999999999999')
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);
664: --
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');
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);
712: cep_standard.debug('p_ar='||p_ar);
713: cep_standard.debug('p_pay='||p_pay);
719: (p_pay IS NULL OR p_pay = 'N') AND
720: (p_xtr IS NULL OR p_xtr = 'N') THEN
721: fnd_message.set_name('CE', 'CE_NO_ACCOUNT_USE');
722: fnd_msg_pub.add;
723: x_return_status := fnd_api.g_ret_sts_error;
724: END IF;
725:
726:
727: EXCEPTION
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);
757:
758:
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');
761: fnd_msg_pub.add;
762: x_return_status := fnd_api.g_ret_sts_error;
763: END IF;
764:
765:
766: EXCEPTION
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:
795: IF (p_start_date is not NULL) AND (p_end_date is not NULL) THEN
796: IF p_start_date > p_end_date THEN
795: IF (p_start_date is not NULL) AND (p_end_date is not NULL) THEN
796: IF p_start_date > p_end_date THEN
797: fnd_message.set_name('CE', 'CE_EARLY_END_DATE');
798: fnd_msg_pub.add;
799: x_return_status := fnd_api.g_ret_sts_error;
800: END IF;
801: END IF;
802:
803:
805: WHEN OTHERS THEN
806: FND_MESSAGE.Set_Name('CE', 'CE_UNHANDLED_EXCEPTION');
807: FND_MESSAGE.Set_Token('PROCEDURE', 'CE_BANK_AND_ACCOUNT_VALIDATION.validate_end_date');
808: fnd_msg_pub.add;
809: x_return_status := fnd_api.g_ret_sts_error;
810:
811: END validate_end_date;
812:
813: /*=======================================================================+
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);
1059: cep_standard.debug('p_ar='||p_ar);
1060: cep_standard.debug('p_pay='||p_pay);
1071: ((p_ar IS not NULL) and (p_ar <>'N')) or
1072: ((p_pay IS not NULL) and (p_pay <>'N'))) THEN
1073: fnd_message.set_name('CE', 'CE_LE_ACCESS_ORG');
1074: fnd_msg_pub.add;
1075: x_return_status := fnd_api.g_ret_sts_error;
1076: ELSIF (p_org_type = 'BG') AND
1077: (((p_ap IS not NULL) and (p_ap <>'N')) or
1078: ((p_ar IS not NULL) and (p_ar <>'N')) or
1079: ((p_xtr IS not NULL) and (p_xtr <>'N'))) THEN
1078: ((p_ar IS not NULL) and (p_ar <>'N')) or
1079: ((p_xtr IS not NULL) and (p_xtr <>'N'))) THEN
1080: fnd_message.set_name('CE', 'CE_BG_ACCESS_ORG');
1081: fnd_msg_pub.add;
1082: x_return_status := fnd_api.g_ret_sts_error;
1083: ELSIF (p_org_type = 'OU') AND
1084: (((p_xtr IS not NULL) and (p_xtr <>'N')) or
1085: ((p_pay IS not NULL) and (p_pay <>'N'))) THEN
1086: fnd_message.set_name('CE', 'CE_OU_ACCESS_ORG');
1084: (((p_xtr IS not NULL) and (p_xtr <>'N')) or
1085: ((p_pay IS not NULL) and (p_pay <>'N'))) THEN
1086: fnd_message.set_name('CE', 'CE_OU_ACCESS_ORG');
1087: fnd_msg_pub.add;
1088: x_return_status := fnd_api.g_ret_sts_error;
1089: ELSIF (p_org_type = 'BGOU') AND
1090: ((p_xtr IS not NULL) and (p_xtr <>'N')) THEN
1091: fnd_message.set_name('CE', 'CE_BGOU_ACCESS_ORG');
1092: fnd_msg_pub.add;
1089: ELSIF (p_org_type = 'BGOU') AND
1090: ((p_xtr IS not NULL) and (p_xtr <>'N')) THEN
1091: fnd_message.set_name('CE', 'CE_BGOU_ACCESS_ORG');
1092: fnd_msg_pub.add;
1093: x_return_status := fnd_api.g_ret_sts_error;
1094: END IF;
1095:
1096: EXCEPTION
1097: WHEN OTHERS THEN
1116: | x_msg_data |
1117: | X_VALUE_OUT |
1118: +=======================================================================*/
1119: PROCEDURE VALIDATE_ALC(ALC_VALUE in varchar2,
1120: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1121: x_msg_count OUT NOCOPY NUMBER,
1122: x_msg_data OUT NOCOPY VARCHAR2,
1123: X_VALUE_OUT OUT NOCOPY VARCHAR2,
1124: x_return_status IN OUT NOCOPY VARCHAR2 )
1129:
1130: BEGIN
1131:
1132: -- Initialize message list if p_init_msg_list is set to TRUE.
1133: IF FND_API.to_Boolean(p_init_msg_list) THEN
1134: FND_MSG_PUB.initialize;
1135: END IF;
1136: -- initialize API return status to success.
1137: x_return_status := fnd_api.g_ret_sts_success;
1133: IF FND_API.to_Boolean(p_init_msg_list) THEN
1134: FND_MSG_PUB.initialize;
1135: END IF;
1136: -- initialize API return status to success.
1137: x_return_status := fnd_api.g_ret_sts_success;
1138:
1139:
1140: IF (ALC_VALUE is not null) THEN
1141:
1150: end if;
1151: else
1152: FND_MESSAGE.set_name('CE','CE_ALC_VALUE_TOO_LONG');
1153: fnd_msg_pub.add;
1154: x_return_status := fnd_api.g_ret_sts_error;
1155: END if;
1156: ELSE
1157: FND_MESSAGE.set_name('CE','CE_ALC_NUMERIC_VALUE_ONLY');
1158: fnd_msg_pub.add;
1155: END if;
1156: ELSE
1157: FND_MESSAGE.set_name('CE','CE_ALC_NUMERIC_VALUE_ONLY');
1158: fnd_msg_pub.add;
1159: x_return_status := fnd_api.g_ret_sts_error;
1160: END IF;
1161:
1162: END IF;
1163:
1161:
1162: END IF;
1163:
1164: FND_MSG_PUB.Count_And_Get(
1165: p_encoded => FND_API.G_FALSE,
1166: p_count => x_msg_count,
1167: p_data => x_msg_data);
1168:
1169: EXCEPTION
1212: FETCH c_country INTO l_dummy;
1213: IF c_country%NOTFOUND THEN
1214: fnd_message.set_name('CE', 'CE_API_INVALID_COUNTRY');
1215: fnd_msg_pub.add;
1216: x_return_status := fnd_api.g_ret_sts_error;
1217: END IF;
1218: CLOSE c_country;
1219:
1220: IF l_DEBUG in ('Y', 'C') THEN
1257: p_bank_acct_use_id IN number,
1258: p_org_id IN number,
1259: p_ap_def_settlement in VARCHAR2,
1260: p_xtr_def_settlement in VARCHAR2,
1261: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1262: x_msg_count OUT NOCOPY NUMBER,
1263: x_msg_data OUT NOCOPY VARCHAR2,
1264: x_return_status IN OUT NOCOPY VARCHAR2) IS
1265: p_cur varchar2(5);
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;
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);
1327: fnd_msg_pub.add;
1328: END IF;
1329:
1330: FND_MSG_PUB.Count_And_Get(
1331: p_encoded => FND_API.G_FALSE,
1332: p_count => x_msg_count,
1333: p_data => x_msg_data);
1334:
1335: IF x_msg_count > 0 THEN
1332: p_count => x_msg_count,
1333: p_data => x_msg_data);
1334:
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:
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:
1453: OPEN c_acct_access;
1454: FETCH c_acct_access INTO l_dummy;
1455: IF l_dummy = 'X' THEN
1454: FETCH c_acct_access INTO l_dummy;
1455: IF l_dummy = 'X' THEN
1456: fnd_message.set_name('CE', 'CE_DUP_ACCT_ORG_ACCESS');
1457: fnd_msg_pub.add;
1458: x_return_status := fnd_api.g_ret_sts_error;
1459: END IF;
1460: CLOSE c_acct_access;
1461:
1462: EXCEPTION