DBA Data[Home] [Help]

APPS.JAI_AP_TDS_GENERATION_PKG dependencies on JAI_AP_TDS_GENERATION_PKG

Line 1: PACKAGE BODY jai_ap_tds_generation_pkg

1: PACKAGE BODY jai_ap_tds_generation_pkg
2: /* $Header: jai_ap_tds_gen.plb 120.26.12010000.6 2009/01/07 12:57:28 mbremkum ship $ */
3: AS
4: /* ----------------------------------------------------------------------------
5: FILENAME : jai_ap_tds_gen.plb

Line 279: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.status_update_chk_validate', 'START'); /* 1 */

275: ln_no_of_holds number;
276:
277: begin
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

Line 334: P_process_message := 'jai_ap_tds_generation_pkg.status_update_chk_validate :' || sqlerrm;

330:
331: exception
332: when others then
333: p_process_flag := 'E';
334: P_process_message := 'jai_ap_tds_generation_pkg.status_update_chk_validate :' || sqlerrm;
335: return;
336: end status_update_chk_validate;
337:
338: /* ************************************* process_invoice ************************************ */

Line 577: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.process_tds_at_inv_validate', 'START'); /* 1 */

573:
574:
575: begin
576:
577: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.process_tds_at_inv_validate', 'START'); /* 1 */
578: open c_check_if_exists(p_invoice_id);
579: fetch c_check_if_exists into ln_count;
580: close c_check_if_exists;
581:

Line 678: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN

674: * Rounding to 10 is applicable per invoice
675: * and not on each distribution
676:
677: IF trunc(p_creation_date) >=
678: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN
679: ln_tmp_tds_amt := get_rnded_value(ln_tmp_tds_amt);
680: END IF;
681: */
682: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 value of tax_amount before update'||ln_tax_amount);

Line 856: jai_ap_tds_generation_pkg.maintain_thhold_grps

852: p_codepath := jai_general_pkg.plot_codepath(19.1, p_codepath); /* 19.1 */
853:
854: fnd_file.put_line(FND_FILE.LOG, '19.1 Call maintain thhold grps ');
855:
856: jai_ap_tds_generation_pkg.maintain_thhold_grps
857: (
858: p_threshold_grp_id => ln_threshold_grp_id,
859: p_vendor_id => p_vendor_id,
860: p_org_tan_num => lv_tan_no,

Line 884: jai_ap_tds_generation_pkg.maintain_thhold_grps

880: else
881:
882: p_codepath := jai_general_pkg.plot_codepath(19.2, p_codepath); /* 19.2 */
883:
884: jai_ap_tds_generation_pkg.maintain_thhold_grps
885: (
886: p_threshold_grp_id => ln_threshold_grp_id,
887: p_trx_invoice_amount => cur_rec_section.invoice_amount,
888: p_tds_event => 'INVOICE VALIDATE',

Line 925: jai_ap_tds_generation_pkg.generate_tds_invoices

921: fnd_file.put_line(FND_FILE.LOG, '20. Call generate tds invoices' );
922:
923: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - tax amount while calling generate tds invoices '|| cur_rec.tax_amount);
924:
925: jai_ap_tds_generation_pkg.generate_tds_invoices
926: (
927: pn_invoice_id => p_invoice_id ,
928: pn_threshold_hdr_id => ln_threshold_hdr_id ,
929: pn_taxable_amount => cur_rec.taxable_amount ,

Line 965: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN

961: /* Bug 7280925. Added by Lakshmi Gopalsami -- can be removed
962: * Need to round the value before calling maintain_thhold_grps
963:
964: IF trunc(p_creation_date) >=
965: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN
966: ln_tmp_tds_amt := get_rnded_value(cur_rec.tax_amount);
967: END IF;
968: */
969:

Line 979: jai_ap_tds_generation_pkg.maintain_thhold_grps

975: * changed from ln_tmp_tds_amt to ln_tax_amount
976: */
977: p_codepath := jai_general_pkg.plot_codepath(23, p_codepath); /* 23 */
978:
979: jai_ap_tds_generation_pkg.maintain_thhold_grps
980: (
981: p_threshold_grp_id => ln_threshold_grp_id,
982: p_trx_tax_paid => ln_tax_amount,
983: p_tds_event => 'INVOICE VALIDATE',

Line 1091: jai_ap_tds_generation_pkg.generate_tds_invoices

1087: fnd_file.put_line(FND_FILE.LOG, '31 Call generate tds invoices ');
1088:
1089: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - WCT Tax amt '||cur_non_tds_rec.tax_amount);
1090:
1091: jai_ap_tds_generation_pkg.generate_tds_invoices
1092: (
1093: pn_invoice_id => p_invoice_id ,
1094: pn_threshold_hdr_id => ln_threshold_hdr_id ,
1095: pn_taxable_amount => cur_non_tds_rec.taxable_amount ,

Line 1553: IF trunc(pd_creation_date) >= trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)

1549: ('PREPAYMENT UNAPPLICATION')
1550: THEN
1551: ln_invoice_to_tds_amount := ROUND(ln_invoice_to_tds_amount,g_inr_currency_rounding);
1552: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - value before round '||ln_invoice_to_tds_amount);
1553: IF trunc(pd_creation_date) >= trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)
1554: /* Bug 7280925. Added by Lakshmi Gopalsami
1555: * we should not round for WCT and ESSI. For those threshold_grp_id
1556: * will be null
1557: */

Line 1648: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)

1644: ln_invoice_to_vendor_amount := round( ln_invoice_to_vendor_amount, g_inr_currency_rounding);
1645: end if;
1646: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - value before round '||ln_invoice_to_vendor_amount);
1647: IF trunc(pd_creation_date) >=
1648: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)
1649: /* Bug 7280925. Added by Lakshmi Gopalsami
1650: * we should not round for WCT and ESSI. For those threshold_grp_id
1651: * will be null
1652: */

Line 1828: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)

