DBA Data[Home] [Help]

APPS.JAI_AP_TDS_OLD_PKG dependencies on AP_INVOICES_ALL

Line 97: from ap_invoices_all

93: created_by,
94: last_update_date,
95: last_updated_by,
96: last_update_login
97: from ap_invoices_all
98: where invoice_id = p_inv_id;
99:
100: CURSOR tds_invoices(inv_id NUMBER) IS
101: SELECT tds_invoice_num,tds_tax_id,dm_invoice_num,tds_amount,tds_tax_rate,invoice_amount -- 4333449

Line 113: FROM ap_invoices_all

109:
110:
111: CURSOR for_payment_status(inv_num VARCHAR2,vend_id NUMBER,organization NUMBER) IS ----for information about tds invoice
112: SELECT payment_status_flag,invoice_amount,invoice_id, cancelled_date
113: FROM ap_invoices_all
114: WHERE invoice_num = inv_num
115: AND vendor_id = vend_id
116: AND NVL(org_id, 0) = NVL(organization, 0);
117:

Line 135: FROM ap_invoices_all

131: CURSOR for_std_invoice(inv_id NUMBER) IS
132: SELECT invoice_type_lookup_code,vendor_id,vendor_site_id,invoice_currency_code,
133: exchange_rate,exchange_rate_type,exchange_date,terms_id,payment_method_lookup_code,
134: pay_group_lookup_code,goods_received_date,invoice_received_date --added on 03-12-2001
135: FROM ap_invoices_all
136: WHERE invoice_id = inv_id;
137:
138: CURSOR Fetch_Inv_Date_Cur( inv_id IN NUMBER ) IS
139: SELECT Invoice_date

Line 140: FROM Ap_Invoices_All

136: WHERE invoice_id = inv_id;
137:
138: CURSOR Fetch_Inv_Date_Cur( inv_id IN NUMBER ) IS
139: SELECT Invoice_date
140: FROM Ap_Invoices_All
141: WHERE Invoice_Id = inv_id;
142:
143: CURSOR Fetch_App_Inv_Flag_Cur( p_vendor_id IN NUMBER, p_vendor_site_id IN NUMBER ) IS
144: SELECT NVL( Approved_Invoice_Flag, 'N' ) Approved_Invoice_Flag

Line 155: from ap_invoices_all

151: p_vendor_id in number,
152: p_vendor_site_id in number
153: ) is
154: select -1 * invoice_amount
155: from ap_invoices_all
156: where invoice_num = p_invoice_num
157: and vendor_id = p_vendor_id
158: and vendor_site_id = p_vendor_site_id;
159:

Line 169: FROM ap_invoices_all

165:
166: CURSOR cur_prnt_exchange_rate -- 4333449
167: IS
168: SELECT exchange_rate
169: FROM ap_invoices_all
170: WHERE invoice_id = p_invoice_id;
171:
172: -- end added for bug#3556035
173:

Line 217: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE; --4333449

213: v_out_pay_curr_inv_amount number;
214: v_return_value boolean;
215: ln_invoice_id NUMBER; --4333449
216: ln_prnt_pay_priority ap_payment_schedules_all.payment_priority%TYPE; -- 4333449
217: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE; --4333449
218: lv_invoice_num ap_invoices_interface.invoice_num%type; --rchandan for bug#4428980
219: lv_description ap_invoices_interface.description%type;--rchandan for bug#4428980
220: lv_lookup_type_code ap_invoices_interface.invoice_type_lookup_code%type;--rchandan for bug#4428980
221: lv_source ap_invoices_interface.source%type;--rchandan for bug#4428980

Line 230: from ap_invoices_all

226: cursor c_get_cm_status(p_invoice_num in varchar2,
227: p_vendor_id in number,
228: p_vendor_site_id in number)is
229: select cancelled_date
230: from ap_invoices_all
231: where invoice_num = p_invoice_num
232: and vendor_id = p_vendor_id
233: and vendor_site_id = p_vendor_site_id ;
234:

Line 300: invoice. It was not updating the pay_curr_invoice_amount field in ap_invoices_all for the

