1097: and vendor_site_id = p_vendor_site_id
1098: and section_type = p_section_type--rchandan for bug#4428980
1099: and section_code = p_tds_section_code;
1100:
1101: cursor c_jai_ap_tds_thhold_grps(p_threshold_grp_id number) is
1102: select (
1103: nvl(total_invoice_amount, 0) -
1104: nvl(total_invoice_cancel_amount, 0) -
1105: nvl(total_invoice_apply_amount, 0) +
1105: nvl(total_invoice_apply_amount, 0) +
1106: nvl(total_invoice_unapply_amount, 0)
1107: )
1108: total_invoice_amount
1109: from jai_ap_tds_thhold_grps
1110: where threshold_grp_id = p_threshold_grp_id;
1111:
1112: cursor c_jai_ap_tds_thhold_slabs
1113: ( p_threshold_hdr_id number, p_threshold_type varchar2, p_amount number) is
1168: and a.vendor_id = p_vendor_id
1169: and b.vendor_site_id = p_vendor_site_id;
1170:
1171: cursor c_get_threshold_group
1172: (p_vendor_id number, p_tan_no varchar2, p_pan_no varchar2, p_tds_section_code varchar2 , p_fin_year number,p_section_type jai_ap_tds_thhold_grps.section_type%type) is--rchandan for bug#4428980
1173: select threshold_grp_id
1174: from jai_ap_tds_thhold_grps
1175: where vendor_id = p_vendor_id
1176: and section_type = p_section_type --rchandan for bug#4428980
1170:
1171: cursor c_get_threshold_group
1172: (p_vendor_id number, p_tan_no varchar2, p_pan_no varchar2, p_tds_section_code varchar2 , p_fin_year number,p_section_type jai_ap_tds_thhold_grps.section_type%type) is--rchandan for bug#4428980
1173: select threshold_grp_id
1174: from jai_ap_tds_thhold_grps
1175: where vendor_id = p_vendor_id
1176: and section_type = p_section_type --rchandan for bug#4428980
1177: and section_code = p_tds_section_code
1178: and org_tan_num = p_tan_no
1252: /* if there is no threshold group details,
1253: it means no transaction has happened for that section and vendor combination */
1254: if ln_threshold_grp_id is not null then
1255: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
1256: open c_jai_ap_tds_thhold_grps(ln_threshold_grp_id);
1257: fetch c_jai_ap_tds_thhold_grps into ln_total_invoice_amount;
1258: close c_jai_ap_tds_thhold_grps;
1259: p_threshold_grp_id := ln_threshold_grp_id;
1260: end if;
1253: it means no transaction has happened for that section and vendor combination */
1254: if ln_threshold_grp_id is not null then
1255: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
1256: open c_jai_ap_tds_thhold_grps(ln_threshold_grp_id);
1257: fetch c_jai_ap_tds_thhold_grps into ln_total_invoice_amount;
1258: close c_jai_ap_tds_thhold_grps;
1259: p_threshold_grp_id := ln_threshold_grp_id;
1260: end if;
1261:
1254: if ln_threshold_grp_id is not null then
1255: p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6 */
1256: open c_jai_ap_tds_thhold_grps(ln_threshold_grp_id);
1257: fetch c_jai_ap_tds_thhold_grps into ln_total_invoice_amount;
1258: close c_jai_ap_tds_thhold_grps;
1259: p_threshold_grp_id := ln_threshold_grp_id;
1260: end if;
1261:
1262: ln_total_invoice_amount := nvl(ln_total_invoice_amount, 0 ) ;