This SQL query selects the tax category name and ID where the tax rate ID matches rates associated with TDS tax thresholds for a given invoice, or the default sales tax category for the invoice's organization. It joins several tables to link the invoice, vendor, tax rates, and tax categories tables.
This SQL query selects the tax category name and ID where the tax rate ID matches rates associated with TDS tax thresholds for a given invoice, or the default sales tax category for the invoice's organization. It joins several tables to link the invoice, vendor, tax rates, and tax categories tables.
This SQL query selects the tax category name and ID where the tax rate ID matches rates associated with TDS tax thresholds for a given invoice, or the default sales tax category for the invoice's organization. It joins several tables to link the invoice, vendor, tax rates, and tax categories tables.
This SQL query selects the tax category name and ID where the tax rate ID matches rates associated with TDS tax thresholds for a given invoice, or the default sales tax category for the invoice's organization. It joins several tables to link the invoice, vendor, tax rates, and tax categories tables.
from jai_tax_categories jatc, jai_tax_category_lines jatcl where jatc.tax_category_id = jatcl.tax_category_id and jatcl.tax_rate_id in (select distinct jtcl.tax_rate_id from apps.JAI_AP_TDS_THHOLD_HDRS hdr, JAI_AP_TDS_THHOLD_TYPE_SLABS jttts, apps.JAI_AP_TDS_THHOLD_TAXES ldr, JAI_reporting_associations v, apps.jai_party_regs_v reg, ap_invoices_all ai, apps.jai_tax_categories jtc, jai_tax_category_lines jtcl where hdr.SECTION_TYPE = 'TDS_SECTION' and hdr.SECTION_CODE =(select lookup_code from FND_LOOKUP_VALUES_VL vl where lookup_type = 'JAI_TDS_SECTION' and vl.MEANING =:JAI_AP_INV_DISTRIBUTIONS.SECTION_CODE_MEANING) and hdr.THRESHOLD_HDR_ID = jttts.THRESHOLD_HDR_ID and jttts.threshold_type = 'CUMULATIVE' and jttts.to_date is null and jttts.THRESHOLD_slab_ID = ldr.THRESHOLD_slab_ID and hdr.VENDOR_TYPE_LOOKUP_CODE = v.REPORTING_CODE and v.REGIME_ID = 10002 and v.reporting_type_name = 'Vendor Type' and reg.PARTY_CLASS_CODE = 'SUPPLIER' and REG_CLASS_CODE = 'THIRD_PARTY' and reg.PARTY_REG_ID = v.entity_id and reg.party_id = ai.VENDOR_ID and reg.party_site_id = ai.VENDOR_SITE_ID and ldr.OPERATING_UNIT_ID = ai.org_id and ai.invoice_id =:JAI_AP_INV_DISTRIBUTIONS.INVOICE_ID and ldr.TAX_CATEGORY_ID = jtc.TAX_CATEGORY_ID and jtc.TAX_CATEGORY_ID = jtcl.TAX_CATEGORY_ID and jtcl.tax_type_id = 10002) UNION SELECT jatc.tax_category_name, jatc.tax_category_id FROM apps.jai_tax_categories jatc, apps.jai_tax_category_lines jatcl WHERE jatc.tax_category_id = jatcl.tax_category_id AND tax_type_id = 10000 AND regime_id = 10000 AND ORG_ID=(SELECT ORG_ID FROM AP_INVOICES_ALL WHERE INVOICE_ID=:JAI_AP_INV_DISTRIBUTIONS.INVOICE_ID)