[Home] [Help]
206: PRIMARY_REC_RATE_DET_RULE_FLAG = 'Y'
207: WHERE EXISTS (SELECT 1
208: FROM ZX_RATES_B zx_rates,
209: ap_tax_codes_all codes,
210: ap_tax_recvry_rules_all rules
211: WHERE codes.tax_recovery_rule_id = rules.rule_id
212: AND codes.tax_id = nvl(zx_rates.source_id, zx_rates.tax_rate_id)
213: AND zx_rates.record_type_code = 'MIGRATED'
214: AND zx_rates.tax_regime_code = TAXES.TAX_REGIME_CODE
1301: FROM
1302: zx_update_criteria_results results,
1303: ap_tax_codes_all codes,
1304: ar_vat_tax_all_b ar_codes,
1305: ap_tax_recvry_rules_all rec_rules,
1306: financials_system_params_all fsp,
1307: zx_party_tax_profile ptp
1308: WHERE
1309: results.tax_code_id = codes.tax_id
1401: ap_tax_codes_all codes,
1402: ar_vat_tax_all_b ar_codes,
1403: zx_update_criteria_results offset,
1404: financials_system_params_all fsp,
1405: ap_tax_recvry_rules_all rec_rules,
1406: zx_party_tax_profile ptp
1407: WHERE
1408: results.tax_code_id = codes.tax_id
1409: AND results.tax_class = 'INPUT'
1718: FROM
1719: zx_update_criteria_results results,
1720: ap_tax_codes_all codes,
1721: ar_vat_tax_all_b ar_codes,
1722: ap_tax_recvry_rules_all rec_rules,
1723: financials_system_params_all fsp,
1724: zx_party_tax_profile ptp
1725: WHERE
1726: results.tax_code_id = codes.tax_id
1819: ap_tax_codes_all codes,
1820: ar_vat_tax_all_b ar_codes,
1821: zx_update_criteria_results offset,
1822: financials_system_params_all fsp,
1823: ap_tax_recvry_rules_all rec_rules,
1824: zx_party_tax_profile ptp
1825: WHERE
1826: results.tax_code_id = codes.tax_id
1827: AND results.tax_class = 'INPUT'
2147: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
2148: FROM
2149: zx_update_criteria_results results,
2150: ap_tax_codes_all codes,
2151: ap_tax_recvry_rules_all rec_rules,
2152: financials_system_params_all fsp,
2153: zx_party_tax_profile ptp
2154: WHERE
2155: results.tax_code_id = codes.tax_id
2248: zx_update_criteria_results results,
2249: ap_tax_codes_all codes,
2250: zx_update_criteria_results offset,
2251: financials_system_params_all fsp,
2252: ap_tax_recvry_rules_all rec_rules,
2253: zx_party_tax_profile ptp
2254: WHERE
2255: results.tax_code_id = codes.tax_id
2256: AND results.tax_class = 'INPUT'
2571: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
2572: FROM
2573: zx_update_criteria_results results,
2574: ap_tax_codes_all codes,
2575: ap_tax_recvry_rules_all rec_rules,
2576: financials_system_params_all fsp,
2577: zx_party_tax_profile ptp
2578: WHERE
2579: results.tax_code_id = codes.tax_id
2673: zx_update_criteria_results results,
2674: ap_tax_codes_all codes,
2675: zx_update_criteria_results offset,
2676: financials_system_params_all fsp,
2677: ap_tax_recvry_rules_all rec_rules,
2678: zx_party_tax_profile ptp
2679: WHERE
2680: results.tax_code_id = codes.tax_id
2681: AND results.tax_class = 'INPUT'
5938: 'MIGRATED' RECORD_TYPE_CODE
5939: FROM
5940: ap_tax_codes_all codes,
5941: zx_rates_b zx_rates,
5942: ap_tax_recvry_rules_all rules,
5943: ap_tax_recvry_rates_all rates
5944: WHERE
5945: codes.tax_recovery_rule_id = rules.rule_id
5946: AND rules.rule_id = rates.rule_id
9070: RATES.CONCATENATED_SEGMENT_LOW VALUE_LOW ,
9071: RATES.CONCATENATED_SEGMENT_HIGH VALUE_HIGH
9072:
9073: FROM
9074: ap_tax_recvry_rules_all RULES,
9075: ap_tax_recvry_rates_all RATES
9076: WHERE
9077: RULES.rule_id = rates.rule_id
9078: --Added following conditions for Sync process
9097: RATES.condition_value ALPHANUMERIC_VALUE ,
9098: NULL VALUE_LOW ,
9099: NULL VALUE_HIGH
9100: FROM
9101: ap_tax_recvry_rules_all RULES,
9102: ap_tax_recvry_rates_all RATES
9103: WHERE
9104: RULES.rule_id = rates.rule_id
9105: --Added following conditions for Sync process
9211: fnd_global.conc_program_id ,--Program Id
9212: fnd_global.conc_login_id ,--Program Login ID
9213: 1
9214: FROM
9215: ap_tax_recvry_rules_all RULES,
9216: --ap_system_parameters_all ASP,
9217: gl_sets_of_books SOB,
9218: financials_system_params_all FSP,
9219: ap_tax_recvry_rates_all RATES
9235: RATES1.rate_id) CONDITION_GROUP_CODE,
9236: RULES1.RULE_ID,
9237: RATES1.RATE_ID
9238: FROM
9239: ap_tax_recvry_rules_all RULES1,
9240: ap_tax_recvry_rates_all RATES1
9241: WHERE
9242: RULES1.rule_id = RATES1.rule_id
9243: ) TEMP_GROUPS
9343: fnd_global.conc_program_id ,--Program Id
9344: fnd_global.conc_login_id ,--Program Login ID
9345: 1
9346: FROM
9347: ap_tax_recvry_rules_all RULES,
9348: --ap_system_parameters_all ASP,
9349: gl_sets_of_books SOB,
9350: financials_system_params_all FSP,
9351: ap_tax_recvry_rates_all RATES
9368: RATES1.rate_id) CONDITION_GROUP_CODE,
9369: RULES1.RULE_ID,
9370: RATES1.RATE_ID
9371: FROM
9372: ap_tax_recvry_rules_all RULES1,
9373: ap_tax_recvry_rates_all RATES1
9374: WHERE
9375: RULES1.rule_id = RATES1.rule_id
9376: ) TEMP_GROUPS
9481: fnd_global.conc_program_id ,--Program Id
9482: fnd_global.conc_login_id ,--Program Login ID
9483: 1
9484: FROM
9485: ap_tax_recvry_rules_all RULES,
9486: --ap_system_parameters_all ASP,
9487: gl_sets_of_books SOB,
9488: financials_system_params_all FSP,
9489: ap_tax_recvry_rates_all RATES
9505: RATES1.rate_id) CONDITION_GROUP_CODE,
9506: RULES1.RULE_ID,
9507: RATES1.RATE_ID
9508: FROM
9509: ap_tax_recvry_rules_all RULES1,
9510: ap_tax_recvry_rates_all RATES1
9511: WHERE
9512: RULES1.rule_id = RATES1.rule_id
9513: ) TEMP_GROUPS
9615: fnd_global.conc_program_id ,--Program Id
9616: fnd_global.conc_login_id ,--Program Login ID
9617: 1
9618: FROM
9619: ap_tax_recvry_rules_all RULES,
9620: --ap_system_parameters_all ASP,
9621: gl_sets_of_books SOB,
9622: financials_system_params_all FSP,
9623: ap_tax_recvry_rates_all RATES
9640: RATES1.rate_id) CONDITION_GROUP_CODE,
9641: RULES1.RULE_ID,
9642: RATES1.RATE_ID
9643: FROM
9644: ap_tax_recvry_rules_all RULES1,
9645: ap_tax_recvry_rates_all RATES1
9646: WHERE
9647: RULES1.rule_id = RATES1.rule_id
9648: ) TEMP_GROUPS
9806: FROM
9807: (
9808: SELECT
9809: DISTINCT
9810: --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9811: CASE WHEN EXISTS (select NULL
9812: from ap_tax_recvry_rules_all
9813: where name=RULES.NAME
9814: group by name having count(*)>1)
9808: SELECT
9809: DISTINCT
9810: --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9811: CASE WHEN EXISTS (select NULL
9812: from ap_tax_recvry_rules_all
9813: where name=RULES.NAME
9814: group by name having count(*)>1)
9815: THEN
9816: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9812: from ap_tax_recvry_rules_all
9813: where name=RULES.NAME
9814: group by name having count(*)>1)
9815: THEN
9816: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9817: DECODE(SIGN(LENGTHB(RULES.NAME||RATES.TAX)-30),
9818: 1, SUBSTRB(RULES.NAME,1,24)||ZX_MIGRATE_UTIL.GET_NEXT_SEQID('ZX_RULES_B_S'),
9819: RULES.NAME||RATES.TAX)
9820: ELSE -- else for GROUP BY CHECKING
9828: ptp.party_tax_profile_id CONTENT_OWNER_ID
9829: FROM
9830: ap_tax_codes_all codes,
9831: zx_rates_b rates,
9832: ap_tax_recvry_rules_all Rules,
9833: zx_party_tax_profile ptp
9834: WHERE
9835: CODES.TAX_ID = NVL(RATES.SOURCE_ID, RATES.TAX_RATE_ID)
9836: AND CODES.TAX_RECOVERY_RULE_ID = RULES.RULE_ID
9839: --Added following conditions for Sync process
9840: AND codes.tax_id = nvl(p_tax_id,codes.tax_id)
9841: AND not exists (select 1 from zx_rules_b
9842: where substrb(tax_rule_code,1,24)
9843: = ( --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9844: CASE WHEN EXISTS (select NULL
9845: from ap_tax_recvry_rules_all
9846: where name=RULES.NAME
9847: group by name having count(*)>1)
9841: AND not exists (select 1 from zx_rules_b
9842: where substrb(tax_rule_code,1,24)
9843: = ( --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9844: CASE WHEN EXISTS (select NULL
9845: from ap_tax_recvry_rules_all
9846: where name=RULES.NAME
9847: group by name having count(*)>1)
9848: THEN
9849: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9845: from ap_tax_recvry_rules_all
9846: where name=RULES.NAME
9847: group by name having count(*)>1)
9848: THEN
9849: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9850: DECODE(SIGN(LENGTHB(RULES.NAME||RATES.TAX)-30),
9851: 1, SUBSTRB(RULES.NAME,1,24),
9852: SUBSTRB(RULES.NAME||RATES.TAX,1,24))
9853: ELSE -- else for GROUP BY CHECKING
9917: FROM
9918: (
9919: SELECT
9920: DISTINCT
9921: --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9922: CASE WHEN EXISTS (select NULL
9923: from ap_tax_recvry_rules_all
9924: where name=RULES.NAME
9925: group by name having count(*)>1
9919: SELECT
9920: DISTINCT
9921: --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9922: CASE WHEN EXISTS (select NULL
9923: from ap_tax_recvry_rules_all
9924: where name=RULES.NAME
9925: group by name having count(*)>1
9926: )
9927: THEN
9924: where name=RULES.NAME
9925: group by name having count(*)>1
9926: )
9927: THEN
9928: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9929: DECODE(SIGN(LENGTHB(RULES.NAME||RATES.TAX)-30),
9930: 1, SUBSTRB(RULES.NAME,1,24)||ZX_MIGRATE_UTIL.GET_NEXT_SEQID('ZX_RULES_B_S'),
9931: RULES.NAME||RATES.TAX
9932: )
9941: ptp.party_tax_profile_id CONTENT_OWNER_ID
9942: FROM
9943: ap_tax_codes_all codes,
9944: zx_rates_b rates,
9945: ap_tax_recvry_rules_all Rules,
9946: zx_party_tax_profile ptp
9947: WHERE
9948: CODES.TAX_ID = NVL(RATES.SOURCE_ID, RATES.TAX_RATE_ID)
9949: AND CODES.TAX_RECOVERY_RULE_ID = RULES.RULE_ID
9953: --Added following conditions for Sync process
9954: AND codes.tax_id = nvl(p_tax_id,codes.tax_id)
9955: AND not exists (select 1 from zx_rules_b
9956: where substrb(tax_rule_code,1,24)
9957: = ( --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9958: CASE WHEN EXISTS (select NULL
9959: from ap_tax_recvry_rules_all
9960: where name=RULES.NAME
9961: group by name having count(*)>1)
9955: AND not exists (select 1 from zx_rules_b
9956: where substrb(tax_rule_code,1,24)
9957: = ( --check if there exists multiple rows in ap_tax_recvry_rules_all with the same name.
9958: CASE WHEN EXISTS (select NULL
9959: from ap_tax_recvry_rules_all
9960: where name=RULES.NAME
9961: group by name having count(*)>1)
9962: THEN
9963: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9959: from ap_tax_recvry_rules_all
9960: where name=RULES.NAME
9961: group by name having count(*)>1)
9962: THEN
9963: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
9964: DECODE(SIGN(LENGTHB(RULES.NAME||RATES.TAX)-30),
9965: 1,SUBSTRB(RULES.NAME,1,24),
9966: SUBSTRB(RULES.NAME||RATES.TAX,1,24))
9967: ELSE -- else for GROUP BY CHECKING
10006: ,b.tax_rule_id
10007: ,rules.description
10008: ,l.LANGUAGE_CODE
10009: FROM ap_tax_codes_all codes,
10010: ap_tax_recvry_rules_all Rules,
10011: zx_rates_b rates,
10012: zx_rules_b b,
10013: fnd_languages L
10014: WHERE l.installed_flag in ('I', 'B')
10118: ELSE 'Y'
10119: END ENABLED_FLAG --ENABLED_FLAG
10120: FROM
10121: AP_TAX_CODES_ALL CODES,
10122: ap_tax_recvry_rules_all AP_RULES,
10123: ap_tax_recvry_rates_all AP_RATES,
10124: ZX_RATES_B ZX_RATES,
10125: ZX_RULES_B ZX_RULES,
10126: ZX_CONDITION_GROUPS_B GROUPS,
10131: AND AP_RULES.RULE_ID = AP_RATES.RULE_ID
10132: -- AND AP_RULES.NAME = ZX_RULES.TAX_RULE_CODE
10133: AND ZX_RULES.TAX_RULE_CODE =
10134: CASE WHEN EXISTS (select NULL
10135: from ap_tax_recvry_rules_all
10136: where name=ap_rules.NAME
10137: group by name having count(*)>1
10138: )
10139: THEN
10136: where name=ap_rules.NAME
10137: group by name having count(*)>1
10138: )
10139: THEN
10140: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
10141: DECODE(SIGN(LENGTHB(ap_rules.NAME||zx_rates.TAX)-30),
10142: 1, SUBSTRB(ap_rules.NAME,1,24)||zx_rules.tax_rule_id,
10143: ap_rules.NAME||zx_rates.TAX
10144: )
10162: RATES1.rate_id) CONDITION_GROUP_CODE,
10163: RULES1.RULE_ID,
10164: RATES1.RATE_ID
10165: FROM
10166: ap_tax_recvry_rules_all RULES1,
10167: ap_tax_recvry_rates_all RATES1
10168: WHERE
10169: RULES1.rule_id = RATES1.rule_id
10170: ) TEMP_GROUPS
10274: ELSE 'Y'
10275: END ENABLED_FLAG --ENABLED_FLAG
10276: FROM
10277: AP_TAX_CODES_ALL CODES,
10278: ap_tax_recvry_rules_all AP_RULES,
10279: ap_tax_recvry_rates_all AP_RATES,
10280: ZX_RATES_B ZX_RATES,
10281: ZX_RULES_B ZX_RULES,
10282: ZX_CONDITION_GROUPS_B GROUPS,
10287: AND AP_RULES.RULE_ID = AP_RATES.RULE_ID
10288: -- AND AP_RULES.NAME = ZX_RULES.TAX_RULE_CODE
10289: AND ZX_RULES.TAX_RULE_CODE =
10290: CASE WHEN EXISTS (select NULL
10291: from ap_tax_recvry_rules_all
10292: where name=ap_rules.NAME
10293: group by name having count(*)>1
10294: )
10295: THEN
10292: where name=ap_rules.NAME
10293: group by name having count(*)>1
10294: )
10295: THEN
10296: --check if ap_tax_recvry_rules_all.NAME || rates.TAX is more than 30 characters in length
10297: DECODE(SIGN(LENGTHB(ap_rules.NAME||zx_rates.TAX)-30),
10298: 1, SUBSTRB(ap_rules.NAME,1,24)||zx_rules.tax_rule_id,
10299: ap_rules.NAME||zx_rates.TAX
10300: )
10319: RATES1.rate_id) CONDITION_GROUP_CODE,
10320: RULES1.RULE_ID,
10321: RATES1.RATE_ID
10322: FROM
10323: ap_tax_recvry_rules_all RULES1,
10324: ap_tax_recvry_rates_all RATES1
10325: WHERE
10326: RULES1.rule_id = RATES1.rule_id
10327: ) TEMP_GROUPS
11073: FROM
11074: zx_update_criteria_results results,
11075: ap_tax_codes_all codes,
11076: ar_vat_tax_all_b ar_codes,
11077: ap_tax_recvry_rules_all rec_rules,
11078: financials_system_params_all fsp,
11079: zx_party_tax_profile ptp
11080: WHERE
11081: results.tax_code_id = tax_id_tab(i)
11174: ap_tax_codes_all codes,
11175: ar_vat_tax_all_b ar_codes,
11176: zx_update_criteria_results offset,
11177: financials_system_params_all fsp,
11178: ap_tax_recvry_rules_all rec_rules,
11179: zx_party_tax_profile ptp
11180: WHERE
11181: results.tax_code_id = tax_id_tab(i)
11182: AND results.tax_code_id = codes.tax_id
11495: FROM
11496: zx_update_criteria_results results,
11497: ap_tax_codes_all codes,
11498: ar_vat_tax_all_b ar_codes,
11499: ap_tax_recvry_rules_all rec_rules,
11500: financials_system_params_all fsp,
11501: zx_party_tax_profile ptp
11502: WHERE
11503: results.tax_code_id = tax_id_tab(i)
11597: ap_tax_codes_all codes,
11598: ar_vat_tax_all_b ar_codes,
11599: zx_update_criteria_results offset,
11600: financials_system_params_all fsp,
11601: ap_tax_recvry_rules_all rec_rules,
11602: zx_party_tax_profile ptp
11603: WHERE
11604: results.tax_code_id = tax_id_tab(i)
11605: AND results.tax_code_id = codes.tax_id
11930: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
11931: FROM
11932: zx_update_criteria_results results,
11933: ap_tax_codes_all codes,
11934: ap_tax_recvry_rules_all rec_rules,
11935: financials_system_params_all fsp,
11936: zx_party_tax_profile ptp
11937: WHERE
11938: results.tax_code_id = tax_id_tab(i)
12031: zx_update_criteria_results results,
12032: ap_tax_codes_all codes,
12033: zx_update_criteria_results offset,
12034: financials_system_params_all fsp,
12035: ap_tax_recvry_rules_all rec_rules,
12036: zx_party_tax_profile ptp
12037: WHERE
12038: results.tax_code_id = tax_id_tab(i)
12039: AND results.tax_code_id = codes.tax_id
12354: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
12355: FROM
12356: zx_update_criteria_results results,
12357: ap_tax_codes_all codes,
12358: ap_tax_recvry_rules_all rec_rules,
12359: financials_system_params_all fsp,
12360: zx_party_tax_profile ptp
12361: WHERE
12362: results.tax_code_id = tax_id_tab(i)
12456: zx_update_criteria_results results,
12457: ap_tax_codes_all codes,
12458: zx_update_criteria_results offset,
12459: financials_system_params_all fsp,
12460: ap_tax_recvry_rules_all rec_rules,
12461: zx_party_tax_profile ptp
12462: WHERE
12463: results.tax_code_id = tax_id_tab(i)
12464: AND results.tax_code_id = codes.tax_id
12796: FROM
12797: zx_update_criteria_results results,
12798: ap_tax_codes_all codes,
12799: ar_vat_tax_all_b ar_codes,
12800: ap_tax_recvry_rules_all rec_rules,
12801: financials_system_params_all fsp,
12802: zx_party_tax_profile ptp
12803: WHERE
12804: results.tax_code_id = codes.tax_id
12896: ap_tax_codes_all codes,
12897: ar_vat_tax_all_b ar_codes,
12898: zx_update_criteria_results offset,
12899: financials_system_params_all fsp,
12900: ap_tax_recvry_rules_all rec_rules,
12901: zx_party_tax_profile ptp
12902: WHERE
12903: results.tax_code_id = codes.tax_id
12904: AND codes.enabled_flag = 'N'
13219: FROM
13220: zx_update_criteria_results results,
13221: ap_tax_codes_all codes,
13222: ar_vat_tax_all_b ar_codes,
13223: ap_tax_recvry_rules_all rec_rules,
13224: financials_system_params_all fsp,
13225: zx_party_tax_profile ptp
13226: WHERE
13227: results.tax_code_id = codes.tax_id
13320: ap_tax_codes_all codes,
13321: ar_vat_tax_all_b ar_codes,
13322: zx_update_criteria_results offset,
13323: financials_system_params_all fsp,
13324: ap_tax_recvry_rules_all rec_rules,
13325: zx_party_tax_profile ptp
13326: WHERE
13327: results.tax_code_id = codes.tax_id
13328: AND codes.enabled_flag = 'N'
13656: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
13657: FROM
13658: zx_update_criteria_results results,
13659: ap_tax_codes_all codes,
13660: ap_tax_recvry_rules_all rec_rules,
13661: financials_system_params_all fsp,
13662: zx_party_tax_profile ptp
13663: WHERE
13664: results.tax_code_id = codes.tax_id
13757: zx_update_criteria_results results,
13758: ap_tax_codes_all codes,
13759: zx_update_criteria_results offset,
13760: financials_system_params_all fsp,
13761: ap_tax_recvry_rules_all rec_rules,
13762: zx_party_tax_profile ptp
13763: WHERE
13764: results.tax_code_id = codes.tax_id
13765: AND codes.enabled_flag = 'N'
14080: codes.DESCRIPTION DESCRIPTION -- Bug 4705196
14081: FROM
14082: zx_update_criteria_results results,
14083: ap_tax_codes_all codes,
14084: ap_tax_recvry_rules_all rec_rules,
14085: financials_system_params_all fsp,
14086: zx_party_tax_profile ptp
14087: WHERE
14088: results.tax_code_id = codes.tax_id
14182: zx_update_criteria_results results,
14183: ap_tax_codes_all codes,
14184: zx_update_criteria_results offset,
14185: financials_system_params_all fsp,
14186: ap_tax_recvry_rules_all rec_rules,
14187: zx_party_tax_profile ptp
14188: WHERE
14189: results.tax_code_id = codes.tax_id
14190: AND codes.enabled_flag = 'N'