840: FROM ZX_FC_COUNTRY_DEFAULTS ContDef,
841: ZX_IMPORT_TAX_LINES_GT TaxLines_gt,
842: ZX_TRX_HEADERS_GT Header,
843: --ZX_TRANSACTION_LINES_GT Lines,
844: ZX_RATES_B rates,
845: ZX_SUBSCRIPTION_DETAILS sd_rates
846: WHERE TaxLines_gt.tax_rate_code = rates.tax_rate_code(+)
847: AND (Taxlines_gt.tax_rate_code IS NOT NULL OR Taxlines_gt.tax_rate_id IS NOT NULL)
848: AND Taxlines_gt.tax_date --Bug 5018766
908: BETWEEN NVL(sd_rates.effective_from,Taxlines_gt.subscription_date)
909: AND NVL(sd_rates.effective_to,Taxlines_gt.subscription_date)
910: OR
911: Rates.effective_from = (SELECT MIN(effective_from)
912: FROM zx_rates_b
913: WHERE
914: tax_regime_code = Rates.tax_regime_code and
915: tax = Rates.tax and
916: tax_status_code = Rates.tax_status_code and
920: )
921: )
922: AND (NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC') OR
923: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
924: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
925: WHERE b.tax_regime_code = Rates.tax_regime_code
926: AND b.tax = Rates.tax
927: AND b.tax_status_code = Rates.tax_status_code
928: AND b.tax_rate_code = Rates.tax_rate_code
971: FROM ZX_FC_COUNTRY_DEFAULTS ContDef,
972: ZX_IMPORT_TAX_LINES_GT TaxLines_gt,
973: ZX_TRX_HEADERS_GT Header,
974: --ZX_TRANSACTION_LINES_GT Lines,
975: ZX_RATES_B rates,
976: ZX_SUBSCRIPTION_DETAILS sd_rates
977: WHERE TaxLines_gt.tax_rate_id = rates.tax_rate_id(+)
978: AND (Taxlines_gt.tax_rate_code IS NOT NULL OR Taxlines_gt.tax_rate_id IS NOT NULL)
979: AND Taxlines_gt.tax_date --Bug 5018766
1040: BETWEEN NVL(sd_rates.effective_from,Taxlines_gt.subscription_date)
1041: AND NVL(sd_rates.effective_to, Taxlines_gt.subscription_date)
1042: OR
1043: Rates.effective_from = (SELECT MIN(effective_from)
1044: FROM zx_rates_b
1045: WHERE
1046: tax_regime_code = Rates.tax_regime_code and
1047: tax = Rates.tax and
1048: tax_status_code = Rates.tax_status_code and
1052: )
1053: )
1054: AND (NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC') OR
1055: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1056: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
1057: WHERE b.tax_regime_code = Rates.tax_regime_code
1058: AND b.tax = Rates.tax
1059: AND b.tax_status_code = Rates.tax_status_code
1060: AND b.tax_rate_code = Rates.tax_rate_code
1098: FROM ZX_STATUS_B Status,
1099: ZX_TRX_HEADERS_GT Header,
1100: --ZX_TRANSACTION_LINES_GT Lines,
1101: ZX_SUBSCRIPTION_DETAILS sd_status,
1102: ZX_RATES_B rates,
1103: ZX_SUBSCRIPTION_DETAILS sd_rates
1104: WHERE Status.tax_regime_code = TaxLines.tax_regime_code
1105: AND Status.tax = TaxLines.tax
1106: --AND Status.default_status_flag = 'Y'
1192: BETWEEN NVL(sd_rates.effective_from,Taxlines.subscription_date)
1193: AND NVL(sd_rates.effective_to,Taxlines.subscription_date)
1194: OR
1195: Rates.effective_from = (SELECT MIN(effective_from)
1196: FROM zx_rates_b
1197: WHERE
1198: tax_regime_code = Rates.tax_regime_code and
1199: tax = Rates.tax and
1200: tax_status_code = Rates.tax_status_code and
1204: )
1205: )
1206: AND (NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC') OR
1207: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1208: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
1209: WHERE b.tax_regime_code = Rates.tax_regime_code
1210: AND b.tax = Rates.tax
1211: AND b.tax_status_code = Rates.tax_status_code
1212: AND b.tax_rate_code = Rates.tax_rate_code
1343: (SELECT jur.TAX_JURISDICTION_CODE
1344: FROM ZX_JURISDICTIONS_B Jur,
1345: ZX_TRX_HEADERS_GT Header,
1346: --ZX_TRANSACTION_LINES_GT Lines,
1347: ZX_RATES_B rates,
1348: ZX_SUBSCRIPTION_DETAILS sd_rates
1349: WHERE Jur.tax = TaxLines.Tax
1350: AND Jur.tax_regime_code = TaxLines.Tax_Regime_Code
1351: --AND Jur.default_jurisdiction_flag = 'Y'
1416: BETWEEN NVL(sd_rates.effective_from,Taxlines.subscription_date)
1417: AND NVL(sd_rates.effective_to,Taxlines.subscription_date)
1418: OR
1419: Rates.effective_from = (SELECT MIN(effective_from)
1420: FROM zx_rates_b
1421: WHERE
1422: tax_regime_code = Rates.tax_regime_code and
1423: tax = Rates.tax and
1424: tax_status_code = Rates.tax_status_code and
1428: )
1429: AND (NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC')
1430: OR
1431: ( NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1432: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
1433: WHERE b.tax_regime_code = Rates.tax_regime_code
1434: AND b.tax = Rates.tax
1435: AND b.tax_status_code = Rates.tax_status_code
1436: AND b.tax_rate_code = Rates.tax_rate_code
1477: TaxLines_gt.entity_code entity_code,
1478: TaxLines_gt.event_class_code event_class_code,
1479: TaxLines_gt.trx_id trx_id,
1480: TaxLines_gt.summary_tax_line_number summary_tax_line_number
1481: FROM zx_rates_b rates,
1482: zx_trx_headers_gt header,
1483: --zx_transaction_lines_gt lines,
1484: zx_subscription_details sd_rates,
1485: zx_import_tax_lines_gt taxlines_gt
1517: BETWEEN NVL(sd_rates.effective_from,Taxlines_gt.subscription_date)
1518: AND NVL(sd_rates.effective_to,Taxlines_gt.subscription_date)
1519: OR
1520: Rates.effective_from = (SELECT MIN(effective_from)
1521: FROM zx_rates_b
1522: WHERE tax_regime_code = Rates.tax_regime_code
1523: and tax = Rates.tax
1524: and tax_status_code = Rates.tax_status_code
1525: and tax_rate_code = Rates.tax_rate_code
1529: )
1530: AND ( NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC')
1531: OR
1532: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1533: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
1534: WHERE b.tax_regime_code = Rates.tax_regime_code
1535: AND b.tax = Rates.tax
1536: AND b.tax_status_code = Rates.tax_status_code
1537: AND b.tax_rate_code = Rates.tax_rate_code
1619: TaxLines_gt.entity_code entity_code,
1620: TaxLines_gt.event_class_code event_class_code,
1621: TaxLines_gt.trx_id trx_id,
1622: TaxLines_gt.summary_tax_line_number summary_tax_line_number
1623: FROM zx_rates_b rates,
1624: zx_trx_headers_gt header,
1625: --zx_transaction_lines_gt lines,
1626: zx_subscription_details sd_rates,
1627: zx_import_tax_lines_gt taxlines_gt
1659: BETWEEN NVL(sd_rates.effective_from,Taxlines_gt.subscription_date)
1660: AND NVL(sd_rates.effective_to,Taxlines_gt.subscription_date)
1661: OR
1662: Rates.effective_from = (SELECT MIN(effective_from)
1663: FROM zx_rates_b
1664: WHERE tax_regime_code = Rates.tax_regime_code
1665: and tax = Rates.tax
1666: and tax_status_code = Rates.tax_status_code
1667: and tax_rate_code = Rates.tax_rate_code
1671: )
1672: AND ( NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC')
1673: OR
1674: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1675: AND NOT EXISTS (SELECT 1 FROM zx_rates_b b
1676: WHERE b.tax_regime_code = Rates.tax_regime_code
1677: AND b.tax = Rates.tax
1678: AND b.tax_status_code = Rates.tax_status_code
1679: AND b.tax_rate_code = Rates.tax_rate_code
1755: ZX_IMPORT_TAX_LINES_GT TaxLines,
1756: ZX_TRX_HEADERS_GT Header,
1757: ZX_TRANSACTION_LINES_GT Lines,
1758: ZX_TAXES_B tax,
1759: zx_rates_b rate,
1760: zx_subscription_details sd_tax,
1761: zx_subscription_details sd_rates
1762: WHERE Taxlines.TAX_LINE_ALLOCATION_FLAG = 'Y'
1763: AND TaxLines.tax_amt is NULL
1880: header.trx_date,
1881: SYSDATE) )
1882: OR
1883: rate.effective_from = (select min(effective_from)
1884: from ZX_RATES_B
1885: where
1886: tax_regime_code = rate.tax_regime_code and
1887: tax = rate.tax and
1888: tax_status_code = rate.tax_status_code and
1891: )
1892: )
1893: AND (NVL(sd_rates.view_options_code,'NONE') in ('NONE', 'VFC') OR
1894: (NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
1895: AND NOT EXISTS (select 1 from zx_rates_b b
1896: where b.tax_regime_code = rate.tax_regime_code
1897: and b.tax = rate.tax
1898: and b.tax_status_code = rate.tax_status_code
1899: and b.tax_rate_code = rate.tax_rate_code
1975: ZX_FC_CODES_B fc_int,
1976: FND_LOOKUPS fnd,
1977: FND_TERRITORIES fnd_terr,
1978: ZX_FC_PRODUCT_FISCAL_V fc_product
1979: --ZX_RATES_B rates --Commented for Bug#7504455--
1980: WHERE lines_gt.trx_id = header.trx_id
1981: AND fc_product.classification_code(+) = lines_gt.product_fisc_classification
1982: AND fc_prodcat.classification_code(+) = lines_gt.product_category
1983: AND fc_user.classification_type_code(+) = 'USER_DEFINED'
2013: FROM ZX_TRX_HEADERS_GT header,
2014: ZX_REGIMES_B regime ,
2015: ZX_TAXES_B tax ,
2016: ZX_STATUS_B status ,
2017: -- ZX_RATES_B rate ,
2018: -- zx_rates_b off_rate,
2019: -- zx_import_tax_lines_gt temp_gt,
2020: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
2021: zx_transaction_lines_gt lines_gt,
2014: ZX_REGIMES_B regime ,
2015: ZX_TAXES_B tax ,
2016: ZX_STATUS_B status ,
2017: -- ZX_RATES_B rate ,
2018: -- zx_rates_b off_rate,
2019: -- zx_import_tax_lines_gt temp_gt,
2020: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
2021: zx_transaction_lines_gt lines_gt,
2022: ZX_JURISDICTIONS_B jur,
4499: /* CASE WHEN ((lines_gt.output_tax_classification_code IS NOT NULL OR
4500: lines_gt.input_tax_classification_code IS NOT NULL)
4501: --Changed for Bug#7504455--
4502: AND NOT EXISTS (SELECT 1
4503: FROM zx_rates_b rates,
4504: zx_subscription_details zxsd
4505: WHERE rates.tax_rate_code = NVL(lines_gt.output_tax_classification_code,
4506: lines_gt.input_tax_classification_code)
4507: AND rates.tax_regime_code = zxsd.tax_regime_code
4515: /*CASE WHEN /*(lines_gt.output_tax_classification_code IS NOT NULL OR
4516: lines_gt.input_tax_classification_code IS NOT NULL)
4517: AND (EXISTS (SELECT 1 FROM ZX_TAXES_B
4518: WHERE TAX_TYPE_CODE = 'OFFSET'
4519: AND tax IN (SELECT tax FROM ZX_RATES_B
4520: WHERE tax_rate_code = NVL(lines_gt.output_tax_classification_code,
4521: lines_gt.input_tax_classification_code)))
4522: OR
4523: rates.rate_type_code = 'RECOVERY'
4529: CASE WHEN ((lines_gt.output_tax_classification_code IS NOT NULL OR
4530: lines_gt.input_tax_classification_code IS NOT NULL) AND
4531: --Changed for Bug#7504455--
4532: NOT EXISTS (SELECT 1
4533: FROM zx_rates_b rates,
4534: zx_subscription_details zxsd
4535: WHERE rates.tax_rate_code = NVL(lines_gt.output_tax_classification_code,
4536: lines_gt.input_tax_classification_code)
4537: AND rates.tax_regime_code = zxsd.tax_regime_code
4546: CASE WHEN ((lines_gt.output_tax_classification_code IS NOT NULL OR
4547: lines_gt.input_tax_classification_code IS NOT NULL) AND
4548: --Changed for Bug#7504455--
4549: NOT EXISTS (SELECT 1
4550: FROM zx_rates_b rates,
4551: zx_subscription_details zxsd
4552: WHERE rates.tax_rate_code = NVL(lines_gt.output_tax_classification_code,
4553: lines_gt.input_tax_classification_code)
4554: AND rates.tax_regime_code = zxsd.tax_regime_code
4662: --ZX_FC_BUSINESS_CATEGORIES_V fc_trx,
4663: --ZX_FC_CODES_B fc_int,
4664: FND_LOOKUPS fnd--,
4665: --ZX_FC_PRODUCT_FISCAL_V fc_product
4666: --ZX_RATES_B rates --Commented for Bug#7504455--
4667: WHERE
4668: lines_gt.trx_id = header.trx_id
4669: and lines_gt.application_id = header.application_id
4670: and lines_gt.entity_code = header.entity_code
5422: FROM ZX_TRX_HEADERS_GT header,
5423: ZX_REGIMES_B regime ,
5424: ZX_TAXES_B tax ,
5425: ZX_STATUS_B status ,
5426: -- ZX_RATES_B rate ,
5427: -- zx_rates_b off_rate,
5428: -- zx_import_tax_lines_gt temp_gt,
5429: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
5430: --zx_transaction_lines_gt lines_gt,
5423: ZX_REGIMES_B regime ,
5424: ZX_TAXES_B tax ,
5425: ZX_STATUS_B status ,
5426: -- ZX_RATES_B rate ,
5427: -- zx_rates_b off_rate,
5428: -- zx_import_tax_lines_gt temp_gt,
5429: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
5430: --zx_transaction_lines_gt lines_gt,
5431: ZX_JURISDICTIONS_B jur,
7836: CASE WHEN (sd_rates.tax_regime_code is not null and
7837: rate.tax_rate_code is not NULL )
7838: THEN CASE WHEN taxlines_gt.tax_rate_id IS NOT NULL
7839: AND NOT EXISTS (SELECT 1
7840: FROM zx_rates_b
7841: WHERE tax_rate_id = taxlines_gt.tax_rate_id
7842: )
7843: THEN 'Y'
7844: ELSE 'N'
7887: END
7888: ELSE NULL
7889: END DEFAULT_RATE_CODE_NOT_EXISTS
7890: FROM ZX_TRX_HEADERS_GT header,
7891: ZX_RATES_B rate ,
7892: zx_rates_b off_rate,
7893: zx_import_tax_lines_gt temp_gt,
7894: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
7895: --zx_transaction_lines_gt lines_gt,
7888: ELSE NULL
7889: END DEFAULT_RATE_CODE_NOT_EXISTS
7890: FROM ZX_TRX_HEADERS_GT header,
7891: ZX_RATES_B rate ,
7892: zx_rates_b off_rate,
7893: zx_import_tax_lines_gt temp_gt,
7894: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
7895: --zx_transaction_lines_gt lines_gt,
7896: zx_subscription_details sd_rates
7970: /* OR rate.effective_from =
7971: (
7972: SELECT
7973: min(effective_from)
7974: FROM ZX_RATES_B
7975: WHERE tax_regime_code = rate.tax_regime_code
7976: AND tax = rate.tax
7977: AND tax_status_code = rate.tax_status_code
7978: AND tax_rate_code = rate.tax_rate_code
7986: NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
7987: AND NOT EXISTS
7988: (
7989: SELECT 1
7990: FROM zx_rates_b b
7991: WHERE b.tax_regime_code = rate.tax_regime_code
7992: AND b.tax = rate.tax
7993: AND b.tax_status_code = rate.tax_status_code
7994: AND b.tax_rate_code = rate.tax_rate_code
7998: )
7999: AND rate.tax_rate_code = off_rate.offset_tax_rate_code(+)
8000: AND rate.tax_rate_code = temp_gt.tax_rate_code(+) --Bug 14226805
8001: -- Bug 12385195
8002: AND NOT EXISTS (SELECT 1 FROM zx_rates_b ss1
8003: WHERE ss1.tax_regime_code = rate.tax_regime_code
8004: AND ss1.tax = rate.tax
8005: AND ss1.tax_status_code = rate.tax_status_code
8006: AND ss1.tax_rate_code = rate.tax_rate_code
8143: CASE WHEN ( sd_rates.tax_regime_code IS NOT NULL
8144: AND rate.tax_rate_id IS NOT NULL )
8145: THEN CASE WHEN taxlines_gt.tax_rate_code IS NOT NULL
8146: AND NOT EXISTS ( SELECT 1
8147: FROM zx_rates_b
8148: WHERE tax_rate_code = taxlines_gt.tax_rate_code
8149: )
8150: THEN 'Y'
8151: ELSE 'N'
8164: THEN 'N'
8165: ELSE 'Y'
8166: END TAX_RATE_NOT_ACTIVE
8167: FROM ZX_TRX_HEADERS_GT header,
8168: ZX_RATES_B rate ,
8169: zx_rates_b off_rate,
8170: zx_import_tax_lines_gt temp_gt,
8171: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
8172: --zx_transaction_lines_gt lines_gt,
8165: ELSE 'Y'
8166: END TAX_RATE_NOT_ACTIVE
8167: FROM ZX_TRX_HEADERS_GT header,
8168: ZX_RATES_B rate ,
8169: zx_rates_b off_rate,
8170: zx_import_tax_lines_gt temp_gt,
8171: ZX_IMPORT_TAX_LINES_GT taxlines_gt,
8172: --zx_transaction_lines_gt lines_gt,
8173: zx_subscription_details sd_rates
8241: /* OR rate.effective_from =
8242: (
8243: SELECT
8244: min(effective_from)
8245: FROM ZX_RATES_B
8246: WHERE tax_regime_code = rate.tax_regime_code
8247: AND tax = rate.tax
8248: AND tax_status_code = rate.tax_status_code
8249: AND tax_rate_code = rate.tax_rate_code
8258: NVL(sd_rates.view_options_code, 'VFR') = 'VFR'
8259: AND NOT EXISTS
8260: (
8261: SELECT 1
8262: FROM zx_rates_b b
8263: WHERE b.tax_regime_code = rate.tax_regime_code
8264: AND b.tax = rate.tax
8265: AND b.tax_status_code = rate.tax_status_code
8266: AND b.tax_rate_code = rate.tax_rate_code