DBA Data[Home] [Help]

APPS.JAI_RCV_RCV_RTV_PKG SQL Statements

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

Line: 120

                added a new column - "NVL(manufacturing, 'N') receiving_org_manufacturing" in the select
             2. Changed the if condition -
                "if  r_iso_from_org_type.source_org_trading = 'Y' and
                    ( r_ja_in_hr_organization_units.receving_org_trading = 'Y'
                      OR
                      r_ja_in_hr_organization_units1.receving_org_trading = 'Y'
                    )
               TO
               "if  r_iso_from_org_type.source_org_trading = 'Y' and
                  ( r_ja_in_hr_organization_units.receving_org_trading = 'Y'
                    OR
                    r_ja_in_hr_organization_units1.receving_org_trading = 'Y'
                    OR                                                           --Added the OR Condition by Ramananda for Bug #4516577
                    r_ja_in_hr_organization_units.receiving_org_manufacturing = 'Y'
                    OR                                                           --Added the OR Condition by Ramananda for Bug #4516577
                    r_ja_in_hr_organization_units1.receiving_org_manufacturing = 'Y'
                  )

             (Functional)  Dependency Due to This Bug
             --------------------------
             jai_rcv_trx_prc.plb  (120.2)
             jai_om_rg.plb        (120.2)

27/07/2005   Ramananda for Bug#4514461, File Version 120.3
             Problem
             -------
             On creating the receipt, system is giving the error - Both Credit and Debit are Zero

             Fix
             ---
             In the Procedure ja_in_receive_rtv_pkg.regime_tax_accounting_interim, before calling ja_in_receipt_accounting_pkg
             Commented the condition -- if (ln_debit is not null or ln_credit is not null) then
             And added the condition -- if (NVL(ln_debit,0) <> 0 OR NVL(ln_credit,0) <> 0) then

             Future Dependency due to this Bug
             ---------------------------------
             None

28/11/2005 Harshita for Bug 4762433, File Version 120.4
           Issue :
           a) lv_source_name was declared with length 15 and assigned the value
              'Purchasing India' which is of length 16 .
           b) Who column information missing in the insert to the table JAI_RCV_REP_ACCRUAL_T.
           Fix :
           a) Modified the size of the variable lv_source_name from 15 to 20.
              Changes made in the post_entries and regime_tax_accounting_interim procedures.
           b) Added the who columns in the insert of JAI_RCV_REP_ACCRUAL_T.
              Change made in the post_entries procedures.
            Future Dependency due to this Bug
            ---------------------------------
             None

30/10/2006 sacsethi for bug 5228046, File version 120.5
            Forward porting the change in 11i bug 5365523 (Additional CVD Enhancement).
            This bug has datamodel and spec changes.

23/02/07      bduvarag for bug#5527885,File version 120.4
               Forward porting the changes done in 11i bug#5478427
	      bduvarag for bug#5632406,File version 120.4
               Forward porting the changes done in 11i bug#5603081
13/04/2007	bduvarag for the Bug#5989740, file version 120.11
		Forward porting the changes done in 11i bug#5907436

25-April-2007   ssawant for bug 5879769 ,File version 120.5
                Forward porting of
		ENH : SERVICE TAX BY INVENTORY ORGANIZATION AND SERVICE TYPE SOLUTION
		from 11.5( bug no 5694855) to R12 (bug no 5879769).

17-aug-2007     vkaranam for bug 6030615,File version 120.11
                Fwdporting of 115 bug 2942973(Interorg)
21-aug-2007     vkaranam for bug 6030615,File version 120.12
                Issue:
                In R12 we should not use org_organization_defintions view as this will cause the performance degradation.
                Changes are done as per the requirement.

03-dec-2007     Eric modified cursor c_ja_in_receipt_tax_lines  and cursor
                c_ja_in_tax_amt_by_account to pick up the exclusive taxes only

18-FEB-2008:     Changes done by nprashar for Bug #6807023. Changed the value of variable lv_organization_type to jai_constants.orgn_type_io;
Line: 247

               Fix - Removed the round() function for the accrual amount when inserting into table
                     jai_rcv_rep_accrual_t.

09-may-2011  vkaranam for bug#10167393
             Issue: VALUE AND TAXES AS PER CORRECTION OF QTY IS NOT UPDATED IN SYSTEM
             Fix:
             Adhoc freight taxes shall not be apportioned during receipt correction and
             there will not be any correction accounting for the adhoc freight taxes.

