Getting the Tax Rate Codes by Business Unit and Reference Set

Use the Below QUERY to get the Tax Rate Codes corresponding to each Business Unit and Reference Data Set.



SELECT A.INTERNAL_ORGANIZATION_ID,
       BU.BU_NAME,
       R.TAX_RATE_CODE,
       RM.COUNTRY_CODE,
       T.TAX_TYPE_CODE,
       RM.TAX_REGIME_CODE,
       RM.REGIME_TYPE_FLAG,
       LC.LOOKUP_TYPE,
       LC.LOOKUP_CODE,
       LC.DISPLAY_SEQUENCE,
       LC.ENABLED_FLAG,
       LC.START_DATE_ACTIVE,
       LC.END_DATE_ACTIVE,
       LC.MEANING,
       LC.DESCRIPTION,
       LC.TAG,
       LC.SET_ID LookUpSetID
  FROM ZX_RATES_B               R,
       ZX_TAXES_B               T,
       ZX_ACCOUNTS              A,
       FUN_FIN_BUSINESS_UNITS_V BU,
       ZX_REGIMES_B             RM,
       FND_LOOKUP_VALUES_VL     LC,
       FND_SETID_ASSIGNMENTS    SA
WHERE     R.TAX_RATE_ID = A.TAX_ACCOUNT_ENTITY_ID
       AND A.TAX_ACCOUNT_ENTITY_CODE = 'RATES'
       AND NVL (R.EFFECTIVE_TO, SYSDATE) >= SYSDATE
       AND NVL (RM.EFFECTIVE_TO, SYSDATE) >= SYSDATE
       AND R.ACTIVE_FLAG = 'Y'
       AND A.INTERNAL_ORGANIZATION_ID = BU.BU_ID
       AND R.TAX_REGIME_CODE = RM.TAX_REGIME_CODE
       AND (   (    LC.LOOKUP_TYPE = 'ZX_INPUT_CLASSIFICATIONS'
                AND RM.REGIME_TYPE_FLAG = 'I')
            OR (    LC.LOOKUP_TYPE = 'ZX_WHT_TAX_CLASSIFICATION_CODE'
                AND RM.REGIME_TYPE_FLAG = 'W'))
       AND LC.LOOKUP_CODE = R.TAX_RATE_CODE
       AND LC.ENABLED_FLAG = 'Y'
       AND SA.DETERMINANT_VALUE = BU.BU_ID
       AND LC.SET_ID = SA.SET_ID
       AND SA.REFERENCE_GROUP_NAME = 'ZX_TAX_CLASSIFICATION_CODES'
       AND R.TAX = T.TAX
       AND RM.TAX_REGIME_CODE = T.TAX_REGIME_CODE
       AND NVL (T.EFFECTIVE_TO, SYSDATE) >= SYSDATE

Comments

Popular posts from this blog

How to Add an Attachment to the Payables Invoice using the REST API

How to Create Procurement Agent in Bulk or using REST API

Oracle Cloud ERP - AP - How to get the Status of the Invoice