DBA Data[Home] [Help]

APPS.JAI_AP_IDA_TRIGGER_PKG SQL Statements

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

Line: 20

     select 'Y'
     from JAI_AP_MATCH_INV_TAXES
     where invoice_id = ln_invoice_id ;
Line: 53

                        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

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

6.      03/11/2006     Sanjikum for Bug#5131075, File Version 120.1
                       1) Changes are done for forward porting of bugs - 4722011, 4683207

                       Dependency Due to this Bug
                       --------------------------
                       Yes, as Package spec is changed and there are multiple files changed as part of current

7       13-JUNE-2007    ssawant for bug 6074957
      Modified cursor c_get_rnd_factor to check whether the current date is between start and end date.


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_AIDA_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: 109

      Select DECODE(SUBSTR (value,1,INSTR(value,',') -1),NULL,
             Value,SUBSTR (value,1,INSTR(value,',') -1))
        INTO lv_utl_location
        from v$parameter
       where name = 'utl_file_dir';
Line: 125

    UTL_FILE.PUT_LINE(lv_myfilehandle, ' inside update ');
Line: 250

    select vendor_id,
           vendor_site_id,
           invoice_currency_code,
           exchange_rate,
           set_of_books_id,
           source,
           cancelled_date,
           -- Bug#5131075(4683207). Added by Lakshmi Gopalsami
           invoice_type_lookup_code,
           invoice_num         /*added for bug 6493858 ref-6318997*/
    from   ap_invoices_all
    where  invoice_id = pr_new.invoice_id;
Line: 265

  SELECT  '1'
  FROM    jai_ap_tds_prepayments
  WHERE   invoice_distribution_id_prepay = pr_new.invoice_distribution_id;
Line: 270

  SELECT  '1'
  FROM    jai_ap_tds_prepayments
  WHERE   invoice_distribution_id_prepay = pr_new.parent_reversal_id
  AND     unapply_flag = 'Y';
Line: 294

   SELECT NVL(tds_rounding_factor,0) , tds_rounding_start_date
     FROM JAI_AP_TDS_YEARS
    WHERE legal_entity_id IN (SELECT legal_entity_id
                             FROM hr_operating_units
          where organization_id = p_org_id
        )
          AND trunc (sysdate) between start_date and end_date; --added by ssawant for bug 6074957
Line: 305

  SELECT
         nvl(tds_rounding_factor,0) ,
         tds_rounding_start_date
  FROM
         jai_ap_tds_years
  WHERE
         legal_entity_id  = p_org_id
   AND   trunc (sysdate) between start_date and end_date ;
Line: 317

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

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

        p_last_updated_by                =>     pr_new.last_updated_by,
        p_last_update_date               =>     pr_new.last_update_date,
        p_created_by                     =>     pr_new.created_by,
        p_creation_date                  =>     pr_new.creation_date,
        p_org_id                         =>     pr_new.org_id,
        p_process_flag                   =>     lv_process_flag,
        p_process_message                =>     lv_process_message
      );
Line: 523

if pv_action = jai_constants.inserting or pv_action = jai_constants.updating then
    ln_org_id := pr_new.org_id;
Line: 550

   * prepayments will be processed during insert event.
   */
  lv_process_old_trxn := 'Y';
