[Home] [Help]
187: from
188: ap_checks_all aca ,
189: ap_invoice_payments_all aipa ,
190: ap_invoices_all aia ,
191: jai_ap_tds_thhold_trxs jattt,
192: JAI_CMN_TAXES_ALL jitc
193: where
194: aca.check_id = aipa.check_id
195: and aipa.invoice_id = jattt.invoice_to_tds_authority_id
289: where invoice_id = aia.invoice_id
290: )
291: and not exists (
292: SELECT 1
293: FROM jai_ap_tds_thhold_trxs
294: WHERE invoice_to_tds_authority_id = aia.invoice_id
295: )/*bduvarag for Bug#5647725*/
296:
297: ;
431: aia.attribute1 ,
432: aida_prepayment.invoice_id
433: ;
434:
435: cursor c_jai_ap_tds_thhold_trxs(pn_invoice_to_tds_authority_id number) is
436: select
437: jatt.threshold_trx_id,
438: jatt.invoice_id,
439: jatc.section_code tds_section,
443: jatt.tax_amount,
444: jatt.vendor_id,
445: jatt.vendor_site_id
446: from
447: jai_ap_tds_thhold_trxs jatt,
448: JAI_CMN_TAXES_ALL jatc
449: where
450: jatt.invoice_to_tds_authority_id = pn_invoice_to_tds_authority_id
451: and jatc.tax_id = jatt.tax_id
558: from
559: ap_checks_all aca ,
560: ap_invoice_payments_all aipa ,
561: ap_invoices_all aia ,
562: jai_ap_tds_thhold_trxs jattt,
563: JAI_CMN_TAXES_ALL jitc
564: where
565: aca.check_id = aipa.check_id
566: and aipa.invoice_id = jattt.invoice_to_tds_authority_id
923: fetch c_get_payment_details into r_get_payment_details;
924: close c_get_payment_details;
925:
926: /* Check if the TDS invoice is created post clean up then get all info from there */
927: open c_jai_ap_tds_thhold_trxs(cur_rec.invoice_id);
928: fetch c_jai_ap_tds_thhold_trxs into
929: ln_threshold_trx_id,
930: ln_parent_invoice_id,
931: lv_section_code ,
924: close c_get_payment_details;
925:
926: /* Check if the TDS invoice is created post clean up then get all info from there */
927: open c_jai_ap_tds_thhold_trxs(cur_rec.invoice_id);
928: fetch c_jai_ap_tds_thhold_trxs into
929: ln_threshold_trx_id,
930: ln_parent_invoice_id,
931: lv_section_code ,
932: ln_tax_id,
934: ln_taxable_basis,
935: ln_tax_amount,
936: ln_vendor_id,
937: ln_vendor_site_id;
938: close c_jai_ap_tds_thhold_trxs;
939:
940: if ln_threshold_trx_id is not null then
941: goto populate_invoice_details;
942: end if;
1378: for update of certificate_line_num;
1379:
1380: cursor c_tds_thhold_event(cp_threshold_trx_id number) is
1381: select tds_event
1382: from jai_ap_tds_thhold_trxs
1383: where threshold_trx_id = cp_threshold_trx_id;
1384:
1385: cursor c_get_form16_hdr_id is
1386: select jai_ap_tds_f16_hdrs_all_s.nextval from dual;
1391:
1392:
1393: ln_cert_line_num NUMBER(15);
1394: ln_prev_parent_invoice_id ap_invoices_all.invoice_id%TYPE;
1395: -- lv_prev_tds_event jai_ap_tds_thhold_trxs.tds_event%TYPE;
1396: /*Bug 5647725 bduvarag*/
1397: lv_tds_event jai_ap_tds_thhold_trxs.tds_event%TYPE;
1398:
1399:
1393: ln_cert_line_num NUMBER(15);
1394: ln_prev_parent_invoice_id ap_invoices_all.invoice_id%TYPE;
1395: -- lv_prev_tds_event jai_ap_tds_thhold_trxs.tds_event%TYPE;
1396: /*Bug 5647725 bduvarag*/
1397: lv_tds_event jai_ap_tds_thhold_trxs.tds_event%TYPE;
1398:
1399:
1400: --r_hr_operating_units c_hr_operating_units%rowtype;
1401: r_ja_in_tds_year_info c_ja_in_tds_year_info%rowtype;