DBA Data[Home] [Help]

APPS.JAI_AP_DTC_CANCELLATION_PKG dependencies on AP_INVOICES_ALL

Line 85: cursor c_ap_invoices_all(p_invoice_id number) is

81:
82: /* Bug 4559756. Added by Lakshmi Gopalsami
83: Added org_id for passing it to ap_utilities_pkg
84: */
85: cursor c_ap_invoices_all(p_invoice_id number) is
86: select invoice_id,
87: cancelled_date,
88: payment_status_flag,
89: invoice_amount,

Line 93: from ap_invoices_all

89: invoice_amount,
90: set_of_books_id,
91: invoice_num,
92: org_id
93: from ap_invoices_all
94: where invoice_id = p_invoice_id;
95:
96: cursor c_get_parent_inv_dtls(p_invoice_id number) is
97: select set_of_books_id, invoice_currency_code, exchange_rate

Line 98: from ap_invoices_all

94: where invoice_id = p_invoice_id;
95:
96: cursor c_get_parent_inv_dtls(p_invoice_id number) is
97: select set_of_books_id, invoice_currency_code, exchange_rate
98: from ap_invoices_all
99: where invoice_id = p_invoice_id;
100:
101: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number,
102: cp_section_type jai_ap_tds_inv_taxes.section_type%type) is --rchandan for bug#4428980

Line 116: ,ap_invoices_all aia

112: -------------------------------------------------------------------------------
113: and not exists
114: (select jattt.invoice_to_tds_authority_id
115: from jai_ap_tds_thhold_trxs jattt
116: ,ap_invoices_all aia
117: where jattt.threshold_trx_id in(
118: select max(threshold_trx_id)
119: from jai_ap_tds_thhold_trxs
120: where invoice_id = p_invoice_id

Line 157: CURSOR get_dist_gl_date(cp_invoice_id IN ap_invoices_all.invoice_id%TYPE) IS

153: | Changed the source of ld_accounting_date to refer to
154: | ap_invoice_distributions_all.accounting_date instead of
155: | gl_date on headers.
156: */
157: CURSOR get_dist_gl_date(cp_invoice_id IN ap_invoices_all.invoice_id%TYPE) IS
158: SELECT accounting_date
159: FROM ap_invoice_distributions_all
160: WHERE invoice_id = cp_invoice_id
161: AND distribution_line_number = 1;

Line 167: CURSOR c_get_lines_acct_date(cp_invoice_id IN ap_invoices_all.invoice_id%TYPE) IS

163: -- hard coded the distribution line number to 1.
164:
165: /*Bug 8830302 - Get Accounting Date from AP_INVOICE_LINES_ALL.
166: This is fail safe if Distributions does not have accounting date*/
167: CURSOR c_get_lines_acct_date(cp_invoice_id IN ap_invoices_all.invoice_id%TYPE) IS
168: SELECT accounting_date
169: FROM ap_invoice_lines_all
170: WHERE invoice_id = cp_invoice_id
171: AND line_number = 1;

Line 212: r_ap_invoices_all c_ap_invoices_all%rowtype;

208: -------------------------------------------------------------------------------
209: -- Added by Jia for FP Bug#7312295, End
210:
211: r_ja_in_tax_codes c_ja_in_tax_codes%rowtype;
212: r_ap_invoices_all c_ap_invoices_all%rowtype;
213: r_get_parent_inv_dtls c_get_parent_inv_dtls%rowtype;
214: r_gl_sets_of_books c_gl_sets_of_books%rowtype;
215:
216: lv_code_path VARCHAR2(1996);

Line 242: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;

238: ld_accounting_date date; --File.Sql.35 Cbabu := sysdate;
239: ld_out_accounting_date date; --Added by Chong for ZX investigation 20120816
240: lv_open_period ap_invoice_distributions_all.period_name%type;
241:
242: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;
243: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
244: ln_threshold_trx_id NUMBER;
245:
246: ln_taxable_amount NUMBER;

Line 243: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;

239: ld_out_accounting_date date; --Added by Chong for ZX investigation 20120816
240: lv_open_period ap_invoice_distributions_all.period_name%type;
241:
242: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;
243: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
244: ln_threshold_trx_id NUMBER;
245:
246: ln_taxable_amount NUMBER;
247: ln_exchange_rate ap_invoices_all.exchange_rate%type;

Line 247: ln_exchange_rate ap_invoices_all.exchange_rate%type;

243: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
244: ln_threshold_trx_id NUMBER;
245:
246: ln_taxable_amount NUMBER;
247: ln_exchange_rate ap_invoices_all.exchange_rate%type;
248: lv_codepath VARCHAR2(1996);
249: ln_start_threshold_trx_id NUMBER;
250: ln_threshold_grp_id NUMBER;
251: ln_threshold_grp_audit_id number;

Line 320: open c_ap_invoices_all(p_invoice_id);

316:
317: /* bug 4559756. Added by Lakshmi Gopalsami
318: Fetch the org_id
319: */
320: open c_ap_invoices_all(p_invoice_id);
321: fetch c_ap_invoices_all
322: into r_ap_invoices_all;
323: close c_ap_invoices_all;
324:

Line 321: fetch c_ap_invoices_all

317: /* bug 4559756. Added by Lakshmi Gopalsami
318: Fetch the org_id
319: */
320: open c_ap_invoices_all(p_invoice_id);
321: fetch c_ap_invoices_all
322: into r_ap_invoices_all;
323: close c_ap_invoices_all;
324:
325: --Removed the code from here by Lakshmi Gopalsami for Bug#5131075(5193852)

Line 322: into r_ap_invoices_all;

318: Fetch the org_id
319: */
320: open c_ap_invoices_all(p_invoice_id);
321: fetch c_ap_invoices_all
322: into r_ap_invoices_all;
323: close c_ap_invoices_all;
324:
325: --Removed the code from here by Lakshmi Gopalsami for Bug#5131075(5193852)
326:

Line 323: close c_ap_invoices_all;

319: */
320: open c_ap_invoices_all(p_invoice_id);
321: fetch c_ap_invoices_all
322: into r_ap_invoices_all;
323: close c_ap_invoices_all;
324:
325: --Removed the code from here by Lakshmi Gopalsami for Bug#5131075(5193852)
326:
327: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath); /* 2 */

Line 403: r_ap_invoices_all := null;

399: lv_tds_credit_memo_flag := null;
400: lv_tds_credit_memo_message := null;
401:
402: /* Get the details of the Invoice to TDS authority */
403: r_ap_invoices_all := null;
404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
405: fetch c_ap_invoices_all
406: into r_ap_invoices_all;
407: close c_ap_invoices_all;

Line 404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);

