DBA Data[Home] [Help]

APPS.HZ_ACCOUNT_VALIDATE_V2PUB dependencies on HZ_CUST_ACCT_SITES

Line 2798: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

2794: l_credit_classification HZ_CUSTOMER_PROFILES.CREDIT_CLASSIFICATION%TYPE;
2795:
2796: l_cust_acct_site_use_code HZ_CUST_SITE_USES.SITE_USE_CODE%TYPE;
2797: l_return_status VARCHAR2(1);
2798: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
2799:
2800: l_ckeck_acc_bfb_enabled VARCHAR2(1);
2801: ll_cons_inv_flag VARCHAR2(1);
2802:

Line 3458: FROM HZ_CUST_ACCT_SITES_ALL

3454: END;
3455:
3456: -- cust_account_id should be same as cust_account_id site_use_id belongs to.
3457: SELECT CUST_ACCOUNT_ID INTO l_cust_account_id
3458: FROM HZ_CUST_ACCT_SITES_ALL
3459: WHERE CUST_ACCT_SITE_ID = l_cust_acct_site_id;
3460:
3461: IF l_cust_account_id <> p_customer_profile_rec.cust_account_id THEN
3462: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_ACCT_SITEUSE_MISMATCH' );

Line 6721: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;

6717: l_rowid ROWID := NULL;
6718:
6719: l_cust_account_id NUMBER;
6720: l_party_site_id NUMBER;
6721: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6722: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6723: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6724: l_application_id NUMBER;
6725: l_status HZ_CUST_ACCT_SITES.status%TYPE;

Line 6723: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;

6719: l_cust_account_id NUMBER;
6720: l_party_site_id NUMBER;
6721: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6722: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6723: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6724: l_application_id NUMBER;
6725: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6726: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6727: l_count NUMBER := 0;

Line 6725: l_status HZ_CUST_ACCT_SITES.status%TYPE;

6721: l_orig_system_reference HZ_CUST_ACCT_SITES.orig_system_reference%TYPE;
6722: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6723: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6724: l_application_id NUMBER;
6725: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6726: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6727: l_count NUMBER := 0;
6728: l_instr_length number := 0;
6729: l_validate_flag varchar2(1) := 'Y';

Line 6726: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;

6722: l_orig_system_reference1 HZ_CUST_ACCOUNTS.orig_system_reference%TYPE;
6723: l_created_by_module HZ_CUST_ACCT_SITES.created_by_module%TYPE;
6724: l_application_id NUMBER;
6725: l_status HZ_CUST_ACCT_SITES.status%TYPE;
6726: l_customer_category_code HZ_CUST_ACCT_SITES.customer_category_code%TYPE;
6727: l_count NUMBER := 0;
6728: l_instr_length number := 0;
6729: l_validate_flag varchar2(1) := 'Y';
6730: l_mosr_owner_table_id number;

Line 6755: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

6751: SELECT CUST_ACCOUNT_ID, PARTY_SITE_ID, ORIG_SYSTEM_REFERENCE,
6752: CREATED_BY_MODULE, APPLICATION_ID, STATUS, CUSTOMER_CATEGORY_CODE
6753: INTO l_cust_account_id, l_party_site_id, l_orig_system_reference,
6754: l_created_by_module, l_application_id, l_status, l_customer_category_code
6755: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
6756: WHERE ROWID = p_rowid;
6757: END IF;
6758:
6759: --------------------------------------

Line 6775: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

6771: p_cust_acct_site_rec.cust_acct_site_id <> FND_API.G_MISS_NUM
6772: THEN
6773: BEGIN
6774: SELECT 'Y' INTO l_dummy
6775: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
6776: WHERE CUST_ACCT_SITE_ID = p_cust_acct_site_rec.cust_acct_site_id;
6777:
6778: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );
6779: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'cust_acct_site_id' );

Line 6990: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

6986: -- cust_account_id and party_site_id together should be unique.
6987: -- Bug 3456489. Post MOAC, this uniqueness should be within orgs.
6988: BEGIN
6989: SELECT 'Y' INTO l_dummy
6990: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
6991: WHERE CUST_ACCOUNT_ID = p_cust_acct_site_rec.cust_account_id
6992: AND PARTY_SITE_ID = p_cust_acct_site_rec.party_site_id
6993: AND ORG_ID = p_cust_acct_site_rec.org_id -- Bug 3456489
6994: AND ROWNUM = 1;

Line 7041: FROM HZ_CUST_ACCT_SITES_ALL

7037: p_cust_acct_site_rec.orig_system_reference <> FND_API.G_MISS_CHAR
7038: THEN
7039: BEGIN
7040: SELECT 'Y' INTO l_dummy
7041: FROM HZ_CUST_ACCT_SITES_ALL
7042: WHERE ORIG_SYSTEM_REFERENCE = p_cust_acct_site_rec.orig_system_reference
7043: AND ORG_ID = p_cust_acct_site_rec.org_id;
7044:
7045: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_DUPLICATE_COLUMN' );

