The blog provides the Oracle Apps R12 Sql Query to get Customer Tax Registration Number at Header level and Oracle Apps R12 Sql Query to get Customer Tax Registration Number at Customer site Level.
Oracle Apps R12 SQL Query to get Customer Tax Registration
Header Level:
SELECT ZX_REGISTRATIONS_TBL.REGISTRATION_NUMBER
FROM ZX_REGISTRATIONS ZX_REGISTRATIONS_TBL,
ZX_PARTY_TAX_PROFILE ZX_PARTY_TAX_PROF_TBL
WHERE TAX_REGIME_CODE='IN GST'
AND EFFECTIVE_TO IS NULL
AND ROWNUM=1
AND ZX_REGISTRATIONS_TBL.PARTY_TAX_PROFILE_ID=ZX_PARTY_TAX_PROF_TBL.PARTY_TAX_PROFILE_ID
AND ZX_PARTY_TAX_PROF_TBL.PARTY_ID=
(SELECT PARTY_ID FROM HZ_CUST_ACCOUNTS_ALL WHERE CUST_ACCOUNT_ID=:P_CUSTOMER_ID)
Customer Site Level:
SELECT ZX_REGISTRATIONS_TBL.REGISTRATION_NUMBER
FROM ZX_REGISTRATIONS ZX_REGISTRATIONS_TBL,
ZX_PARTY_TAX_PROFILE ZX_PARTY_TAX_PROF_TBL
WHERE TAX_REGIME_CODE='IN GST'
AND EFFECTIVE_TO IS NULL
AND ROWNUM=1
AND ZX_REGISTRATIONS_TBL.PARTY_TAX_PROFILE_ID=ZX_PARTY_TAX_PROF_TBL.PARTY_TAX_PROFILE_ID
AND ZX_PARTY_TAX_PROF_TBL.PARTY_ID=:P_PARTY_SITE_ID