400: lv_tds_credit_memo_message := null;
401:
402: /* Get the details of the Invoice to TDS authority */
403: r_ap_invoices_all := null;
404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
405: fetch c_ap_invoices_all
406: into r_ap_invoices_all;
407: close c_ap_invoices_all;
408:

Line 405: fetch c_ap_invoices_all

401:
402: /* Get the details of the Invoice to TDS authority */
403: r_ap_invoices_all := null;
404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
405: fetch c_ap_invoices_all
406: into r_ap_invoices_all;
407: close c_ap_invoices_all;
408:
409: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami

Line 406: into r_ap_invoices_all;

402: /* Get the details of the Invoice to TDS authority */
403: r_ap_invoices_all := null;
404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
405: fetch c_ap_invoices_all
406: into r_ap_invoices_all;
407: close c_ap_invoices_all;
408:
409: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
410: * Derivced the accounting_date of the original distribution

Line 407: close c_ap_invoices_all;

403: r_ap_invoices_all := null;
404: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
405: fetch c_ap_invoices_all
406: into r_ap_invoices_all;
407: close c_ap_invoices_all;
408:
409: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
410: * Derivced the accounting_date of the original distribution
411: * as this value is also getting passed for Threshold adjustments if the

Line 438: if r_ap_invoices_all.payment_status_flag <> 'N' then

434: CLOSE c_get_lines_acct_date;
435: end if;
436:
437: /* Check if the TDS invoice is paid, no processing is required if it is already paid. */
438: if r_ap_invoices_all.payment_status_flag <> 'N' then
439: lv_codepath := jai_general_pkg.plot_codepath(4,
440: lv_codepath); /* 4 */
441: lv_tds_invoice_flag := 'X';
442: lv_tds_invoice_message := 'Invoice to TDS Authority is already paid.';

Line 451: if r_ap_invoices_all.cancelled_date is not null then

447:
448: /* Check if the invoice to TDS authority is already canccelled,
449: if yes, no need to do the cancel processing of the invoice */
450: lv_codepath := jai_general_pkg.plot_codepath(5, lv_codepath); /* 5 */
451: if r_ap_invoices_all.cancelled_date is not null then
452: lv_codepath := jai_general_pkg.plot_codepath(6,
453: lv_codepath); /* 6 */
454: lv_tds_invoice_flag := 'X';
455: lv_tds_invoice_message := ' Invoice to TDS Authority is already Cancelled.';

