DBA Data[Home] [Help]

APPS.JAI_AP_TDS_PREPAYMENTS_PKG dependencies on JAI_AP_TDS_INV_TAXES

Line 70: updated jai_ap_tdS_inv_taxes and jai_ap_tds_thhold_grps

66: gn_tds_rounding_factor
67: gd_tds_rounding_effective_date and function get_rnded_value
68: is created.
69:
70: updated jai_ap_tdS_inv_taxes and jai_ap_tds_thhold_grps
71: withe the rounded values. This is done in procedure
72: process_tds_at_inv_validate and maintain_thhold_grps.
73: In generate_tds_invoices derived the logic for rounding.
74: Added conditions in queries for fetching the taxable

Line 95: The queries referring to the table jai_ap_tds_inv_taxes,

91: Applying prepayment to an invoice takes longer time
92:
93: Fixed: 1) Add new procedure get_prepay_invoice_id to get invoice_id
94: 2) Modified the procedure populate_section_tax and procedure process_tds_invoices.
95: The queries referring to the table jai_ap_tds_inv_taxes,
96: included invoice_id in their where clause to make use of existing index
97:
98: 10. 07/01/2010 Added by Xiao Lv for FP bug#8345080
99: Issue: This is a forward port bug for the bug8333898

Line 1004: /*Bug 9494469 - Removed parameter cp_section_type from c_jai_ap_tds_inv_taxes*/

1000: p_process_message out nocopy varchar2,
1001: p_codepath in out nocopy varchar2
1002: )
1003: is
1004: /*Bug 9494469 - Removed parameter cp_section_type from c_jai_ap_tds_inv_taxes*/
1005: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number, p_prepay_distribution_id number) is
1006: select invoice_distribution_id, amount, invoice_line_number, invoice_id
1007: from jai_ap_tds_inv_taxes
1008: where invoice_id = p_invoice_id

Line 1005: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number, p_prepay_distribution_id number) is

1001: p_codepath in out nocopy varchar2
1002: )
1003: is
1004: /*Bug 9494469 - Removed parameter cp_section_type from c_jai_ap_tds_inv_taxes*/
1005: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number, p_prepay_distribution_id number) is
1006: select invoice_distribution_id, amount, invoice_line_number, invoice_id
1007: from jai_ap_tds_inv_taxes
1008: where invoice_id = p_invoice_id
1009: and invoice_distribution_id <> p_prepay_distribution_id

Line 1007: from jai_ap_tds_inv_taxes

1003: is
1004: /*Bug 9494469 - Removed parameter cp_section_type from c_jai_ap_tds_inv_taxes*/
1005: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number, p_prepay_distribution_id number) is
1006: select invoice_distribution_id, amount, invoice_line_number, invoice_id
1007: from jai_ap_tds_inv_taxes
1008: where invoice_id = p_invoice_id
1009: and invoice_distribution_id <> p_prepay_distribution_id
1010: --and section_type = cp_section_type /*Commented for Bug 9494469*/
1011: and nvl(actual_tax_id, default_tax_id) is not null ;/*Bug 8431516*/

Line 1023: from jai_ap_tds_inv_taxes

1019:
1020: /*START, Added by bgowrava for bug#9214036*/
1021: cursor c_get_effective_available_amt(p_invoice_id number, p_invoice_line_num number) is
1022: select sum(amount) amount
1023: from jai_ap_tds_inv_taxes
1024: where invoice_id = p_invoice_id
1025: and invoice_line_number = p_invoice_line_num
1026: and nvl(actual_tax_id, default_tax_id) is not null /* Added and condition for bug 14811018 */
1027: and amount < 0;

Line 1045: /* Loop through to get the taxable basis for each line in jai_ap_tds_inv_taxes */

1041: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg', 'p_invoice_id:'||p_invoice_id );
1042: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg', 'p_invoice_distribution_id:'||p_invoice_distribution_id );
1043: ln_remaining_prepayment_amount := abs(p_prepay_amount); /* Apply amount is negative */
1044: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg', 'ln_remaining_prepayment_amount:'||ln_remaining_prepayment_amount );
1045: /* Loop through to get the taxable basis for each line in jai_ap_tds_inv_taxes */
1046: /* It is ok to loop through section_type = 'TDS_SECTION as considering any one section type
1047: is ok and tds section will always be there */
1048:
1049: -- Bug 4754213. Added by Lakshmi Gopalsami

