DBA Data[Home] [Help]

APPS.AR_DEPOSIT_LIB_PVT SQL Statements

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

Line: 30

      SELECT name,
      salesrep_number
      INTO l_default_srep_name,
           l_default_srep_number
      FROM RA_SALESREPS
      WHERE SALESREP_ID = p_default_salesrep_id
      AND NVL(status,'A') ='A'
      AND p_deposit_date between nvl(start_date_active, p_deposit_date) and
                                 nvl(end_date_active, p_deposit_date);
Line: 73

select distinct acct_role.cust_account_role_id contact_id
from hz_cust_account_roles acct_role,
     hz_parties party,
     hz_relationships rel,
     hz_org_contacts  org_cont,
     hz_parties       rel_party
where acct_role.party_id = rel.party_id
  and acct_role.role_type = 'CONTACT'
  and org_cont.party_relationship_id = rel.relationship_id
  and rel.subject_id = party.party_id
  and rel.party_id = rel_party.party_id
  and rel.subject_table_name = 'HZ_PARTIES'
  and rel.object_table_name = 'HZ_PARTIES'
  and rel.directional_flag = 'F'
  and acct_role.cust_account_id = p_bill_to_customer_id
  and acct_role.cust_acct_site_id is null
 /* the contact must be active. however, for credit memos
    against specific transactions, the credited transaction's
    contact may also be used even if it is not active. */
AND    ( acct_role.cust_account_role_id =  NULL
          OR  ( acct_role.status = 'A'))
ORDER BY 1;
Line: 97

select distinct acct_role.cust_account_role_id contact_id
from hz_cust_account_roles acct_role,
     hz_parties party,
     hz_relationships rel,
     hz_org_contacts  org_cont,
     hz_parties       rel_party,
     hz_cust_acct_sites acct_site,
     hz_cust_site_uses site_uses
where acct_role.party_id = rel.party_id
  and acct_role.role_type = 'CONTACT'
  and org_cont.party_relationship_id = rel.relationship_id
  and rel.subject_id = party.party_id
  and rel.party_id = rel_party.party_id
  and rel.subject_table_name = 'HZ_PARTIES'
  and rel.object_table_name = 'HZ_PARTIES'
  and rel.directional_flag = 'F'
  and acct_role.cust_account_id = p_bill_to_customer_id
  and site_uses.site_use_id     = p_bill_to_site_use_id
  and acct_site.cust_account_id = acct_role.cust_account_id
                    /* show customer level as well as address level contacts */
  and  acct_role.cust_acct_site_id = site_uses.cust_acct_site_id
  and  acct_site.cust_acct_site_id = site_uses.cust_acct_site_id
  and site_uses.site_use_code = 'BILL_TO'

 /* the contact must be active. however, for credit memos
    against specific transactions, the credited transaction's
    contact may also be used even if it is not active. */
AND    ( acct_role.cust_account_role_id =  NULL
         OR  ( acct_role.status = 'A') )
ORDER BY 1;
Line: 241

     SELECT SALESREP_REQUIRED_FLAG,ORG_ID
     into l_salesreprequiredflag,l_org_id
     FROM  AR_SYSTEM_PARAMETERS;
Line: 256

        are defaulted after selecting the customer.

************************************************************************ */
                  /*-----------------------------------------------------+
                   |  Default the Primary Salesrep : Hierarchy           |
                   |                                                     |
                   |    -- From the Bill to Site Value                   |
                   |    -- From the Ship to Site Value                   |
                   |    -- From Customer defaults (if Not Multi-Org)     |
                   |    -- To 'No Sales Credits' if Required_Flag='Y'    |
                   |_____________________________________________________*/

  /* Bill to */

        begin
        select  su.primary_salesrep_id
        into    l_default_srep_id_1
        from    hz_cust_acct_sites acct_site,
                hz_party_sites party_site,
                hz_locations loc,
                hz_cust_site_uses su,
                fnd_territories_vl t
        where   acct_site.cust_acct_site_id = su.cust_acct_site_id
        and     acct_site.party_site_id = party_site.party_site_id
        and     loc.location_id = party_site.location_id
        and     loc.country = t.territory_code
        and     acct_site.cust_account_id = p_bill_to_customer_id
        and     su.site_use_id = nvl(p_bill_to_site_use_id, su.site_use_id)
        and     su.site_use_code = 'BILL_TO'
        and     ( su.site_use_id = null
                  or ( su.status = 'A'
                       and acct_site.status = 'A'
                     )
                )
        and su.primary_flag = 'Y';
