2008 (64)
2010 (42)
2011 (54)
2016 (1)
SELECT ADDR.ORG_ID,
ADDR.CUST_ACCOUNT_ID CUSTOMER_ID ,
ADDR.CUST_ACCT_SITE_ID ADDRESS_ID ,
LOC.COUNTRY COUNTRY ,
LOC.LANGUAGE LANGUAGE ,
substr(cus.customer_name,1,50),
CUS.customer_number,
LOC.LANGUAGE
FROM HZ_LOCATIONS LOC,
HZ_CUST_ACCT_SITES_ALL ADDR,
AR_LOOKUPS L_CAT,
HZ_PARTY_SITES PARTY_SITE,
HZ_LOC_ASSIGNMENTS LOC_ASSIGN,
ar_customers_v cus,
hz_cust_site_uses_all su,
hz_cust_acct_sites_all cas
where ADDR.CUSTOMER_CATEGORY_CODE = L_CAT.LOOKUP_CODE(+)
AND L_CAT.LOOKUP_TYPE(+) = 'ADDRESS_CATEGORY'
AND ADDR.PARTY_SITE_ID = PARTY_SITE.PARTY_SITE_ID
AND LOC.LOCATION_ID = PARTY_SITE.LOCATION_ID
AND LOC.LOCATION_ID = LOC_ASSIGN.LOCATION_ID
AND ADDR.CUST_ACCOUNT_ID = cus.customer_id
AND su.site_use_code = 'BILL_TO'
AND su.cust_acct_site_id = cas.cust_acct_site_id
AND cas.party_site_id = addr.party_site_id
AND NVL(ADDR.ORG_ID, -99) = NVL(LOC_ASSIGN.ORG_ID, -99)
AND NVL(ADDR.ORG_ID, -99) = NVL(su.ORG_ID, -99)
AND NVL(cas.ORG_ID, -99) = NVL(su.ORG_ID, -99)
ORDER BYcustomer_id
This is useful if we need to generate invoice in language set on customer ‘bill to’ site.