SELECT b.registration_number
FROM ja.jai_party_regs a, ja.jai_party_reg_lines b
WHERE a.org_id = 81 --:p_org_id
AND a.party_id = 1040 --:p_vendor_id
AND a.party_site_id = 3048 --:p_vendor_site_id
AND a.party_reg_id = b.party_reg_id
AND a.PARTY_TYPE_CODE = 'THIRD_PARTY_SITE'
AND NVL(a.CUSTOMER_FLAG,'N') = 'Y' AND NVL(SITE_FLAG,'N') = 'Y'
AND b.REGISTRATION_TYPE_CODE = 'GSTIN' --Depen on Setup
AND SYSDATE BETWEEN b.effective_from AND NVL (b.effective_to, SYSDATE)