Line: 310

        select  asa.primary_salesrep_id
       /* selecting salesrep_id for Rel 11 */
        into    l_default_srep_id_2
        from
        (
          SELECT
            A.CUST_ACCOUNT_ID CUSTOMER_ID ,
            A.STATUS A_STATUS ,
            SU.PRIMARY_FLAG PRIMARY_FLAG ,
            SU.STATUS SU_STATUS ,
            SU.SITE_USE_ID SITE_USE_ID ,
            SU.PRIMARY_SALESREP_ID
          FROM
            HZ_CUST_ACCT_SITES A,
            HZ_CUST_SITE_USES SU
          WHERE
            A.CUST_ACCT_SITE_ID = SU.CUST_ACCT_SITE_ID
            AND SU.SITE_USE_CODE = 'SHIP_TO'
        ) asa
        where   asa.customer_id = p_ship_to_customer_id
        and     ( asa.site_use_id = p_ship_to_site_use_id
                  or ( asa.su_status = 'A'
                       and asa.a_status = 'A'
                     )
                )
        and asa.primary_flag='Y';
Line: 458

   SELECT st.territory_id territory_id
   FROM   ra_salesrep_territories st
   WHERE  st.salesrep_id = p_salesrep_id
   AND    'A'            = NVL(st.status(+), 'A')
   AND    p_deposit_date  BETWEEN NVL(st.start_date_active(+), p_deposit_date  )
                              AND NVL(st.end_date_active(+), p_deposit_date  );
Line: 469

    select DEFAULT_TERRITORY
    into l_territory_default
    from ar_system_parameters;
Line: 476

             arp_util.debug('EXCEPTIONS: Others system option selection');
Line: 485

         select territory_id
         into l_territory_id
         from hz_cust_site_uses_all
         where site_use_id = l_Site_Use_Id ;
Line: 503

         select territory_id
         into l_territory_id
         from hz_cust_site_uses_all
         where site_use_id =l_Site_Use_Id ;
Line: 569

         select ship_via
         into l_ship_via_ship_site_default
         from hz_cust_site_uses_all
         where site_use_id =l_Site_Use_Id ;
Line: 587

        select ship_via into l_ship_via_ship_default
        from hz_cust_accounts
        where   cust_account_id = p_ship_to_customer_id;
Line: 611

           select ship_via
           into l_ship_via_bill_site_default
           from hz_cust_site_uses
           where site_use_id = l_Site_Use_Id;
Line: 629

           select ship_via
           into l_ship_via_bill_default
           from hz_cust_accounts
           where   cust_account_id = p_bill_to_customer_id;
Line: 688

         select fob_point
         into l_fob_ship_site_default
         from hz_cust_site_uses
         where site_use_id =l_Site_Use_Id ;
Line: 707

        select fob_point into l_fob_ship_default
        from hz_cust_accounts
        where   cust_account_id = p_ship_to_customer_id;
Line: 730

           select fob_point
           into l_fob_bill_site_default
           from hz_cust_site_uses
           where site_use_id = l_Site_Use_Id;
Line: 748

           select fob_point
           into l_fob_bill_default
           from hz_cust_accounts
           where   cust_account_id = p_bill_to_customer_id;
Line: 786

  l_selected_id NUMBER;
Line: 790

                    SELECT acct_role.cust_account_role_id
                    INTO l_selected_id
                    from hz_cust_account_roles acct_role,
                         hz_parties party,
                         hz_relationships rel,
                         hz_org_contacts  org_cont,
                         hz_parties       rel_party
                    where acct_role.party_id = rel.party_id
                         and acct_role.role_type = 'CONTACT'
                         and org_cont.party_relationship_id =
                                             rel.relationship_id
                         and rel.subject_id = party.party_id
                         and rel.party_id = rel_party.party_id
                         and rel.subject_table_name = 'HZ_PARTIES'
                         and rel.object_table_name = 'HZ_PARTIES'
                         and rel.directional_flag = 'F'
                         and acct_role.cust_account_id = p_customer_id
            /* the contact must be active. however, for credit memos
               against specific transactions, the credited transaction's
               contact may also be used even if it is not active. */
                         AND acct_role.status = 'A'
                         AND party.person_last_name  =  p_person_last_name
                         AND party.person_first_name = p_person_first_name;
