2125:
2126: cursor get_vendor_site_name(cn_vendor_site_id number)
2127: is
2128: select vendor_site_code
2129: FROM po_vendor_sites_all
2130: where vendor_site_id = cn_vendor_site_id;
2131:
2132:
2133: lv_vendor_name po_vendors.vendor_name%type;
2130: where vendor_site_id = cn_vendor_site_id;
2131:
2132:
2133: lv_vendor_name po_vendors.vendor_name%type;
2134: lv_vendor_site_name po_vendor_sites_all.vendor_site_code%type;
2135:
2136: lv_attr_code VARCHAR2(25);
2137: lv_attr_type_code VARCHAR2(25);
2138: lv_tds_regime VARCHAR2(25);
2579: select c.pan_no pan_no,
2580: d.org_tan_num tan_no,
2581: c.confirm_pan_flag confirm_pan_flag /*Fixing QA Bug 12431997 - Included in 11896260*/
2582: from po_vendors a,
2583: po_vendor_sites_all b,
2584: JAI_AP_TDS_VENDOR_HDRS c,
2585: jai_ap_tds_org_tan_v d --rchandan for bug#4323338
2586: where a.vendor_id = b.vendor_id
2587: and b.vendor_id = c.vendor_id
5875: accts_pay_code_combination_id -- Bug 9759709
5876: from ap_invoices_all
5877: where invoice_id = cp_invoice_id;
5878:
5879: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
5880: select terms_id,
5881: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
5882: pay_group_lookup_code
5883: from po_vendor_sites_all
5879: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
5880: select terms_id,
5881: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
5882: pay_group_lookup_code
5883: from po_vendor_sites_all
5884: where vendor_id = cp_vendor_id
5885: and vendor_site_id = cp_vendor_site_id;
5886:
5887: cursor c_po_vendors(cp_vendor_id number) is
5944: --Add by Chong on 20130130 for bug#16048702 end
5945:
5946: r_ap_invoices_all c_ap_invoices_all%rowtype;
5947: r_ja_in_tax_codes c_ja_in_tax_codes%rowtype;
5948: r_po_vendor_sites_all c_po_vendor_sites_all%rowtype;
5949: r_po_vendors c_po_vendors%rowtype;
5950: r_gl_sets_of_books c_gl_sets_of_books%rowtype;
5951: r_ap_payment_schedules_all c_ap_payment_schedules_all%rowtype;
5952:
6043: fetch c_ap_invoices_all into r_ap_invoices_all;
6044: close c_ap_invoices_all;
6045:
6046: /*
6047: || moved this up from the under the cursor - c_po_vendor_sites_all by Ramananda for Bug#4562793
6048: */
6049: open c_ja_in_tax_codes(pn_tax_id);
6050: fetch c_ja_in_tax_codes into r_ja_in_tax_codes;
6051: close c_ja_in_tax_codes;
6058: fetch c_po_vendors into r_po_vendors;
6059: close c_po_vendors;
6060:
6061: /*
6062: || open c_po_vendor_sites_all(r_ap_invoices_all.vendor_id, r_ap_invoices_all.vendor_site_id);
6063: || Commented the above and added the below by sanjikum for Bug#4562793
6064: */
6065: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
6066: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
6061: /*
6062: || open c_po_vendor_sites_all(r_ap_invoices_all.vendor_id, r_ap_invoices_all.vendor_site_id);
6063: || Commented the above and added the below by sanjikum for Bug#4562793
6064: */
6065: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
6066: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
6067: close c_po_vendor_sites_all;
6068:
6069: open c_gl_sets_of_books(r_ap_invoices_all.set_of_books_id);
6062: || open c_po_vendor_sites_all(r_ap_invoices_all.vendor_id, r_ap_invoices_all.vendor_site_id);
6063: || Commented the above and added the below by sanjikum for Bug#4562793
6064: */
6065: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
6066: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
6067: close c_po_vendor_sites_all;
6068:
6069: open c_gl_sets_of_books(r_ap_invoices_all.set_of_books_id);
6070: fetch c_gl_sets_of_books into r_gl_sets_of_books;
6063: || Commented the above and added the below by sanjikum for Bug#4562793
6064: */
6065: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
6066: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
6067: close c_po_vendor_sites_all;
6068:
6069: open c_gl_sets_of_books(r_ap_invoices_all.set_of_books_id);
6070: fetch c_gl_sets_of_books into r_gl_sets_of_books;
6071: close c_gl_sets_of_books;
6088: end if;
6089: /*Bug # 7410219 - End*/
6090:
6091: /* Get the payment details from the vendor site */
6092: ln_terms_id := r_po_vendor_sites_all.terms_id;
6093: -- lv_payment_method_lookup_code := r_po_vendor_sites_all.payment_method_lookup_code;--commented by Sanjikum for Bug#4482462
6094: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
6095:
6096:
6089: /*Bug # 7410219 - End*/
6090:
6091: /* Get the payment details from the vendor site */
6092: ln_terms_id := r_po_vendor_sites_all.terms_id;
6093: -- lv_payment_method_lookup_code := r_po_vendor_sites_all.payment_method_lookup_code;--commented by Sanjikum for Bug#4482462
6094: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
6095:
6096:
6097: if (
6090:
6091: /* Get the payment details from the vendor site */
6092: ln_terms_id := r_po_vendor_sites_all.terms_id;
6093: -- lv_payment_method_lookup_code := r_po_vendor_sites_all.payment_method_lookup_code;--commented by Sanjikum for Bug#4482462
6094: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
6095:
6096:
6097: if (
6098: ln_terms_id is null or
6795: accts_pay_code_combination_id -- Bug 9759709
6796: from ap_invoices_all
6797: where invoice_id = cp_invoice_id;
6798:
6799: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
6800: select terms_id,
6801: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
6802: pay_group_lookup_code
6803: from po_vendor_sites_all
6799: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
6800: select terms_id,
6801: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
6802: pay_group_lookup_code
6803: from po_vendor_sites_all
6804: where vendor_id = cp_vendor_id
6805: and vendor_site_id = cp_vendor_site_id;
6806:
6807: cursor c_po_vendors(cp_vendor_id number) is
6839: where invoice_id = p_invoice_id;
6840:
6841: r_ap_invoices_all c_ap_invoices_all%rowtype;
6842: r_ja_in_tax_codes c_ja_in_tax_codes%rowtype;
6843: r_po_vendor_sites_all c_po_vendor_sites_all%rowtype;
6844: r_po_vendors c_po_vendors%rowtype;
6845: r_gl_sets_of_books c_gl_sets_of_books%rowtype;
6846: r_ap_payment_schedules_all c_ap_payment_schedules_all%rowtype;
6847:
7102: fetch c_ap_invoices_all into r_ap_invoices_all;
7103: close c_ap_invoices_all;
7104:
7105: /*
7106: || moved this up from the under the cursor - c_po_vendor_sites_all by Ramananda for Bug#4562793
7107: */
7108:
7109:
7110: open c_gl_sets_of_books(r_ap_invoices_all.set_of_books_id);
7451: fetch c_po_vendors into r_po_vendors;
7452: close c_po_vendors;
7453:
7454:
7455: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
7456: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
7457: close c_po_vendor_sites_all;
7458:
7459:
7452: close c_po_vendors;
7453:
7454:
7455: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
7456: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
7457: close c_po_vendor_sites_all;
7458:
7459:
7460: ln_terms_id := r_po_vendor_sites_all.terms_id;
7453:
7454:
7455: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
7456: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
7457: close c_po_vendor_sites_all;
7458:
7459:
7460: ln_terms_id := r_po_vendor_sites_all.terms_id;
7461: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
7456: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
7457: close c_po_vendor_sites_all;
7458:
7459:
7460: ln_terms_id := r_po_vendor_sites_all.terms_id;
7461: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
7462:
7463:
7464: if ((ln_terms_id is null) or (lv_pay_group_lookup_code is null))then
7457: close c_po_vendor_sites_all;
7458:
7459:
7460: ln_terms_id := r_po_vendor_sites_all.terms_id;
7461: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
7462:
7463:
7464: if ((ln_terms_id is null) or (lv_pay_group_lookup_code is null))then
7465:
10314: accts_pay_code_combination_id -- Bug 9759709
10315: from ap_invoices_all
10316: where invoice_id = cp_invoice_id;
10317:
10318: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
10319: select terms_id,
10320: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
10321: pay_group_lookup_code
10322: from po_vendor_sites_all
10318: cursor c_po_vendor_sites_all(cp_vendor_id number, cp_vendor_site_id number) is
10319: select terms_id,
10320: --payment_method_lookup_code, --commented by Sanjikum for Bug#4482462
10321: pay_group_lookup_code
10322: from po_vendor_sites_all
10323: where vendor_id = cp_vendor_id
10324: and vendor_site_id = cp_vendor_site_id;
10325:
10326: cursor c_po_vendors(cp_vendor_id number) is
10368: where invoice_id = p_invoice_id;
10369:
10370: r_ap_invoices_all c_ap_invoices_all%rowtype;
10371: r_ja_in_tax_codes c_ja_in_tax_codes%rowtype;
10372: r_po_vendor_sites_all c_po_vendor_sites_all%rowtype;
10373: r_po_vendors c_po_vendors%rowtype;
10374: r_gl_sets_of_books c_gl_sets_of_books%rowtype;
10375: r_ap_payment_schedules_all c_ap_payment_schedules_all%rowtype;
10376:
10747: fetch c_po_vendors into r_po_vendors;
10748: close c_po_vendors;
10749:
10750:
10751: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
10752: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
10753: close c_po_vendor_sites_all;
10754:
10755:
10748: close c_po_vendors;
10749:
10750:
10751: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
10752: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
10753: close c_po_vendor_sites_all;
10754:
10755:
10756: ln_terms_id := r_po_vendor_sites_all.terms_id;
10749:
10750:
10751: open c_po_vendor_sites_all(r_ja_in_tax_codes.vendor_id, r_ja_in_tax_codes.vendor_site_id);
10752: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
10753: close c_po_vendor_sites_all;
10754:
10755:
10756: ln_terms_id := r_po_vendor_sites_all.terms_id;
10757: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
10752: fetch c_po_vendor_sites_all into r_po_vendor_sites_all;
10753: close c_po_vendor_sites_all;
10754:
10755:
10756: ln_terms_id := r_po_vendor_sites_all.terms_id;
10757: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
10758:
10759:
10760: if ((ln_terms_id is null) or (lv_pay_group_lookup_code is null))then
10753: close c_po_vendor_sites_all;
10754:
10755:
10756: ln_terms_id := r_po_vendor_sites_all.terms_id;
10757: lv_pay_group_lookup_code := r_po_vendor_sites_all.pay_group_lookup_code;
10758:
10759:
10760: if ((ln_terms_id is null) or (lv_pay_group_lookup_code is null))then
10761: