Friday, January 3, 2025

SQL query to get list of Jurisdictions for which Tax Rates has been defined in Oracle APPS R12

SELECT zj.tax
      ,zj.tax_jurisdiction_code
  ,hzg.geography_element2_code state_code
  ,hzg.geography_element3_code county_code
  ,hzg.geography_element4_code city_code
  FROM zx_jurisdictions_b zj
      ,hz_geographies hzg
 WHERE zj.tax_regime_codE='XX_SALE_TAX'
   AND SYSDATE BETWEEN zj.effective_from AND NVL(zj.effective_to,'31-DEC-4999')
   AND SYSDATE BETWEEN hzg.start_date AND hzg.end_date
   AND zj.zone_geography_id=hzg.geography_id
   AND zj.tax=hzg.geography_type
   AND NOT EXISTS (SELECT 1 
                     FROM zx_rates_b zr
                    WHERE zr.tax_regime_code='XX_SALE_TAX'
                      AND zr.tax_jurisdiction_code=zj.tax_jurisdiction_code
   )
ORDER BY zj.tax
        ,zj.tax_jurisdiction_code
    ,hzg.geography_element2_code
,hzg.geography_element3_code
,hzg.geography_element4_code

No comments:

Post a Comment

Query to get Parent and Child Accounts in Oracle APPS R12

SELECT ffv1.flex_value parent_account       ,ffvt1.description parent_account_desc   ,ffv2.flex_value child_account   ,ffvt2.description...