296: supplier on cancellation of the vendor invoice.
297:
298: 9. 29-oct-2003 Aparajita for bug#3205957. Version#616.3
299: When the base invoice is getting cancelled, this procedure is cancelling the related tds
300: invoice. It was not updating the pay_curr_invoice_amount field in ap_invoices_all for the
301: tds invoice. Because of this the amount was still being displayed as before cancellation
302: in the payment schedule screen. Added code to update it to 0.
303:
304: 10. 8-apr-2004 Aparajita for bug#3536079. Version#619.1

Line 338: cannot update null into ap_invoices_all.last_update_date. This error was captured in

334:
335: 13. 31-jan-2005 rchandan - bug#4149343 - File version 115.1
336:
337: When an invoice is cancelled , it was not getting cancelled and instead throwing an error
338: cannot update null into ap_invoices_all.last_update_date. This error was captured in
339: JAI_CMN_ERRORS_T on the client's instance through an exception handler.
340: The value to be set into this column was retreived through an API call to ap_cancel_pkg.Ap_Cancel_Single_Invoice
341:
342: Due to some internal exception, the out parameter corresponding to the the last_update_date is null

Line 348: As part of this fix , removed the last_update_date from the columns in the update ap_invoices_all

344: Spoke to lgopalsa she was of the opinion that in the ap_cancel_pkg.Ap_Cancel_Single_Invoice API ,
345: the standard who columns are being set anyway and there is no need to set it explicitly in the
346: procedure.
347:
348: As part of this fix , removed the last_update_date from the columns in the update ap_invoices_all
349: table.
350:
351: 14 25/3/2005 Aparajita - Bug#4088186 . File Version # 115.3 TDS Clean up.
352:

Line 440: UPDATE ap_invoices_all

436: lv_statement_no := '5';
437:
438: /* Start comment for bug#3536079
439:
440: UPDATE ap_invoices_all
441: SET cancelled_date = SYSDATE,
442: cancelled_amount = for_pay_status_tds_rec.invoice_amount,
443: cancelled_by = cancelled_invoices_rec.last_updated_by,
444: base_amount = 0,

Line 458: from ap_invoices_all

454: amount_remaining = 0
455: -- , inv_curr_gross_amount = 0
456: -- base applications is not updating this field when a standard invoice is cancelled. so not updating this field in our code also
457: WHERE invoice_id in (select invoice_id
458: from ap_invoices_all
459: WHERE invoice_num = tds_invoices_rec.tds_invoice_num
460: AND vendor_id = vendor_rec.vendor_id
461: AND NVL(org_id, 999999) = NVL(cancelled_invoices_rec.org_id, 999999)
462: );

Line 494: /*UPDATE ap_invoices_all

490:
491:
492:
493: --REVERSE THE DISRTIBUTION LINE IN THE TDS INVOICE
494: /*UPDATE ap_invoices_all
495: SET invoice_amount = 0
496: WHERE invoice_id = for_pay_status_tds_rec.invoice_id;
497: */
498:

Line 565: update ap_invoices_all

561: 'India Localization - cancel TDS invoice'
562: );
563:
564:
565: update ap_invoices_all
566: set
567: invoice_amount = v_out_invoice_amount ,
568: base_amount = v_out_base_amount ,
569: tax_amount = v_out_tax_amount ,

Line 1027: FROM ap_invoices_all

1023:
1024: CURSOR for_payment_status(inv_num VARCHAR2,vend_id NUMBER,organization NUMBER) IS
1025: ----for information about tds invoice
1026: SELECT payment_status_flag,invoice_amount,invoice_id
1027: FROM ap_invoices_all
1028: WHERE invoice_num = inv_num
1029: AND vendor_id = vend_id
1030: AND NVL(org_id, 0) = NVL(organization, 0);
1031:

Line 1051: FROM ap_invoices_all

1047: exchange_rate,exchange_rate_type,exchange_date,terms_id,payment_method_lookup_code,
1048: pay_group_lookup_code,invoice_num,
1049: invoice_received_date, -- added by Aparajita on 10/07/2002 for bug # 2439034
1050: goods_received_date -- added by Aparajita on 10/07/2002 for bug # 2439034
1051: FROM ap_invoices_all
1052: WHERE invoice_id = inv_id;
1053:
1054: CURSOR for_payment_amount(inv_id NUMBER) IS
1055: SELECT amount

Line 1062: FROM ap_invoices_all