Line 1050: for cur_si_distributions_rec in c_jai_ap_tds_inv_taxes(p_invoice_id, p_invoice_distribution_id) /*Bug 9494469 - Removed parameter cp_section_type*/

1046: /* It is ok to loop through section_type = 'TDS_SECTION as considering any one section type
1047: is ok and tds section will always be there */
1048:
1049: -- Bug 4754213. Added by Lakshmi Gopalsami
1050: for cur_si_distributions_rec in c_jai_ap_tds_inv_taxes(p_invoice_id, p_invoice_distribution_id) /*Bug 9494469 - Removed parameter cp_section_type*/
1051: loop
1052: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg', 'cur_si_distributions_rec.invoice_distribution_id:'||cur_si_distributions_rec.invoice_distribution_id );
1053: lv_reversal_flag := get_reversal_flag(cur_si_distributions_rec.invoice_distribution_id); /*Bug 8431516*/
1054: if lv_reversal_flag = 'N' then /*Bug 8431516*/

Line 1119: end loop; /* cur_si_distributions_rec in c_jai_ap_tds_inv_taxes */

1115: end if;
1116:
1117: end if; /*if lv_reversal_flag = 'N' then*/
1118:
1119: end loop; /* cur_si_distributions_rec in c_jai_ap_tds_inv_taxes */
1120:
1121:
1122: << exit_from_procedure >>
1123: p_codepath := jai_general_pkg.plot_codepath(100, p_codepath, null, 'END'); /* 100 */

Line 1150: from jai_ap_tds_inv_taxes

1146: cursor c_get_tax_details_pp_inv_dist(p_pre_pay_inv_id number, p_prepay_distribution_id number) is -- Added parameter p_pre_pay_inv_id by Jia for FP bug6929483
1147: select section_type,
1148: nvl(actual_section_code, default_section_code) section_code, --Added NVL condition for Bug 8431516
1149: nvl(actual_tax_id, default_tax_id) tax_id --Added NVL condition for Bug 8431516
1150: from jai_ap_tds_inv_taxes
1151: where invoice_id = p_pre_pay_inv_id -- Added where clause p_pre_pay_inv_id by Jia for FP bug6929483
1152: and invoice_distribution_id = p_prepay_distribution_id
1153: and nvl(actual_tax_id, default_tax_id) is not null; --Added NVL condition for Bug 8431516
1154:

Line 1160: from jai_ap_tds_inv_taxes

1156: select section_type,
1157: nvl(actual_section_code, default_section_code) section_code,
1158: nvl(actual_tax_id, default_tax_id) tax_id,
1159: threshold_slab_id_single /* Bug 14657086 */
1160: from jai_ap_tds_inv_taxes
1161: where invoice_id = p_invoice_id
1162: and invoice_distribution_id = p_invoice_distribution_id;
1163:
1164:

Line 1176: from jai_ap_tds_inv_taxes

1172:
1173:
1174: cursor c_get_tds_application_basis(p_invoice_id number) is
1175: select 'N'
1176: from jai_ap_tds_inv_taxes
1177: where invoice_id = p_invoice_id
1178: and nvl(match_status_flag, 'N') <> 'A';
1179:
1180: /* Bug 5751783 - Start*/

Line 1185: FROM jai_ap_tds_inv_taxes

1181: /* added parameter p_pre_pay_inv_id to cursor for bug 6929483*/
1182: CURSOR get_threshold_trx_id (p_pre_pay_inv_id number, p_invoice_distribution_id IN NUMBER )
1183: IS
1184: SELECT threshold_trx_id
1185: FROM jai_ap_tds_inv_taxes
1186: WHERE invoice_id = p_pre_pay_inv_id
1187: AND invoice_distribution_id = p_invoice_distribution_id ;
1188:
1189: lv_si_thhold_trx_id jai_ap_tds_thhold_trxs.threshold_trx_id%TYPE;

Line 1239: * jai_ap_tds_inv_taxes.

1235: * for the deriving the basis is changed.
1236: * We should get the details of the invoice which is created latest in the
1237: * system. i.e., whichever is validated later in the system. We can get
1238: * these details by getting the value of threshold_trx_id from
1239: * jai_ap_tds_inv_taxes.
1240: */
1241:
1242: -- Get the tds_threshold_trx_id of the prepay invoice.
1243: OPEN get_threshold_trx_id (pre_pay_inv_id,p_prepay_distribution_id );