1824: ln_tds_rnded_amt := ROUND(pn_tax_amount / r_ap_invoices_all.exchange_rate, g_fcy_currency_rounding);
1825: END IF ;
1826: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - value before round '||ln_tds_rnded_amt);
1827: IF (trunc(pd_creation_date) >=
1828: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date)
1829: /* Bug 7280925. Added by Lakshmi Gopalsami
1830: * we should not round for WCT and ESSI. For those threshold_grp_id
1831: * will be null
1832: */

Line 1835: ln_tds_rnding_factor := jai_ap_tds_generation_pkg.gn_tds_rounding_factor;

1831: * will be null
1832: */
1833: and pn_threshold_grp_id is not null )
1834: THEN
1835: ln_tds_rnding_factor := jai_ap_tds_generation_pkg.gn_tds_rounding_factor;
1836: ln_tds_rnded_amt := get_rnded_value(ln_tds_rnded_amt);
1837: fnd_file.put_line(FND_FILE.LOG, ' Bug 7280925 - value after round before insert into trxs'||ln_tds_rnded_amt);
1838: END IF;
1839: END IF;

Line 1919: p_process_message := 'Error from jai_ap_tds_generation_pkg.generate_tds_invoices :' || sqlerrm;

1915:
1916: exception
1917: when others then
1918: p_process_flag := 'E';
1919: p_process_message := 'Error from jai_ap_tds_generation_pkg.generate_tds_invoices :' || sqlerrm;
1920:
1921: end generate_tds_invoices;
1922:
1923: /* *********************************** procedure generate_tds_invoices ********************************** */

Line 2012: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN

2008: ROUND(r_jai_ap_tds_thhold_grps.total_invoice_amount * (r_ja_in_tax_codes.tax_rate/100),
2009: g_inr_currency_rounding);
2010:
2011: IF trunc(sysdate) >=
2012: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN
2013: ln_thhold_transition_tax_amt := get_rnded_value(ln_thhold_transition_tax_amt);
2014: END IF;
2015:
2016: ln_thhold_transition_tax_amt := ln_thhold_transition_tax_amt - r_jai_ap_tds_thhold_grps.total_tax_paid;

Line 2022: jai_ap_tds_generation_pkg.generate_tds_invoices

