DBA Data[Home] [Help]

APPS.JAI_AP_TDS_OLD_PKG dependencies on AP_INVOICE_DISTRIBUTIONS_ALL

Line 125: FROM ap_invoice_distributions_all

121: accts_pay_code_combination_id,
122: period_name,set_of_books_id,
123: amount,match_status_flag,base_amount_to_post,prepay_amount_remaining,
124: parent_invoice_id,org_id,description
125: FROM ap_invoice_distributions_all
126: WHERE invoice_id = inv_id
127: AND distribution_line_number = (SELECT MAX(distribution_line_number)
128: FROM ap_invoice_distributions_all
129: WHERE invoice_id = inv_id);

Line 128: FROM ap_invoice_distributions_all

124: parent_invoice_id,org_id,description
125: FROM ap_invoice_distributions_all
126: WHERE invoice_id = inv_id
127: AND distribution_line_number = (SELECT MAX(distribution_line_number)
128: FROM ap_invoice_distributions_all
129: WHERE invoice_id = inv_id);
130:
131: CURSOR for_std_invoice(inv_id NUMBER) IS
132: SELECT invoice_type_lookup_code,vendor_id,vendor_site_id,invoice_currency_code,

Line 584: INSERT INTO ap_invoice_distributions_all

580:
581:
582: /* Start comment for bug#3536079
583:
584: INSERT INTO ap_invoice_distributions_all
585: (
586: accounting_date,
587: accrual_posted_flag,
588: reversal_flag,

Line 966: FROM ap_invoice_distributions_all

962: IS
963:
964: /* CURSOR check_prep_amt_app(p_id NUMBER,inv_id NUMBER) IS
965: SELECT amount amt_app
966: FROM ap_invoice_distributions_all
967: WHERE prepay_distribution_id = p_id
968: AND invoice_id = inv_id
969: AND amount < 0 ;
970: */

Line 976: FROM ap_invoice_distributions_all

972: -- above definition comented by Aparajita Reopen issue - 1 for bug #2461706 and replaced by code below
973:
974: CURSOR check_prep_amt_app(p_id NUMBER,inv_id NUMBER) IS
975: SELECT -1 * amount amt_app
976: FROM ap_invoice_distributions_all
977: WHERE invoice_id = inv_id
978: AND invoice_distribution_id = p_inv_dist_id
979: AND prepay_distribution_id = p_id
980: -- AND amount < 0 ;

Line 985: FROM ap_invoice_distributions_all

981: ;
982:
983: CURSOR check_prep_amt_unapp(p_id NUMBER,inv_id NUMBER) IS
984: SELECT amount amt_unapp
985: FROM ap_invoice_distributions_all
986: WHERE prepay_distribution_id = p_id
987: AND invoice_id = inv_id
988: AND amount >0 ;
989:

Line 1010: FROM ap_invoice_distributions_all

1006: organization_id
1007: FROM JAI_AP_TDS_INVOICES
1008: WHERE source_attribute=p_att
1009: AND invoice_id = (SELECT invoice_id
1010: FROM ap_invoice_distributions_all
1011: WHERE invoice_distribution_id=prepay_dist_id);
1012:
1013: /*CURSOR check_for_tds_invoice(inv_id NUMBER) IS
1014: SELECT tds_invoice_num,invoice_id,invoice_amount,amt_reversed,amt_applied,tds_tax_id,organization_id

Line 1039: FROM ap_invoice_distributions_all

1035: accts_pay_code_combination_id,
1036: period_name,set_of_books_id,
1037: amount,match_status_flag,base_amount_to_post,prepay_amount_remaining,
1038: parent_invoice_id,org_id,description
1039: FROM ap_invoice_distributions_all
1040: WHERE invoice_id = inv_id
1041: AND distribution_line_number = (SELECT MAX(distribution_line_number)
1042: FROM ap_invoice_distributions_all
1043: WHERE invoice_id = inv_id);

Line 1042: FROM ap_invoice_distributions_all

1038: parent_invoice_id,org_id,description
1039: FROM ap_invoice_distributions_all
1040: WHERE invoice_id = inv_id
1041: AND distribution_line_number = (SELECT MAX(distribution_line_number)
1042: FROM ap_invoice_distributions_all
1043: WHERE invoice_id = inv_id);
1044:
1045: CURSOR for_std_invoice(inv_id NUMBER) IS
1046: SELECT invoice_type_lookup_code,vendor_id,vendor_site_id,invoice_currency_code,

Line 1056: FROM ap_invoice_distributions_all

1052: WHERE invoice_id = inv_id;
1053:
1054: CURSOR for_payment_amount(inv_id NUMBER) IS
1055: SELECT amount
1056: FROM ap_invoice_distributions_all
1057: WHERE invoice_id = inv_id
1058: AND distribution_line_number = 1;
1059:
1060: CURSOR for_approved_amount(inv_id NUMBER) IS

Line 1088: FROM ap_invoice_distributions_all

1084: --Added by Abhay on 20-JAN-2000 to tackle unapplication of prepayment {
1085:
1086: CURSOR fetch_amount(inv_id NUMBER) IS
1087: SELECT amount
1088: FROM ap_invoice_distributions_all
1089: WHERE invoice_id = inv_id
1090: AND distribution_line_number = 1;
1091:
1092: --Added by Abhay on 20-JAN-2000 to tackle unapplication of prepayment }

Line 1102: from ap_invoice_distributions_all

1098: */
1099:
1100: Cursor get_prepay_dist_date is -- bug 3112711 kpvs
1101: select accounting_date
1102: from ap_invoice_distributions_all
1103: where invoice_distribution_id = p_inv_dist_id;
1104:
1105: CURSOR cur_prnt_pay_priority -- Ravi
1106: IS