Line 484: P_Org_Id => r_ap_invoices_all.org_id);

480: | created for cancellation.
481: */
482: --Check if the given date is in current open period
483: lv_open_period := ap_utilities_pkg.get_current_gl_date(P_Date => ld_accounting_date,
484: P_Org_Id => r_ap_invoices_all.org_id);
485: if lv_open_period is null then
486:
487: lv_codepath := jai_general_pkg.plot_codepath(1.1, lv_codepath); /* 1.1 */
488:

Line 492: P_Org_Id => r_ap_invoices_all.org_id);

488:
489: ap_utilities_pkg.get_open_gl_date(p_date => ld_accounting_date, /* In date */
490: p_period_name => lv_open_period, /* out Period */
491: p_gl_date => ld_out_accounting_date, /* out date */--Updated by Chong for ZX investigation 20120816
492: P_Org_Id => r_ap_invoices_all.org_id);
493:
494: /*Commented by Chong for ZX investigation 20120816
495: if lv_open_period is null then
496: lv_codepath := jai_general_pkg.plot_codepath(1.2,

Line 524: -- ' Org id ' || r_ap_invoices_all.org_id);

520:
521: /*Added set_policy_context call to implement MOAC - Bug 8475540*/
522:
523: --fnd_file.put_line(FND_FILE.LOG,
524: -- ' Org id ' || r_ap_invoices_all.org_id);
525: IF ( ln_proc_level >= ln_dbg_level)
526: THEN
527: FND_LOG.STRING ( ln_proc_level
528: , GV_MODULE_PREFIX ||'.'|| lv_proc_name

Line 529: , ' Org id ' || r_ap_invoices_all.org_id

525: IF ( ln_proc_level >= ln_dbg_level)
526: THEN
527: FND_LOG.STRING ( ln_proc_level
528: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
529: , ' Org id ' || r_ap_invoices_all.org_id
530: );
531: END IF; --( ln_proc_level >= ln_dbg_level)
532: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);
533:

Line 532: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);

528: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
529: , ' Org id ' || r_ap_invoices_all.org_id
530: );
531: END IF; --( ln_proc_level >= ln_dbg_level)
532: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);
533:
534: lb_return_value := ap_cancel_pkg.ap_cancel_single_invoice(P_invoice_id => cur_rec.invoice_to_tds_authority_id,
535: P_last_updated_by => fnd_global.user_id,
536: P_last_update_login => fnd_global.login_id,

Line 537: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,

533:
534: lb_return_value := ap_cancel_pkg.ap_cancel_single_invoice(P_invoice_id => cur_rec.invoice_to_tds_authority_id,
535: P_last_updated_by => fnd_global.user_id,
536: P_last_update_login => fnd_global.login_id,
537: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,
538: P_accounting_date => ld_accounting_date,
539: --P_period_name => lv_open_period ,
540: P_message_name => lv_out_message_name,
541: P_invoice_amount => ln_out_invoice_amount,

Line 570: update ap_invoices_all

566:
567: /* Bug4523064. Added by Lakshmi Gopalsami
568: Commented the tax_amount update */
569:
570: update ap_invoices_all
571: set invoice_amount = ln_out_invoice_amount,
572: base_amount = ln_out_base_amount,
573: --tax_amount = ln_out_tax_amount ,
574: temp_cancelled_amount = ln_out_temp_cancelled_amount,

Line 591: r_ap_invoices_all := null;

587: lv_codepath := jai_general_pkg.plot_codepath(9, lv_codepath); /* 9 */
588:
589: <>
590: /* Get the details of the Credit memo to the supplier for TDS */
591: r_ap_invoices_all := null;
592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
593: fetch c_ap_invoices_all
594: into r_ap_invoices_all;
595: close c_ap_invoices_all;

Line 592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);

588:
589: <>
590: /* Get the details of the Credit memo to the supplier for TDS */
591: r_ap_invoices_all := null;
592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
593: fetch c_ap_invoices_all
594: into r_ap_invoices_all;
595: close c_ap_invoices_all;
596:

Line 593: fetch c_ap_invoices_all

589: <>
590: /* Get the details of the Credit memo to the supplier for TDS */
591: r_ap_invoices_all := null;
592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
593: fetch c_ap_invoices_all
594: into r_ap_invoices_all;
595: close c_ap_invoices_all;
596:
597: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami

Line 594: into r_ap_invoices_all;

590: /* Get the details of the Credit memo to the supplier for TDS */
591: r_ap_invoices_all := null;
592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
593: fetch c_ap_invoices_all
594: into r_ap_invoices_all;
595: close c_ap_invoices_all;
596:
597: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
598: * Derivced the accounting_date of the original distribution

Line 595: close c_ap_invoices_all;

591: r_ap_invoices_all := null;
592: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
593: fetch c_ap_invoices_all
594: into r_ap_invoices_all;
595: close c_ap_invoices_all;
596:
597: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
598: * Derivced the accounting_date of the original distribution
599: * as this value is also getting passed for Threshold adjustments if the

Line 619: if r_ap_invoices_all.cancelled_date is not null then

615:
616: /* Check if the Credit memo to the supplier for TDS already canccelled,
617: if yes, no need to cancel it again here */
618:
619: if r_ap_invoices_all.cancelled_date is not null then
620: lv_codepath := jai_general_pkg.plot_codepath(10, lv_codepath); /* 10 */
621: lv_tds_credit_memo_flag := 'X';
622: lv_tds_credit_memo_message := 'Credit memo to the supplier for TDS is already Cancelled.';
623: goto Continue_with_next_record;

Line 629: if r_ap_invoices_all.payment_status_flag = 'N' then

625:
626: /* Check if the Credit memo to the supplier for TDS is paid,
627: if yes a separate invoice needs to be generated, or else the same credit memo can be cancelled */
628:
629: if r_ap_invoices_all.payment_status_flag = 'N' then
630: lv_codepath := jai_general_pkg.plot_codepath(11, lv_codepath); /* 11 */
631: /* Credit memo not paid, can cancel the same */
632: lv_tds_credit_memo_flag := 'Y';
633: lv_tds_credit_memo_message := 'Cancelling Credit memo to the supplier for TDS as it is not paid ';

Line 658: P_Org_Id => r_ap_invoices_all.org_id);