Line 7085: p_owner_table_name => 'HZ_CUST_ACCT_SITES_ALL',

7081: then
7082: hz_orig_system_ref_pub.get_owner_table_id
7083: (p_orig_system => p_cust_acct_site_rec.orig_system,
7084: p_orig_system_reference => p_cust_acct_site_rec.orig_system_reference,
7085: p_owner_table_name => 'HZ_CUST_ACCT_SITES_ALL',
7086: x_owner_table_id => l_mosr_owner_table_id,
7087: x_return_status => l_temp_return_status);
7088:
7089: IF (l_temp_return_status = fnd_api.g_ret_sts_success AND

Line 7144: FROM HZ_CUST_ACCT_SITES_ALL

7140: p_cust_acct_site_rec.tp_header_id <> FND_API.G_MISS_NUM
7141: THEN
7142: BEGIN
7143: SELECT ROWID INTO l_rowid
7144: FROM HZ_CUST_ACCT_SITES_ALL
7145: WHERE TP_HEADER_ID = p_cust_acct_site_rec.tp_header_id
7146: AND ORG_ID = p_cust_acct_site_rec.org_id; -- Bug 3456489
7147:
7148: IF p_create_update_flag = 'C' OR

Line 7397: from hz_cust_acct_sites_all addr -- Bug 3456489

7393: p_cust_acct_site_rec.ece_tp_location_code <> FND_API.G_MISS_CHAR
7394: THEN
7395: select count(1)
7396: into l_count
7397: from hz_cust_acct_sites_all addr -- Bug 3456489
7398: where addr.cust_account_id = p_cust_acct_site_rec.cust_account_id
7399: and addr.ece_tp_location_code = p_cust_acct_site_rec.ece_tp_location_code
7400: and org_id = p_cust_acct_site_rec.org_id; -- Bug 3456489
7401:

Line 7415: from hz_cust_acct_sites_all addr -- Bug 3456489

7411: p_cust_acct_site_rec.ece_tp_location_code <> FND_API.G_MISS_CHAR
7412: THEN
7413: select count(1)
7414: into l_count
7415: from hz_cust_acct_sites_all addr -- Bug 3456489
7416: where addr.cust_account_id = l_cust_account_id
7417: and addr.ece_tp_location_code = p_cust_acct_site_rec.ece_tp_location_code
7418: and addr.cust_acct_site_id <> p_cust_acct_site_rec.cust_acct_site_id
7419: and org_id = p_cust_acct_site_rec.org_id; -- Bug 3456489

Line 7680: -- cust_acct_site_id is foreign key to hz_cust_acct_sites

7676:
7677: -- Since cust_acct_site_id is mandatory and non-updateable, we only need
7678: -- to check FK during site use creation.
7679:
7680: -- cust_acct_site_id is foreign key to hz_cust_acct_sites
7681: IF p_create_update_flag = 'C' AND
7682: p_cust_site_use_rec.cust_acct_site_id IS NOT NULL AND
7683: p_cust_site_use_rec.cust_acct_site_id <> FND_API.G_MISS_NUM
7684: THEN

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

7688: p_org_id => p_cust_site_use_rec.org_id, -- Bug 3456489
7689: x_return_status => x_return_status );
7690:
7691: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
7692: hz_utility_v2pub.debug(p_message=>'cust_acct_site_id is foreign key to hz_cust_acct_sites. ' ||
7693: 'x_return_status = ' || x_return_status,
7694: p_prefix =>l_debug_prefix,
7695: p_msg_level=>fnd_log.level_statement);
7696: END IF;

Line 7703: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

