DBA Data[Home] [Help]

APPS.JAI_AP_TDS_CANCELLATION_PKG dependencies on AP_INVOICES_ALL

Line 44: (1) Added org_id in cursor c_ap_invoices_all

40: and also commented the update for tax_amount
41: (2)Also raised exception if P_TOKEN is not null
42:
43: 5. 23-Aug-2005 Bug4559756. Added by Lakshmi Gopalsami version 120.3
44: (1) Added org_id in cursor c_ap_invoices_all
45: (2) Fetched the same before calling ap_utilities_pkg
46: and passed the same the package call.
47: To get the period name and date.
48:

Line 110: cursor c_ap_invoices_all(p_invoice_id number) is

106: /* Bug 4559756. Added by Lakshmi Gopalsami
107: Added org_id for passing it to ap_utilities_pkg
108:
109: */
110: cursor c_ap_invoices_all(p_invoice_id number) is
111: select invoice_id,
112: cancelled_date,
113: payment_status_flag,
114: invoice_amount,

Line 118: from ap_invoices_all

114: invoice_amount,
115: set_of_books_id,
116: invoice_num,
117: org_id
118: from ap_invoices_all
119: where invoice_id = p_invoice_id;
120:
121: cursor c_get_parent_inv_dtls(p_invoice_id number) is
122: select set_of_books_id,

Line 125: from ap_invoices_all

121: cursor c_get_parent_inv_dtls(p_invoice_id number) is
122: select set_of_books_id,
123: invoice_currency_code,
124: exchange_rate
125: from ap_invoices_all
126: where invoice_id = p_invoice_id;
127:
128:
129: cursor c_jai_ap_tds_inv_taxes(p_invoice_id number,cp_section_type jai_ap_tds_inv_taxes.section_type%type) is--rchandan for bug#4428980

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

147: | Changed the source of ld_accounting_date to refer to
148: | ap_invoice_distributions_all.accounting_date instead of
149: | gl_date on headers.
150: */
151: CURSOR get_dist_gl_date( cp_invoice_id IN ap_invoices_all.invoice_id%TYPE)
152: IS
153: SELECT accounting_date
154: FROM ap_invoice_distributions_all
155: WHERE invoice_id = cp_invoice_id

Line 163: r_ap_invoices_all c_ap_invoices_all%rowtype;

159:
160:
161:
162: r_ja_in_tax_codes c_ja_in_tax_codes%rowtype;
163: r_ap_invoices_all c_ap_invoices_all%rowtype;
164: r_get_parent_inv_dtls c_get_parent_inv_dtls%rowtype;
165: r_gl_sets_of_books c_gl_sets_of_books%rowtype;
166:
167: lv_code_path VARCHAR2(1996);

Line 192: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;

188:
189: ld_accounting_date date; --File.Sql.35 Cbabu := sysdate;
190: lv_open_period ap_invoice_distributions_all.period_name%type;
191:
192: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;
193: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
194: ln_threshold_trx_id number;
195:
196: ln_taxable_amount number;

Line 193: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;

189: ld_accounting_date date; --File.Sql.35 Cbabu := sysdate;
190: lv_open_period ap_invoice_distributions_all.period_name%type;
191:
192: lv_invoice_to_tds_num ap_invoices_all.invoice_num%type;
193: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
194: ln_threshold_trx_id number;
195:
196: ln_taxable_amount number;
197: ln_exchange_rate ap_invoices_all.exchange_rate%type;

Line 197: ln_exchange_rate ap_invoices_all.exchange_rate%type;

193: lv_invoice_to_vendor_num ap_invoices_all.invoice_num%type;
194: ln_threshold_trx_id number;
195:
196: ln_taxable_amount number;
197: ln_exchange_rate ap_invoices_all.exchange_rate%type;
198: lv_codepath VARCHAR2(1996);
199: ln_start_threshold_trx_id number;
200: ln_threshold_grp_id number;
201: ln_threshold_grp_audit_id number;

Line 246: open c_ap_invoices_all(p_invoice_id);

242:
243: /* bug 4559756. Added by Lakshmi Gopalsami
244: Fetch the org_id
245: */
246: open c_ap_invoices_all(p_invoice_id);
247: fetch c_ap_invoices_all into r_ap_invoices_all;
248: close c_ap_invoices_all;
249:
250:

Line 247: fetch c_ap_invoices_all into r_ap_invoices_all;

243: /* bug 4559756. Added by Lakshmi Gopalsami
244: Fetch the org_id
245: */
246: open c_ap_invoices_all(p_invoice_id);
247: fetch c_ap_invoices_all into r_ap_invoices_all;
248: close c_ap_invoices_all;
249:
250:
251: --Removed the code from here by Lakshmi Gopalsami for Bug#5131075(5193852)