654: | created for cancellation.
655: */
656: --Check if the given date is in current open period
657: lv_open_period := ap_utilities_pkg.get_current_gl_date(P_Date => ld_accounting_date,
658: P_Org_Id => r_ap_invoices_all.org_id);
659:
660: if lv_open_period is null then
661:
662: lv_codepath := jai_general_pkg.plot_codepath(1.1, lv_codepath); /* 1.1 */

Line 667: P_Org_Id => r_ap_invoices_all.org_id);

663:
664: ap_utilities_pkg.get_open_gl_date(p_date => ld_accounting_date, /* In date */
665: p_period_name => lv_open_period, /* out Period */
666: p_gl_date => ld_out_accounting_date, /* out date */ ----Updated by Chong for ZX investigation 20120816
667: P_Org_Id => r_ap_invoices_all.org_id);
668:
669: /*Commented by Chong for ZX investigation 20120816
670: if lv_open_period is null then
671: lv_codepath := jai_general_pkg.plot_codepath(1.2,

Line 699: -- ' Org id ' || r_ap_invoices_all.org_id);

695:
696: /*Added set_policy_context call to implement MOAC - Bug 8475540*/
697:
698: --fnd_file.put_line(FND_FILE.LOG,
699: -- ' Org id ' || r_ap_invoices_all.org_id);
700: IF ( ln_proc_level >= ln_dbg_level)
701: THEN
702: FND_LOG.STRING ( ln_proc_level
703: , GV_MODULE_PREFIX ||'.'|| lv_proc_name

Line 704: , ' Org id ' || r_ap_invoices_all.org_id

700: IF ( ln_proc_level >= ln_dbg_level)
701: THEN
702: FND_LOG.STRING ( ln_proc_level
703: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
704: , ' Org id ' || r_ap_invoices_all.org_id
705: );
706: END IF; --( ln_proc_level >= ln_dbg_level)
707: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);
708:

Line 707: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);

