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
196: and aipa.invoice_id = aia.invoice_id
223: and vendor_id = jattt.vendor_id /*Added by nprashar for bug # 6195566*/
224: and invoice_id = aipa.invoice_id /*Added by nprashar for bug # 6195566*/
225: and tds_tax_id in /*bduvarag for Bug#5647725*/
226: (
227: select tax_id from JAI_CMN_TAXES_ALL where tax_type = 'TDS'
228: and section_type = p_section_type)
229: )
230: ;
231:
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
452: and jatc.section_type = p_section_type /*bduvarag for Bug#5647725*/ ;
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
567: and aipa.invoice_id = aia.invoice_id
1219: and vendor_id = nvl(pn_vendor_id, vendor_id)
1220: and vendor_site_id = nvl(pn_vendor_site_id, vendor_site_id)
1221: and org_tan_num = pv_org_tan_num
1222: and tds_tax_id in ( SELECT tax_id
1223: FROM JAI_CMN_TAXES_ALL
1224: WHERE section_type = p_section_type
1225: );/*bduvarag for Bug#5647725*/
1226:
1227:
1252: and vendor_site_id = nvl(pn_vendor_site_id, vendor_site_id)
1253: and org_tan_num = pv_org_tan_num
1254: and operating_unit_id = pn_operating_unit_id
1255: and tds_tax_id in ( SELECT tax_id
1256: FROM JAI_CMN_TAXES_ALL
1257: WHERE section_type = p_section_type
1258: );/*bduvarag for Bug#5647725*/
1259: --Commented below by Bgowrava for Bug#6129650
1260: /*
1304: and vendor_id = nvl(pn_vendor_id, vendor_id)
1305: and vendor_site_id = nvl(pn_vendor_site_id, vendor_site_id)
1306: and org_tan_num = pv_org_tan_num
1307: and tds_tax_id in ( SELECT tax_id
1308: FROM JAI_CMN_TAXES_ALL
1309: WHERE section_type = p_section_type
1310: )
1311: group by
1312: fin_year,
1354: and vendor_id = nvl(pn_vendor_id, vendor_id)
1355: and vendor_site_id = nvl(pn_vendor_site_id, vendor_site_id)
1356: and org_tan_num = pv_org_tan_num
1357: and tds_tax_id in ( SELECT tax_id
1358: FROM JAI_CMN_TAXES_ALL
1359: WHERE section_type = p_section_type
1360: );/*bduvarag for Bug#5647725*/
1361:
1362:
1501: and org_tan_num = pv_org_tan_num
1502: and operating_unit_id = cur_ou.operating_unit_id
1503: and invoice_date = cur_invoice_date.invoice_date
1504: and tds_tax_id in ( SELECT tax_id
1505: FROM JAI_CMN_TAXES_ALL
1506: WHERE section_type = p_section_type
1507: );/*bduvarag for Bug#5647725*/
1508:
1509:
1553: and vendor_site_id = cur_rec.vendor_site_id
1554: and org_tan_num = pv_org_tan_num
1555: and operating_unit_id = cur_rec.operating_unit_id
1556: and tds_tax_id in ( SELECT tax_id
1557: FROM JAI_CMN_TAXES_ALL
1558: WHERE section_type = p_section_type
1559: );
1560:
1561: END LOOP; /*c_group_for_no_certificate*/
1611: and vendor_site_id = cur_rec.vendor_site_id
1612: and org_tan_num = pv_org_tan_num
1613: and operating_unit_id = cur_rec.operating_unit_id
1614: and tds_tax_id in ( SELECT tax_id
1615: FROM JAI_CMN_TAXES_ALL
1616: WHERE section_type = p_section_type
1617: );/*bduvarag for Bug#5647725*/
1618:
1619: if sql%rowcount = 0 then