13-may-2011 vkaranam for bug#10167393
Issue: VALUE AND TAXES AS PER CORRECTION OF QTY IS NOT UPDATED IN SYSTEM
            Review comment:  taxes should get  proportioned in case of qty/rate based.
            Fix : Added the qty/rate condition for apportioning logic in get_tax_breakup function.
07-jun-2011 vkaranam for bug#11936596
             Issue: R12:POT - INCLUSIVE TAX ACCOUNTING NOT HAPPENING FOR PO MATCHED INVOICES
             Fix details: Changes are done in get_Tax_breakup ,post_entries procedure
Accounting entry for inclusive service tax at receive event:
Dr Receiving Inventory (-service recoverable amt)
Cr AP Accrual account  (-service recoverable amt)

20-Jan-2012  vkavulur for bug #13494816
  			 Issue : ROUNDING DIFFERENCE IN RETURN TO VENDOR ACCOUNTING
 			 Fix Details : Changes are done in get_Tax_breakup procedure to
			 multiply the taxes with the apportion factor once the excise
			 taxes are rounded

04-Aug-2012  Bug 14185068
             Description: VAT Inclusive Tax Accounting is incorrect in P2P flow. VAT Interim Account
             is not set off ot Receiving Inventory Account when a Receipt is created
             Fix: Added parameters to fetch the VAT Inclusive Tax in get_tax_breakup.
             Passed the same to post_entries to create accounting in Receving Inventory.
             Fetched VAT Inclusive Tax in regime_tax_accounting_interim to set off the entry
             created in post_entries.

21-Sep-2012  mmurtuza for bug 14307860
	 Description: WRONG ACCOUNTING FOR ISO SHIPMENT AND RECEIPT
	 Fix: Added code in procedure validate_transaction_tax_accnt such that  p_ap_accrual_account is picked as p_interorg_payables_account
	 when fob point is receipt (2)

24-Jan-2013 mmurtuza for bug 16101545
     Description: WRONG INCLUSIVE TAX ACCOUNTING AT RECEIPT FOR ISO
	 Fix: Added excise taxes and changed tax_types.tax_type to jtc.tax_type in cursor c_ja_in_receipt_tax_lines
	      Also chekced for excise taxes before setting ln_tax_amount to zero

23-Apr-2013 qimeng for bug 16598602
   Description: VAT INTERIM RECOVERY NOT DEBITED ON PO RECEIPT FOR INCLUSIVE VAT TAXES
   Fix: Add condition: or nvl(ln_inclu_vat_recoverable,0) <> 0
        before calling of regime_tax_accounting_interim


Dependency Section
========== =======

Date      Version    Bug         Remarks
--------- -------   ----------  -------------------------------------------------------------
6-sep-04  115.0     ER#3848010  This is a part of correction ER.

28-jan-05 115.1     Er#4239736  This is a Service + Cess Solution.

19-mar-05 115.4     ER#4245089  VAT Solution
10-may-05 116.1     ER#4346453  DFF Elimination Enh.
----------------------------------------------------------------------------------------- */
/*Bug 5527885 Start*/
gn_currency_precision number;
Line: 338

    select  organization_id,
            location_id,
            transaction_type,
            parent_transaction_type,
            currency_conversion_rate,
            transaction_date,
            parent_transaction_id,
            inventory_item_id,
            inv_item_flag /* Service */
    from    JAI_RCV_TRANSACTIONS
    where   transaction_id = cp_transaction_id;
Line: 351

    select  shipment_header_id,
            shipment_line_id,
            po_distribution_id,
            po_line_location_id,
            currency_code, /*Bug 12543504*/
            -- attribute5, Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh.
            vendor_id
            -- Vijay Shankar for Bug#4346453. RCV DFF Elim. Enh. , upper(attribute_category) attribute_category
            -- , source_document_code
            -- , decode(source_document_code, 'RMA', jai_rcv_trx_processing_pkg.india_rma_receipt,
            --                                      jai_rcv_trx_processing_pkg.india_receipt) attribute_category
    from    rcv_transactions
    where   transaction_id = cp_transaction_id;
Line: 366

    select  from_organization_id,
            to_organization_id
    from    rcv_shipment_lines
    where   shipment_line_id = cp_shipment_line_id;