Line: 816

                 l_selected_id := null;
Line: 824

                 l_selected_id := null;
Line: 828

          return(l_selected_id);
Line: 843

l_selected_id  VARCHAR2(100);
Line: 849

      l_selected_id := null;
Line: 855

                    SELECT c.cust_account_id
                    INTO   l_selected_id
                    FROM   hz_cust_accounts c,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  c.cust_account_id = cp.cust_account_id (+) and
                           cp.site_use_id is null and
                           c.account_number = p_value and
                           c.status <> 'I'
                      AND  c.party_id = party.party_id;
Line: 869

                    SELECT cust_acct.cust_account_id
                    INTO   l_selected_id
                    FROM   hz_cust_accounts cust_acct,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  cust_acct.cust_account_id = cp.cust_account_id (+)
                      and  cust_acct.party_id = party.party_id(+)
                      and  cp.site_use_id is null
                      and  cust_acct.status <> 'I'
                      and  party.party_name = p_value;
Line: 882

                    SELECT salesrep_id
                    INTO   l_selected_id
                    FROM    ra_salesreps
                    WHERE  name = p_value;
Line: 889

                      SELECT batch_source_id
                      INTO   l_selected_id
                      FROM   ra_batch_sources
                      WHERE  name      = p_value and
                             nvl(status, 'A') = 'A' and (batch_source_type = 'INV');
Line: 896

                      SELECT term_id
                      INTO   l_selected_id
                      FROM   ra_terms
                      WHERE  name      = p_value;
Line: 905

                    SELECT receipt_method_id
                    INTO   l_selected_id
                    FROM   ar_receipt_methods
                    WHERE  name = p_value;
Line: 914

                    SELECT bank_account_id
                    INTO   l_selected_id
                    FROM   ce_bank_accounts
                    WHERE  bank_account_num = p_value
                     AND   pg_deposit_date  <  NVL(end_date,
                                               TO_DATE('01/01/2200',
                                                       'DD/MM/YYYY') );
Line: 924

                    SELECT bank_account_id
                    INTO   l_selected_id
                    FROM   ce_bank_accounts
                    WHERE  bank_account_name = p_value
                     AND   pg_deposit_date  <  NVL(end_date,
                                               TO_DATE('01/01/2200',
                                                       'DD/MM/YYYY') );
Line: 934

                     SELECT currency_code
                     INTO   l_selected_id
                     FROM   fnd_currencies_vl
                     WHERE  name = p_value;
Line: 941

                      SELECT conversion_type
                      INTO   l_selected_id
                      FROM   gl_daily_conversion_types
                      WHERE  user_conversion_type = p_value ;
Line: 948

               RETURN( l_selected_id );
Line: 978

l_selected_id  hz_cust_site_uses.site_use_id%type;
Line: 988

               SELECT site_use.site_use_id
               INTO   l_selected_id
               FROM   hz_cust_site_uses site_use,
                      hz_cust_acct_sites acct_site
               WHERE  acct_site.cust_account_id   =  p_customer_id
                 AND  acct_site.status        = 'A'
                 AND  site_use.cust_acct_site_id = acct_site.cust_acct_site_id
                 AND  (site_use.site_use_code = nvl(p_site_use_code1,
                                                    site_use.site_use_code) OR
                       site_use.site_use_code = nvl(p_site_use_code1,
                                                    site_use.site_use_code))
                 AND  site_use.status        = 'A'
                 AND  site_use.location = p_location;