Line 248: close c_ap_invoices_all;

244: Fetch the org_id
245: */
246: open c_ap_invoices_all(p_invoice_id);
247: fetch c_ap_invoices_all into r_ap_invoices_all;
248: close c_ap_invoices_all;
249:
250:
251: --Removed the code from here by Lakshmi Gopalsami for Bug#5131075(5193852)
252:

Line 284: r_ap_invoices_all := null;

280: lv_tds_credit_memo_flag := null;
281: lv_tds_credit_memo_message := null;
282:
283: /* Get the details of the Invoice to TDS authority */
284: r_ap_invoices_all := null;
285: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
286: fetch c_ap_invoices_all into r_ap_invoices_all;
287: close c_ap_invoices_all;
288:

Line 285: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);

281: lv_tds_credit_memo_message := null;
282:
283: /* Get the details of the Invoice to TDS authority */
284: r_ap_invoices_all := null;
285: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
286: fetch c_ap_invoices_all into r_ap_invoices_all;
287: close c_ap_invoices_all;
288:
289: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami

Line 286: fetch c_ap_invoices_all into r_ap_invoices_all;

282:
283: /* Get the details of the Invoice to TDS authority */
284: r_ap_invoices_all := null;
285: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
286: fetch c_ap_invoices_all into r_ap_invoices_all;
287: close c_ap_invoices_all;
288:
289: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
290: * Derivced the accounting_date of the original distribution

Line 287: close c_ap_invoices_all;

283: /* Get the details of the Invoice to TDS authority */
284: r_ap_invoices_all := null;
285: open c_ap_invoices_all(cur_rec.invoice_to_tds_authority_id);
286: fetch c_ap_invoices_all into r_ap_invoices_all;
287: close c_ap_invoices_all;
288:
289: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
290: * Derivced the accounting_date of the original distribution
291: * as this value is also getting passed for Threshold adjustments if the

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

297: CLOSE get_dist_gl_date;
298:
299:
300: /* Check if the TDS invoice is paid, no processing is required if it is already paid. */
301: if r_ap_invoices_all.payment_status_flag <> 'N' then
302: lv_codepath := jai_general_pkg.plot_codepath(4, lv_codepath); /* 4 */
303: lv_tds_invoice_flag := 'X';
304: lv_tds_invoice_message := 'Invoice to TDS Authority is already paid.';
305: lv_tds_credit_memo_flag := 'X';

Line 313: if r_ap_invoices_all.cancelled_date is not null then

309:
310: /* Check if the invoice to TDS authority is already canccelled,
311: if yes, no need to do the cancel processing of the invoice */
312: lv_codepath := jai_general_pkg.plot_codepath(5, lv_codepath); /* 5 */
313: if r_ap_invoices_all.cancelled_date is not null then
314: lv_codepath := jai_general_pkg.plot_codepath(6, lv_codepath); /* 6 */
315: lv_tds_invoice_flag := 'X';
316: lv_tds_invoice_message := ' Invoice to TDS Authority is already Cancelled.';
317: goto credit_memo_processing;

Line 346: P_Org_Id => r_ap_invoices_all.org_id);

342: */
343: --Check if the given date is in current open period
344: lv_open_period:= ap_utilities_pkg.get_current_gl_date
345: (P_Date => ld_accounting_date,
346: P_Org_Id => r_ap_invoices_all.org_id);
347:
348:
349: if lv_open_period is null then
350:

Line 358: P_Org_Id => r_ap_invoices_all.org_id

354: (
355: p_date => ld_accounting_date, /* In date */
356: p_period_name => lv_open_period, /* out Period */
357: p_gl_date => ld_accounting_date, /* out date */
358: P_Org_Id => r_ap_invoices_all.org_id
359: );
360:
361:
362: if lv_open_period is null then

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

388: (
389: P_invoice_id => cur_rec.invoice_to_tds_authority_id ,
390: P_last_updated_by => fnd_global.user_id ,
391: P_last_update_login => fnd_global.login_id ,
392: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,
393: P_accounting_date => ld_accounting_date ,
394: --P_period_name => lv_open_period ,
395: P_message_name => lv_out_message_name ,
396: P_invoice_amount => ln_out_invoice_amount ,

Line 426: update ap_invoices_all

422:
423: /* Bug4523064. Added by Lakshmi Gopalsami
424: Commented the tax_amount update */
425:
426: update ap_invoices_all
427: set invoice_amount = ln_out_invoice_amount ,
428: base_amount = ln_out_base_amount ,
429: --tax_amount = ln_out_tax_amount ,
430: temp_cancelled_amount = ln_out_temp_cancelled_amount ,

Line 448: r_ap_invoices_all := null;

444:
445:
446: << credit_memo_processing >>
447: /* Get the details of the Credit memo to the supplier for TDS */
448: r_ap_invoices_all := null;
449: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
450: fetch c_ap_invoices_all into r_ap_invoices_all;
451: close c_ap_invoices_all;
452:

Line 449: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);

