DBA Data[Home] [Help]

APPS.JAI_PO_HA_TRIGGER_PKG SQL Statements

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

Line: 16

   select 1
   from   po_lines_all pol
   where  po_header_id = pr_new.po_header_id
   and    exists
   (select 1
    from   po_line_types_b
    where  line_type_id = pol.line_type_id
    and    outside_operation_flag = 'Y'
   );
Line: 27

   select set_of_books_id
   from   po_distributions_all
   where  po_header_id = pr_new.po_header_id;
Line: 32

   select Currency_code
   from   gl_sets_of_books
   where  set_of_books_id = cp_set_of_books_id;
Line: 77

                        2) Added another loop which inserts the atomic elements in that
                           belong to a phantom item instead of the phantom item itself.

                        3) Changed the Quantity to correctly reflect the po Qty * component quantity instead of just the po_qty.

3.   01/11/2004       ssumaith - bug#3179320  - file version 115.1

                       Removed the code to populate the 57F4 details from the trigger and instead calling the procedure
                       jai_po_osp_pkg.ja_in_57F4_process_header. This creates a dependency for future bugs.


4.   29-nov-2004  ssumaith - bug# 4037690  - File version 115.3
                   Check whether india localization is being used was done using a INR check in every trigger.
                   This check has now been moved into a new package and calls made to this package from this trigger
                   If the function jai_cmn_utils_pkg.check_jai_exists returns true it means INR is the set of books currency ,
                   Hence if this function returns FALSE , control should return.

5.   08-dec-2004 ssumaith - bug# 4037690  - File version 115.4

                   comparison in the cursor c_set_of_books was incorrect. This cursor was refering to po_release_id
                   instead of po_header_id. This has been corrected now.

6.   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

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

8    07/12/2005   Hjujjuru for the bug 4866533 File version 120.1
                    added the who columns in the insert of JAI_CMN_ERRORS_T
                    Dependencies Due to this bug:-
                    None

9.   18/12/2012   for bug 16013918 by anupgupt
                  Removed GST changes

Future Dependencies For the release Of this Object:-
(Please add a row in the section below only if your bug introduces a dependency due to spec change/ A new call to a object/
A datamodel change )
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Current Version    Current Bug    Dependent           Files                Version   Author   Date          Remarks
Of File                           On Bug/Patchset    Dependent On

ja_in_create_57f4_trg.sql
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
115.2              4037690        IN60105D2          ja_in_util_pkg_s.sql  115.0     ssumaith 29-Nov-2004  Call to this function.
                                                     ja_in_util_pkg_s.sql  115.0     ssumaith

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

   open  c_set_of_books;
Line: 165

    insert into JAI_CMN_ERRORS_T
    ( APPLICATION_SOURCE                 ,
      ERROR_MESSAGE                  ,
      ADDITIONAL_ERROR_MESG          ,
      CREATION_DATE                  ,
      CREATED_BY ,
      -- added, Harshita for Bug 4866533
      LAST_UPDATED_BY,
      LAST_UPDATE_DATE
      )
    values
    ( 'ja_in_create_57F4',
      'error occured'    ,
      v_sqlerrm ,
      sysdate  ,
      fnd_global.user_id,
      -- added, Harshita for Bug 4866533
      fnd_global.user_id,
      sysdate
    );
Line: 201

  v_last_upd_dt     DATE ; --File.Sql.35 Cbabu            :=  pr_new.Last_Update_Date ;
Line: 202

  v_last_upd_by     NUMBER; --File.Sql.35 Cbabu           :=  pr_new.Last_Updated_By;
Line: 203

  v_last_upd_login  NUMBER ; --File.Sql.35 Cbabu          :=  pr_new.Last_Update_Login;
Line: 247

  v_last_upd_dt     :=  pr_new.Last_Update_Date ;
Line: 248

  v_last_upd_by     :=  pr_new.Last_Updated_By;
Line: 249

  v_last_upd_login  :=  pr_new.Last_Update_Login;
Line: 267

    UPDATE JAI_PO_TAXES
    SET    Currency = v_curr,
         Last_Update_Date = v_last_upd_dt,
         Last_Updated_By = v_last_upd_by,
         Last_Update_Login = v_last_upd_login
    WHERE  Po_Header_Id = v_po_hdr_id
     AND   Currency = v_old_curr;
Line: 327

    v_last_upd_dt               DATE  ;  --File.Sql.35 Cbabu               :=  pr_new.Last_Update_Date ;
Line: 328

    v_last_upd_by               NUMBER;  --File.Sql.35 Cbabu               :=  pr_new.Last_Updated_By;
Line: 329

    v_last_upd_login            NUMBER;  --File.Sql.35 Cbabu               :=  pr_new.Last_Update_Login;