Line: 1017

               SELECT site_use.site_use_id
               INTO   l_selected_id
               FROM   hz_cust_site_uses site_use,
                      hz_cust_acct_sites acct_site
               WHERE  acct_site.cust_account_id   =  p_customer_id
                 AND  acct_site.status        = 'A'
                 AND  site_use.cust_acct_site_id  = acct_site.cust_acct_site_id
                 AND  (site_use.site_use_code = nvl(p_site_use_code1,
                                                    site_use.site_use_code) OR
                       site_use.site_use_code = nvl(p_site_use_code1,
                                                    site_use.site_use_code))
                 AND  site_use.status        = 'A'
                 AND  site_use.primary_flag  = 'Y';
Line: 1048

 RETURN( l_selected_id );
Line: 1475

           SELECT term_id
           INTO   x_term_id
           FROM   ra_terms
           WHERE  name  = p_term_name and
                  nvl(p_deposit_date, trunc(sysdate)) between start_date_active
                             and nvl(end_date_active,nvl(p_deposit_date,trunc(sysdate)));
Line: 1492

           SELECT term_id
           INTO   x_term_id
           FROM   ra_terms
           WHERE  term_id  = x_term_id and
                  nvl(p_deposit_date, trunc(sysdate)) between start_date_active
                             and nvl(end_date_active,nvl(p_deposit_date,trunc(sysdate)));
Line: 1514

           SELECT salesrep_id
           INTO   x_salesrep_id
           FROM    ra_salesreps
           WHERE  name  = p_salesrep_name and
                  NVL(status,'A') ='A'      and
                  p_deposit_date between nvl(start_date_active, p_deposit_date) and
                                             nvl(end_date_active, p_deposit_date);
Line: 1532

           SELECT salesrep_id
           INTO   x_salesrep_id
           FROM    ra_salesreps
          WHERE  salesrep_id = x_salesrep_id and
                 NVL(status,'A') ='A'      and
                 p_deposit_date between nvl(start_date_active, p_deposit_date) and
                                             nvl(end_date_active, p_deposit_date);
Line: 1556

           select memo_line_id
           into   x_memo_line_id
           from ar_memo_lines
           where  line_type='LINE' and
                 sysdate between nvl(trunc(start_date),sysdate)
                         and nvl(trunc(end_date),sysdate) and
                  name = p_memo_line_name;
Line: 1579

           select memo_line_id
           into   l_dummy
           from ar_memo_lines
           where  line_type='LINE' and
                  sysdate between nvl(trunc(start_date),sysdate)
                          and nvl(trunc(end_date),sysdate) and
                  memo_line_id = x_memo_line_id;
Line: 1598

           select inventory_item_id
           into   l_dummy
           from   MTL_SYSTEM_ITEMS_B
           where  inventory_item_id = x_inventory_id and
                  ORGANIZATION_ID = oe_profile.value('SO_ORGANIZATION_ID') and
                  ENABLED_FLAG = 'Y';
Line: 1624

        /* SELECT batch_source_id
         INTO   x_batch_source_id
         FROM   ra_batch_sources
         WHERE  name  = p_batch_source_name and
                batch_source_id not in (11,12) and
                nvl(status,'A')= 'A' and (batch_source_type = 'INV');*/
Line: 1630

         SELECT batch_source_id
         INTO   x_batch_source_id
         FROM   ra_batch_sources bs
         WHERE  name  = p_batch_source_name and
                batch_source_id not in (11,12) and
                nvl(status,'A')= 'A' and (batch_source_type = 'INV') and
                (( p_deposit_number is not null and
                   auto_trx_numbering_flag = 'N' )  or
                  ( p_deposit_number is null and
                    auto_trx_numbering_flag = 'Y' ) ) and
                nvl(p_deposit_date, trunc(sysdate)) between nvl(bs.start_date, nvl(p_deposit_date, trunc(sysdate))) and
                                                        nvl(bs.end_date, nvl(p_deposit_date, trunc(sysdate)));
Line: 1663

        /* SELECT batch_source_id
         INTO   l_dummy
         FROM   ra_batch_sources
         WHERE  batch_source_id  = x_batch_source_id and
                batch_source_id not in (11,12) and
                nvl(status,'A')= 'A' and (batch_source_type = 'INV');*/
