DBA Data[Home] [Help]

APPS.JAI_AP_TDS_GENERATION_PKG dependencies on JAI_AP_TDS_INV_TAXES

Line 194: updated jai_ap_tdS_inv_taxes and jai_ap_tds_thhold_grps

190: gn_tds_rounding_factor
191: gd_tds_rounding_effective_date and function get_rnded_value
192: is created.
193:
194: updated jai_ap_tdS_inv_taxes and jai_ap_tds_thhold_grps
195: withe the rounded values. This is done in procedure
196: process_tds_at_inv_validate and maintain_thhold_grps.
197: In generate_tds_invoices derived the logic for rounding.
198: Added conditions in queries for fetching the taxable

Line 249: from jai_ap_tds_inv_taxes

245:
246:
247: cursor c_check_not_validate(p_invoice_id number, p_section_type VARCHAR2 ) is
248: select count(tds_inv_tax_id) total_count, sum(decode(match_status_flag, 'A', 1, 0)) validated_count
249: from jai_ap_tds_inv_taxes
250: where invoice_id = p_invoice_id
251: -- Harshita for Bug 4870243
252: and nvl(invoice_line_number, -9999) = nvl(p_invoice_line_number, invoice_line_number)
253: and invoice_distribution_id = nvl(p_invoice_distribution_id, invoice_distribution_id) -- Bug 6119216

Line 258: from jai_ap_tds_inv_taxes

254: and section_type = p_section_type ;
255:
256:
257: /*select tds_inv_tax_id
258: from jai_ap_tds_inv_taxes
259: where invoice_id = p_invoice_id
260: and nvl(invoice_line_number, -9999) = nvl(p_invoice_line_number, -9999)
261: and nvl(invoice_distribution_id, -9999) = nvl(p_invoice_distribution_id, -9999)
262: and section_type = p_section_type; */

Line 282: update jai_ap_tds_inv_taxes

278:
279: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.status_update_chk_validate', 'START'); /* 1 */
280:
281: if p_invoice_distribution_id is not null and p_match_status_flag is not null then
282: update jai_ap_tds_inv_taxes
283: set match_status_flag = p_match_status_flag
284: where invoice_id = p_invoice_id
285: and invoice_distribution_id = p_invoice_distribution_id;
286: end if;

Line 364: from jai_ap_tds_inv_taxes

360: is
361:
362: cursor c_check_if_exists(p_invoice_id number) is
363: select count(tds_inv_tax_id)
364: from jai_ap_tds_inv_taxes
365: where invoice_id = p_invoice_id
366: and (actual_tax_id is not null or default_tax_id is not null);
367:
368: cursor c_check_if_processed(p_invoice_id number,p_process_status jai_ap_tds_inv_taxes.process_status%type) is

Line 368: cursor c_check_if_processed(p_invoice_id number,p_process_status jai_ap_tds_inv_taxes.process_status%type) is

364: from jai_ap_tds_inv_taxes
365: where invoice_id = p_invoice_id
366: and (actual_tax_id is not null or default_tax_id is not null);
367:
368: cursor c_check_if_processed(p_invoice_id number,p_process_status jai_ap_tds_inv_taxes.process_status%type) is
369: select count(tds_inv_tax_id)
370: from jai_ap_tds_inv_taxes
371: where invoice_id = p_invoice_id
372: and process_status = p_process_status;

Line 370: from jai_ap_tds_inv_taxes

366: and (actual_tax_id is not null or default_tax_id is not null);
367:
368: cursor c_check_if_processed(p_invoice_id number,p_process_status jai_ap_tds_inv_taxes.process_status%type) is
369: select count(tds_inv_tax_id)
370: from jai_ap_tds_inv_taxes
371: where invoice_id = p_invoice_id
372: and process_status = p_process_status;
373:
374: cursor c_calculate_tax(p_invoice_id number) is

Line 376: from jai_ap_tds_inv_taxes

372: and process_status = p_process_status;
373:
374: cursor c_calculate_tax(p_invoice_id number) is
375: select tds_inv_tax_id, actual_tax_id, amount
376: from jai_ap_tds_inv_taxes
377: where invoice_id = p_invoice_id
378: and actual_tax_id is not null;
379:
380: cursor c_ja_in_tax_codes(p_tax_id number) is

Line 390: cursor c_for_each_tds_section(p_invoice_id number, p_exchange_rate number,p_section_type jai_ap_tds_inv_taxes.section_type%type) is--rchandan for bug#4428980

386: '. Setup needs modification.' tax_end_dated_message
387: from JAI_CMN_TAXES_ALL
388: where tax_id = p_tax_id;
389:
390: cursor c_for_each_tds_section(p_invoice_id number, p_exchange_rate number,p_section_type jai_ap_tds_inv_taxes.section_type%type) is--rchandan for bug#4428980
391: select actual_section_code, sum(amount*p_exchange_rate) invoice_amount, sum(tax_amount) section_amount
392: from jai_ap_tds_inv_taxes
393: where invoice_id = p_invoice_id
394: and section_type = p_section_type --rchandan for bug#4428980