7699: -- Find customer account id this site use belongs to.
7700: -- For later use.
7701:
7702: SELECT CUST_ACCOUNT_ID INTO l_cust_account_id
7703: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
7704: WHERE CUST_ACCT_SITE_ID = l_cust_acct_site_id;
7705:
7706: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
7707: hz_utility_v2pub.debug(p_message=>'(+) after validate cust_acct_site_id ... ' ||

Line 7848: FROM HZ_CUST_ACCT_SITES_ALL site,

7844:
7845: IF l_site_use_code IN ( 'DUN', 'STMTS', 'LEGAL' ) THEN
7846: BEGIN
7847: SELECT 'Y' INTO l_dummy
7848: FROM HZ_CUST_ACCT_SITES_ALL site,
7849: HZ_CUST_SITE_USES_ALL su
7850: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
7851: AND site.CUST_ACCT_SITE_ID = su.CUST_ACCT_SITE_ID
7852: AND su.SITE_USE_CODE = l_site_use_code

Line 7991: FROM HZ_CUST_ACCT_SITES_ALL site,

7987:
7988: --Bug No : 2998504. Status check added to the where clause.
7989:
7990: SELECT 'Y' INTO l_dummy
7991: FROM HZ_CUST_ACCT_SITES_ALL site,
7992: HZ_CUST_SITE_USES_ALL su
7993: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
7994: AND site.CUST_ACCT_SITE_ID = su.CUST_ACCT_SITE_ID
7995: AND su.SITE_USE_CODE = l_site_use_code

Line 8064: FROM HZ_CUST_ACCT_SITES_ALL site,

8060: THEN
8061: IF l_site_use_code = 'SHIP_TO' THEN
8062: BEGIN
8063: SELECT 'Y' INTO l_dummy
8064: FROM HZ_CUST_ACCT_SITES_ALL site,
8065: HZ_CUST_SITE_USES_ALL su
8066: WHERE su.SITE_USE_ID = p_cust_site_use_rec.bill_to_site_use_id
8067: AND su.SITE_USE_CODE = 'BILL_TO'
8068: AND su.STATUS = 'A'

Line 8294: FROM HZ_CUST_ACCT_SITES site,

8290: IF p_cust_site_use_rec.primary_flag = 'Y'
8291: THEN
8292: BEGIN
8293: SELECT 'Y' INTO l_dummy
8294: FROM HZ_CUST_ACCT_SITES site,
8295: HZ_CUST_SITE_USES su
8296: WHERE site.CUST_ACCOUNT_ID = l_cust_account_id
8297: AND su.CUST_ACCT_SITE_ID = site.CUST_ACCT_SITE_ID
8298: AND su.SITE_USE_CODE = l_site_use_code

Line 9484: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

9480: l_status HZ_CUST_ACCOUNT_ROLES.status%TYPE;
9481: l_validate_flag varchar2(1) := 'Y';
9482: l_mosr_owner_table_id number;
9483: l_return_status VARCHAR2(1);
9484: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
9485: l_temp_return_status VARCHAR2(10); -- for storing return status from
9486: -- hz_orig_system_ref_pub.get_owner_table_id
9487:
9488: BEGIN

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

9735: END IF;
9736:
9737: END IF;
9738:
9739: -- cust_acct_site_id is foreign key to hz_cust_acct_sites.
9740: -- The cust_account_id in hz_cust_acct_sites should be same
9741: -- as we put in cust_account_id in hz_cust_account_roles.
9742: -- Since cust_acct_site_id is non-updateable, we only need to
9743: -- check FK during creation.

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

9736:
9737: END IF;
9738:
9739: -- cust_acct_site_id is foreign key to hz_cust_acct_sites.
9740: -- The cust_account_id in hz_cust_acct_sites should be same
9741: -- as we put in cust_account_id in hz_cust_account_roles.
9742: -- Since cust_acct_site_id is non-updateable, we only need to
9743: -- check FK during creation.
9744:

Line 9753: FROM HZ_CUST_ACCT_SITES_ALL

9749: BEGIN
9750:
9751: SELECT CUST_ACCOUNT_ID,ORG_ID
9752: INTO l_cust_account_id,l_org_id
9753: FROM HZ_CUST_ACCT_SITES_ALL
9754: WHERE CUST_ACCT_SITE_ID = p_cust_account_role_rec.cust_acct_site_id;
9755:
9756: -- Bug 4650473. Check if org is accessible.
9757: BEGIN

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

9772: WHEN NO_DATA_FOUND THEN
9773: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
9774: FND_MESSAGE.SET_TOKEN( 'FK', 'cust_acct_site_id' );
9775: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'cust_acct_site_id' );
9776: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );
9777: FND_MSG_PUB.ADD;
9778: x_return_status := FND_API.G_RET_STS_ERROR;
9779: END;
9780:

Line 9782: 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.' ||

9778: x_return_status := FND_API.G_RET_STS_ERROR;
9779: END;
9780:
9781: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
9782: 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.' ||
9783: 'x_return_status = ' || x_return_status,
9784: p_prefix =>l_debug_prefix,
9785: p_msg_level=>fnd_log.level_statement);
9786: END IF;

Line 10707: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489

10703:
10704: BEGIN
10705:
10706: SELECT 'Y' INTO l_dummy
10707: FROM HZ_CUST_ACCT_SITES_ALL -- Bug 3456489
10708: WHERE CUST_ACCT_SITE_ID = p_column_value
10709: AND ORG_ID = p_org_id; -- Bug 3456489
10710:
10711: EXCEPTION

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

10712: WHEN NO_DATA_FOUND THEN
10713: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
10714: FND_MESSAGE.SET_TOKEN( 'FK', 'cust_acct_site_id' );
10715: FND_MESSAGE.SET_TOKEN( 'COLUMN', p_column );
10716: FND_MESSAGE.SET_TOKEN( 'TABLE', 'hz_cust_acct_sites' );
10717: FND_MSG_PUB.ADD;
10718: x_return_status := FND_API.G_RET_STS_ERROR;
10719:
10720: END check_cust_acct_site_fk;

Line 10729: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;

10725: x_return_status IN OUT NOCOPY VARCHAR2
10726: ) IS
10727:
10728: l_return_status VARCHAR2(1);
10729: l_org_id HZ_CUST_ACCT_SITES_ALL.org_id%TYPE;
10730: BEGIN
10731:
10732: SELECT org_id INTO l_org_id
10733: FROM HZ_CUST_SITE_USES_ALL