Line: 1669

        SELECT batch_source_id
         INTO   l_dummy
         FROM   ra_batch_sources bs
         WHERE  batch_source_id  = x_batch_source_id and
                batch_source_id not in (11,12) and
                nvl(status,'A')= 'A' and (batch_source_type = 'INV') and
                (( p_deposit_number is not null and
                   auto_trx_numbering_flag = 'N' )  or
                  ( p_deposit_number is null and
                    auto_trx_numbering_flag = 'Y' ) ) and
                nvl(p_deposit_date, trunc(sysdate)) between nvl(bs.start_date, nvl(p_deposit_date, trunc(sysdate))) and
                                                        nvl(bs.end_date, nvl(p_deposit_date, trunc(sysdate)));
Line: 1696

            SELECT  cust_trx_type_id
            INTO x_cust_trx_type_id
            FROM  ra_cust_trx_types
            where type = 'DEP' and
                  nvl(p_deposit_date, trunc(sysdate)) between
                      nvl(start_date(+), nvl(p_deposit_date, trunc(sysdate)))   and
                      nvl(end_date(+), nvl(p_deposit_date, trunc(sysdate)))  and
                  NAME = p_cust_trx_type;
Line: 1727

          SELECT  cust_trx_type_id
          INTO   l_dummy
          FROM  ra_cust_trx_types
          where   type = 'DEP' and
                  nvl(p_deposit_date, trunc(sysdate)) between
                      nvl(start_date(+), nvl(p_deposit_date, trunc(sysdate)))   and
                      nvl(end_date(+), nvl(p_deposit_date, trunc(sysdate)))  and
                  cust_trx_type_id = x_cust_trx_type_id;
Line: 1811

                    SELECT cust.cust_account_id
                    INTO   l_customer_id
                    FROM   hz_cust_accounts cust,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  cust.cust_account_id = cp.cust_account_id (+) and
                           cp.site_use_id is null and
                           cust.cust_account_id = x_bill_to_customer_id and
                           cust.status <> 'I'  and
                           cust.party_id = party.party_id;
Line: 1904

                    SELECT cust.cust_account_id
                    INTO   l_customer_id
                    FROM   hz_cust_accounts cust,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  cust.cust_account_id = cp.cust_account_id (+) and
                           cp.site_use_id is null and
                           cust.cust_account_id = x_ship_to_customer_id and
                           cust.status <> 'I'  and
                           cust.party_id = party.party_id;
Line: 1944

      select  su.location
      into l_dft_bill_to_location
      from    hz_cust_acct_sites acct_site,
              hz_party_sites party_site,
              hz_locations loc,
              hz_cust_site_uses su,
              fnd_territories_vl t
        where   acct_site.cust_acct_site_id = su.cust_acct_site_id
        and     acct_site.party_site_id = party_site.party_site_id
        and     loc.location_id = party_site.location_id
        and     loc.country = t.territory_code
        and     acct_site.cust_account_id = x_bill_to_customer_id
        and     su.site_use_id = nvl(null,su.site_use_id)
        and     su.site_use_code = 'BILL_TO'
        and     ( su.site_use_id = null
                  or ( su.status = 'A'
                       and acct_site.status = 'A'
                     )
                )
        and su.primary_flag = 'Y';
Line: 1978

      select  su.location
      into l_dft_ship_to_location
      from    hz_cust_acct_sites acct_site,
              hz_party_sites party_site,
              hz_locations loc,
              hz_cust_site_uses su,
              fnd_territories_vl t
        where   acct_site.cust_acct_site_id = su.cust_acct_site_id
        and     acct_site.party_site_id = party_site.party_site_id
        and     loc.location_id = party_site.location_id
        and     loc.country = t.territory_code
        and     acct_site.cust_account_id = x_ship_to_customer_id
        and     su.site_use_id = nvl(null,su.site_use_id)
        and     su.site_use_code = 'SHIP_TO'
        and     ( su.site_use_id = null
                  or ( su.status = 'A'
                       and acct_site.status = 'A'
                     )
                )
        and su.primary_flag = 'Y';
Line: 2076

             SELECT acct_role.cust_account_role_id
             INTO l_dummy
             from hz_cust_account_roles acct_role,
                  hz_parties party,
                  hz_relationships rel,
                  hz_org_contacts  org_cont,
                  hz_parties       rel_party
            where acct_role.party_id = rel.party_id
                  and acct_role.role_type = 'CONTACT'
                  and org_cont.party_relationship_id =
                                         rel.relationship_id
                  and rel.subject_id = party.party_id
                  and rel.party_id = rel_party.party_id
                  and rel.subject_table_name = 'HZ_PARTIES'
                  and rel.object_table_name = 'HZ_PARTIES'
                  and rel.directional_flag = 'F'
                  and acct_role.cust_account_id = x_bill_to_customer_id
    /* the contact must be active. however, for credit memos
    against specific transactions, the credited transaction's
    contact may also be used even if it is not active. */
                 AND acct_role.status = 'A'
                 AND acct_role.cust_account_role_id  = x_bill_to_contact_id;
Line: 2159

             SELECT acct_role.cust_account_role_id
             INTO l_dummy
             from hz_cust_account_roles acct_role,
                  hz_parties party,
                  hz_relationships rel,
                  hz_org_contacts  org_cont,
                  hz_parties       rel_party
            where acct_role.party_id = rel.party_id
                  and acct_role.role_type = 'CONTACT'
                  and org_cont.party_relationship_id =
                                  rel.relationship_id
                  and rel.subject_id = party.party_id
                  and rel.party_id = rel_party.party_id
                  and rel.subject_table_name = 'HZ_PARTIES'
                  and rel.object_table_name = 'HZ_PARTIES'
                  and rel.directional_flag = 'F'
                  and acct_role.cust_account_id = x_ship_to_customer_id
	/* the contact must be active. however, for credit memos
	against specific transactions, the credited transaction's
	contact may also be used even if it is not active. */
                 AND acct_role.status   = 'A'
                 AND acct_role.cust_account_role_id  = x_ship_to_contact_id;
Line: 2222

         SELECT name
         INTO   p_receipt_method_name
         FROM   ar_receipt_methods
         WHERE  receipt_method_id = x_receipt_method_id;
Line: 2362

          select address_id into l_dummy
          from ar_active_remit_to_addresses_v
          where address_id = x_remit_to_address_id;
Line: 2447

                    SELECT cust.cust_account_id
                    INTO   l_customer_id
                    FROM   hz_cust_accounts cust,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  cust.cust_account_id = cp.cust_account_id (+) and
                           cp.site_use_id is null and
                           cust.cust_account_id = x_sold_to_customer_id and
                           cust.status <> 'I'  and
                           cust.party_id = party.party_id;
Line: 2535

                    SELECT cust.cust_account_id
                    INTO   l_customer_id
                    FROM   hz_cust_accounts cust,
                           hz_customer_profiles cp,
                           hz_parties party
                    WHERE  cust.cust_account_id = cp.cust_account_id (+) and
                           cp.site_use_id is null and
                           cust.cust_account_id = x_paying_customer_id and
                           cust.status <> 'I'  and
                           cust.party_id = party.party_id;
Line: 2575

      select   su.site_use_id
      into  x_paying_customer_site_use_id
      from    hz_cust_acct_sites acct_site,
              hz_party_sites party_site,
              hz_locations loc,
              hz_cust_site_uses su,
              fnd_territories_vl t
        where   acct_site.cust_acct_site_id = su.cust_acct_site_id
        and     acct_site.party_site_id = party_site.party_site_id
        and     loc.location_id = party_site.location_id
        and     loc.country = t.territory_code
        and     acct_site.cust_account_id = x_paying_customer_id
        and     su.site_use_id = nvl(null,su.site_use_id)
        and     su.site_use_code = 'BILL_TO'
        and     ( su.site_use_id = null
                  or ( su.status = 'A'
                       and acct_site.status = 'A'
                     )
                )
        and su.primary_flag = 'Y';
Line: 2667

    Select trunc(sysdate)
    into p_deposit_date
    from dual;
Line: 2919

  SELECT 'Y'
  FROM fnd_descriptive_flexs
  WHERE application_id = 222 and
        descriptive_flexfield_name = p_desc_flex_name;
Line: 2928

select title
into   l_flex_title
from   FND_DESCRIPTIVE_FLEXS_VL
where  DESCRIPTIVE_FLEXFIELD_NAME=p_flex_name;