1058: AND distribution_line_number = 1;
1059:
1060: CURSOR for_approved_amount(inv_id NUMBER) IS
1061: SELECT approved_amount,amount_applicable_to_discount
1062: FROM ap_invoices_all
1063: WHERE invoice_id = inv_id;
1064:
1065: CURSOR Fetch_Invoice_Num_Cur IS
1066: SELECT Invoice_Num

Line 1067: FROM Ap_Invoices_All

1063: WHERE invoice_id = inv_id;
1064:
1065: CURSOR Fetch_Invoice_Num_Cur IS
1066: SELECT Invoice_Num
1067: FROM Ap_Invoices_All
1068: WHERE Invoice_Id = p_invoice_id;
1069:
1070: /* CURSOR Fetch_App_Inv_Flag_Cur( p_vendor_id IN NUMBER, p_vendor_site_id IN NUMBER ) IS
1071: SELECT NVL( Approved_Invoice_Flag, 'N' ) Approved_Invoice_Flag

Line 1080: (SELECT vendor_id, vendor_site_id FROM ap_invoices_all WHERE invoice_id = p_inv_id);

1076: CURSOR Fetch_App_Inv_Flag_Cur( p_inv_id IN NUMBER) IS
1077: SELECT NVL( Approved_Invoice_Flag, 'N' ) Approved_Invoice_Flag
1078: FROM JAI_CMN_VENDOR_SITES
1079: WHERE (Vendor_Id, vendor_site_id) =
1080: (SELECT vendor_id, vendor_site_id FROM ap_invoices_all WHERE invoice_id = p_inv_id);
1081:
1082:
1083:
1084: --Added by Abhay on 20-JAN-2000 to tackle unapplication of prepayment {

Line 1114: FROM ap_invoices_all

1110:
1111: CURSOR cur_prnt_exchange_rate -- Ravi
1112: IS
1113: SELECT exchange_rate
1114: FROM ap_invoices_all
1115: WHERE invoice_id = p_invoice_id;
1116:
1117: lv_object_name VARCHAR2(61) ; --:= '.'; /* Added by Ramananda for bug#4407165 */
1118:

Line 1156: v_tds_inv_num ap_invoices_all.invoice_num%TYPE;

1152: insert_amt_ap NUMBER;
1153: insert_inv_id NUMBER;
1154:
1155: -- Start : following variables added by Aparajita on 07/07/2002 for bug # 2439034
1156: v_tds_inv_num ap_invoices_all.invoice_num%TYPE;
1157: v_sup_cm_num ap_invoices_all.invoice_num%TYPE;
1158:
1159: v_tds_inv_run_num NUMBER;
1160: v_sup_cm_run_num NUMBER;

Line 1157: v_sup_cm_num ap_invoices_all.invoice_num%TYPE;

1153: insert_inv_id NUMBER;
1154:
1155: -- Start : following variables added by Aparajita on 07/07/2002 for bug # 2439034
1156: v_tds_inv_num ap_invoices_all.invoice_num%TYPE;
1157: v_sup_cm_num ap_invoices_all.invoice_num%TYPE;
1158:
1159: v_tds_inv_run_num NUMBER;
1160: v_sup_cm_run_num NUMBER;
1161:

Line 1166: v_tds_invoice_num ap_invoices_all.invoice_num%TYPE;

1162: v_Approved_Invoice_Flag CHAR(1); -- := 'N'; -- added by Aparajita for bug # 2441683 on 23/07/2002 --Ramananda for File.Sql.35
1163: -- End : following variables added by Aparajita on 07/07/2002 for bug # 2439034
1164:
1165: -- variables added by Aparajita on 08-jul-2002 for bug # 2461706
1166: v_tds_invoice_num ap_invoices_all.invoice_num%TYPE;
1167: v_invoice_id NUMBER;
1168: v_invoice_amount NUMBER;
1169: v_amt_reversed NUMBER;
1170: v_amt_applied NUMBER;

Line 1179: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE;

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;
1180: ln_tax_rate JAI_AP_TDS_INVOICES.tds_tax_rate%type;
1181: ln_tax_amount JAI_AP_TDS_INVOICES.tds_amount%type;
1182: ln_taxable_amount JAI_AP_TDS_INVOICES.invoice_amount%type;
1183: lv_invoice_num ap_invoices_interface.invoice_num%type; --rchandan for bug#4428980

Line 1897: FROM ap_invoices_all