Line 392: from jai_ap_tds_inv_taxes

388: where tax_id = p_tax_id;
389:
390: cursor c_for_each_tds_section(p_invoice_id number, p_exchange_rate number,p_section_type jai_ap_tds_inv_taxes.section_type%type) is--rchandan for bug#4428980
391: select actual_section_code, sum(amount*p_exchange_rate) invoice_amount, sum(tax_amount) section_amount
392: from jai_ap_tds_inv_taxes
393: where invoice_id = p_invoice_id
394: and section_type = p_section_type --rchandan for bug#4428980
395: and actual_section_code is not null
396: group by actual_section_code

Line 405: (p_vendor_id number, p_vendor_site_id number, p_tds_section_code varchar2,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980

401: from JAI_AP_TDS_VNDR_TYPE_V
402: where vendor_id = p_vendor_id;
403:
404: cursor c_get_threshold
405: (p_vendor_id number, p_vendor_site_id number, p_tds_section_code varchar2,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
406: select threshold_hdr_id
407: from JAI_AP_TDS_TH_VSITE_V
408: where vendor_id = p_vendor_id
409: and vendor_site_id = p_vendor_site_id

Line 414: (p_vendor_id number, p_tan_no varchar2, p_pan_no varchar2, p_tds_section_code varchar2 , p_fin_year number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980

410: and section_type = p_section_type --rchandan for bug#4428980
411: and section_code = p_tds_section_code;
412:
413: cursor c_get_threshold_group
414: (p_vendor_id number, p_tan_no varchar2, p_pan_no varchar2, p_tds_section_code varchar2 , p_fin_year number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
415: select threshold_grp_id
416: from jai_ap_tds_thhold_grps
417: where vendor_id = p_vendor_id
418: and section_type = p_section_type --rchandan for bug#4428980

Line 469: p_exchange_rate number, p_threshold_slab_id_single number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980

465: ln_check_slab_exists NUMBER;
466:
467: cursor c_get_taxes_to_generate_tds
468: (p_invoice_id number, p_tds_section_code varchar2, p_generate_all_invoices varchar2,
469: p_exchange_rate number, p_threshold_slab_id_single number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
470: select actual_tax_id,
471: sum(amount*p_exchange_rate) taxable_amount,
472: sum(tax_amount) tax_amount
473: from jai_ap_tds_inv_taxes

Line 473: from jai_ap_tds_inv_taxes

469: p_exchange_rate number, p_threshold_slab_id_single number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
470: select actual_tax_id,
471: sum(amount*p_exchange_rate) taxable_amount,
472: sum(tax_amount) tax_amount
473: from jai_ap_tds_inv_taxes
474: where invoice_id = p_invoice_id
475: and section_type = p_section_type --rchandan for bug#4428980
476: and actual_section_code = p_tds_section_code
477: and (

Line 524: cursor c_get_non_tds_section_tax (p_invoice_id number, p_exchange_rate number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980

520: select currency_code
521: from gl_sets_of_books
522: where set_of_books_id = cp_set_of_books_id;
523:
524: cursor c_get_non_tds_section_tax (p_invoice_id number, p_exchange_rate number,p_section_type jai_ap_tds_inv_taxes.section_type%type) IS --rchandan for bug#4428980
525: select section_type,
526: actual_tax_id,
527: sum(amount*p_exchange_rate) taxable_amount,
528: sum(tax_amount) tax_amount

Line 529: from jai_ap_tds_inv_taxes

525: select section_type,
526: actual_tax_id,
527: sum(amount*p_exchange_rate) taxable_amount,
528: sum(tax_amount) tax_amount
529: from jai_ap_tds_inv_taxes
530: where invoice_id = p_invoice_id
531: and section_type <> p_section_type --rchandan for bug#4428980
532: and actual_tax_id is not null
533: group by section_type, actual_tax_id;

Line 609: update jai_ap_tds_inv_taxes

605:
606:
607: /* Update actual value from default value if actual is null for TDS section taxes only*/
608: p_codepath := jai_general_pkg.plot_codepath(5, p_codepath); /* 5 */
609: update jai_ap_tds_inv_taxes
610: set actual_tax_id = default_tax_id
611: where invoice_id = p_invoice_id
612: and actual_tax_id is null
613: and user_deleted_tax_flag IS NOT NULL AND user_deleted_tax_flag <> 'Y' -- nvl(user_deleted_tax_flag, 'N') <> 'Y'

Line 618: update jai_ap_tds_inv_taxes

614: and section_type = lv_tds_section_type; --rchandan for bug#4428980
615:
616:
617: /* Update processed for those cases where NO TDS has to be deducted for TDS section taxes only */
618: update jai_ap_tds_inv_taxes
619: set process_status = 'P'
620: where invoice_id = p_invoice_id
621: and section_type = lv_tds_section_type --rchandan for bug#4428980
622: and nvl(user_deleted_tax_flag, 'N') = 'Y';

Line 688: update jai_ap_tds_inv_taxes

684: /* bug 7280925. Added by Lakshmi Gopalsami
685: * changed from ln_tmp_tds_amt to ln_tax_amount
686: */
687:
688: update jai_ap_tds_inv_taxes
689: set tax_amount = ln_tax_amount, -- ln_tmp_tds_amt, -- Bug 5722028
690: actual_section_code = r_ja_in_tax_codes.section_code
691: where tds_inv_tax_id = cur_rec.tds_inv_tax_id;
692:

Line 1003: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */

999: goto exit_from_procedure;
1000: END IF;
1001:
1002:
1003: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */
1004: update jai_ap_tds_inv_taxes
1005: set threshold_trx_id = ln_threshold_trx_id,
1006: threshold_slab_id_single = ln_threshold_slab_id_single
1007: where invoice_id = p_invoice_id

Line 1004: update jai_ap_tds_inv_taxes

1000: END IF;
1001:
1002:
1003: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */
1004: update jai_ap_tds_inv_taxes
1005: set threshold_trx_id = ln_threshold_trx_id,
1006: threshold_slab_id_single = ln_threshold_slab_id_single
1007: where invoice_id = p_invoice_id
1008: and section_type = lv_tds_section_type --rchandan for bug#4428980

Line 1025: update jai_ap_tds_inv_taxes

1021: end loop;
1022: /* Loop and generate invoices */
1023:
1024: p_codepath := jai_general_pkg.plot_codepath(25, p_codepath); /* 25 */
1025: update jai_ap_tds_inv_taxes
1026: set threshold_grp_id = ln_threshold_grp_id,
1027: threshold_hdr_id = ln_threshold_hdr_id,
1028: threshold_slab_id = ln_threshold_slab_id_after,
1029: process_status = 'P'

Line 1127: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */

1123: end if;
1124:
1125: fnd_file.put_line(FND_FILE.LOG, '34. Start thhold trx id '|| ln_start_threshold_trx_id);
1126:
1127: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */
1128: update jai_ap_tds_inv_taxes
1129: set threshold_trx_id = ln_threshold_trx_id,
1130: process_status = 'P' /*Bug 4667681*/
1131: where invoice_id = p_invoice_id

Line 1128: update jai_ap_tds_inv_taxes

1124:
1125: fnd_file.put_line(FND_FILE.LOG, '34. Start thhold trx id '|| ln_start_threshold_trx_id);
1126:
1127: /* Punch threshold_trx_id in jai_ap_tds_inv_taxes */
1128: update jai_ap_tds_inv_taxes
1129: set threshold_trx_id = ln_threshold_trx_id,
1130: process_status = 'P' /*Bug 4667681*/
1131: where invoice_id = p_invoice_id
1132: and section_type = cur_non_tds_rec.section_type

Line 1976: lv_codepath jai_ap_tds_inv_taxes.codepath%type;

1972: -- Bug 5722028. Added by csahoo
1973: -- added the following condition
1974: jattt.tds_event like 'THRESHOLD TRANSITION%' );
1975:
1976: lv_codepath jai_ap_tds_inv_taxes.codepath%type;
1977:
1978:
1979: r_jai_ap_tds_thhold_taxes c_jai_ap_tds_thhold_taxes%rowtype;
1980: r_jai_ap_tds_thhold_grps c_jai_ap_tds_thhold_grps%rowtype;

Line 3320: FROM jai_ap_tds_inv_taxes

3316: IS
3317: CURSOR c_get_threshold_grp_id(p_prepay_distribution_id NUMBER)
3318: IS
3319: SELECT threshold_grp_id
3320: FROM jai_ap_tds_inv_taxes
3321: WHERE invoice_distribution_id = p_prepay_distribution_id
3322: AND section_type = 'TDS_SECTION';
3323:
3324: CURSOR c_get_threshold_grp_dtl(p_threshold_grp_id NUMBER)

Line 3484: jai_ap_tds_inv_taxes b

3480: p_single_threshold_amt NUMBER)
3481: IS
3482: SELECT 'Y'
3483: FROM jai_ap_tds_thhold_trxs a,
3484: jai_ap_tds_inv_taxes b
3485: WHERE a.invoice_id = b.invoice_id
3486: AND b.invoice_distribution_id = p_invoice_distribution_id
3487: AND a.tds_event = 'INVOICE VALIDATE'
3488: AND a.taxable_amount >= p_single_threshold_amt;