DBA Data[Home] [Help]

APPS.JAI_AP_TDS_ETDS_PKG dependencies on JAI_AP_TDS_THHOLD_TRXS

Line 88: based on the taxable_amount of jai_ap_tds_thhold_trxs table.

84: Added a call to the Concurrent JAINTDSA in the quarterly_returns procedure.
85:
86:
87: Added the update clause to modify the taxabale_amount of JAI_AP_ETDS_T
88: based on the taxable_amount of jai_ap_tds_thhold_trxs table.
89: In case of threshold transition and rollback transactions, the
90: taxable amount should be 0 for the differential invoice that has been created.
91: Hence, implemented this change.
92:

Line 554: FROM jai_ap_tds_thhold_trxs

550: IS
551: SELECT tds_invoice_id, tds_check_id, tds_tax_id, tds_amount
552: FROM jai_ap_etds_t
553: WHERE tds_invoice_id = (SELECT MAX(invoice_to_tds_authority_id)
554: FROM jai_ap_tds_thhold_trxs
555: WHERE threshold_grp_id = p_threshold_grp_id
556: AND tds_event LIKE 'THRESHOLD TRANSITION%'
557: );
558: CURSOR c_gl_date(p_tds_invoice_id IN NUMBER)

Line 566: FROM jai_ap_tds_thhold_trxs