1893: CURSOR for_payment_status(inv_num VARCHAR2,vend_id NUMBER,organization NUMBER) IS --for information about tds invoice
1894: SELECT payment_status_flag,
1895: invoice_amount,
1896: invoice_id
1897: FROM ap_invoices_all
1898: WHERE invoice_num = inv_num
1899: AND vendor_id = vend_id
1900: AND NVL(org_id, 0) = NVL(organization, 0);
1901:

Line 1943: FROM ap_invoices_all

1939: goods_received_date,
1940: invoice_received_date
1941: --Added the above line by pavan on 06-Jun-01 to populate the goods_received_date
1942: --column for the RTN invoice generated
1943: FROM ap_invoices_all
1944: WHERE invoice_id = inv_id;
1945:
1946: CURSOR for_payment_amount(inv_id NUMBER) IS
1947: SELECT amount

Line 1954: FROM Ap_Invoices_All

1950: AND distribution_line_number = 1;
1951:
1952: CURSOR Fetch_Invoice_Num_Cur IS
1953: SELECT Invoice_Num
1954: FROM Ap_Invoices_All
1955: WHERE Invoice_Id = p_invoice_id;
1956:
1957: CURSOR Fetch_App_Inv_Flag_Cur( p_vendor_id IN NUMBER, p_vendor_site_id IN NUMBER ) IS
1958: SELECT NVL( Approved_Invoice_Flag, 'N' ) Approved_Invoice_Flag

Line 1975: FROM ap_invoices_all

1971: SELECT invoice_amount,
1972: payment_status_flag,
1973: invoice_type_lookup_code,
1974: org_id
1975: FROM ap_invoices_all
1976: WHERE invoice_id = inv_id;
1977:
1978: for_dist_insertion_tds_rec for_distribution_insertion%ROWTYPE;
1979: check_tds_prepayment_rec check_for_tds_invoice%ROWTYPE;

Line 2036: FROM ap_invoices_all

2032: get_base_inv_id_rec get_base_inv_id%ROWTYPE;
2033:
2034: CURSOR get_exchange_rate_base_inv(v_inv_id NUMBER) IS
2035: SELECT exchange_rate
2036: FROM ap_invoices_all
2037: WHERE invoice_id = v_inv_id;
2038:
2039: Cursor get_prepay_dist_date is -- bug 3112711 kpvs
2040: select accounting_date

Line 2053: FROM ap_invoices_all

2049:
2050: CURSOR cur_prnt_exchange_rate -- 4333449
2051: IS
2052: SELECT exchange_rate
2053: FROM ap_invoices_all
2054: WHERE invoice_id = p_invoice_id;
2055:
2056:
2057: get_exchange_rate_base_inv_rec get_exchange_rate_base_inv%ROWTYPE;

Line 2069: v_ap_tds_cm_num ap_invoices_all.invoice_num%TYPE;

2065: v_stage NUMBER(2):= 0; -- added by Aparajita on 23-may-2002 for tracking the stage in case of exception
2066:
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

Line 2070: v_ap_sup_inv_num ap_invoices_all.invoice_num%TYPE;

2066:
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

Line 2073: ln_prnt_exchange_rate ap_invoices_all.exchange_rate%TYPE; --4333449

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
2076: ln_taxable_amount JAI_AP_TDS_INVOICES.invoice_amount%type; -- 4333449
2077:

Line 3599: FROM Ap_Invoices_All

3595: v_std_inv_num VARCHAR2(50); --Added by Ajay Sharma
3596:
3597: CURSOR Fetch_Set_Of_Books_Id_Cur(inv_id NUMBER) IS
3598: SELECT Set_Of_Books_Id
3599: FROM Ap_Invoices_All
3600: WHERE Invoice_Id = inv_id;
3601:
3602: /*CURSOR Fetch_App_Inv_Flag_Cur IS
3603: SELECT NVL( Approved_Invoice_Flag, 'N' ) Approved_Invoice_Flag

Line 3620: FROM Ap_Invoices_All

3616: WHERE Tax_Id = v_tds_tax_id;
3617:
3618: CURSOR Fetch_Inv_Id_Cur( v_inv_num IN VARCHAR2, v_vendor_id IN NUMBER, v_vendor_site_id IN NUMBER ) IS
3619: SELECT Invoice_Id
3620: FROM Ap_Invoices_All
3621: WHERE Invoice_Num = v_inv_num
3622: AND Vendor_Id = v_vendor_id
3623: AND Vendor_Site_Id = v_vendor_site_id;
3624:

Line 3632: FROM ap_invoices_all

3628: WHERE invoice_id = inv_id;
3629:
3630: CURSOR cancelled_info(inv_id NUMBER) 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,

Line 3649: FROM ap_invoices_all

3645: /* added by Ajay Sharma on 15-apr-01 */
3646:
3647: CURSOR Fetch_Std_Inv_Num_Cur IS
3648: SELECT invoice_num
3649: FROM ap_invoices_all
3650: WHERE invoice_id = p_invoice_id;
3651:
3652: CURSOR Fetch_Like_Inv_Id_Cur( v_inv_num IN VARCHAR2, v_vendor_id IN NUMBER, v_vendor_site_id IN NUMBER ) IS
3653: SELECT Invoice_Id