703: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
704: , ' Org id ' || r_ap_invoices_all.org_id
705: );
706: END IF; --( ln_proc_level >= ln_dbg_level)
707: mo_global.set_policy_context('S', r_ap_invoices_all.org_id);
708:
709: lb_return_value := ap_cancel_pkg.ap_cancel_single_invoice(P_invoice_id => cur_rec.invoice_to_vendor_id,
710: P_last_updated_by => fnd_global.user_id,
711: P_last_update_login => fnd_global.login_id,

Line 712: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,

708:
709: lb_return_value := ap_cancel_pkg.ap_cancel_single_invoice(P_invoice_id => cur_rec.invoice_to_vendor_id,
710: P_last_updated_by => fnd_global.user_id,
711: P_last_update_login => fnd_global.login_id,
712: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,
713: P_accounting_date => ld_accounting_date,
714: --P_period_name => lv_open_period ,
715: P_message_name => lv_out_message_name,
716: P_invoice_amount => ln_out_invoice_amount,

Line 743: update ap_invoices_all

739: End if;
740:
741: /*Bug4523064. Added by Lakshmi Gopalsami
742: Commented the tax_amount update */
743: update ap_invoices_all
744: set invoice_amount = ln_out_invoice_amount,
745: base_amount = ln_out_base_amount,
746: -- tax_amount = ln_out_tax_amount ,
747: temp_cancelled_amount = ln_out_temp_cancelled_amount,

Line 771: pv_invoice_num_to_vendor_can => r_ap_invoices_all.invoice_num,

767: CLOSE c_get_section_type;
768: -- Added by ChongLei for DTC Bug#13768894 end on 20120222
769:
770: jai_ap_dtc_generation_pkg.generate_dtc_invoices(pn_invoice_id => p_invoice_id,
771: pv_invoice_num_to_vendor_can => r_ap_invoices_all.invoice_num,
772: pn_taxable_amount => cur_rec.taxable_amount,
773: pn_tax_amount => cur_rec.tax_amount,
774: pn_tax_category_id => cur_rec.tax_category_id,
775: pv_section_type => lv_section_type, -- 'TDS_SECTION_TYPE', Updated by Chong.Lei for Bug#13768894 on 20120222

Line 908: r_ap_invoices_all := NULL;

904: UPDATE JAI_AP_TDS_THHOLD_TRXS
905: SET TDS_ROLLBACKED = 'Y'
906: WHERE threshold_trx_id = cur_rec.threshold_trx_id;
907:
908: r_ap_invoices_all := NULL;
909:
910: OPEN c_ap_invoices_all(p_invoice_id);
911: FETCH c_ap_invoices_all
912: into r_ap_invoices_all;

Line 910: OPEN c_ap_invoices_all(p_invoice_id);

906: WHERE threshold_trx_id = cur_rec.threshold_trx_id;
907:
908: r_ap_invoices_all := NULL;
909:
910: OPEN c_ap_invoices_all(p_invoice_id);
911: FETCH c_ap_invoices_all
912: into r_ap_invoices_all;
913: CLOSE c_ap_invoices_all;
914:

Line 911: FETCH c_ap_invoices_all

907:
908: r_ap_invoices_all := NULL;
909:
910: OPEN c_ap_invoices_all(p_invoice_id);
911: FETCH c_ap_invoices_all
912: into r_ap_invoices_all;
913: CLOSE c_ap_invoices_all;
914:
915: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,

Line 912: into r_ap_invoices_all;

908: r_ap_invoices_all := NULL;
909:
910: OPEN c_ap_invoices_all(p_invoice_id);
911: FETCH c_ap_invoices_all
912: into r_ap_invoices_all;
913: CLOSE c_ap_invoices_all;
914:
915: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,
916: p_before_threshold_type => lv_threshold_type,

Line 913: CLOSE c_ap_invoices_all;

909:
910: OPEN c_ap_invoices_all(p_invoice_id);
911: FETCH c_ap_invoices_all
912: into r_ap_invoices_all;
913: CLOSE c_ap_invoices_all;
914:
915: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,
916: p_before_threshold_type => lv_threshold_type,
917: p_after_threshold_type => lv_after_threshold_type,

Line 921: p_org_id => r_ap_invoices_all.org_id,

917: p_after_threshold_type => lv_after_threshold_type,
918: p_before_threshold_slab_id => ln_threshold_slab_id,
919: p_after_threshold_slab_id => ln_after_threshold_slab_id,
920: p_threshold_grp_id => cur_rec.threshold_grp_id,
921: p_org_id => r_ap_invoices_all.org_id,
922: p_accounting_date => ld_accounting_date,
923: p_invoice_distribution_id => NULL,
924: p_prepay_distribution_id => NULL,
925: p_process_flag => lv_process_flag,

Line 991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);

987: for tds_id in (select invoice_to_tds_authority_id
988: from jai_ap_tds_thhold_trxs
989: where invoice_id = r_threshold_breach.invoice_id) loop
990:
991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
992: fetch c_ap_invoices_all
993: into r_ap_invoices_all;
994: close c_ap_invoices_all;
995: if r_ap_invoices_all.payment_status_flag <> 'N' and

Line 992: fetch c_ap_invoices_all

988: from jai_ap_tds_thhold_trxs
989: where invoice_id = r_threshold_breach.invoice_id) loop
990:
991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
992: fetch c_ap_invoices_all
993: into r_ap_invoices_all;
994: close c_ap_invoices_all;
995: if r_ap_invoices_all.payment_status_flag <> 'N' and
996: lv_payment = 'N' then

Line 993: into r_ap_invoices_all;

989: where invoice_id = r_threshold_breach.invoice_id) loop
990:
991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
992: fetch c_ap_invoices_all
993: into r_ap_invoices_all;
994: close c_ap_invoices_all;
995: if r_ap_invoices_all.payment_status_flag <> 'N' and
996: lv_payment = 'N' then
997: lv_payment := 'Y';