562: WHERE invoice_id = p_tds_invoice_id;
563: CURSOR c_chk_threshold_rollback(p_threshold_grp_id IN NUMBER)
564: IS
565: SELECT invoice_to_tds_authority_id
566: FROM jai_ap_tds_thhold_trxs
567: WHERE tds_event LIKE 'THRESHOLD ROLLBACK%'
568: AND threshold_grp_id = p_threshold_grp_id
569: AND invoice_to_tds_authority_id > (SELECT MAX(invoice_to_tds_authority_id)
570: FROM jai_ap_tds_thhold_trxs

Line 570: FROM jai_ap_tds_thhold_trxs

566: FROM jai_ap_tds_thhold_trxs
567: WHERE tds_event LIKE 'THRESHOLD ROLLBACK%'
568: AND threshold_grp_id = p_threshold_grp_id
569: AND invoice_to_tds_authority_id > (SELECT MAX(invoice_to_tds_authority_id)
570: FROM jai_ap_tds_thhold_trxs
571: WHERE threshold_grp_id = p_threshold_grp_id
572: AND tds_event LIKE 'THRESHOLD TRANSITION%'
573: );
574: ln_calculated_inv_amt NUMBER;

Line 659: FROM jai_ap_tds_thhold_trxs jatt

655: SELECT threshold_trx_id,
656: tax_amount,
657: taxable_amount,
658: tds_event
659: FROM jai_ap_tds_thhold_trxs jatt
660: WHERE jatt.invoice_to_tds_authority_id = cp_invoice_id
661: AND tds_event like 'SURCHARGE_CALCULATE';
662:
663: r_get_tds_inv c_get_tds_inv_det%rowtype;

Line 901: and not exists (select 1 from jai_ap_tds_thhold_trxs where invoice_id = jatit.invoice_id)

897: and aida.accounting_Date between p_tds_inv_from_date and p_tds_inv_to_date
898: AND aida.match_status_flag in ('A','T')
899: AND aia.invoice_type_lookup_code IN ('STANDARD','PREPAYMENT')
900: AND aia.org_id = p_organization_id
901: and not exists (select 1 from jai_ap_tds_thhold_trxs where invoice_id = jatit.invoice_id)
902: and jitc.tax_rate = 0
903: and jitc.vendor_id = p_tds_vendor_id
904: and (p_tds_vendor_site_id is null or jitc.vendor_site_id = p_tds_vendor_site_id)
905: and upper(jitc.section_code) in (select lookup_code

Line 1003: and not exists (select '1' from jai_ap_tds_thhold_trxs jattt where jattt.invoice_id = base_invoices.invoice_id) \*Bug 10408793 - TDS should not be deducted*\

999: and aida.invoice_id = base_invoices.invoice_id
1000: and aida.match_status_flag in ('A','T') \*10408793 - Unvalidated Invoices must not be picked*\
1001: and base_invoices.org_id = p_organization_id
1002: and base_invoices.invoice_type_lookup_code IN ('STANDARD','PREPAYMENT')
1003: and not exists (select '1' from jai_ap_tds_thhold_trxs jattt where jattt.invoice_id = base_invoices.invoice_id) \*Bug 10408793 - TDS should not be deducted*\
1004: and not exists (select '1' from jai_ap_etds_t where base_invoice_id=base_invoices.invoice_id and batch_id=p_batch_id) \* Added by Avanija for FVU3.6 *\
1005: --and base_invoices.gl_date between p_tds_inv_from_date and p_tds_inv_to_date
1006: and aida.accounting_date between p_tds_inv_from_date and p_tds_inv_to_date \* Changed by Avanija for FVU3.6 *\
1007: and

Line 1075: and not exists (select '1' from jai_ap_tds_thhold_trxs jattt where jattt.invoice_id = base_invoices.invoice_id) \*Bug 10408793 - TDS should not be deducted*\

1071: and aida.match_status_flag in ('A','T') \*10408793 - Unvalidated Invoices must not be picked*\
1072: and aida.invoice_id = base_invoices.invoice_id
1073: and base_invoices.org_id = p_organization_id
1074: and base_invoices.invoice_type_lookup_code IN ('STANDARD','PREPAYMENT')
1075: and not exists (select '1' from jai_ap_tds_thhold_trxs jattt where jattt.invoice_id = base_invoices.invoice_id) \*Bug 10408793 - TDS should not be deducted*\
1076: and not exists (select '1' from jai_ap_etds_t where base_invoice_id=base_invoices.invoice_id and batch_id=p_batch_id) \* Added by Avanija for FVU3.6 *\
1077: --and base_invoices.gl_date between p_tds_inv_from_date and p_tds_inv_to_date
1078: and aida.accounting_date between p_tds_inv_from_date and p_tds_inv_to_date \* Changed by Avanija for FVU3.6 *\
1079: and lv_exclude_flag = 'Y'

Line 1098: FROM jai_ap_tds_thhold_trxs jatit_1

1094: WHERE invoice_id IN (SELECT base_invoice_id
1095: FROM jai_ap_etds_t
1096: WHERE batch_id = p_batch_id
1097: AND EXISTS (SELECT 1
1098: FROM jai_ap_tds_thhold_trxs jatit_1
1099: WHERE jatit_1.invoice_to_tds_authority_id = tds_invoice_id
1100: AND jatit_1.tds_event LIKE 'THRESHOLD TRANSITION%'
1101: )
1102: )

Line 1366: FROM jai_ap_tds_thhold_trxs

1362:
1363: DELETE jai_ap_etds_t
1364: WHERE batch_id = p_batch_id
1365: AND EXISTS (SELECT 1
1366: FROM jai_ap_tds_thhold_trxs
1367: WHERE invoice_to_tds_authority_id = tds_invoice_id
1368: AND tds_event LIKE 'THRESHOLD TRANSITION%'
1369: AND threshold_grp_id = c_get_threshold_grp.threshold_grp_id
1370: );

Line 1636: from JAI_AP_TDS_THHOLD_TRXS b

1632: -- start 5647248
1633: update jai_ap_etds_t a
1634: set base_taxabale_amount =
1635: ( select nvl(taxable_amount,0)
1636: from JAI_AP_TDS_THHOLD_TRXS b
1637: where b.invoice_to_tds_authority_id = a.tds_invoice_id )
1638: where a.batch_id = p_batch_id
1639: and a.tds_invoice_id <> -9999 --Bug 10315928
1640: and exists

Line 1642: from JAI_AP_TDS_THHOLD_TRXS c

1638: where a.batch_id = p_batch_id
1639: and a.tds_invoice_id <> -9999 --Bug 10315928
1640: and exists
1641: ( select 1
1642: from JAI_AP_TDS_THHOLD_TRXS c
1643: where c.invoice_to_tds_authority_id = a.tds_invoice_id
1644: and c.tds_event like '%THRESHOLD%'
1645: ) ;
1646: -- end 5647248

Line 1651: * jai_ap_tds_thhold_trxs *\

1647: *\
1648: \* Bug 5721614. Code migration by Xiao Lv from jai_ap_tds_etds_pkg.sql with version 115.26.6307.8
1649: * Commented the above and added the below.
1650: * Updates records which are available in
1651: * jai_ap_tds_thhold_trxs *\
1652:
1653: \*Bug 12415388 - Update Base Taxable amount to the portion of Check amount*\
1654: UPDATE jai_ap_etds_t a
1655: SET base_taxabale_amount =

Line 1661: FROM jai_ap_tds_thhold_trxs b

1657: 'SURCHARGE_CALCULATE',
1658: 0,
1659: \* nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt) * (tds_amount/abs(invoice_to_tds_authority_amt))) *\ --Added DECODE by Xiao Lv for Bug#7662155
1660: nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt)) \*commented above and added nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt) for bug 13070779*\
1661: FROM jai_ap_tds_thhold_trxs b
1662: WHERE b.invoice_to_tds_authority_id = a.tds_invoice_id )
1663: WHERE a.batch_id = p_batch_id
1664: and a.tds_invoice_id not in ( -9999, -9997 ); --Bug 10315928 \* ER: 13514846 *\
1665:

Line 1668: * are not available in jai_ap_tds_thhold_trxs

1664: and a.tds_invoice_id not in ( -9999, -9997 ); --Bug 10315928 \* ER: 13514846 *\
1665:
1666:
1667: \* This update is used to update invoices which
1668: * are not available in jai_ap_tds_thhold_trxs
1669: * but considered for calculating taxable_basis
1670: * for threshold transition or rollback.
1671: *\
1672:

Line 1805: FROM jai_ap_tds_thhold_trxs