Line 3654: FROM Ap_Invoices_All inv

3650: WHERE invoice_id = p_invoice_id;
3651:
3652: CURSOR Fetch_Like_Inv_Id_Cur( v_inv_num IN VARCHAR2, v_vendor_id IN NUMBER, v_vendor_site_id IN NUMBER ) IS
3653: SELECT Invoice_Id
3654: FROM Ap_Invoices_All inv
3655: WHERE Invoice_Num LIKE v_inv_num
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.

Line 3674: v_uap_tds_inv_num ap_invoices_all.invoice_num%TYPE;

3670:
3671: /* Start : Added by Aparajita Das for bug # 2439034 */
3672:
3673: -- for unapplying prepayment.
3674: v_uap_tds_inv_num ap_invoices_all.invoice_num%TYPE;
3675: v_uap_sup_cm_num ap_invoices_all.invoice_num%TYPE;
3676: v_uap_inv_id NUMBER;
3677: v_uap_vendor_id NUMBER;
3678:

Line 3675: v_uap_sup_cm_num ap_invoices_all.invoice_num%TYPE;

3671: /* Start : Added by Aparajita Das for bug # 2439034 */
3672:
3673: -- for unapplying prepayment.
3674: v_uap_tds_inv_num ap_invoices_all.invoice_num%TYPE;
3675: v_uap_sup_cm_num ap_invoices_all.invoice_num%TYPE;
3676: v_uap_inv_id NUMBER;
3677: v_uap_vendor_id NUMBER;
3678:
3679: -- for applying prepayment.

Line 3680: v_ap_tds_cm_num ap_invoices_all.invoice_num%TYPE;

3676: v_uap_inv_id NUMBER;
3677: v_uap_vendor_id NUMBER;
3678:
3679: -- for applying prepayment.
3680: v_ap_tds_cm_num ap_invoices_all.invoice_num%TYPE;
3681: v_ap_sup_inv_num ap_invoices_all.invoice_num%TYPE;
3682: v_ap_inv_id NUMBER;
3683: v_ap_vendor_id NUMBER;
3684:

Line 3681: v_ap_sup_inv_num ap_invoices_all.invoice_num%TYPE;

3677: v_uap_vendor_id NUMBER;
3678:
3679: -- for applying prepayment.
3680: v_ap_tds_cm_num ap_invoices_all.invoice_num%TYPE;
3681: v_ap_sup_inv_num ap_invoices_all.invoice_num%TYPE;
3682: v_ap_inv_id NUMBER;
3683: v_ap_vendor_id NUMBER;
3684:
3685: -- Common cursor for both applying and unapplying prepayment

Line 3688: FROM ap_invoices_all

3684:
3685: -- Common cursor for both applying and unapplying prepayment
3686: CURSOR c_get_invoice(p_inv_num VARCHAR2) IS
3687: SELECT invoice_id, vendor_id
3688: FROM ap_invoices_all
3689: WHERE invoice_num = p_inv_num;
3690:
3691: /* End : Added by Aparajita Das for bug # 2439034 */
3692:

Line 4248: FROM ap_invoices_all ai

4244: -- If invoice is cancelled, return 'CANCELLED'.
4245: --
4246: SELECT ai.cancelled_date
4247: INTO cancelled_date
4248: FROM ap_invoices_all ai
4249: WHERE ai.invoice_id = l_invoice_id;
4250: IF (cancelled_date IS NOT NULL) THEN
4251: RETURN('CANCELLED');
4252: END IF;