Line 1175: v_prepay_dist_date ap_invoice_distributions_all.accounting_date%TYPE; -- bug 3112711 kpvs

1171: v_tds_tax_id NUMBER;
1172: v_organization_id NUMBER;
1173: -- variables added by Aparajita on 08-jul-2002 for bug # 2461706
1174:
1175: v_prepay_dist_date ap_invoice_distributions_all.accounting_date%TYPE; -- bug 3112711 kpvs
1176:
1177: v_insertion_amount_tds_si NUMBER := 0; -- bug#3469847
1178: ln_prnt_pay_priority ap_payment_schedules_all.payment_priority%TYPE;
1179: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE;

Line 1242: created in ap_invoice_distributions_all .

1238: 6 15/01/2003 Aparajita for Bug # 2738340. RCS version 615.6
1239: Added the commit interval parameter in the request for APXIIMPT. This was missing.
1240: 7 15/10/2003 kpvs for bug # 3112711, version 616.1
1241: Cursor get_prepay_dist_date incorporated to get the GL date of the distribution line
1242: created in ap_invoice_distributions_all .
1243:
1244: This date is inserted as invoice_date into ap_invoices_interface
1245: and as accounting_date into ap_invoice_lines_interface.
1246: This would ensure that the invoice date and GL date of the TDS invoices

Line 1885: FROM ap_invoice_distributions_all

1881: organization_id
1882: FROM JAI_AP_TDS_INVOICES
1883: WHERE source_attribute=p_att
1884: AND invoice_id = (SELECT invoice_id
1885: FROM ap_invoice_distributions_all
1886: WHERE invoice_distribution_id=prepay_dist_id);
1887:
1888: CURSOR for_vendor_id(t_id NUMBER) IS
1889: SELECT vendor_id

Line 1921: FROM ap_invoice_distributions_all

1917: prepay_amount_remaining,
1918: parent_invoice_id,
1919: org_id,
1920: description
1921: FROM ap_invoice_distributions_all
1922: WHERE invoice_id = inv_id
1923: AND distribution_line_number = (SELECT MAX(distribution_line_number)
1924: FROM ap_invoice_distributions_all
1925: WHERE invoice_id = inv_id);

Line 1924: FROM ap_invoice_distributions_all

1920: description
1921: FROM ap_invoice_distributions_all
1922: WHERE invoice_id = inv_id
1923: AND distribution_line_number = (SELECT MAX(distribution_line_number)
1924: FROM ap_invoice_distributions_all
1925: WHERE invoice_id = inv_id);
1926:
1927: CURSOR for_std_invoice(inv_id NUMBER) IS
1928: SELECT invoice_type_lookup_code,

Line 1948: FROM ap_invoice_distributions_all

1944: WHERE invoice_id = inv_id;
1945:
1946: CURSOR for_payment_amount(inv_id NUMBER) IS
1947: SELECT amount
1948: FROM ap_invoice_distributions_all
1949: WHERE invoice_id = inv_id
1950: AND distribution_line_number = 1;
1951:
1952: CURSOR Fetch_Invoice_Num_Cur IS

Line 2041: from ap_invoice_distributions_all

2037: WHERE invoice_id = v_inv_id;
2038:
2039: Cursor get_prepay_dist_date is -- bug 3112711 kpvs
2040: select accounting_date
2041: from ap_invoice_distributions_all
2042: where invoice_distribution_id = p_invoice_distribution_id;
2043:
2044: CURSOR cur_prnt_pay_priority -- 4333449
2045: IS

