DBA Data[Home] [Help]

APPS.JAI_AP_IA_TRIGGER_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 26

                        insert, update and delete.

                        Introduced the call to centralized packaged procedure,
                        jai_cmn_utils_pkg.check_jai_exists to check if localization has been installed.

2.        08-Jun-2005   This Object is Modified to refer to New DB Entity names in place of Old
                        DB Entity as required for CASE COMPLAINCE.  Version 116.1

3.      13-Jun-2005    File Version: 116.2
                       Ramananda for bug#4428980. Removal of SQL LITERALs is done

4.			01-FEB-2007			CSahoo for BUG#5631784, Version 120.1
												Forward Porting of ii1 BUG#4742259(TCS solution)
												When an invoice generated during the TCS settlement is paid we update
												the invoice_id column in the jai_rgm_settlements table with the
												corresponding invoice_id.
												Update of invoice_id in jai_rgm_settlements is made when payment_status_flag is
												Y. Previously it was checking if amount_paid is more than invoice_amount.
                        This would not work if there is any discount.
                        The if condition to update invoice_id in jai_rgm_settlements was modified from
												IF nvl(:new.payment_status_flag,'N') <> 'Y' AND nvl(:new.payment_status_flag,'N') = 'Y' to
                        IF nvl(:old.payment_status_flag,'N') <> 'Y' AND nvl(:new.payment_status_flag,'N') = 'Y'
5	29/03/2007	bduvarag for bug#5662741,File version 120.2
		       Forward porting the changes done in 11i bug#5638769

6   15-OCT-2007  Bug 6493858 File version 120.0.12000000.3
                 Removed changes done for bug 5662741 and moved the logic to jai_ap_ida_t.plb.


Dependency:
----------

Sl No. Bug        Dependent on
                  Bug/Patch set    Details
-------------------------------------------------------------------------------------------------
1      3924692    4033992          Call to  jai_cmn_utils_pkg.check_jai_exists, whcih was created thru bug
                                   4033992.
                                   ja_in_util_pkg_s.sql 115.0
                                   ja_in_util_pkg_b.sql 115.0
------------------------------------------------------------------------------------------ */

  --if
  --  jai_cmn_utils_pkg.check_jai_exists (p_calling_object   => 'JA_IN_AP_AIA_AFTER_TRG',
  --                               p_org_id           =>  pr_new.org_id,
  --                               p_set_of_books_id  =>  pr_new.set_of_books_id )
  --  =
  --  FALSE
  --then
    /* India Localization funtionality is not required */
  --  return;
Line: 86

			UPDATE jai_rgm_settlements
				 SET invoice_id            = pr_new.invoice_id,
						 last_updated_by       = fnd_global.user_id,
						 last_update_date      = sysdate
			 WHERE system_invoice_no     = pr_new.invoice_num
				 AND tax_authority_id      = pr_new.vendor_id
				 AND tax_authority_site_id = pr_new.vendor_site_id;
Line: 132

  SELECT invoice_to_tds_authority_id invoice_id, invoice_to_tds_authority_num invoice_num
  FROM 		jai_ap_tds_thhold_trxs
  WHERE 	invoice_id = cp_invoice_id;
Line: 146

		SELECT  payment_status_flag
		FROM    ap_invoices_all
		WHERE   invoice_id = cp_invoice_id;
Line: 186

                       the actual invoice id update , and hence this package should go along with this trigger

2.      24/05/2005    Ramananda for bug# 4388958 File Version: 116.1
      Changed AP Lookup code from 'TDS' to 'INDIA TDS'
                        Changed AP Lookup code from 'RECEIPT' to 'INDIA TAX INVOICE'

3.      08-Jun-2005   This Object is Modified to refer to New DB Entity names in place of Old
                      DB Entity as required for CASE COMPLAINCE.  Version 116.2

4. 13-Jun-2005    File Version: 116.3
                  Ramananda for bug#4428980. Removal of SQL LITERALs is done

5.       14/10/2008    Bgowrava for Bug#5638773, file version 120.0.12000000.7, 120.3.12010000.3
                                   Issue - Base AP invoice shouldn't be allowed to be cancelled, if the corresponding
                                               invoice to TDS Authority is already paid
                                   Fix -   1) Added a new cursor - c_tds_invoice_id, to get the tds_invoice_id
                                             2) Created an autonomous function to get the payment_status of an invoice
                                              3) Added the code to if check the tds_invoice is already paid, then stop the
                                                   cancelling of base invoice by using - raise_application_error

Dependency:
----------
Sl No. Bug        Dependent on
                  Bug/Patch set    Details
-------------------------------------------------------------------------------------------------
1.      3924692    4033992          Call to  jai_cmn_utils_pkg.check_jai_exists, which was created thru bug
                                   4033992.
                                   ja_in_util_pkg_s.sql 115.0
                                   ja_in_util_pkg_b.sql 115.0




------------------------------------------------------------------------------------------ */
 if pv_action = jai_constants.inserting or pv_action = jai_constants.updating then
  ln_org_id := pr_new.org_id;
Line: 288

  /* Update invoice Ids in TDS tables for TDS invoices */
  if pv_action = jai_constants.inserting and pr_new.source = 'INDIA TDS' then  /* 'TDS' then --Ramanand for bug#4388958 */

    jai_ap_tds_generation_pkg.populate_tds_invoice_id
    (
      p_invoice_id            =>    pr_new.invoice_id,
      p_invoice_num           =>    pr_new.invoice_num,
      p_vendor_id             =>    pr_new.vendor_id,
      p_vendor_site_id        =>    pr_new.vendor_site_id,
      p_process_flag          =>    lv_process_flag,
      p_process_message       =>    lv_process_message
    );
Line: 307

  end if; /* Update invoice Ids in TDS tables for TDS invoices */
Line: 309

  /* Update invoice Ids in Third Party tables for Third Party invoices */
  if pv_action = jai_constants.inserting and pr_new.source = 'INDIA TAX INVOICE' then /* 'RECEIPT' then --Ramanand for bug#4388958 */

     jai_rcv_third_party_pkg.populate_tp_invoice_id
     (
       p_invoice_id           =>    pr_new.invoice_id,
       p_invoice_num          =>    pr_new.invoice_num,
       p_vendor_id            =>    pr_new.vendor_id,
       p_vendor_site_id       =>    pr_new.vendor_site_id,
       p_process_flag         =>    lv_process_flag,
       p_process_message      =>    lv_process_message
     );
Line: 329

  || Update invoice Ids in Third Party tables for Third Party invoices
  */

  /* Deleting */
  if pv_action = jai_constants.deleting  then

    jai_ap_tds_tax_defaultation.process_delete
    (
      p_invoice_id                  =>  pr_old.invoice_id,
      p_process_flag                =>  lv_process_flag,
      P_process_message             =>  lv_process_message
    );