Line 1250: FROM jai_ap_tds_inv_taxes

1246: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg','lv_pp_thhold_trx_id: '||lv_pp_thhold_trx_id);
1247: -- Get the threshold_trx_id of the standard invoice.
1248: SELECT max(nvl(threshold_trx_id, 0))
1249: INTO lv_si_thhold_trx_id
1250: FROM jai_ap_tds_inv_taxes
1251: WHERE invoice_id = p_invoice_id ;
1252: jai_cmn_utils_pkg.write_fnd_log_msg('jai_ap_tds_prepayments_pkg',' lv_si_thhold_trx_id: '||lv_si_thhold_trx_id);
1253: IF (lv_si_thhold_trx_id > NVL (lv_pp_thhold_trx_id,0 )) THEN
1254: lv_application_basis := 'STANDARD INVOICE';

Line 1427: cursor c_get_prepayment_thgroup(p_pre_pay_inv_id number, p_prepay_distribution_id number,cp_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980

1423: from JAI_CMN_TAXES_ALL
1424: where tax_id = p_tax_id;
1425:
1426: --Add parameter p_pre_pay_inv_id in cursor c_get_prepayment_throup by Jia for FP bug6929483, Begin
1427: cursor c_get_prepayment_thgroup(p_pre_pay_inv_id number, p_prepay_distribution_id number,cp_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
1428: select threshold_grp_id,
1429: actual_tax_id,
1430: threshold_trx_id /*Bug 6363056*/
1431: from jai_ap_tds_inv_taxes

Line 1431: from jai_ap_tds_inv_taxes

1427: cursor c_get_prepayment_thgroup(p_pre_pay_inv_id number, p_prepay_distribution_id number,cp_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
1428: select threshold_grp_id,
1429: actual_tax_id,
1430: threshold_trx_id /*Bug 6363056*/
1431: from jai_ap_tds_inv_taxes
1432: where invoice_id = p_pre_pay_inv_id -- Added by Jia for FP bug6929483
1433: and invoice_distribution_id = p_prepay_distribution_id
1434: and section_type = cp_section_type; --rchandan for bug#4428980
1435:

Line 1438: from jai_ap_tds_inv_taxes

1434: and section_type = cp_section_type; --rchandan for bug#4428980
1435:
1436: cursor c_get_pp_section_tax_id(p_prepay_distribution_id number, p_section_type varchar2) is
1437: select actual_tax_id, invoice_id /*Bug 5751783*/
1438: from jai_ap_tds_inv_taxes
1439: where invoice_distribution_id = p_prepay_distribution_id
1440: and section_type = p_section_type;
1441:
1442:

Line 1453: from jai_ap_tds_inv_taxes /* ap_invoice_distributions not used for mutation problem */

1449: select invoice_num, invoice_id /*Bug 5751783*/
1450: from ap_invoices_all
1451: where invoice_id in
1452: ( select invoice_id
1453: from jai_ap_tds_inv_taxes /* ap_invoice_distributions not used for mutation problem */
1454: where invoice_distribution_id = p_invoice_distribution_id);
1455:
1456:
1457: cursor c_get_total_prepayment_tax

Line 1473: from jai_ap_tds_inv_taxes

1469: /* Bug 4522507. Added by Lakshmi Gopalsami */
1470:
1471: cursor c_get_if_tds_inv_generated_pp(p_prepay_distribution_id number) is
1472: select threshold_trx_id
1473: from jai_ap_tds_inv_taxes
1474: where invoice_distribution_id = p_prepay_distribution_id
1475: -- Bug 4754213. Added by Lakshmi Gopalsami
1476: and section_type = 'TDS_SECTION';
1477:

Line 1488: from jai_ap_tds_inv_taxes

1484: /*Bug 6363056. Added invoice_distribution_id condition also*/
1485: and invoice_distribution_id = p_item_distribution_id
1486: and tds_applicable_flag = 'Y'
1487: and exists (select '1'
1488: from jai_ap_tds_inv_taxes
1489: where invoice_distribution_id = jatp.invoice_distribution_id
1490: -- Bug 4754213. Added by Lakshmi Gopalsami
1491: and section_type = 'TDS_SECTION'
1492: and threshold_trx_id is not null

Line 1513: from jai_ap_tds_inv_taxes

1509:
1510: cursor c_get_grp_details_si_inv_dist(p_invoice_id number, p_invoice_distribution_id number)
1511: is
1512: select threshold_grp_id
1513: from jai_ap_tds_inv_taxes
1514: where invoice_id = p_invoice_id
1515: and invoice_distribution_id = p_invoice_distribution_id
1516: and section_type = 'TDS_SECTION'; --Added for bug#8855650 by JMEENA
1517:

Line 1543: FROM jai_ap_tds_inv_taxes

1539: /*Fetch the taxable basis for which TDS would be generated*/
1540: CURSOR c_available_amount (p_invoice_id number, p_exchange_rate NUMBER)
1541: IS
1542: SELECT nvl(sum(amount*nvl(p_exchange_rate, 1)), 0)
1543: FROM jai_ap_tds_inv_taxes
1544: WHERE invoice_id = p_invoice_id
1545: AND nvl(actual_tax_id, default_tax_id) is not null
1546: AND section_type = 'TDS_SECTION'
1547: AND actual_section_code IS NOT NULL

Line 1586: ln_threshold_trx_id_prepay jai_ap_tds_inv_taxes.threshold_trx_id%type;

1582: ln_pp_section_tax_id number;
1583: ln_threshold_grp_audit_id number;
1584: lv_application_basis jai_ap_tds_prepayments.application_basis%type;
1585: /* Bug 4522507. Added by Lakshmi Gopalsami */
1586: ln_threshold_trx_id_prepay jai_ap_tds_inv_taxes.threshold_trx_id%type;
1587: ln_amt_tds_inv_generated_si number;
1588: --Added the below 6 variables by Sanjikum for Bug#5131075(4718907)
1589: ln_threshold_slab_id jai_ap_tds_thhold_slabs.threshold_slab_id%TYPE;
1590: lv_threshold_type jai_ap_tds_thhold_types.threshold_type%TYPE;

Line 1937: from jai_ap_tdS_inv_taxes

1933: AND invoice_distribution_id_prepay = p_invoice_distribution_id
1934: AND jattt.invoice_id = p_invoice_id
1935: AND jatp.invoice_distribution_id in
1936: (select invoice_distribution_id
1937: from jai_ap_tdS_inv_taxes
1938: where threshold_trx_id = jattt.threshold_trx_id
1939: and invoice_id = p_invoice_id
1940: and section_type ='TDS_SECTION'
1941: )

Line 2039: In the above case there would be no records in jai_ap_tds_inv_taxes with the distribution

2035: ELSE
2036: /*Bug 8606302 - Start*/
2037: /*cursor c_ap_invoices_all would not fetch the Invoice ID if the Prepayment did not
2038: suffer TDS when it was validated initially, but only when Threshold was breached
2039: In the above case there would be no records in jai_ap_tds_inv_taxes with the distribution
2040: ID of the Prepayment Invoice*/
2041: get_prepay_invoice_id(p_prepay_distribution_id, ln_parent_invoice_id);
2042: OPEN c_si_ap_invoices_all (ln_parent_invoice_id);
2043: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;

Line 2085: In the above case there would be no records in jai_ap_tds_inv_taxes with the distribution

2081: ELSE
2082: /*Bug 8606302 - Start*/
2083: /*cursor c_ap_invoices_all would not fetch the Invoice ID if the Prepayment did not
2084: suffer TDS when it was validated initially, but only when Threshold was breached
2085: In the above case there would be no records in jai_ap_tds_inv_taxes with the distribution
2086: ID of the Prepayment Invoice*/
2087: get_prepay_invoice_id(p_prepay_distribution_id, ln_parent_invoice_id);
2088: OPEN c_si_ap_invoices_all (ln_parent_invoice_id);
2089: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;

Line 2381: from jai_ap_tds_inv_taxes

2377:
2378: /* Following cursor definition has been changed to cater for the obsoletion of table ja_in_ap_tds_inv_temp */
2379: cursor c_tds_count_unapp(p_invoice_id number, p_section_type varchar2) IS --rchandan for bug#4428980
2380: select count(1)
2381: from jai_ap_tds_inv_taxes
2382: where invoice_id = p_invoice_id
2383: and section_type = p_section_type; --rchandan for bug#4428980
2384:
2385: ln_tds_count_attribute1 number;