Line 2071: v_prepay_dist_date ap_invoice_distributions_all.accounting_date%TYPE; -- bug 3112711 kpvs

2067: ---end addition of 02-Feb-2002
2068: -- following added by Aparajita on 07/07/2002 for bug 2439034
2069: v_ap_tds_cm_num ap_invoices_all.invoice_num%TYPE;
2070: v_ap_sup_inv_num ap_invoices_all.invoice_num%TYPE;
2071: v_prepay_dist_date ap_invoice_distributions_all.accounting_date%TYPE; -- bug 3112711 kpvs
2072: ln_prnt_pay_priority ap_payment_schedules_all.payment_priority%TYPE; -- 4333449
2073: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE; --4333449
2074: ln_tax_rate JAI_AP_TDS_INVOICES.tds_tax_rate%type; -- 4333449
2075: ln_tax_amount JAI_AP_TDS_INVOICES.tds_amount%type; -- 4333449

Line 2123: Cursor c_inv_distribution_details(cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type,

2119: v_return_inv_amt number;
2120:
2121: -- cursor to fetch the distribution lines having taxes which are not prepayment lines.
2122: -- reversed lines if any also should not be considered.
2123: Cursor c_inv_distribution_details(cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type,
2124: cp_global_attribute_category ap_invoice_distributions_all.global_attribute_category%TYPE ) is--rchandan for bug#4428980
2125: select amount, prepay_distribution_id, global_attribute1, global_attribute2, global_attribute3 -- rchandan for bug#4333488
2126: from ap_invoice_distributions_all
2127: where invoice_id = p_invoice_id

Line 2124: cp_global_attribute_category ap_invoice_distributions_all.global_attribute_category%TYPE ) is--rchandan for bug#4428980

2120:
2121: -- cursor to fetch the distribution lines having taxes which are not prepayment lines.
2122: -- reversed lines if any also should not be considered.
2123: Cursor c_inv_distribution_details(cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type,
2124: cp_global_attribute_category ap_invoice_distributions_all.global_attribute_category%TYPE ) is--rchandan for bug#4428980
2125: select amount, prepay_distribution_id, global_attribute1, global_attribute2, global_attribute3 -- rchandan for bug#4333488
2126: from ap_invoice_distributions_all
2127: where invoice_id = p_invoice_id
2128: and nvl(reversal_flag, 'N') <> 'Y'

Line 2126: from ap_invoice_distributions_all

2122: -- reversed lines if any also should not be considered.
2123: Cursor c_inv_distribution_details(cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type,
2124: cp_global_attribute_category ap_invoice_distributions_all.global_attribute_category%TYPE ) is--rchandan for bug#4428980
2125: select amount, prepay_distribution_id, global_attribute1, global_attribute2, global_attribute3 -- rchandan for bug#4333488
2126: from ap_invoice_distributions_all
2127: where invoice_id = p_invoice_id
2128: and nvl(reversal_flag, 'N') <> 'Y'
2129: and line_type_lookup_code <> cp_line_type_lookup_code--rchandan for bug#4428980
2130: and global_attribute_category = cp_global_attribute_category--rchandan for bug#4428980

Line 2137: from ap_invoice_distributions_all si ,

2133:
2134: -- cursor to get the total of prepayment amoun having tds already applied
2135: Cursor c_inv_prepayments is
2136: select si.amount amount, pp.global_attribute1 global_attribute1, pp.global_attribute2 global_attribute2, pp.global_attribute3 global_attribute3 -- rchandan for bug#4333488
2137: from ap_invoice_distributions_all si ,
2138: ap_invoice_distributions_all pp
2139: where si.invoice_id= p_invoice_id
2140: and si.invoice_distribution_id <> p_distribution_id
2141: and si.prepay_distribution_id = pp.invoice_distribution_id;

Line 2138: ap_invoice_distributions_all pp

2134: -- cursor to get the total of prepayment amoun having tds already applied
2135: Cursor c_inv_prepayments is
2136: select si.amount amount, pp.global_attribute1 global_attribute1, pp.global_attribute2 global_attribute2, pp.global_attribute3 global_attribute3 -- rchandan for bug#4333488
2137: from ap_invoice_distributions_all si ,
2138: ap_invoice_distributions_all pp
2139: where si.invoice_id= p_invoice_id
2140: and si.invoice_distribution_id <> p_distribution_id
2141: and si.prepay_distribution_id = pp.invoice_distribution_id;
2142:

Line 2388: distribution line created in ap_invoice_distributions_all when the prepay invoice

