[Home] [Help]
87: Issue: This is a forward port bug for the bug7252683.
88: Cancellation of the invoice breaching the surcharge threhsold does not cancel the surcharge invoice that
89: got created while the transition. this results in wrong surcharge calculation
90:
91: Fixed: Added the column 'tds_event' to the cusor c_jai_ap_tds_thhold_trxs to pick the tds_even also for cancellation,
92: also ordered the result based on the threshold_trx_id. Checked the slabs after and before cancellation and
93: if it was different then cancelled the surcharge invoice else not cancelled it.
94:
95: 14. 13-Jun-2010 Xiao for Bug#7154864
122: p_invoice_id in number
123: )
124: is
125:
126: cursor c_jai_ap_tds_thhold_trxs (p_invoice_id number) is--rchandan for bug#4428980
127: select threshold_trx_id,
128: threshold_grp_id,
129: threshold_hdr_id, --Added by Sanjikum for Bug#5131075(4718907)
130: tax_id,
133: invoice_to_tds_authority_id,
134: invoice_to_vendor_id,
135: tds_event, -- Added by Jia for FP Bug#7312295
136: calc_tax_amount -- Bug 5751783
137: from jai_ap_tds_thhold_trxs
138: where invoice_id = p_invoice_id
139: and (tds_event = 'INVOICE VALIDATE' or tds_event = 'SURCHARGE_CALCULATE') --Bug 7312295 - Added condition 'or tds_event = 'SURCHARGE_CALCULATE'
140: order by threshold_trx_id; -- Added by Jia for FP Bug#7312295
141:
186: from gl_sets_of_books
187: where set_of_books_id = cp_set_of_books_id;
188: /*start-ETDS FVU3.1 11896260*/
189: cursor c_threshold_breach(p_invoice_id number) is
190: select jattt.invoice_id,jattt.tds_event,jattt.invoice_to_tds_authority_id from jai_ap_tds_inv_taxes jatit,jai_ap_tds_thhold_trxs jattt
191: where jatit.invoice_id =p_invoice_id and
192: jatit.default_cum_threshold_stage= 'BEFORE THRESHOLD'
193: and jatit.threshold_grp_id =jattt.threshold_grp_id
194: and jattt.tds_event like 'THRESHOLD%'
191: where jatit.invoice_id =p_invoice_id and
192: jatit.default_cum_threshold_stage= 'BEFORE THRESHOLD'
193: and jatit.threshold_grp_id =jattt.threshold_grp_id
194: and jattt.tds_event like 'THRESHOLD%'
195: and not exists (select '1' from jai_ap_tds_thhold_trxs where invoice_id =jatit.invoice_id);/*to ensure that no TDS is deducted*/
196: lv_count number:=0;
197: lv_payment varchar2(1) :='N';
198: /*end-ETDS FVU3.1 11896260*/
199: /* Bug#5131075(5193852). Added by Lakshmi Gopalsami
350:
351: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath); /* 2 */
352:
353: /* Get all the TDS invoices that were generated at the time of the INVOICE VALIDATE */
354: for cur_rec in c_jai_ap_tds_thhold_trxs(p_invoice_id)
355: --Bug 7312295 - Removed INVOICE_VALIDATE event from c_jai_ap_tds_thhold_trxs. Modified the cursor to include Validate and Surcharge
356: loop
357: Fnd_File.put_line(Fnd_File.LOG, ' Inside Loop');
358: --Start Added by Sanjikum for Bug#5131075(4718907)
351: lv_codepath := jai_general_pkg.plot_codepath(2, lv_codepath); /* 2 */
352:
353: /* Get all the TDS invoices that were generated at the time of the INVOICE VALIDATE */
354: for cur_rec in c_jai_ap_tds_thhold_trxs(p_invoice_id)
355: --Bug 7312295 - Removed INVOICE_VALIDATE event from c_jai_ap_tds_thhold_trxs. Modified the cursor to include Validate and Surcharge
356: loop
357: Fnd_File.put_line(Fnd_File.LOG, ' Inside Loop');
358: --Start Added by Sanjikum for Bug#5131075(4718907)
359: jai_ap_tds_generation_pkg.get_tds_threshold_slab(
982:
983: elsif (r_threshold_breach.tds_event like 'THRESHOLD ROLLBACK%') then
984: lv_count :=lv_count-1;
985: end if;
986: for tds_id in (select invoice_to_tds_authority_id from jai_ap_tds_thhold_trxs where invoice_id = r_threshold_breach.invoice_id)
987: loop
988:
989: open c_ap_invoices_all(tds_id.invoice_to_tds_authority_id);
990: fetch c_ap_invoices_all into r_ap_invoices_all;