SELECT *
FROM hz_cust_accounts
WHERE ACCOUNT_NUMBER = 'R08'; -- CUST_ACCOUNT_ID =51401 , PARTY_ID= 235048
SELECT *
FROM hz_parties H
WHERE party_id = 235048;
--- JGZZ_FISCAL_CODE holds the tax payer id.--PARTY_ID, PARTY_NUMBER, PARTY_NAME, PARTY_TYPE, STATUS, JGZZ_FISCAL_CODE, H.*
SELECT *--PARTY_SITE_ID, PARTY_ID, LOCATION_ID, PARTY_SITE_NUMBER, STATUS, CREATED_BY_MODULE, H.*
FROM HZ_PARTY_SITES H
WHERE --location_id in(45802,45770) --
PARTY_ID = 235048; -- PARTY_SITE_ID : 242061, LOCATION_ID= 45808
-- wrong LOCATION_ID=50148, PARTY_SITE_ID=430023
SELECT * FROM hz_locations h WHERE location_id in(45808,50148)
SELECT * FROM hz_cust_acct_sites_all h, hr_operating_units ou
WHERE ORG_ID=ou.short_code
and PARTY_SITE_ID in (242061, 430023)
SELECT * FROM HZ_CUST_SITE_USES_ALL h where location in(45808,50148)
select * from org_organization_definitions where organization_code='R08'
-- Oracle APPS ISO Internal Location details and deletion from backend.
SELECT * FROM PO_LOCATION_ASSOCIATIONS_ALL a, hr_operating_units ou
WHERE --LOCATION_ID in(45808,50148)-- AND
--ORG_ID = 122 --&enter org_id;
a.ORG_ID=ou.organization_id and
a.organization_id=716
--If it returns any row, it means that, indeed, an Internal location is Already assigned to another Ship-to Address
--For deletion of internal location association
--Please run following datafix:
--Take a backup of table :- FROM PO_LOCATION_ASSOCIATIONS_ALL
DELETE FROM PO_LOCATION_ASSOCIATIONS_ALL
WHERE LOCATION_ID = &location_id AND ORG_ID = &enter org_id;
select * FROM PO_LOCATION_ASSOCIATIONS_ALL where LOCATION_ID = 12560 AND ORG_ID = 209
--create table xxPO_LOCATION_ASSOCIATIONS_ALL_bak as
delete FROM PO_LOCATION_ASSOCIATIONS_ALL where LOCATION_ID = 12560 AND ORG_ID = 209