Line 994: close c_ap_invoices_all;

990:
991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
992: fetch c_ap_invoices_all
993: into r_ap_invoices_all;
994: close c_ap_invoices_all;
995: if r_ap_invoices_all.payment_status_flag <> 'N' and
996: lv_payment = 'N' then
997: lv_payment := 'Y';
998: end if;

Line 995: if r_ap_invoices_all.payment_status_flag <> 'N' and

991: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
992: fetch c_ap_invoices_all
993: into r_ap_invoices_all;
994: close c_ap_invoices_all;
995: if r_ap_invoices_all.payment_status_flag <> 'N' and
996: lv_payment = 'N' then
997: lv_payment := 'Y';
998: end if;
999: end loop;

Line 1146: r_ap_invoices_all := NULL;

1142: IF lv_process_flag = 'E' THEN
1143: goto end_of_outer_loop;
1144: END IF;
1145:
1146: r_ap_invoices_all := NULL;
1147:
1148: OPEN c_ap_invoices_all(p_invoice_id);
1149: FETCH c_ap_invoices_all
1150: into r_ap_invoices_all;

Line 1148: OPEN c_ap_invoices_all(p_invoice_id);

1144: END IF;
1145:
1146: r_ap_invoices_all := NULL;
1147:
1148: OPEN c_ap_invoices_all(p_invoice_id);
1149: FETCH c_ap_invoices_all
1150: into r_ap_invoices_all;
1151: CLOSE c_ap_invoices_all;
1152:

Line 1149: FETCH c_ap_invoices_all

1145:
1146: r_ap_invoices_all := NULL;
1147:
1148: OPEN c_ap_invoices_all(p_invoice_id);
1149: FETCH c_ap_invoices_all
1150: into r_ap_invoices_all;
1151: CLOSE c_ap_invoices_all;
1152:
1153: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,

Line 1150: into r_ap_invoices_all;

1146: r_ap_invoices_all := NULL;
1147:
1148: OPEN c_ap_invoices_all(p_invoice_id);
1149: FETCH c_ap_invoices_all
1150: into r_ap_invoices_all;
1151: CLOSE c_ap_invoices_all;
1152:
1153: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,
1154: p_before_threshold_type => lv_threshold_type,

Line 1151: CLOSE c_ap_invoices_all;

1147:
1148: OPEN c_ap_invoices_all(p_invoice_id);
1149: FETCH c_ap_invoices_all
1150: into r_ap_invoices_all;
1151: CLOSE c_ap_invoices_all;
1152:
1153: jai_ap_dtc_generation_pkg.process_threshold_rollback(p_invoice_id => p_invoice_id,
1154: p_before_threshold_type => lv_threshold_type,
1155: p_after_threshold_type => lv_after_threshold_type,

Line 1159: p_org_id => r_ap_invoices_all.org_id,

1155: p_after_threshold_type => lv_after_threshold_type,
1156: p_before_threshold_slab_id => ln_threshold_slab_id,
1157: p_after_threshold_slab_id => ln_after_threshold_slab_id,
1158: p_threshold_grp_id => cur_rec.threshold_grp_id,
1159: p_org_id => r_ap_invoices_all.org_id,
1160: p_accounting_date => sysdate, --modified ld_accounting_date to sysdate by Bgowrava for bug#8682951
1161: p_invoice_distribution_id => NULL,
1162: p_prepay_distribution_id => NULL,
1163: p_process_flag => lv_process_flag,