2018:
2019: if ln_thhold_transition_tax_amt > 0 then
2020:
2021:
2022: jai_ap_tds_generation_pkg.generate_tds_invoices
2023: (
2024: pn_invoice_id => p_invoice_id ,
2025: pn_taxable_amount => null ,
2026: /* No taxable amount in case of threshold transition invoice */

Line 2076: p_process_message := 'Error from jai_ap_tds_generation_pkg.process_threshold_transition :' || sqlerrm;

2072:
2073: exception
2074: when others then
2075: p_process_flag := 'E';
2076: p_process_message := 'Error from jai_ap_tds_generation_pkg.process_threshold_transition :' || sqlerrm;
2077: end process_threshold_transition;
2078:
2079: /* *********************************** procedure import_and_approve ********************************** */
2080:

Line 2212: p_process_message := 'Error from jai_ap_tds_generation_pkg.import_and_approve :' || sqlerrm;

2208:
2209: exception
2210: when others then
2211: p_process_flag := 'E';
2212: p_process_message := 'Error from jai_ap_tds_generation_pkg.import_and_approve :' || sqlerrm;
2213: end import_and_approve;
2214:
2215: /* *********************************** procedure import_and_approve ********************************** */
2216:

Line 2275: Fnd_File.put_line(Fnd_File.LOG, 'jai_ap_tds_generation_pkg.approve_tds_invoices');

2271:
2272: begin
2273:
2274: /* Check for the status of the import request */
2275: Fnd_File.put_line(Fnd_File.LOG, 'jai_ap_tds_generation_pkg.approve_tds_invoices');
2276: Fnd_File.put_line(Fnd_File.LOG, 'p_parent_request_id =>' || p_parent_request_id);
2277: Fnd_File.put_line(Fnd_File.LOG, 'p_invoice_id=> ' || p_invoice_id );
2278: Fnd_File.put_line(Fnd_File.LOG, 'p_vendor_id=> ' || p_vendor_id);
2279: Fnd_File.put_line(Fnd_File.LOG, 'p_vendor_site_id=> ' || p_vendor_site_id);

Line 2371: p_calling_sequence => 'jai_ap_tds_generation_pkg.approve_tds_invoices'

2367: p_holds_count => ln_holds_count,
2368: p_approval_status => lv_approval_status,
2369: /* Bug 4943949. Added by Lakshmi Gopalsami
2370: p_funds_return_code => lv_funds_ret_code,
2371: p_calling_sequence => 'jai_ap_tds_generation_pkg.approve_tds_invoices'
2372: ) ;
2373: */
2374: BEGIN
2375: IF ap_approval_pkg.batch_approval(

Line 2401: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices-> :

2397: END IF ;
2398: EXCEPTION
2399: WHEN OTHERS THEN
2400: retcode := 'E';
2401: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices-> :
2402: during call to batch_approval for TDS invoice' || sqlerrm;
2403: END;
2404:
2405: End if;

Line 2443: p_calling_sequence => 'jai_ap_tds_generation_pkg.approve_tds_invoices'

2439: p_holds_count => ln_holds_count,
2440: p_approval_status => lv_approval_status,
2441: /* Bug 4943949. Added by Lakshmi Gopalsami
2442: p_funds_return_code => lv_funds_ret_code,
2443: p_calling_sequence => 'jai_ap_tds_generation_pkg.approve_tds_invoices'
2444: ) ;
2445: */
2446:
2447: BEGIN

Line 2474: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices-> :

2470: END IF ;
2471: EXCEPTION
2472: WHEN OTHERS THEN
2473: retcode := 'E';
2474: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices-> :
2475: during call to batch_approval for TDS invoice' || sqlerrm;
2476: END;
2477:
2478:

Line 2490: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices : ' || sqlerrm;

2486:
2487: exception
2488: when others then
2489: retcode := 2;
2490: errbuf := 'Error from jai_ap_tds_generation_pkg.approve_tds_invoices : ' || sqlerrm;
2491: end approve_tds_invoices;
2492:
2493: /* ********************************* populate_tds_invoice_id **************************************** */
2494:

Line 2567: p_process_message := 'Error from jai_ap_tds_generation_pkg.populate_tds_invoice_id :' || sqlerrm;

2563:
2564: exception
2565: when others then
2566: p_process_flag := 'E';
2567: p_process_message := 'Error from jai_ap_tds_generation_pkg.populate_tds_invoice_id :' || sqlerrm;
2568: end populate_tds_invoice_id;
2569:
2570: /* ********************************* populate_tds_invoice_id **************************************** */
2571:

Line 2658: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.maintain_thhold_grps', 'START'); /* 1 */

2654:
2655:
2656: begin
2657:
2658: p_codepath := jai_general_pkg.plot_codepath(1, p_codepath, 'jai_ap_tds_generation_pkg.maintain_thhold_grps', 'START'); /* 1 */
2659:
2660:
2661: /* Validate the input */
2662: ln_threshold_grp_id := nvl(p_threshold_grp_id, 0);

Line 2670: P_process_message := 'Vendor must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2666: p_codepath := jai_general_pkg.plot_codepath(2, p_codepath); /*2*/
2667:
2668: if p_vendor_id is null then
2669: p_process_flag := 'E';
2670: P_process_message := 'Vendor must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2671: goto exit_from_procedure;
2672: end if;
2673:
2674: if p_org_tan_num is null then

Line 2676: P_process_message := 'Organization TAN number must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2672: end if;
2673:
2674: if p_org_tan_num is null then
2675: p_process_flag := 'E';
2676: P_process_message := 'Organization TAN number must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2677: goto exit_from_procedure;
2678: end if;
2679:
2680: if p_vendor_pan_num is null then

Line 2682: P_process_message := 'Vendor PAN number must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2678: end if;
2679:
2680: if p_vendor_pan_num is null then
2681: p_process_flag := 'E';
2682: P_process_message := 'Vendor PAN number must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2683: goto exit_from_procedure;
2684: end if;
2685:
2686: if p_section_type is null then

Line 2688: P_process_message := 'Section Type must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2684: end if;
2685:
2686: if p_section_type is null then
2687: p_process_flag := 'E';
2688: P_process_message := 'Section Type must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2689: goto exit_from_procedure;
2690: end if;
2691:
2692: if p_section_code is null then

Line 2694: P_process_message := 'Section Code must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2690: end if;
2691:
2692: if p_section_code is null then
2693: p_process_flag := 'E';
2694: P_process_message := 'Section Code must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2695: goto exit_from_procedure;
2696: end if;
2697:
2698: if p_fin_year is null then

Line 2700: P_process_message := 'Fin Year must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';

2696: end if;
2697:
2698: if p_fin_year is null then
2699: p_process_flag := 'E';
2700: P_process_message := 'Fin Year must be specified as threshold group identifier is null(jai_ap_tds_generation_pkg.maintain_thhold_grps) ';
2701: goto exit_from_procedure;
2702: end if;
2703:
2704: end if; /* Validate the input */

Line 2804: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN

2800: IF p_tds_event NOT IN
2801: -- Bug 7280925. Commented by Lakshmi Gopalsami ('INVOICE CANCEL',
2802: ('PREPAYMENT UNAPPLICATION') THEN
2803: IF trunc(p_creation_date) >=
2804: trunc(jai_ap_tds_generation_pkg.gd_tds_rounding_effective_date) THEN
2805: ln_tmp_tds_amt := get_rnded_value(ln_tmp_tds_amt);
2806: END IF;
2807: END IF;
2808: -- End if ;

Line 2923: p_process_message := 'Error from jai_ap_tds_generation_pkg.maintain_thhold_grps :' || sqlerrm;

2919: exception
2920: when others then
2921: fnd_file.put_line(FND_FILE.LOG,' Error in maintain thhold grps '|| substr(SQLERRM,1,200));
2922: p_process_flag := 'E';
2923: p_process_message := 'Error from jai_ap_tds_generation_pkg.maintain_thhold_grps :' || sqlerrm;
2924: end maintain_thhold_grps;
2925:
2926: /* ******************************** maintain_thhold_grps ******************************************* */
2927: /* ******************************** insert_tds_thhold_trxs ******************************************* */

Line 3148: jai_ap_tds_generation_pkg.process_tds_at_inv_validate

3144: end if ;
3145:
3146: if lv_is_invoice_validated = 'Y' then
3147:
3148: jai_ap_tds_generation_pkg.process_tds_at_inv_validate
3149: (
3150: p_invoice_id => p_invoice_id,
3151: p_vendor_id => p_vendor_id,
3152: p_vendor_site_id => p_vendor_site_id,

Line 3259: 'Error - procedure jai_ap_tds_generation_pkg.create_tds_after_holds_release : ' || lv_process_message);

3255: );
3256:
3257: if nvl(lv_process_flag, 'N') = 'E' then
3258: raise_application_error(-20007,
3259: 'Error - procedure jai_ap_tds_generation_pkg.create_tds_after_holds_release : ' || lv_process_message);
3260: end if;
3261:
3262: else
3263: --Invoke the old regime functionality

Line 3281: 'Error - procedure jai_ap_tds_generation_pkg.create_tds_after_holds_release : ' || lv_process_message);

3277: );
3278:
3279: if nvl(lv_process_flag, 'N') = 'E' then
3280: raise_application_error(-20008,
3281: 'Error - procedure jai_ap_tds_generation_pkg.create_tds_after_holds_release : ' || lv_process_message);
3282: end if;
3283: end if; --Transactions in new regime
3284:
3285: END IF;