Line: 568

  if pv_action = jai_constants.inserting or pv_action = jai_constants.updating then

    if  nvl(pr_new.global_attribute_category, 'JA.IN.APXINWKB.DISTRIBUTIONS' ) = 'JA.IN.APXINWKB.DISTRIBUTIONS' and   -- rchandan for bug#4333488
        pr_new.line_type_lookup_code <> 'PREPAY' and
        c_rec_ap_invoices_all.source <> 'INDIA TDS' and /*'TDS' and --Ramanand for bug#4388958 */
        c_rec_ap_invoices_all.cancelled_date is null
    then

      jai_ap_tds_tax_defaultation.process_invoice
      (
        p_invoice_id                  =>  pr_new.invoice_id,
        p_invoice_line_number         =>  pr_new.invoice_line_number ,   /* AP  Lines*/
        p_invoice_distribution_id     =>  pr_new.invoice_distribution_id,
        p_line_type_lookup_code       =>  pr_new.line_type_lookup_code,
        p_distribution_line_number    =>  pr_new.distribution_line_number,
        p_parent_reversal_id          =>  pr_new.parent_reversal_id,
        p_reversal_flag               =>  pr_new.reversal_flag,
        p_amount                      =>  pr_new.amount,
        p_invoice_currency_code       =>  c_rec_ap_invoices_all.invoice_currency_code,
        p_exchange_rate               =>  c_rec_ap_invoices_all.exchange_rate,
        p_set_of_books_id             =>  c_rec_ap_invoices_all.set_of_books_id,
        p_po_distribution_id          =>  pr_new.po_distribution_id,
        p_rcv_transaction_id          =>  pr_new.rcv_transaction_id,
        p_vendor_id                   =>  c_rec_ap_invoices_all.vendor_id,
        p_vendor_site_id              =>  c_rec_ap_invoices_all.vendor_site_id,
        p_input_dff_value_tds         =>  pr_new.global_attribute1,   -- rchandan for bug#4333488
        p_input_dff_value_wct         =>  pr_new.global_attribute2,   -- rchandan for bug#4333488
  --p_old_input_dff_value_wct     =>  pr_old.global_attribute2,-- Bug 5911913 Added by vkantamn --commented by Sanjikum for Bug#6708042
        p_input_dff_value_essi        =>  pr_new.global_attribute3,   -- rchandan for bug#4333488
  --p_old_input_dff_value_essi    =>  pr_old.global_attribute3, -- Bug 5911913 Added by vkantamn --commented by Sanjikum for Bug#6708042
        p_org_id                      =>  pr_new.org_id,
        p_accounting_date             =>  pr_new.accounting_date,
        p_call_from                   =>  'ja_in_ap_aida_after_trg',
        p_final_tds_tax_id            =>  ln_final_tds_tax_id,
        p_process_flag                =>  lv_process_flag,
        p_process_message             =>  lv_process_message,
        p_codepath                    =>  lv_codepath
      );
Line: 624

  end if; /*inserting or updating */
Line: 650

      jai_ap_tds_generation_pkg.status_update_chk_validate
      (
        p_invoice_id                  =>  pr_new.invoice_id,
        p_invoice_line_number         =>  pr_new.invoice_line_number, /* AP  Lines*/
        p_invoice_distribution_id     =>  pr_new.invoice_distribution_id,
        p_match_status_flag           =>  pr_new.match_status_flag,
        p_is_invoice_validated        =>  lv_is_invoice_validated,
        p_process_flag                =>  lv_process_flag,
        p_process_message             =>  lv_process_message,
        p_codepath                    =>  lv_codepath
        );
Line: 739

  if pv_action = jai_constants.inserting then

    if  pr_new.line_type_lookup_code = 'PREPAY'   and
        c_rec_ap_invoices_all.source <> 'INDIA TDS' and /*'TDS'   and --Ramanand for bug#4388958 */
        c_rec_ap_invoices_all.cancelled_date is null
    then

      /* Bug#5131075(4683207). Added by Lakshmi Gopalsami
          Don't proceed for TDS invoice creation if the invoice type
        is either 'CREDIT' or 'DEBIT'
      */

      If c_rec_ap_invoices_all.invoice_type_lookup_code
                  IN ('CREDIT', 'DEBIT')
      Then
         return;
Line: 763

      jai_ap_tds_generation_pkg.status_update_chk_validate
      (
        p_invoice_id                  =>  pr_new.invoice_id,
        /* p_invoice_line_id          =>  null,  Future use AP  Lines
        /*p_invoice_distribution_id     =>  null,*/
        p_match_status_flag           =>  pr_new.match_status_flag, --Changed by Sanjikum for Bug#5131075(4722011)
        p_is_invoice_validated        =>  lv_is_invoice_validated,
        p_process_flag                =>  lv_process_flag,
        p_process_message             =>  lv_process_message,
        p_codepath                    =>  lv_codepath
        );
Line: 853

          p_last_updated_by                =>     pr_new.last_updated_by,
          p_last_update_date               =>     pr_new.last_update_date,
          p_created_by                     =>     pr_new.created_by,
          p_creation_date                  =>     pr_new.creation_date,
          p_org_id                         =>     pr_new.org_id,
          p_process_flag                   =>     lv_process_flag,
          p_process_message                =>     lv_process_message
        );
Line: 894

  end if; /* inserting */
Line: 898

    jai_ap_tds_tax_defaultation.process_delete
    (
      p_invoice_id                  =>  pr_old.invoice_id,
      p_invoice_line_number         =>  pr_new.invoice_line_number, /* AP  Lines*/
      p_invoice_distribution_id     =>  pr_old.invoice_distribution_id,
      p_process_flag                =>  lv_process_flag,
      P_process_message             =>  lv_process_message
    );