Line: 334

    SELECT Inventory_Organization_id
    FROM   Hr_Locations
    WHERE  Location_Id = v_ship_loc_id;
Line: 341

    SELECT JAI_PO_LINE_LOCATIONS_S.NEXTVAL
    FROM   Dual;
Line: 345

    SELECT NVL( COUNT( Po_Line_Id ), 0 )
    FROM   JAI_PO_LINE_LOCATIONS
    WHERE  Po_Header_Id = v_po_hdr_id;
Line: 351

    SELECT DISTINCT Po_Line_Id
    FROM   JAI_PO_LINE_LOCATIONS
    WHERE  Po_Header_Id = v_po_hdr_id;
Line: 356

    SELECT Item_Id
    FROM   Po_Lines_All
    WHERE  Po_Line_Id = Lineid;
Line: 361

    SELECT Line_Location_Id
    FROM   JAI_PO_LINE_LOCATIONS
    WHERE  Po_Line_Id = lineid;
Line: 366

    SELECT Quantity, Unit_Price, Unit_Meas_Lookup_Code
    FROM   Po_Lines_All
    WHERE  Po_Line_Id = lineid;
Line: 371

    SELECT Quantity, Price_Override, Unit_Meas_Lookup_Code
    FROM   Po_Line_Locations_All
    WHERE  Po_Line_Id = lineid
    AND   Line_Location_Id = linelocid;
Line: 378

    SELECT Uom_Code
    FROM   Mtl_Units_Of_Measure
    WHERE  Unit_Of_Measure = v_uom;
Line: 383

    SELECT NVL( Tax_Modified_Flag, 'N' )
    FROM   JAI_PO_LINE_LOCATIONS
    WHERE  Po_Line_Id = lineid
    AND   Line_Location_Id IS NULL;
Line: 390

    SELECT NVL( Tax_Modified_Flag, 'N' )
    FROM   JAI_PO_LINE_LOCATIONS
    WHERE  Po_Line_Id = lineid
    AND   Line_Location_Id = linelocid;
Line: 397

    SELECT Vendor_Id
    FROM   JAI_PO_TAXES
    WHERE  Po_Line_Id = lineid
    AND   Line_Location_Id = linelocid;
Line: 403

    SELECT Vendor_Id
    FROM   JAI_PO_TAXES
    WHERE  Po_Line_Id = lineid
    AND   Line_Location_Id IS NULL;
Line: 412

    SELECT  override_flag
    FROM    JAI_CMN_VENDOR_SITES
    WHERE   vendor_id = c_supplier_id
    AND     vendor_site_id = c_supp_site_id;
Line: 430

                         Vendor id gets updated for a PO for supplier merge scenario. Data in receipt tax table
                         JAI_RCV_LINE_TAXES still used to hold the old vendor. Added code on top to update
                         this vendor id as there are multiple return statements in the code.

                         There is no need to update the vendor site as it is only for third party tax.

3.        29/Nov/2004    Aiyer for bug#4035566. Version#115.1
                          Issue:-
                          The trigger should not get fires when the  non-INR based set of books is attached to the current operating unit
                          where transaction is being done.

                          Fix:-
                          Function jai_cmn_utils_pkg.check_jai_exists is being called which returns the TRUE if the currency is INR and FALSE if the currency is
                          NON-INR

                          Dependency Due to this Bug:-
                  The current trigger becomes dependent on the function jai_cmn_utils_pkg.check_jai_exists version 115.0. introduced through the bug 4033992

4.        23/Jan/2005     brathod for bug#4030192 Version#115.2
                          Issue:-   Trigger is not updating the vendor_id field in JAI_PO_TAXES
                                    when a PO having no vendor is updated with the new vendor.

                          Fix :-    Modified condition that checks wether pr_old.vendor_id is equal to vendor_id in
                                    JAI_PO_TAXES.  The condition was evaluating to false because
                                    comparision like "Null = Null".

5.       17-Mar-2005  hjujjuru - bug #4245062  File version 115.3
                      The Assessable Value is calculated for the transaction. For this, a call is
                      made to the function ja_in_vat_assessable_value_f.sql with the parameters
                      relevant for the transaction. This assessable value is again passed to the
                      procedure that calucates the taxes.

                      Base bug - #4245089

                          Dependency Due to this Bug:-
                          None
6.      31-Mar-2005 Brathod, Bug#4242351, File Version 115.5
                        Issue :- Procedure jai_po_tax_pkg.copy_reqn_taxes is modified for mutating error and new
               arguments are added in the procedure signature that must be passed from
         current trigger.  Call to jai_po_tax_pkg.copy_reqn_taxes procedure in the current
         trigger needs to be modified.

      Fix:-    call to jai_po_tax_pkg.copy_reqn_taxes is modified by passing the required
               new arguments.

7.    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

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

9. 08-Jul-2005    Sanjikum for Bug#4483042
                  1) Added a call to jai_cmn_utils_pkg.validate_po_type, to check whether for the current PO
                     IL functionality should work or not.

10. 12-Jul-2005   Sanjikum for Bug#4483042
                  1) Changed the parameter being passed to jai_cmn_utils_pkg.validate_po_type

11. 10-Sep-2010  Jia for GST Bug#10091373

12. 06-06-2012   amandali for bug 14085523
                 Description:AFTER SUPPLIER MERGE OLD SUPPLIER IS DISPLAYED IN 'RECEIPT LOCALIZATION' WINDOW
                 Fix: In ARU_T3, added an update statement to jai_rcv_headers to update the vendor to the new vendor

 Future Dependencies For the release Of this Object:-
(Please add a row in the section below only if your bug introduces a dependency due to spec change/ A new call to a object/
A datamodel change )
----------------------------------------------------------------------------------------------------------------------------------------------------------
Current Version    Current Bug    Dependent           Files                Version   Author   Date          Remarks
Of File                           On Bug/Patchset    Dependent On
ja_in_po_hdr_vendor_upd_trg
----------------------------------------------------------------------------------------------------------------------------------------------------
115.1              4035566        IN60105D2 +
                                  4033992           ja_in_util_pkg_s.sql  115.0     Aiyer    29-Nov-2004  Call to this function.
                          ja_in_util_pkg_b.sql  115.0

115.2              4245062       IN60106 + 4245089                                  hjujjuru  17/03/2005   VAT Implelentation
----------------------------------------------------------------------------------------------------------------------------------------------------*/


  --File.Sql.35 Cbabu
  v_vendor_id                 :=  NVL( pr_new.Vendor_Id, 0 );
Line: 525

  v_last_upd_dt               :=  pr_new.Last_Update_Date ;
Line: 526

  v_last_upd_by               :=  pr_new.Last_Updated_By;
Line: 527

  v_last_upd_login            :=  pr_new.Last_Update_Login;
Line: 553

    select  distinct shipment_header_id, shipment_line_id
    from    rcv_transactions
    where   po_header_id = pr_new.po_header_id
    )
    loop
        update JAI_RCV_LINE_TAXES
        set    vendor_id = pr_new.vendor_id
        where  shipment_header_id =  c_receipt_rec.shipment_header_id
        and    shipment_line_id =  c_receipt_rec.shipment_line_id
        and    vendor_id  = pr_old.vendor_id;
Line: 564

		update jai_rcv_headers
		set    vendor_id = pr_new.vendor_id,
		       vendor_site_id = decode(vendor_site_id,pr_old.vendor_site_id, pr_new.vendor_site_id)
        where  shipment_header_id =  c_receipt_rec.shipment_header_id
        and    vendor_id  = pr_old.vendor_id;
Line: 600

                    DELETE FROM JAI_PO_TAXES
                    WHERE po_header_id = v_po_hdr_id;
Line: 761

                DELETE FROM JAI_PO_TAXES
                WHERE Po_Line_Id = Rec.Po_Line_Id
                AND NVL( Line_Location_Id, -999 ) = NVL( Rec1.Line_Location_Id, -999 );
Line: 766

                DELETE FROM JAI_PO_LINE_LOCATIONS
                WHERE Po_Line_Id = Rec.Po_Line_Id
                AND NVL( Line_Location_Id, -999 ) = NVL( Rec1.Line_Location_Id, -999 );
Line: 777

                INSERT INTO JAI_PO_LINE_LOCATIONS
                (
                Line_Focus_Id,
                Line_Location_Id,
                Po_Line_Id,
                Po_Header_Id,
                Tax_Modified_Flag,
                Tax_Amount,
                Total_Amount,
                Creation_Date,
                Created_By,
                Last_Update_Date,
                Last_Updated_By,
                Last_Update_Login,
                service_type_code /* ssumaith - bug# 6109941*/
                )
                VALUES
                (
                v_next_val,
                Rec1.Line_Location_Id,
                Rec.po_line_id,
                v_po_hdr_id,
                'N',
                0,
                0,
                v_cre_dt,
                v_cre_by,
                v_last_upd_dt,
                v_last_upd_by,
                v_last_upd_login,
                v_service_type_code  /* added by ssumaith - bug# 6109941 */
                );
Line: 894

                    UPDATE JAI_PO_TAXES
                    SET    Vendor_Id = v_vendor_id
                    WHERE Vendor_id  = nvl(pr_old.vendor_id,0)   /*Added by nprashar for bug 8349329*/
                    AND       Po_Line_Id = Rec.Po_Line_Id
                    AND   nvl(Line_Location_Id,-999) = nvl(Rec1.Line_Location_Id,-999); /*Added by nprashar for bug 8349329*/