445:
446: << credit_memo_processing >>
447: /* Get the details of the Credit memo to the supplier for TDS */
448: r_ap_invoices_all := null;
449: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
450: fetch c_ap_invoices_all into r_ap_invoices_all;
451: close c_ap_invoices_all;
452:
453: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami

Line 450: fetch c_ap_invoices_all into r_ap_invoices_all;

446: << credit_memo_processing >>
447: /* Get the details of the Credit memo to the supplier for TDS */
448: r_ap_invoices_all := null;
449: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
450: fetch c_ap_invoices_all into r_ap_invoices_all;
451: close c_ap_invoices_all;
452:
453: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
454: * Derivced the accounting_date of the original distribution

Line 451: close c_ap_invoices_all;

447: /* Get the details of the Credit memo to the supplier for TDS */
448: r_ap_invoices_all := null;
449: open c_ap_invoices_all(cur_rec.invoice_to_vendor_id);
450: fetch c_ap_invoices_all into r_ap_invoices_all;
451: close c_ap_invoices_all;
452:
453: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
454: * Derivced the accounting_date of the original distribution
455: * as this value is also getting passed for Threshold adjustments if the

Line 467: if r_ap_invoices_all.cancelled_date is not null then

463:
464: /* Check if the Credit memo to the supplier for TDS already canccelled,
465: if yes, no need to cancel it again here */
466:
467: if r_ap_invoices_all.cancelled_date is not null then
468: lv_codepath := jai_general_pkg.plot_codepath(10, lv_codepath); /* 10 */
469: lv_tds_credit_memo_flag := 'X';
470: lv_tds_credit_memo_message := 'Credit memo to the supplier for TDS is already Cancelled.';
471: goto Continue_with_next_record;

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

473:
474: /* Check if the Credit memo to the supplier for TDS is paid,
475: if yes a separate invoice needs to be generated, or else the same credit memo can be cancelled */
476:
477: if r_ap_invoices_all.payment_status_flag = 'N' then
478: lv_codepath := jai_general_pkg.plot_codepath(11, lv_codepath); /* 11 */
479: /* Credit memo not paid, can cancel the same */
480: lv_tds_credit_memo_flag := 'Y';
481: lv_tds_credit_memo_message := 'Cancelling Credit memo to the supplier for TDS as it is not paid ';

Line 507: P_Org_Id => r_ap_invoices_all.org_id);

503: */
504: --Check if the given date is in current open period
505: lv_open_period:= ap_utilities_pkg.get_current_gl_date
506: (P_Date => ld_accounting_date,
507: P_Org_Id => r_ap_invoices_all.org_id);
508:
509:
510: if lv_open_period is null then
511:

Line 519: P_Org_Id => r_ap_invoices_all.org_id

515: (
516: p_date => ld_accounting_date, /* In date */
517: p_period_name => lv_open_period, /* out Period */
518: p_gl_date => ld_accounting_date, /* out date */
519: P_Org_Id => r_ap_invoices_all.org_id
520: );
521:
522:
523: if lv_open_period is null then

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