Line 3675: jai_ap_tds_generation_pkg.generate_tds_invoices

3671: --There is an excess TDS payment/deduction. So need to create RTN invoice for the TDS Authority and SI for Vendor for ln_diff_tds_amount
3672:
3673: lv_tds_event := 'THRESHOLD ROLLBACK( from slab id - '||p_before_threshold_slab_id||' to slab id - '||p_after_threshold_slab_id||')';
3674:
3675: jai_ap_tds_generation_pkg.generate_tds_invoices
3676: (
3677: pn_invoice_id => p_invoice_id ,
3678: pn_taxable_amount => null ,
3679: --No taxable amount in case of threshold rollback invoice

Line 3698: jai_ap_tds_generation_pkg.import_and_approve

3694: goto exit_from_procedure;
3695: end if;
3696:
3697: IF ln_threshold_trx_id IS NOT NULL THEN
3698: jai_ap_tds_generation_pkg.import_and_approve
3699: (
3700: p_invoice_id => p_invoice_id,
3701: p_start_thhold_trx_id => ln_threshold_trx_id,
3702: p_tds_event => lv_tds_event,

Line 3757: IF jai_ap_tds_generation_pkg.gn_tds_rounding_factor = -1 then

3753: BEGIN
3754: ln_tds_sign := sign(p_tax_amount);
3755: ln_tmp_tax_amt := abs(p_tax_amount);
3756:
3757: IF jai_ap_tds_generation_pkg.gn_tds_rounding_factor = -1 then
3758: ln_tds_mod_value := 0;
3759: ln_tds_mod_value := MOD(ROUND(ln_tmp_tax_amt,
3760: g_inr_currency_rounding),10);
3761: IF ln_tds_mod_value >= 5 THEN

Line 3766: END IF ; -- jai_ap_tds_generation_pkg.gn_tds_rounding_factor = -1

3762: ln_tmp_tax_amt := ln_tmp_tax_amt + (10-ln_tds_mod_value);
3763: ELSE -- < 5
3764: ln_tmp_tax_amt := ln_tmp_tax_amt - ln_tds_mod_value;
3765: END IF ;
3766: END IF ; -- jai_ap_tds_generation_pkg.gn_tds_rounding_factor = -1
3767: return (ln_tmp_tax_amt* ln_tds_sign );
3768: END get_rnded_value;
3769: -- End for bug 5722028.
3770:

Line 3772: END jai_ap_tds_generation_pkg;

3768: END get_rnded_value;
3769: -- End for bug 5722028.
3770:
3771:
3772: END jai_ap_tds_generation_pkg;