1801: IS
1802: SELECT tds_invoice_id, tds_check_id, tds_tax_id, tds_amount
1803: FROM jai_ap_etds_t
1804: WHERE tds_invoice_id = (SELECT MAX(invoice_to_tds_authority_id)
1805: FROM jai_ap_tds_thhold_trxs
1806: WHERE threshold_grp_id = p_threshold_grp_id
1807: AND tds_event LIKE 'THRESHOLD TRANSITION%'
1808: );
1809: CURSOR c_gl_date(p_tds_invoice_id IN NUMBER)

Line 1817: FROM jai_ap_tds_thhold_trxs

1813: WHERE invoice_id = p_tds_invoice_id;
1814: CURSOR c_chk_threshold_rollback(p_threshold_grp_id IN NUMBER)
1815: IS
1816: SELECT invoice_to_tds_authority_id
1817: FROM jai_ap_tds_thhold_trxs
1818: WHERE tds_event LIKE 'THRESHOLD ROLLBACK%'
1819: AND threshold_grp_id = p_threshold_grp_id
1820: AND invoice_to_tds_authority_id > (SELECT MAX(invoice_to_tds_authority_id)
1821: FROM jai_ap_tds_thhold_trxs

Line 1821: FROM jai_ap_tds_thhold_trxs

1817: FROM jai_ap_tds_thhold_trxs
1818: WHERE tds_event LIKE 'THRESHOLD ROLLBACK%'
1819: AND threshold_grp_id = p_threshold_grp_id
1820: AND invoice_to_tds_authority_id > (SELECT MAX(invoice_to_tds_authority_id)
1821: FROM jai_ap_tds_thhold_trxs
1822: WHERE threshold_grp_id = p_threshold_grp_id
1823: AND tds_event LIKE 'THRESHOLD TRANSITION%'
1824: );
1825: ln_calculated_inv_amt NUMBER;

Line 1910: FROM jai_ap_tds_thhold_trxs jatt

1906: SELECT threshold_trx_id,
1907: tax_amount,
1908: taxable_amount,
1909: tds_event
1910: FROM jai_ap_tds_thhold_trxs jatt
1911: WHERE jatt.invoice_to_tds_authority_id = cp_invoice_id
1912: AND tds_event like 'SURCHARGE_CALCULATE';
1913:
1914: --Get regime definition information

Line 2355: from JAI_AP_TDS_THHOLD_TRXS b

2351: -- start 5647248
2352: update jai_ap_etds_t a
2353: set base_taxabale_amount =
2354: ( select nvl(taxable_amount,0)
2355: from JAI_AP_TDS_THHOLD_TRXS b
2356: where b.invoice_to_tds_authority_id = a.tds_invoice_id )
2357: where a.batch_id = p_batch_id
2358: and a.tds_invoice_id <> -9999 --Bug 10315928
2359: and exists

Line 2361: from JAI_AP_TDS_THHOLD_TRXS c

2357: where a.batch_id = p_batch_id
2358: and a.tds_invoice_id <> -9999 --Bug 10315928
2359: and exists
2360: ( select 1
2361: from JAI_AP_TDS_THHOLD_TRXS c
2362: where c.invoice_to_tds_authority_id = a.tds_invoice_id
2363: and c.tds_event like '%THRESHOLD%'
2364: ) ;
2365: -- end 5647248

Line 2370: * jai_ap_tds_thhold_trxs */

2366: */
2367: /* Bug 5721614. Code migration by Xiao Lv from jai_ap_tds_etds_pkg.sql with version 115.26.6307.8
2368: * Commented the above and added the below.
2369: * Updates records which are available in
2370: * jai_ap_tds_thhold_trxs */
2371:
2372: /*Bug 12415388 - Update Base Taxable amount to the portion of Check amount*/
2373: UPDATE jai_ap_etds_t a
2374: SET base_taxabale_amount =

Line 2380: FROM jai_ap_tds_thhold_trxs b

2376: 'SURCHARGE_CALCULATE',
2377: 0,
2378: /* nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt) * (tds_amount/abs(invoice_to_tds_authority_amt))) */ --Added DECODE by Xiao Lv for Bug#7662155
2379: nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt)) /*commented above and added nvl(taxable_amount,0) * sign(invoice_to_tds_authority_amt) for bug 13070779*/
2380: FROM jai_ap_tds_thhold_trxs b
2381: WHERE b.invoice_to_tds_authority_id = a.tds_invoice_id )
2382: WHERE a.batch_id = p_batch_id
2383: and a.tds_invoice_id not in ( -9999, -9997 ); --Bug 10315928 /* ER: 13514846 */
2384:

Line 2387: * are not available in jai_ap_tds_thhold_trxs

2383: and a.tds_invoice_id not in ( -9999, -9997 ); --Bug 10315928 /* ER: 13514846 */
2384:
2385:
2386: /* This update is used to update invoices which
2387: * are not available in jai_ap_tds_thhold_trxs
2388: * but considered for calculating taxable_basis
2389: * for threshold transition or rollback.
2390: */
2391: UPDATE jai_ap_etds_t a