2384: return invoices generation is required.
2385:
2386: 17. 15/10/2003 kpvs bug # 3112711 kpvs, version 616.1
2387: Cursor get_prepay_dist_date incorporated to get the GL date of the negative
2388: distribution line created in ap_invoice_distributions_all when the prepay invoice
2389: is applied to a standard invoice.
2390:
2391: This date is inserted as invoice_date into ap_invoices_interface and as
2392: accounting_date into ap_invoice_lines_interface. This would ensure that the CM for

Line 2423: be populated in the attribute columns of ap_invoice_distributions_all table

2419:
2420: 21 11/05/2005 rchandan for bug#4333488. Version 116.2
2421: The Invoice Distribution DFF is eliminated and a new global DFF is used to
2422: maintain the functionality. From now the TDS tax, WCT tax and ESSI will not
2423: be populated in the attribute columns of ap_invoice_distributions_all table
2424: instead these will be populated in the global attribute columns. So the code changes are
2425: made accordingly.
2426: 22. 14-Jul-2005 rchandan for bug#4487676.File version 117.2
2427: Sequnece jai_ap_tds_invoice_num_s is renamed to JAI_AP_TDS_THHOLD_TRXS_S1

Line 3635: CURSOR check_dist_type(inv NUMBER,cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type) IS

3631: SELECT cancelled_date
3632: FROM ap_invoices_all
3633: WHERE invoice_id = inv_id;
3634: ----------------------------------------- PREPAY -------------------------------------
3635: CURSOR check_dist_type(inv NUMBER,cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type) IS
3636: SELECT invoice_id, invoice_distribution_id, amount, org_id,prepay_distribution_id,line_type_lookup_code,
3637: last_updated_by,last_update_date,created_by,creation_date
3638: FROM ap_invoice_distributions_all
3639: WHERE invoice_id = inv

Line 3638: FROM ap_invoice_distributions_all

3634: ----------------------------------------- PREPAY -------------------------------------
3635: CURSOR check_dist_type(inv NUMBER,cp_line_type_lookup_code ap_invoice_distributions_all.line_type_lookup_code%type) IS
3636: SELECT invoice_id, invoice_distribution_id, amount, org_id,prepay_distribution_id,line_type_lookup_code,
3637: last_updated_by,last_update_date,created_by,creation_date
3638: FROM ap_invoice_distributions_all
3639: WHERE invoice_id = inv
3640: and distribution_line_number in (select max(distribution_line_number)
3641: from ap_invoice_distributions_all
3642: where invoice_id = inv

Line 3641: from ap_invoice_distributions_all

3637: last_updated_by,last_update_date,created_by,creation_date
3638: FROM ap_invoice_distributions_all
3639: WHERE invoice_id = inv
3640: and distribution_line_number in (select max(distribution_line_number)
3641: from ap_invoice_distributions_all
3642: where invoice_id = inv
3643: and line_type_lookup_code =cp_line_type_lookup_code ) ;
3644: -----------------------------------------------------------------------------------------------
3645: /* added by Ajay Sharma on 15-apr-01 */

Line 3660: FROM ap_invoice_distributions_all

3656: AND Vendor_Id = v_vendor_id
3657: AND Vendor_Site_Id = v_vendor_site_id
3658: --following added by Aparajita to avoid approval of already approved invoice on 07/07/2002.
3659: AND NOT EXISTS (SELECT '1'
3660: FROM ap_invoice_distributions_all
3661: WHERE invoice_id = inv.invoice_id
3662: AND NVL(match_status_flag, 'T') = 'A')
3663: ;
3664:

Line 4211: FROM ap_invoice_distributions_all

4207:
4208: -----------------------------------------------------------------------------------
4209: CURSOR approval_cursor IS
4210: SELECT match_status_flag
4211: FROM ap_invoice_distributions_all
4212: WHERE invoice_id = l_invoice_id
4213: UNION
4214: SELECT 'N'
4215: FROM ap_invoice_distributions_all

Line 4215: FROM ap_invoice_distributions_all

4211: FROM ap_invoice_distributions_all
4212: WHERE invoice_id = l_invoice_id
4213: UNION
4214: SELECT 'N'
4215: FROM ap_invoice_distributions_all
4216: WHERE invoice_id = l_invoice_id
4217: AND match_status_flag IS NULL
4218: AND EXISTS
4219: (SELECT 'There are both untested and tested lines'

Line 4220: FROM ap_invoice_distributions_all

4216: WHERE invoice_id = l_invoice_id
4217: AND match_status_flag IS NULL
4218: AND EXISTS
4219: (SELECT 'There are both untested and tested lines'
4220: FROM ap_invoice_distributions_all
4221: WHERE invoice_id = l_invoice_id
4222: AND match_status_flag IN ('T','A'));
4223: BEGIN
4224: