DBA Data[Home] [Help]

APPS.HZ_ACCOUNT_VALIDATE_V2PUB dependencies on HZ_CUST_ACCT_SITES

Line 2824: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

2820: l_credit_classification HZ_CUSTOMER_PROFILES.CREDIT_CLASSIFICATION%TYPE;
2821:
2822: l_cust_acct_site_use_code HZ_CUST_SITE_USES.SITE_USE_CODE%TYPE;
2823: l_return_status VARCHAR2(1);
2824: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
2825:
2826: l_ckeck_acc_bfb_enabled VARCHAR2(1);
2827: ll_cons_inv_flag VARCHAR2(1);
2828:

Line 3485: FROM HZ_CUST_ACCT_SITES_ALL

3481: END;
3482:
3483: -- cust_account_id should be same as cust_account_id site_use_id belongs to.
3484: SELECT CUST_ACCOUNT_ID INTO l_cust_account_id
3485: FROM HZ_CUST_ACCT_SITES_ALL
3486: WHERE CUST_ACCT_SITE_ID = l_cust_acct_site_id;
3487:
3488: IF l_cust_account_id <> p_customer_profile_rec.cust_account_id THEN
3489: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_ACCT_SITEUSE_MISMATCH' );

Line 6978: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;

6974: l_rowid ROWID := NULL;
6975:
6976: l_cust_account_id NUMBER;
6977: l_party_site_id NUMBER;
6978: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6979: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6980: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6981: l_application_id NUMBER;
6982: l_status HZ_CUST_ACCT_SITES.status%TYPE;

Line 6980: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;

6976: l_cust_account_id NUMBER;
6977: l_party_site_id NUMBER;
6978: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6979: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6980: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6981: l_application_id NUMBER;
6982: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6983: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6984: l_count NUMBER := 0;

Line 6982: l_status HZ_CUST_ACCT_SITES.status%TYPE;

6978: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6979: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6980: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6981: l_application_id NUMBER;
6982: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6983: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6984: l_count NUMBER := 0;
6985: l_instr_length number := 0;
6986: l_validate_flag varchar2(1) := 'Y';

Line 6983: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;

6979: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6980: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6981: l_application_id NUMBER;
6982: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6983: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6984: l_count NUMBER := 0;
6985: l_instr_length number := 0;
6986: l_validate_flag varchar2(1) := 'Y';
6987: l_mosr_owner_table_id number;

Line 7012: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

7008: SELECT CUST_ACCOUNT_ID, PARTY_SITE_ID, ORIG_SYSTEM_REFERENCE,
7009: CREATED_BY_MODULE, APPLICATION_ID, STATUS, CUSTOMER_CATEGORY_CODE
7010: INTO l_cust_account_id, l_party_site_id, l_orig_system_reference,
7011: l_created_by_module, l_application_id, l_status, l_customer_category_code
7012: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
7013: WHERE ROWID = p_rowid;
7014: END IF;
7015:
7016: --------------------------------------

Line 7032: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

7028: p_cust_acct_site_rec.cust_acct_site_id <> FND_API.G_MISS_NUM
7029: THEN
7030: BEGIN
7031: SELECT 'Y' INTO l_dummy
7032: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
7033: WHERE CUST_ACCT_SITE_ID = p_cust_acct_site_rec.cust_acct_site_id;
7034:
7035: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );
7036: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'cust_acct_site_id' );

Line 7265: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

7261: -- cust_account_id and party_site_id together should be unique.
7262: -- Bug 3456489. Post MOAC, this uniqueness should be within orgs.
7263: BEGIN
7264: SELECT 'Y' INTO l_dummy
7265: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
7266: WHERE CUST_ACCOUNT_ID = p_cust_acct_site_rec.cust_account_id
7267: AND PARTY_SITE_ID = p_cust_acct_site_rec.party_site_id
7268: AND ORG_ID = p_cust_acct_site_rec.org_id -- Bug 3456489
7269: AND ROWNUM = 1;

Line 7316: FROM HZ_CUST_ACCT_SITES_ALL

7312: p_cust_acct_site_rec.orig_system_reference <> FND_API.G_MISS_CHAR
7313: THEN
7314: BEGIN
7315: SELECT 'Y' INTO l_dummy
7316: FROM HZ_CUST_ACCT_SITES_ALL
7317: WHERE ORIG_SYSTEM_REFERENCE = p_cust_acct_site_rec.orig_system_reference
7318: AND ORG_ID = p_cust_acct_site_rec.org_id;
7319:
7320: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );

Line 7360: p_owner_table_name => 'HZ_CUST_ACCT_SITES_ALL',

7356: then
7357: hz_orig_system_ref_pub.get_owner_table_id
7358: (p_orig_system => p_cust_acct_site_rec.orig_system,
7359: p_orig_system_reference => p_cust_acct_site_rec.orig_system_reference,
7360: p_owner_table_name => 'HZ_CUST_ACCT_SITES_ALL',
7361: x_owner_table_id => l_mosr_owner_table_id,
7362: x_return_status => l_temp_return_status);
7363:
7364: IF (l_temp_return_status = fnd_api.g_ret_sts_success AND

Line 7419: FROM HZ_CUST_ACCT_SITES_ALL

7415: p_cust_acct_site_rec.tp_header_id <> FND_API.G_MISS_NUM
7416: THEN
7417: BEGIN
7418: SELECT ROWID INTO l_rowid
7419: FROM HZ_CUST_ACCT_SITES_ALL
7420: WHERE TP_HEADER_ID = p_cust_acct_site_rec.tp_header_id
7421: AND ORG_ID = p_cust_acct_site_rec.org_id; -- Bug 3456489
7422:
7423: IF p_create_update_flag = 'C' OR

Line 7672: from hz_cust_acct_sites_all addr -- Bug 3456489

7668: p_cust_acct_site_rec.ece_tp_location_code <> FND_API.G_MISS_CHAR
7669: THEN
7670: select count(1)
7671: into l_count
7672: from hz_cust_acct_sites_all addr -- Bug 3456489
7673: where addr.cust_account_id = p_cust_acct_site_rec.cust_account_id
7674: and addr.ece_tp_location_code = p_cust_acct_site_rec.ece_tp_location_code
7675: and org_id = p_cust_acct_site_rec.org_id; -- Bug 3456489
7676:

Line 7690: from hz_cust_acct_sites_all addr -- Bug 3456489

7686: p_cust_acct_site_rec.ece_tp_location_code <> FND_API.G_MISS_CHAR
7687: THEN
7688: select count(1)
7689: into l_count
7690: from hz_cust_acct_sites_all addr -- Bug 3456489
7691: where addr.cust_account_id = l_cust_account_id
7692: and addr.ece_tp_location_code = p_cust_acct_site_rec.ece_tp_location_code
7693: and addr.cust_acct_site_id <> p_cust_acct_site_rec.cust_acct_site_id
7694: and org_id = p_cust_acct_site_rec.org_id; -- Bug 3456489

Line 7958: -- cust_acct_site_id is foreign key to hz_cust_acct_sites

7954:
7955: -- Since cust_acct_site_id is mandatory and non-updateable, we only need
7956: -- to check FK during site use creation.
7957:
7958: -- cust_acct_site_id is foreign key to hz_cust_acct_sites
7959: IF p_create_update_flag = 'C' AND
7960: p_cust_site_use_rec.cust_acct_site_id IS NOT NULL AND
7961: p_cust_site_use_rec.cust_acct_site_id <> FND_API.G_MISS_NUM
7962: THEN

Line 7970: hz_utility_v2pub.debug(p_message=>'cust_acct_site_id is foreign key to hz_cust_acct_sites. ' ||

7966: p_org_id => p_cust_site_use_rec.org_id, -- Bug 3456489
7967: x_return_status => x_return_status );
7968:
7969: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
7970: hz_utility_v2pub.debug(p_message=>'cust_acct_site_id is foreign key to hz_cust_acct_sites. ' ||
7971: 'x_return_status = ' || x_return_status,
7972: p_prefix =>l_debug_prefix,
7973: p_msg_level=>fnd_log.level_statement);
7974: END IF;

Line 7981: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

7977: -- Find customer account id this site use belongs to.
7978: -- For later use.
7979:
7980: SELECT CUST_ACCOUNT_ID INTO l_cust_account_id
7981: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
7982: WHERE CUST_ACCT_SITE_ID = l_cust_acct_site_id;
7983:
7984: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
7985: hz_utility_v2pub.debug(p_message=>'(+) after validate cust_acct_site_id ... ' ||

Line 8127: FROM HZ_CUST_ACCT_SITES_ALL site,

8123:
8124: IF l_site_use_code IN ( 'DUN', 'STMTS', 'LEGAL' ) THEN
8125: BEGIN
8126: SELECT 'Y' INTO l_dummy
8127: FROM HZ_CUST_ACCT_SITES_ALL site,
8128: HZ_CUST_SITE_USES_ALL su
8129: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
8130: AND site.CUST_ACCT_SITE_ID = su.CUST_ACCT_SITE_ID
8131: AND su.SITE_USE_CODE = l_site_use_code

Line 8274: FROM HZ_CUST_ACCT_SITES_ALL site,

8270:
8271: --Bug No : 2998504. Status check added to the where clause.
8272:
8273: SELECT 'Y' INTO l_dummy
8274: FROM HZ_CUST_ACCT_SITES_ALL site,
8275: HZ_CUST_SITE_USES_ALL su
8276: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
8277: AND site.CUST_ACCT_SITE_ID = su.CUST_ACCT_SITE_ID
8278: AND su.SITE_USE_CODE = l_site_use_code

Line 8347: FROM HZ_CUST_ACCT_SITES_ALL site,

8343: THEN
8344: IF l_site_use_code = 'SHIP_TO' THEN
8345: BEGIN
8346: SELECT 'Y' INTO l_dummy
8347: FROM HZ_CUST_ACCT_SITES_ALL site,
8348: HZ_CUST_SITE_USES_ALL su
8349: WHERE su.SITE_USE_ID = p_cust_site_use_rec.bill_to_site_use_id
8350: AND su.SITE_USE_CODE = 'BILL_TO'
8351: AND su.STATUS = 'A'

Line 8577: FROM HZ_CUST_ACCT_SITES site,

8573: IF p_cust_site_use_rec.primary_flag = 'Y'
8574: THEN
8575: BEGIN
8576: SELECT 'Y' INTO l_dummy
8577: FROM HZ_CUST_ACCT_SITES site,
8578: HZ_CUST_SITE_USES su
8579: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
8580: AND su.CUST_ACCT_SITE_ID = site.CUST_ACCT_SITE_ID
8581: AND su.SITE_USE_CODE = l_site_use_code

Line 9767: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

9763: l_status HZ_CUST_ACCOUNT_ROLES.status%TYPE;
9764: l_validate_flag varchar2(1) := 'Y';
9765: l_mosr_owner_table_id number;
9766: l_return_status VARCHAR2(1);
9767: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
9768: l_temp_return_status VARCHAR2(10); -- for storing return status from
9769: -- hz_orig_system_ref_pub.get_owner_table_id
9770:
9771: BEGIN

Line 10022: -- cust_acct_site_id is foreign key to hz_cust_acct_sites.

10018: END IF;
10019:
10020: END IF;
10021:
10022: -- cust_acct_site_id is foreign key to hz_cust_acct_sites.
10023: -- The cust_account_id in hz_cust_acct_sites should be same
10024: -- as we put in cust_account_id in hz_cust_account_roles.
10025: -- Since cust_acct_site_id is non-updateable, we only need to
10026: -- check FK during creation.

Line 10023: -- The cust_account_id in hz_cust_acct_sites should be same

10019:
10020: END IF;
10021:
10022: -- cust_acct_site_id is foreign key to hz_cust_acct_sites.
10023: -- The cust_account_id in hz_cust_acct_sites should be same
10024: -- as we put in cust_account_id in hz_cust_account_roles.
10025: -- Since cust_acct_site_id is non-updateable, we only need to
10026: -- check FK during creation.
10027:

Line 10036: FROM HZ_CUST_ACCT_SITES_ALL

10032: BEGIN
10033:
10034: SELECT CUST_ACCOUNT_ID,ORG_ID
10035: INTO l_cust_account_id,l_org_id
10036: FROM HZ_CUST_ACCT_SITES_ALL
10037: WHERE CUST_ACCT_SITE_ID = p_cust_account_role_rec.cust_acct_site_id;
10038:
10039: -- Bug 4650473. Check if org is accessible.
10040: BEGIN

Line 10059: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );

10055: WHEN NO_DATA_FOUND THEN
10056: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
10057: FND_MESSAGE.SET_TOKEN( 'FK', 'cust_acct_site_id' );
10058: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'cust_acct_site_id' );
10059: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );
10060: FND_MSG_PUB.ADD;
10061: x_return_status := FND_API.G_RET_STS_ERROR;
10062: END;
10063:

Line 10065: hz_utility_v2pub.debug(p_message=>'cust_acct_site_id is foreign key to hz_cust_acct_sites and cust_account_id in hz_cust_acct_sites should be same as we put in cust_account_id in hz_cust_account_roles.' ||

10061: x_return_status := FND_API.G_RET_STS_ERROR;
10062: END;
10063:
10064: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
10065: hz_utility_v2pub.debug(p_message=>'cust_acct_site_id is foreign key to hz_cust_acct_sites and cust_account_id in hz_cust_acct_sites should be same as we put in cust_account_id in hz_cust_account_roles.' ||
10066: 'x_return_status = ' || x_return_status,
10067: p_prefix =>l_debug_prefix,
10068: p_msg_level=>fnd_log.level_statement);
10069: END IF;

Line 10998: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

10994: p_msg_level=>fnd_log.level_procedure);
10995: END IF;
10996:
10997: SELECT 'Y' INTO l_dummy
10998: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
10999: WHERE CUST_ACCT_SITE_ID = p_column_value
11000: AND ORG_ID = p_org_id; -- Bug 3456489
11001:
11002: EXCEPTION

Line 11007: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );

11003: WHEN NO_DATA_FOUND THEN
11004: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
11005: FND_MESSAGE.SET_TOKEN( 'FK', 'cust_acct_site_id' );
11006: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_column );
11007: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );
11008: FND_MSG_PUB.ADD;
11009: x_return_status := FND_API.G_RET_STS_ERROR;
11010:
11011: END check_cust_acct_site_fk;

Line 11020: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

11016: x_return_status IN OUT NOCOPY VARCHAR2
11017: ) IS
11018:
11019: l_return_status VARCHAR2(1);
11020: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
11021: BEGIN
11022:
11023: SELECT org_id INTO l_org_id
11024: FROM HZ_CUST_SITE_USES_ALL