549: (
550: P_invoice_id => cur_rec.invoice_to_vendor_id ,
551: P_last_updated_by => fnd_global.user_id ,
552: P_last_update_login => fnd_global.login_id ,
553: --P_set_of_books_id => r_ap_invoices_all.set_of_books_id ,
554: P_accounting_date => ld_accounting_date ,
555: --P_period_name => lv_open_period ,
556: P_message_name => lv_out_message_name ,
557: P_invoice_amount => ln_out_invoice_amount ,

Line 585: update ap_invoices_all

581: End if;
582:
583: /*Bug4523064. Added by Lakshmi Gopalsami
584: Commented the tax_amount update */
585: update ap_invoices_all
586: set invoice_amount = ln_out_invoice_amount ,
587: base_amount = ln_out_base_amount ,
588: -- tax_amount = ln_out_tax_amount ,
589: temp_cancelled_amount = ln_out_temp_cancelled_amount ,

Line 609: pv_invoice_num_to_vendor_can => r_ap_invoices_all.invoice_num,

605:
606: jai_ap_tds_generation_pkg.generate_tds_invoices
607: (
608: pn_invoice_id => p_invoice_id ,
609: pv_invoice_num_to_vendor_can => r_ap_invoices_all.invoice_num,
610: pn_taxable_amount => cur_rec.taxable_amount ,
611: pn_tax_amount => cur_rec.tax_amount ,
612: pn_tax_id => cur_rec.tax_id ,
613: pd_accounting_date => ld_accounting_date ,

Line 741: r_ap_invoices_all := NULL;

737: IF lv_process_flag = 'E' THEN
738: goto end_of_main_loop;
739: END IF;
740:
741: r_ap_invoices_all := NULL;
742:
743: OPEN c_ap_invoices_all(p_invoice_id);
744: FETCH c_ap_invoices_all into r_ap_invoices_all;
745: CLOSE c_ap_invoices_all;

Line 743: OPEN c_ap_invoices_all(p_invoice_id);

739: END IF;
740:
741: r_ap_invoices_all := NULL;
742:
743: OPEN c_ap_invoices_all(p_invoice_id);
744: FETCH c_ap_invoices_all into r_ap_invoices_all;
745: CLOSE c_ap_invoices_all;
746:
747: jai_ap_tds_generation_pkg.process_threshold_rollback(

Line 744: FETCH c_ap_invoices_all into r_ap_invoices_all;

740:
741: r_ap_invoices_all := NULL;
742:
743: OPEN c_ap_invoices_all(p_invoice_id);
744: FETCH c_ap_invoices_all into r_ap_invoices_all;
745: CLOSE c_ap_invoices_all;
746:
747: jai_ap_tds_generation_pkg.process_threshold_rollback(
748: p_invoice_id => p_invoice_id,

Line 745: CLOSE c_ap_invoices_all;

741: r_ap_invoices_all := NULL;
742:
743: OPEN c_ap_invoices_all(p_invoice_id);
744: FETCH c_ap_invoices_all into r_ap_invoices_all;
745: CLOSE c_ap_invoices_all;
746:
747: jai_ap_tds_generation_pkg.process_threshold_rollback(
748: p_invoice_id => p_invoice_id,
749: p_before_threshold_type => lv_threshold_type,

Line 754: p_org_id => r_ap_invoices_all.org_id,

750: p_after_threshold_type => lv_after_threshold_type,
751: p_before_threshold_slab_id => ln_threshold_slab_id,
752: p_after_threshold_slab_id => ln_after_threshold_slab_id,
753: p_threshold_grp_id => cur_rec.threshold_grp_id,
754: p_org_id => r_ap_invoices_all.org_id,
755: p_accounting_date => ld_accounting_date,
756: p_process_flag => lv_process_flag,
757: p_process_message => lv_process_message,
758: p_codepath => lv_codepath);

Line 911: r_ap_invoices_all := NULL;

907: IF lv_process_flag = 'E' THEN
908: goto end_of_outer_loop;
909: END IF;
910:
911: r_ap_invoices_all := NULL;
912:
913: OPEN c_ap_invoices_all(p_invoice_id);
914: FETCH c_ap_invoices_all into r_ap_invoices_all;
915: CLOSE c_ap_invoices_all;

Line 913: OPEN c_ap_invoices_all(p_invoice_id);

909: END IF;
910:
911: r_ap_invoices_all := NULL;
912:
913: OPEN c_ap_invoices_all(p_invoice_id);
914: FETCH c_ap_invoices_all into r_ap_invoices_all;
915: CLOSE c_ap_invoices_all;
916:
917: jai_ap_tds_generation_pkg.process_threshold_rollback(

Line 914: FETCH c_ap_invoices_all into r_ap_invoices_all;

910:
911: r_ap_invoices_all := NULL;
912:
913: OPEN c_ap_invoices_all(p_invoice_id);
914: FETCH c_ap_invoices_all into r_ap_invoices_all;
915: CLOSE c_ap_invoices_all;
916:
917: jai_ap_tds_generation_pkg.process_threshold_rollback(
918: p_invoice_id => p_invoice_id,

Line 915: CLOSE c_ap_invoices_all;

911: r_ap_invoices_all := NULL;
912:
913: OPEN c_ap_invoices_all(p_invoice_id);
914: FETCH c_ap_invoices_all into r_ap_invoices_all;
915: CLOSE c_ap_invoices_all;
916:
917: jai_ap_tds_generation_pkg.process_threshold_rollback(
918: p_invoice_id => p_invoice_id,
919: p_before_threshold_type => lv_threshold_type,

Line 924: p_org_id => r_ap_invoices_all.org_id,

920: p_after_threshold_type => lv_after_threshold_type,
921: p_before_threshold_slab_id => ln_threshold_slab_id,
922: p_after_threshold_slab_id => ln_after_threshold_slab_id,
923: p_threshold_grp_id => cur_rec.threshold_grp_id,
924: p_org_id => r_ap_invoices_all.org_id,
925: p_accounting_date => ld_accounting_date,
926: p_process_flag => lv_process_flag,
927: p_process_message => lv_process_message,
928: p_codepath => lv_codepath);