Line: 372

    select  upper(receipt_source_code) receipt_source_code,
            receipt_num
    from    rcv_shipment_headers
    where   shipment_header_id = cp_shipment_header_id;
Line: 458

  SELECT 'jai_rcv_rcv_rtv_pkg-'||p_transaction_id INTO lv_temp FROM DUAL;
Line: 1081

    select  boe_account_id,
            excise_expense_account,
            excise_rcvble_account,
            rtv_expense_account_id,
            nvl(trading, 'N') receving_org_trading,  /* Bug#4171469 */
            NVL(manufacturing, 'N') receiving_org_manufacturing --Added by Ramananda for Bug #4516577
    from    JAI_CMN_INVENTORY_ORGS
    where   organization_id = cp_organization_id
    and     location_id = cp_location_id;
Line: 1092

    select  receiving_account_id
    from    rcv_parameters
    Where   organization_id = cp_organization_id;
Line: 1097

    select  ap_accrual_account
    from    mtl_parameters
    where   organization_id = cp_organization_id;
Line: 1102

    select  accrual_account_id
    from    po_distributions_all
    where   po_distribution_id = cp_po_distribution_id;
Line: 1107

    select  accrual_account_id
    from    po_distributions_all
    where   po_distribution_id =
            (
              select max(po_distribution_id)
              from   po_distributions_all
              where  line_location_id = cp_po_line_location_id
            );
Line: 1118

    select  interorg_payables_account,
            intransit_inv_account,
            interorg_receivables_account,
            intransit_type,
            fob_point
    from    mtl_interorg_parameters
    where   from_organization_id = cp_from_organization_id
    and     to_organization_id = cp_to_organization_id;
Line: 1128

    select   nvl(trading, 'N') source_org_trading  /* Bug#4171469 */
    from    JAI_CMN_INVENTORY_ORGS
    where   organization_id = cp_organization_id;
Line: 1357

    select  jrtl.tax_id tax_id,
            jrtl.tax_type tax_type,
            nvl(jrtl.tax_amount,0) tax_amount,
            jrtl.currency currency,
            nvl(jrtl.vendor_id, 0) vendor_id,
            nvl(jtc.rounding_factor, 0) rounding_factor,
            nvl(jtc.mod_cr_percentage, 0) recoverable,  /* Service */
            nvl(jrtl.modvat_flag, 'N') modvatable /* Service */
            , nvl(tax_types.regime_code, 'XXXX') regime_code    /* Vijay Shankar for Bug#4250236(4245089). VAT Impl. */
            ,jtc.vat_flag
             ,jtc.adhoc_flag   /*10167393*/
             ,jtc.inclusive_tax_flag --POT 11936596
    from    JAI_RCV_LINE_TAXES jrtl,
            JAI_CMN_TAXES_ALL jtc
            , jai_regime_tax_types_v tax_types     /*Vijay Shankar for Bug#4250236(4245089). VAT Impl. */
    where   jrtl.shipment_line_id = cp_shipment_line_id
      AND   jrtl.tax_id = jtc.tax_id
      AND   jtc.tax_type = tax_types.tax_type(+)
      AND   ( (NVL(jtc.inclusive_tax_flag,'N')='N'  AND NVL(jtc.reverse_charge_flag,'N')='N') -- Qiong for reverse charge bug#16001407
             --added the or condition for POT 11936596
              OR
              (NVL(jtc.inclusive_tax_flag,'N')='Y'
              and jtc.tax_type in ('Service','SERVICE_EDUCATION_CESS','SERVICE_SH_EDU_CESS','VALUE ADDED TAX', /*Bug 14185068*/
			  jai_constants.tax_type_excise, jai_constants.tax_type_exc_additional, jai_constants.tax_type_exc_other,
			  jai_constants.tax_type_exc_edu_cess, jai_constants.tax_type_sh_exc_edu_cess))
            );  /*Added excise taxes by mmurtuza for bug 16101545. Also changed tax_types.tax_type to jtc.tax_type*/
Line: 1385

    select regime_id
    from   JAI_RGM_DEFINITIONS
    where  regime_code = p_regime_code;
Line: 1390

    select attribute_code regime_tax_type
    from   JAI_RGM_REGISTRATIONS
    where  regime_id = cp_regime_id
    and    registration_type = jai_constants.regn_type_tax_types
    and    attribute_code = cp_tax_type;
Line: 1407

    select  organization_id,
            location_id,
            transaction_type,
            parent_transaction_type,
            currency_conversion_rate,
            transaction_date,
            parent_transaction_id,
            inventory_item_id,
            inv_item_flag /* Service */
    from    JAI_RCV_TRANSACTIONS
    where   transaction_id = cp_transaction_id;
Line: 2065

    select  count(boe_id)
    from    JAI_CMN_BOE_MATCHINGS
    where   shipment_line_id  =   cp_shipment_line_id
    and     transaction_id    =   cp_parent_transaction_id;
Line: 2185

  /* If apply relieve BOE has been done successfully, update the boe_applied_flag in ja_in_rcv_transaction */
  if p_process_flag = 'Y' and nvl(p_simulation , 'Y') <> 'Y'  then

    p_codepath := jai_general_pkg.plot_codepath(8, p_codepath); /* 8  */
Line: 2189

    update  JAI_RCV_TRANSACTIONS
    set     boe_applied_flag = 'Y'
    where   transaction_id = p_transaction_id;
Line: 2238

  select boe_id,
         ( nvl(boe_amount, 0) - nvl(amount_applied, 0) - nvl(amount_written_off, 0) )
         available_amount
  from   JAI_CMN_BOE_HDRS  jbh
  where  organization_id =  p_organization_id
  and    ( nvl(boe_amount, 0) - nvl(amount_applied, 0) - nvl(amount_written_off, 0) ) > 0
  and    ( ( nvl(consolidated_flag, 'Y') = 'Y' )
           or
           ( exists ( select '1'
                      from   JAI_CMN_BOE_DTLS
                      where  boe_id = jbh.boe_id
                      and    item_number = cp_inventory_item_id
                     )
           )
         );
Line: 2288

      /* Insert a apply record in JAI_CMN_BOE_MATCHINGS */
      insert into JAI_CMN_BOE_MATCHINGS
      (BOE_MATCHING_ID,
        transaction_id,
        shipment_header_id,
        shipment_line_id,
        boe_id,
        amount,
        creation_date,
        created_by,
        last_update_date,
        last_updated_by
       )
      values
      ( JAI_CMN_BOE_MATCHINGS_S.nextval,
        p_transaction_id,
        p_shipment_header_id,
        p_shipment_line_id,
        cur_available_boe.boe_id,
        ln_boe_amount_to_apply,
        sysdate,
        fnd_global.user_id,
        sysdate,
        fnd_global.user_id
      );
Line: 2315

      /* update the boe header amount */
      update  JAI_CMN_BOE_HDRS
      set     amount_applied = nvl(amount_applied, 0) + ln_boe_amount_to_apply,
              last_update_date = sysdate,
              last_updated_by = fnd_global.user_id,
              last_update_login = fnd_global.user_id
      where   boe_id = cur_available_boe.boe_id;
Line: 2387

    select boe_id, amount
    from   JAI_CMN_BOE_MATCHINGS
    where  shipment_line_id = cp_shipment_line_id
    and    transaction_id =   cp_transaction_id;
Line: 2421

      /* Insert a unapply record in JAI_CMN_BOE_MATCHINGS */
      p_codepath := jai_general_pkg.plot_codepath(6, p_codepath); /* 6  */
Line: 2423

      insert into JAI_CMN_BOE_MATCHINGS
      (BOE_MATCHING_ID,
        transaction_id,
        shipment_header_id,
        shipment_line_id,
        boe_id,
        amount,
        creation_date,
        created_by,
        last_update_date,
        last_updated_by
       )
      values
      ( JAI_CMN_BOE_MATCHINGS_S.nextval,
        p_transaction_id,
        p_shipment_header_id,
        p_shipment_line_id,
        applied_boe_rec.boe_id,
        ln_boe_amount_to_unapply,
        sysdate,
        fnd_global.user_id,
        sysdate,
        fnd_global.user_id
      );
Line: 2448

      /* update the boe header amount */
      p_codepath := jai_general_pkg.plot_codepath(7, p_codepath); /* 7  */
Line: 2450

      update  JAI_CMN_BOE_HDRS
      set     amount_applied = nvl(amount_applied, 0) + ln_boe_amount_to_unapply,
              last_update_date = sysdate,
              last_updated_by = fnd_global.user_id,
              last_update_login = fnd_global.user_id
      where   boe_id = applied_boe_rec.boe_id;
Line: 2559

    select  count(1)
    from    JAI_RCV_REP_ACCRUAL_T
    where   transaction_id = cp_transaction_id;
Line: 2967

      /* Inserting into JAI_RCV_REP_ACCRUAL_T if no record is already inserted */
      p_codepath := jai_general_pkg.plot_codepath(18, p_codepath); /* 18  */
Line: 2975

        insert into JAI_RCV_REP_ACCRUAL_T
        (
          transaction_id,
          accrual_amount,
          -- Harshita, added the 4 parameters below for Bug 4762433
          created_by    ,
          creation_date ,
          last_updated_by,
          last_update_date,
          last_update_login
        )
        values
        (
          p_transaction_id,
          nvl(ln_credit, ln_debit) ,   /*bug 9319913*/
          fnd_global.user_id,
          sysdate,
          fnd_global.user_id,
          sysdate,
          fnd_global.login_id
        );
Line: 3062

    select  organization_id,
            location_id
    into    ln_organization_id,ln_location_id
    from    JAI_RCV_TRANSACTIONS
    where   transaction_id = p_transaction_id;
Line: 3834

    select regime_id
    from   JAI_RGM_DEFINITIONS
    where  regime_code = p_regime_code;
Line: 3851

    select  jai_cmn_rgm_recording_pkg.get_account
            (
               cp_regime_id,
               cp_organization_type,
               cp_organization_id,
               cp_location_id, /* Location Not for service tax */
               jrtl.tax_type,
               cp_account_name
            )  interim_regime_account,
            sum
            (
             ROUND( --rchandan for bug#6971526
              decode
              (
                nvl(jrtl.currency , cp_func_curr), cp_func_curr,
                nvl(jrtl.tax_amount,0)* cp_tax_apportion_factor,
                nvl(jrtl.tax_amount,0)* cp_tax_apportion_factor * cp_currency_conversion_rate
               ) * --rchandan for bug#6971526 start
               (decode(jtc.mod_cr_percentage,100,1,jtc.mod_cr_percentage/100)
               )
               , NVL(jtc.rounding_factor, 0)
                )--rchandan for bug#6971526 end
              ) tax_amount_by_account
    from    JAI_RCV_LINE_TAXES jrtl,
            JAI_CMN_TAXES_ALL jtc
    where   jrtl.shipment_line_id = cp_shipment_line_id
    and     jrtl.tax_id = jtc.tax_id
    and     ( nvl(jtc.mod_cr_percentage,0) between 0 and 100 ) --rchandan for bug#6971526
    and     nvl(jrtl.modvat_flag, 'N') = 'Y'
    and     jrtl.tax_type in
            (
             select jrr.attribute_code
             from   JAI_RGM_DEFINITIONS jr,
                    JAI_RGM_REGISTRATIONS jrr
             where  jr.regime_id = jrr.regime_id
             and    jr.regime_code = p_regime_code
             and    jrr.registration_type = jai_constants.regn_type_tax_types
            )
      AND   (NVL(jtc.inclusive_tax_flag,'N')='N' --add by eric for inclusive tax,picking the exclusive tax only
             OR (NVL(jtc.inclusive_tax_flag,'N')='Y'
                 AND
                 jtc.tax_type = 'VALUE ADDED TAX')) /*Bug 14185068 - Added OR clause as Regime Interim Account must be done for VAT Inclusive Tax*/
      AND   NVL(jtc.reverse_charge_flag,'N')='N'  -- added by Qiong for reverse charge bug#16001407
      --add by eric for inclusive tax,picking the exclusive tax only
    group by  jai_cmn_rgm_recording_pkg.get_account
            (
               cp_regime_id,
               cp_organization_type,
               cp_organization_id,
               cp_location_id, /* Location Not for service tax */
               jrtl.tax_type,
               cp_account_name
            ) ;
Line: 3907

    select operating_unit
    from   org_organization_definitions
    where  organization_id = cp_organization_id;*/
Line: 3912

    SELECT org_information3 FROM HR_ORGANIZATION_INFORMATION
    WHERE organization_id=cp_organization_id
    AND ORG_INFORMATION_CONTEXT='Accounting Information';