DBA Data[Home] [Help]

APPS.IBE_QUOTE_SAVE_PVT SQL Statements

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

Line: 114

  select quote_line_id, item_type_code ,quantity, inventory_item_id
  from aso_quote_lines
  where quote_header_id = p_quote_header_id
  and inventory_item_id = l_inventory_item_id;
Line: 145

	IBE_Util.Debug('p_control_rec.last_update_date = ' || p_control_rec.last_update_date);
Line: 178

  select l.quote_line_id
         ,l.item_type_code
         ,l.quantity
         ,l.inventory_item_id
         ,l.organization_id
         ,l.uom_code
         ,dl.quote_line_detail_id
         ,dl.service_duration
         ,dl.service_period
  from aso_quote_lines l, aso_quote_line_details dl
  where l.quote_header_id = p_quote_header_id
  and  l.item_type_code = 'SRV'
  and  dl.service_ref_line_id = p_service_ref_line_id
  and  dl.quote_line_id  = l.quote_line_id;
Line: 333

procedure updateserviceLine(
  p_qte_line_rec          IN  ASO_Quote_Pub.Qte_Line_Rec_Type
  ,p_qte_line_dtl_rec     IN  ASO_Quote_Pub.Qte_Line_dtl_Rec_Type
  ,p_qte_line_tbl_db      IN  ASO_Quote_Pub.Qte_Line_Tbl_Type
  ,p_qte_line_dtl_tbl_db  IN  ASO_Quote_Pub.Qte_Line_dtl_Tbl_Type
  ,x_qte_line_rec         OUT NOCOPY ASO_Quote_Pub.Qte_Line_Rec_Type
  ,x_qte_line_dtl_rec     OUT NOCOPY ASO_Quote_Pub.Qte_Line_dtl_Rec_Type
)
IS
  l_qte_line_rec      ASO_Quote_Pub.Qte_Line_Rec_Type
                      := ASO_Quote_Pub.g_miss_Qte_Line_rec;
Line: 353

     IBE_Util.Debug('updateserviceline p_qte_line_tbl_db.count='
               ||p_qte_line_tbl_db.count);
Line: 364

            IBE_Util.Debug('updateserviceline start update');
Line: 369

     IBE_Util.Debug('update service inventory_item_id'||l_qte_line_rec.inventory_item_id);
Line: 374

         l_qte_line_rec.operation_code := 'UPDATE';
Line: 381

                                := 'UPDATE';
Line: 395

     IBE_Util.Debug('update service inventory_item_id'||x_qte_line_rec.inventory_item_id);
Line: 396

     IBE_Util.Debug('update service quote_line_id'||x_qte_line_rec.quote_line_id);
Line: 397

     IBE_Util.Debug('update service quote_line_id'||x_qte_line_dtl_rec.quote_line_detail_id);
Line: 399

END updateserviceline;
Line: 413

    select term_id
    from oe_agreements
    where agreement_id = p_contract_id;
Line: 418

    select payment_id
    from aso_payments
    where quote_header_id = p_quote_hdr_id
    and quote_line_id is null;
Line: 481

          if(p_hdr_payment_tbl(counter).operation_code <> 'DELETE') then
            l_hdr_payment_tbl(counter).payment_term_id := l_payment_term_id;
Line: 503

        l_hdr_payment_tbl(counter).operation_code  := 'UPDATE';
Line: 578

   p_auto_update_active_quote IN  VARCHAR2  := FND_API.G_TRUE             ,
   p_hdr_payment_tbl          IN  aso_quote_pub.Payment_Tbl_Type          ,
   x_hdr_payment_tbl          OUT NOCOPY aso_quote_pub.Payment_Tbl_Type   ,
   x_qte_header_rec           OUT NOCOPY ASO_Quote_Pub.Qte_Header_Rec_Type,
   x_return_status            OUT NOCOPY VARCHAR2                         ,
   x_msg_count                OUT NOCOPY NUMBER                           ,
   x_msg_data                 OUT NOCOPY VARCHAR2
)
IS
   l_duration          NUMBER := NULL;
Line: 588

   l_last_update_date  DATE;
Line: 633

      /*A quote header_id is passed in during every update quote operation*/
      ELSE
         IF NOT FND_API.To_Boolean(p_auto_update_active_quote) THEN
            IF FND_Msg_Pub.Check_Msg_Level(FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
               FND_Message.Set_Name('IBE', 'IBE_SC_QUOTE_NEED_REFRESH');
Line: 657

         SELECT price_list_id
         INTO x_qte_header_rec.price_list_id
         FROM OE_Agreements_B
         WHERE agreement_id = x_qte_header_rec.contract_id;
Line: 683

      SELECT party_id        ,
             cust_account_id ,
             last_update_date,
             contract_id     ,
             quote_source_code,
             resource_id,
             publish_flag,
             price_list_id
      INTO l_party_id        ,
           l_cust_account_id ,
           l_last_update_date,
           l_contract_id     ,
           l_quote_source_code,
           l_resource_id,
           l_publish_flag,
           l_price_list_id
      FROM aso_quote_headers_all
      WHERE quote_header_id = x_qte_header_rec.quote_header_id;
Line: 705

         x_qte_header_rec.last_update_date := l_last_update_date;
Line: 717

      Ideally we do not want to change the price list id put in by the Sales Rep for Update of published Quotes.
      This is true only when the agreement is not associated to the quote.*/
      IF (l_resource_id is not null AND nvl(l_publish_flag,'N')='Y'
       AND l_agmt_associated = FND_API.G_FALSE AND l_price_list_id is not null) THEN
        IF (IBE_UTIL.G_DEBUGON = l_true) THEN
           IBE_UTIL.debug('Please revert back the price list id as in the DB,as this is a Published quote, price_list_id='||l_price_list_id);
Line: 733

         SELECT price_list_id
         INTO x_qte_header_rec.price_list_id
         FROM OE_Agreements_B
         WHERE agreement_id = l_contract_id;
Line: 794

    	      SELECT payment_id into l_org_payment_id	FROM ASO_payments
			  WHERE QUOTE_HEADER_ID = x_qte_header_rec.quote_header_id AND quote_line_id is null;
Line: 871

  select quote_line_id, item_type_code ,quantity,marketing_source_code_id
  from aso_quote_lines
  where quote_header_id = p_quote_header_id
  and inventory_item_id = l_inventory_item_id and uom_code = l_uom_code;
Line: 878

  select pricing_line_type_indicator
  from aso_quote_lines
  where quote_header_id = p_quote_header_id;
Line: 956

      x_qte_line_tbl(i).operation_code := 'DELETE';
Line: 1025

            x_qte_line_tbl(i).operation_code := 'UPDATE';
Line: 1043

              updateserviceLine
                ( p_qte_line_rec         => x_qte_line_tbl(l_line_tbl_index)
                  ,p_qte_line_dtl_rec    => x_qte_line_dtl_tbl(l_line_dtl_tbl_index)
                  ,p_qte_line_tbl_db     => l_qte_line_tbl_service_db
                  ,p_qte_line_dtl_tbl_db => l_qte_line_dtl_tbl_service_db
                  ,x_qte_line_rec        => l_qte_line_tbl_tmp(l_line_tbl_index)
                  ,x_qte_line_dtl_rec    => l_qte_line_dtl_tbl_tmp(l_line_dtl_tbl_index));
Line: 1096

          x_qte_line_tbl(i).operation_code := 'UPDATE';
Line: 1164

PROCEDURE DeleteSharees(
  p_api_version_number   IN  NUMBER
  ,p_init_msg_list       IN  VARCHAR2 := FND_API.G_FALSE
  ,p_commit              IN  VARCHAR2 := FND_API.G_FALSE
  ,p_Quote_HEADER_ID     IN  NUMBER
  ,p_minisite_id         IN  NUMBER   := FND_API.G_MISS_NUM
  ,X_Return_Status       OUT NOCOPY VARCHAR2
  ,X_Msg_Count           OUT NOCOPY NUMBER
  ,X_Msg_Data            OUT NOCOPY VARCHAR2
)
IS
  l_api_name             CONSTANT VARCHAR2(30)    := 'DeleteSharees';
Line: 1179

    SELECT quote_sharee_id,
           party_id,
           cust_account_id,
           quote_sharee_number,
           contact_point_id,
           fnd.customer_id shared_by_party_id
    FROM IBE_SH_QUOTE_ACCESS, fnd_user fnd
    where quote_header_id = c_quote_header_id
    and ibe_sh_quote_access.created_by = fnd.user_id;
Line: 1194

   SAVEPOINT    DELETESHAREES_pvt;
Line: 1219

   /*DELETE
   FROM ibe_sh_quote_access
   WHERE quote_header_id = p_quote_header_id;*/
Line: 1232

        IBE_UTIL.DEBUG('DeleteSharees:Calling delete_recipient');
Line: 1235

     IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
       P_Quote_access_rec  => l_qte_access_rec ,
       p_minisite_id       => p_minisite_id    ,
       --p_notes             => p_notes          ,
       x_return_status     => x_return_status  ,
       x_msg_count         => x_msg_count      ,
       x_msg_data          => x_msg_data       );
Line: 1250

        IBE_UTIL.DEBUG('DeleteSharees:Done calling delete_recipient');
Line: 1267

      ROLLBACK TO DELETESHAREES_pvt;
Line: 1269

        IBE_UTIL.DEBUG('Expected error in IBE_QUOTE_SAVE_PVT.DeleteSharees');
Line: 1278

        IBE_UTIL.DEBUG('Unexpected error in IBE_QUOTE_SAVE_PVT.DeleteSharees');
Line: 1280

      ROLLBACK TO DELETESHAREES_pvt;
Line: 1287

        IBE_UTIL.DEBUG('Unknown error in IBE_QUOTE_SAVE_PVT.DeleteSharees');
Line: 1289

      ROLLBACK TO DELETESHAREES_pvt;
Line: 1298

END DeleteSharees;
Line: 1301

PROCEDURE Delete(
   p_api_version_number IN  NUMBER   := 1                  ,
   p_init_msg_list      IN  VARCHAR2 := FND_API.G_TRUE     ,
   p_commit             IN  VARCHAR2 := FND_API.G_FALSE    ,
   x_return_status      OUT NOCOPY VARCHAR2                ,
   x_msg_count          OUT NOCOPY NUMBER                  ,
   x_msg_data           OUT NOCOPY VARCHAR2                ,
   p_quote_header_id    IN  NUMBER                         ,
   p_expunge_flag       IN  VARCHAR2 := FND_API.G_TRUE     ,
   p_minisite_id        IN  NUMBER   :=FND_API.G_MISS_NUM  ,
   p_last_update_date   IN  DATE     := FND_API.G_MISS_DATE,
   p_Quote_access_tbl   IN  IBE_QUOTE_SAVESHARE_pvt.QUOTE_ACCESS_TBL_TYPE
                            := IBE_QUOTE_SAVESHARE_pvt.G_miss_quote_access_Tbl ,
   p_notes              IN  VARCHAR2 := FND_API.G_MISS_CHAR,
   -- in even that we are deleting a shared cart
   -- could be owner or admin recipient
   p_initiator_party_id IN  NUMBER  :=FND_API.G_MISS_NUM  ,
   p_initiator_account_id IN NUMBER  :=FND_API.G_MISS_NUM
)
IS
  l_api_name           CONSTANT VARCHAR2(30) := 'DELETE';
Line: 1328

  l_last_update_date  DATE;
Line: 1335

  select quote_status_id
  from aso_quote_statuses_vl
  where status_code = 'INACTIVE';
Line: 1340

  select quote_sharee_id
  from ibe_sh_quote_access
  where quote_header_id = c_qte_header_id;
Line: 1345

  select party_id, cust_account_id
  from aso_quote_headers_all
  where quote_header_id = p_quote_header_id;
Line: 1357

      IBE_Util.Debug('START IBE_Quote_Save_pvt.Delete()');
Line: 1361

   SAVEPOINT    DELETE_pvt;
Line: 1388

     select quote_sharee_number into l_retrieval_number
     from ibe_sh_quote_access
     where party_id = p_initiator_party_id
     and quote_header_id = p_quote_header_id
     and cust_account_id = p_initiator_account_id;
Line: 1401

     IBE_Quote_Misc_pvt.Validate_User_Update
     (
      p_init_msg_list          => FND_API.G_TRUE
     ,p_quote_header_id        => p_quote_header_id
     ,p_validate_user          => FND_API.G_TRUE
     ,p_quote_retrieval_number => l_retrieval_number
     ,p_privilege_type_code    => 'A'
     ,p_save_type              => OP_DELETE_CART
     ,p_last_update_date       => p_last_update_date
     ,x_return_status          => x_return_status
     ,x_msg_count              => x_msg_count
     ,x_msg_data               => x_msg_data

    );
Line: 1452

/*   -- validate last_update_date
   IF (p_last_update_date is not null
       and p_last_update_date <> FND_API.G_MISS_DATE) THEN
      IF (IBE_UTIL.G_DEBUGON = l_true) THEN
         IBE_UTIL.DEBUG('validate last_update_date ');
Line: 1458

      IBE_Quote_Misc_pvt.validateQuoteLastUpdateDate
      (   p_api_version_number   => p_api_version_number
           ,p_quote_header_id     => p_quote_header_id
           ,p_last_update_date    => p_last_update_date
           ,X_Return_Status       => x_return_status
           ,X_Msg_Count           => x_msg_count
           ,X_Msg_Data            => x_msg_data
      );
Line: 1477

     IBE_UTIL.DEBUG('Quote_save_pvt.Delete: Ready to call deactivate_quote');
Line: 1486

      p_delete_context   => 'IBE_SC_CART_DELETED',
      P_minisite_id      => p_minisite_id          ,
      p_notes            => p_notes                ,
      p_quote_access_tbl => p_quote_access_tbl     ,
      p_api_version      => p_api_version_number   ,
      p_init_msg_list    => fnd_api.g_false        ,
      p_commit           => fnd_api.g_false        ,
      x_return_status    => x_return_status        ,
      x_msg_count        => x_msg_count            ,
      x_msg_data         => x_msg_data             );
Line: 1513

   /*If p_expunge_flag is true then call aso_quote_pub.delete, else
     invalidate the quote setting the quote status to 'INVALID' status
     and expiring the quote*/

  IF (IBE_UTIL.G_DEBUGON = l_true) THEN
     IBE_UTIL.DEBUG('expunge flag is: '||p_expunge_flag);
Line: 1527

       IBE_Util.Debug('ASO_Quote_Pub.Delete_Quote() starts');
Line: 1532

    ASO_Quote_Pub.Delete_quote(
         P_Api_Version_Number => P_Api_Version_Number
        ,P_Init_Msg_List     => FND_API.G_FALSE
        ,P_Commit            => FND_API.G_FALSE
        ,P_qte_header_id     => P_Quote_Header_Id
        ,x_Return_Status     => x_return_status
        ,x_Msg_Count         => x_msg_count
        ,x_Msg_Data          => x_msg_data );
Line: 1544

       IBE_Util.Debug('ASO_Quote_Pub.Delete_Quote() finishes');
Line: 1565

    l_quote_header_rec.last_update_date      := p_last_update_date;
Line: 1578

       IBE_UTIL.DEBUG('l_quote_header_rec.last_update_date :'||l_quote_header_rec.last_update_date);
Line: 1586

        p_save_type          => OP_DELETE_CART                     ,
        p_qte_header_rec     => l_Quote_header_rec                 ,
        x_quote_header_id    => l_quote_header_id                  ,
        x_last_update_date   => l_last_update_date                 ,

        x_return_status      => x_return_status                    ,
        x_msg_count          => x_msg_count                        ,
        x_msg_data           => x_msg_data);
Line: 1617

     IBE_Util.Debug('End   IBE_Quote_Save_pvt.Delete()');
Line: 1623

        IBE_Util.Debug('Expected error: End   IBE_Quote_Save_pvt.Delete()');
Line: 1626

      ROLLBACK TO DELETE_pvt;
Line: 1634

         IBE_Util.Debug('Unexpected error: End   IBE_Quote_Save_pvt.Delete()');
Line: 1636

      ROLLBACK TO DELETE_pvt;
Line: 1644

         IBE_Util.Debug('Unknown error: End   IBE_Quote_Save_pvt.Delete()');
Line: 1646

      ROLLBACK TO DELETE_pvt;
Line: 1656

END DELETE;
Line: 1659

PROCEDURE DeleteAllLines(
   p_api_version_number IN  NUMBER   := 1                  ,
   p_init_msg_list      IN  VARCHAR2 := FND_API.G_TRUE     ,
   p_commit             IN  VARCHAR2 := FND_API.G_FALSE    ,
   x_return_status      OUT NOCOPY VARCHAR2                       ,
   x_msg_count          OUT NOCOPY NUMBER                         ,
   x_msg_data           OUT NOCOPY VARCHAR2                       ,
   p_quote_header_id    IN  NUMBER                         ,
   p_last_update_date   IN  DATE     := FND_API.G_MISS_DATE,
   p_sharee_number      IN  NUMBER   := FND_API.G_MISS_NUM ,
   x_quote_header_id    OUT NOCOPY NUMBER                         ,
   x_last_update_date   OUT NOCOPY DATE
)
is
  l_api_name         CONSTANT VARCHAR2(30)   := 'DELETEALLLINES';
Line: 1687

  select quote_line_id
  from aso_quote_lines
  where quote_header_id = p_quote_header_id;
Line: 1692

   SAVEPOINT    DELETEALLLINES_pvt;
Line: 1711

   IBE_Quote_Misc_pvt.Validate_User_Update
   ( p_init_msg_list               => p_init_msg_list
    ,p_quote_header_id          => p_quote_header_id
    ,p_quote_retrieval_number     => p_sharee_number
    ,p_validate_user          => FND_API.G_TRUE
    ,x_return_status              => x_return_status
    ,x_msg_count              => x_msg_count
    ,x_msg_data                   => x_msg_data
    );
Line: 1737

      l_qte_line_rec.operation_code  := 'DELETE';
Line: 1757

       ,x_last_update_date      => x_last_update_date
       ,x_return_status         => x_return_status
       ,x_msg_count             => x_msg_count
       ,x_msg_data              => x_msg_data
   );
Line: 1784

         IBE_Util.Debug('Expected error: IBE_Quote_Save_pvt.DeleteAllLines()');
Line: 1786

    ROLLBACK TO DELETEALLLINES_pvt;
Line: 1794

        IBE_Util.Debug('Unexpected error:IBE_Quote_Save_pvt.DeleteAllLines()');
Line: 1797

    ROLLBACK TO DELETEALLLINES_pvt;
Line: 1804

        IBE_Util.Debug('Unknown error: IBE_Quote_Save_pvt.DeleteAllLines()');
Line: 1807

      ROLLBACK TO DELETEALLLINES_pvt;
Line: 1817

END DeleteAllLines;
Line: 1820

PROCEDURE Set_Last_Update_Date(p_qte_header_id IN NUMBER,
                       px_last_update_date OUT NOCOPY DATE)
IS
BEGIN
  IF p_qte_header_id <> FND_API.G_MISS_NUM THEN
    px_last_update_date := IBE_Quote_Misc_pvt.getQuoteLastUpdateDate(p_qte_header_id);
Line: 1827

END Set_Last_Update_Date;
Line: 1885

  ,x_last_update_date         OUT NOCOPY  DATE
  ,X_Return_Status            OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                OUT NOCOPY  NUMBER
  ,X_Msg_Data                 OUT NOCOPY  VARCHAR2
)
is

  l_api_name                        CONSTANT VARCHAR2(30)   := 'AddItemsToCart';
Line: 1964

    select  aqld.service_ref_line_id refLine, aql2.inventory_item_id invId
      from  ASO_QUOTE_LINES          aql,
            ASO_QUOTE_LINES          aql2,
            ASO_QUOTE_LINE_DETAILS   aqld
      where aql.item_type_code  = 'SVA'                    and
            aql.quote_line_id   = aqld.service_ref_line_id and
            aql.quote_header_id = l_quote_header_id        and
            aqld.quote_line_id  = aql2.quote_line_id
      order by  aql2.QUOTE_LINE_ID;
Line: 1976

    select  PRIMARY_UOM_CODE uomCode, SERVICE_DURATION_PERIOD_CODE period, SERVICE_DURATION duration
    from  MTL_SYSTEM_ITEMS_VL
    where inventory_item_id = l_inventory_item_id      and
          organization_id   = l_organization_id;
Line: 1982

  Select ql.quote_line_id
  From aso_quote_lines ql, aso_quote_line_details qld
  where ql.quote_line_id   = qld.quote_line_id
  And qld.service_ref_line_id = c_service_ref_line_id;
Line: 1995

    select marketing_source_code_id
    from aso_quote_headers_all
    where quote_header_id = p_quote_header_id;
Line: 2006

    select pricing_attribute1
    from aso_price_attributes
    where quote_header_id = p_quote_header_id
    and quote_line_id is null;
Line: 2014

    select 1 from fnd_lookups
    where lookup_type = p_support_lookup_type
    and   lookup_code = p_support_lookup_code;
Line: 2109

        SELECT COUNT(*) INTO l_numLines
        FROM aso_quote_lines
        WHERE quote_header_id = p_Qte_Header_Rec.quote_header_id;
Line: 2131

        SELECT COUNT(*) INTO l_numLines
        FROM aso_quote_lines
        WHERE quote_header_id = p_Qte_Header_Rec.quote_header_id and
            item_type_code  = 'SVA';
Line: 2165

             SELECT COUNT(inventory_item_id) INTO l_numLines
             FROM aso_quote_lines
             WHERE quote_header_id = p_Qte_Header_Rec.quote_header_id and
                   inventory_item_id = l_Qte_Line_Tbl(i).inventory_item_id;
Line: 2400

                l_Qte_Line_Tbl(l_Qte_Line_Tbl.count).operation_code :=  'DELETE';
Line: 2494

           ,x_last_update_date            => x_last_update_date
           ,X_Return_Status               => x_Return_Status
           ,X_Msg_Count                   => x_Msg_Count
           ,X_Msg_Data                    => x_Msg_Data
           );
Line: 2618

    ,x_last_update_date            => x_last_update_date
    ,x_Qte_Header_Rec              => lx_Qte_Header_Rec_tmp
    ,x_Hd_Price_Attributes_Tbl     => lx_Hd_Price_Attributes_Tbl_tmp
    ,x_Hd_Payment_Tbl              => lx_Hd_Payment_Tbl_tmp
    ,x_Hd_Shipment_Tbl             => lx_Hd_Shipment_Tbl_tmp
    ,x_Hd_Shipment_Rec             => lx_Hd_Shipment_Rec
    ,x_Hd_Freight_Charge_Tbl       => lx_Hd_Freight_Charge_Tbl_tmp
    ,x_Hd_Tax_Detail_Tbl           => lx_Hd_Tax_Detail_Tbl_tmp
    ,x_Qte_Line_Tbl                => x_Qte_Line_Tbl
    ,x_Qte_Line_Dtl_Tbl            => lx_Qte_Line_Dtl_Tbl
    ,x_Line_Attr_Ext_Tbl           => lx_Line_Attr_Ext_Tbl
    ,x_Line_rltship_tbl            => lx_Line_rltship_tbl
    ,x_Ln_Price_Attributes_Tbl     => lx_Ln_Price_Attributes_Tbl
    ,x_Ln_Payment_Tbl              => lx_Ln_Payment_Tbl
    ,x_Ln_Shipment_Tbl             => lx_Ln_Shipment_Tbl
    ,x_Ln_Freight_Charge_Tbl       => lx_Ln_Freight_Charge_Tbl
    ,x_Ln_Tax_Detail_Tbl           => lx_Ln_Tax_Detail_Tbl
    ,x_Price_Adjustment_Tbl        => lx_Price_Adjustment_Tbl_tmp
    ,x_Price_Adj_Attr_Tbl          => lx_Price_Adj_Attr_Tbl_tmp
    ,x_Price_Adj_Rltship_Tbl       => lx_Price_Adj_Rltship_Tbl_tmp
    ,X_Return_Status               => x_Return_Status
    ,X_Msg_Count                   => x_Msg_Count
    ,X_Msg_Data                    => x_Msg_Data
  );
Line: 2907

  ,x_last_update_date         OUT NOCOPY  DATE
  ,X_Return_Status            OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                OUT NOCOPY  NUMBER
  ,X_Msg_Data                 OUT NOCOPY  VARCHAR2
)
is

  l_api_name                    CONSTANT VARCHAR2(30)   := 'ADDMODELSTOCART';
Line: 2942

  l_input_selection             cz_cf_api.input_selection;
Line: 2987

   IBE_Quote_Misc_pvt.Validate_User_Update
   (  p_init_msg_list           => p_init_msg_list
     ,p_quote_header_id            => p_Qte_Header_Rec.quote_header_id
     ,p_party_id                => p_Qte_Header_Rec.party_id
     ,p_cust_account_id            => p_Qte_Header_Rec.cust_account_id
     ,p_quote_retrieval_number    => p_sharee_Number
     ,p_validate_user            => FND_API.G_TRUE
     ,P_save_type               => P_save_flag
     ,p_last_update_date        => p_Qte_Header_Rec.last_update_date
     ,x_return_status           => x_return_status
     ,x_msg_count               => lx_msg_count
     ,x_msg_data                => lx_msg_data
    );
Line: 3077

     ,x_last_update_date         => x_last_update_date
     ,X_Return_Status            => x_return_status
     ,X_Msg_Count                => lx_msg_count
     ,X_Msg_Data                 => lx_msg_data
  );
Line: 3250

  /*This cursor selects price_list_id and term_id(payment_term_id as in aso_payments) */
  cursor c_term_pricelist(p_agreement_id number) is
        select price_list_id, term_id
        from oe_agreements_b
        where agreement_id = p_agreement_id;
Line: 3255

  /*This cursor selects payment_id from aso_payments based on the qte_header_id and quote_line_id*/
  cursor c_payment_id(p_quote_header_id number, p_quote_line_id number) is
        select payment_id
        from aso_payments
        where quote_header_id = p_quote_header_id
        and quote_line_id = p_quote_line_id;
Line: 3335

      if the record is present then operation code in the l_ln_payment_tbl= 'UPDATE'
      else it is 'CREATE'*/
      l_payment_id  := fnd_api.g_miss_num;
Line: 3366

          (l_ln_payment_tbl(l_pmt_rec_counter).operation_code <> 'DELETE')) then
        if (l_payment_id <> fnd_api.g_miss_num ) then
          IF (IBE_UTIL.G_DEBUGON = l_true) THEN
             ibe_util.debug('Operation code is UPDATE');
Line: 3371

          l_ln_payment_tbl(l_pmt_rec_counter).operation_code := 'UPDATE';
Line: 3434

    Select resource_id,quote_name
    from aso_quote_headers_all
    Where quote_header_id = quote_hdr_id;
Line: 3585

          x_last_update_date   OUT NOCOPY Date                ,
          p_minisite_id        IN  NUMBER                     ,
          p_last_update_date   IN  Date                       ,
          p_quote_header_id    IN  NUMBER:= FND_API.G_MISS_NUM,
          p_party_id           IN  NUMBER:= FND_API.G_MISS_NUM,
          p_cust_account_id    IN  NUMBER:= FND_API.G_MISS_NUM,
          p_validate_user      IN  VARCHAR2:= FND_API.G_FALSE ,
          P_quote_name         IN  VARCHAR2                   ,
          P_Reason_code        IN  VARCHAR2                   ,
          P_url                IN  VARCHAR2:= FND_API.G_MISS_CHAR,
          P_COMMENTS           IN  VARCHAR2,
          p_retrieval_number   IN  NUMBER   := FND_API.G_MISS_NUM,
          p_contract_context   IN  VARCHAR2 :='N',
          p_notes              IN  VARCHAR2 := NULL) is

  Cursor c_find_resourceid(qte_hdr_id number) is
            select resource_id,ASSISTANCE_REASON_CODE
            from aso_quote_headers_all
            where quote_header_id = qte_hdr_id;
Line: 3605

            select resource_id
            from jtf_rs_salesreps_mo_v
            where salesrep_id = salesrep;*/
Line: 3611

            SELECT Resource_Id
            /* FROM JTF_RS_SRP_VL */
            FROM JTF_RS_SALESREPS_MO_V
            WHERE Salesrep_number = l_Srep
            AND NVL(status,'A') = 'A'
            AND nvl(trunc(start_date_active), trunc(sysdate)) <= trunc(sysdate)
            AND nvl(trunc(end_date_active), trunc(sysdate)) >= trunc(sysdate) ;
Line: 3621

            select user_id
            from jtf_rs_resource_extns
            where resource_id = resourceid;
Line: 3625

            select quote_status_id
            from aso_quote_statuses_b
            where status_code = p_status_code;
Line: 3630

           select lookup_code, meaning
           from fnd_lookup_values_vl
           where lookup_code = lkp_code
           and   lookup_type = 'IBE_SALES_ASSIST_REASONS_LK';
Line: 3652

  lx_last_update_date   DATE;
Line: 3703

  IBE_Quote_Misc_pvt.Validate_User_Update
   (  p_init_msg_list   => p_Init_Msg_List
     ,p_quote_header_id => p_quote_header_id
     ,p_party_id        => p_party_id
     ,p_cust_account_id => p_cust_account_id
     ,p_validate_user   => p_validate_user
     ,p_quote_retrieval_number => p_retrieval_number
     ,p_save_type       => SALES_ASSISTANCE
     ,p_last_update_date => p_last_update_date
     ,x_return_status   => lx_return_status
     ,x_msg_count       => lx_msg_count
     ,x_msg_data        => lx_msg_data
    );
Line: 3791

    l_qte_hdr_rec.last_update_date := p_last_update_date;
Line: 3814

         x_last_update_date         => lx_last_update_date ,
         x_return_status            => lx_return_status    ,
         x_msg_count                => lx_msg_count        ,
         x_msg_data                 => lx_msg_data);
Line: 3933

  this is done because recipients cannot update a cart after it becomes a quote*/

  IF (IBE_UTIL.G_DEBUGON = l_true) THEN
     IBE_UTIL.DEBUG('Calling share_readonly to downgrade the access levels of  all recipients to R status');
Line: 4071

    Set_Last_Update_Date(p_quote_header_id, x_last_update_date);
Line: 4092

    Set_Last_Update_Date(p_quote_header_id, x_last_update_date);
Line: 4109

  ,p_auto_update_active_quote IN   VARCHAR2   := FND_API.G_TRUE
  ,p_combineSameItem          IN   VARCHAR2   := FND_API.G_MISS_CHAR

  ,p_sharee_Number            IN   Number     := FND_API.G_MISS_NUM
  ,p_sharee_party_id          IN   Number     := FND_API.G_MISS_NUM
  ,p_sharee_cust_account_id   IN   Number     := FND_API.G_MISS_NUM
  ,p_minisite_id              IN   NUMBER     := FND_API.G_MISS_NUM
  ,p_changeowner              IN   VARCHAR2   := FND_API.G_FALSE

  ,p_Control_Rec              IN   ASO_Quote_Pub.Control_Rec_Type
                                     := ASO_Quote_Pub.G_Miss_Control_Rec
  ,p_Qte_Header_Rec           IN   ASO_Quote_Pub.Qte_Header_Rec_Type
                                     := ASO_Quote_Pub.G_MISS_Qte_Header_Rec
  ,p_hd_Price_Attributes_Tbl  IN   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Attributes_Tbl
  ,p_hd_Payment_Tbl           IN   ASO_Quote_Pub.Payment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_hd_Shipment_TBL          IN   ASO_Quote_Pub.Shipment_tbl_Type
                                     := ASO_Quote_Pub.G_MISS_SHIPMENT_TBL
  ,p_hd_Freight_Charge_Tbl    IN   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Freight_Charge_Tbl
  ,p_hd_Tax_Detail_Tbl        IN   ASO_Quote_Pub.Tax_Detail_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Tax_Detail_Tbl
  ,p_Qte_Line_Tbl             IN   ASO_Quote_Pub.Qte_Line_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_QTE_LINE_TBL
  ,p_Qte_Line_Dtl_Tbl         IN   ASO_Quote_Pub.Qte_Line_Dtl_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_QTE_LINE_DTL_TBL
  ,p_Line_Attr_Ext_Tbl        IN   ASO_Quote_Pub.Line_Attribs_Ext_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_Line_Attribs_Ext_TBL
  ,p_line_rltship_tbl         IN   ASO_Quote_Pub.Line_Rltship_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_Line_Rltship_Tbl
  ,p_Price_Adjustment_Tbl     IN   ASO_Quote_Pub.Price_Adj_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Adj_Tbl
  ,p_Price_Adj_Attr_Tbl       IN   ASO_Quote_Pub.Price_Adj_Attr_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_PRICE_ADJ_ATTR_Tbl
  ,p_Price_Adj_Rltship_Tbl    IN   ASO_Quote_Pub.Price_Adj_Rltship_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Adj_Rltship_Tbl
  ,p_Ln_Price_Attributes_Tbl  IN   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Attributes_Tbl
  ,p_Ln_Payment_Tbl           IN   ASO_Quote_Pub.Payment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_Ln_Shipment_Tbl          IN   ASO_Quote_Pub.Shipment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_SHIPMENT_TBL
  ,p_Ln_Freight_Charge_Tbl    IN   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Freight_Charge_Tbl
  ,p_Ln_Tax_Detail_Tbl        IN   ASO_Quote_Pub.Tax_Detail_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Tax_Detail_Tbl
  ,p_save_type                IN   NUMBER := FND_API.G_MISS_NUM
  ,x_quote_header_id          OUT NOCOPY  varchar2
  ,x_last_update_date         OUT NOCOPY  DATE
  ,X_Return_Status            OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                OUT NOCOPY  NUMBER
  ,X_Msg_Data                 OUT NOCOPY  VARCHAR2
)
is
  lx_Qte_Header_Rec                    ASO_Quote_Pub.Qte_Header_Rec_Type;
Line: 4206

    ,p_auto_update_active_quote    => p_auto_update_active_quote
    ,p_combineSameItem             => p_combineSameItem
    ,p_sharee_Number               => p_sharee_Number
    ,p_sharee_party_id             => p_sharee_party_id
    ,p_sharee_cust_account_id      => p_sharee_cust_account_id
    ,p_minisite_id                 => p_minisite_id
    ,p_changeowner                 => p_changeowner
    ,p_Control_Rec                 => p_Control_Rec
    ,p_Qte_Header_Rec              => p_Qte_Header_Rec
    ,p_hd_Price_Attributes_Tbl     => p_hd_Price_Attributes_Tbl
    ,p_hd_Payment_Tbl              => p_hd_Payment_Tbl
    ,p_hd_Shipment_Tbl             => p_hd_Shipment_Tbl
    ,p_hd_Freight_Charge_Tbl       => p_hd_Freight_Charge_Tbl
    ,p_hd_Tax_Detail_Tbl           => p_hd_Tax_Detail_tbl
    ,p_Qte_Line_Tbl                => p_Qte_Line_Tbl
    ,p_Qte_Line_Dtl_Tbl            => p_Qte_Line_Dtl_Tbl
    ,p_Line_Attr_Ext_Tbl           => p_Line_Attr_Ext_Tbl
    ,p_line_rltship_tbl            => p_line_rltship_tbl
    ,p_Price_Adjustment_Tbl        => p_Price_Adjustment_Tbl
    ,p_Price_Adj_Attr_Tbl          => p_Price_Adj_Attr_Tbl
    ,p_Price_Adj_Rltship_Tbl       => p_Price_Adj_Rltship_Tbl
    ,p_Ln_Price_Attributes_Tbl     => p_Ln_Price_Attributes_Tbl
    ,p_Ln_Payment_Tbl              => p_Ln_Payment_Tbl
    ,p_Ln_Shipment_Tbl             => p_Ln_Shipment_Tbl
    ,p_Ln_Freight_Charge_Tbl       => p_Ln_Freight_Charge_Tbl
    ,p_Ln_Tax_Detail_Tbl           => p_Ln_Tax_Detail_Tbl
    ,p_save_type                   => p_save_type
    ,x_quote_header_id             => x_quote_header_id
    ,x_last_update_date            => x_last_update_date
    ,x_Qte_Header_Rec              => lx_Qte_Header_Rec
    ,x_Hd_Price_Attributes_Tbl     => lx_Hd_Price_Attributes_Tbl
    ,x_Hd_Payment_Tbl              => lx_Hd_Payment_Tbl
    ,x_Hd_Shipment_Tbl             => lx_Hd_Shipment_Tbl
    ,x_Hd_Shipment_Rec             => lx_Hd_Shipment_Rec
    ,x_Hd_Freight_Charge_Tbl       => lx_Hd_Freight_Charge_Tbl
    ,x_Hd_Tax_Detail_Tbl           => lx_Hd_Tax_Detail_Tbl
    ,x_Qte_Line_Tbl                => lx_Qte_Line_Tbl
    ,x_Qte_Line_Dtl_Tbl            => lx_Qte_Line_Dtl_Tbl
    ,x_Line_Attr_Ext_Tbl           => lx_Line_Attr_Ext_Tbl
    ,x_Line_rltship_tbl            => lx_Line_rltship_tbl
    ,x_Ln_Price_Attributes_Tbl     => lx_Ln_Price_Attributes_Tbl
    ,x_Ln_Payment_Tbl              => lx_Ln_Payment_Tbl
    ,x_Ln_Shipment_Tbl             => lx_Ln_Shipment_Tbl
    ,x_Ln_Freight_Charge_Tbl       => lx_Ln_Freight_Charge_Tbl
    ,x_Ln_Tax_Detail_Tbl           => lx_Ln_Tax_Detail_Tbl
    ,x_Price_Adjustment_Tbl        => lx_Price_Adjustment_Tbl
    ,x_Price_Adj_Attr_Tbl          => lx_Price_Adj_Attr_Tbl
    ,x_Price_Adj_Rltship_Tbl       => lx_Price_Adj_Rltship_Tbl
    ,X_Return_Status               => x_Return_Status
    ,X_Msg_Count                   => x_Msg_Count
    ,X_Msg_Data                    => x_Msg_Data
  );
Line: 4269

  ,p_auto_update_active_quote IN   VARCHAR2   := FND_API.G_TRUE
  ,p_combineSameItem          IN   VARCHAR2   := FND_API.G_MISS_CHAR

  ,p_sharee_Number            IN   Number     := FND_API.G_MISS_NUM
  ,p_sharee_party_id          IN   Number     := FND_API.G_MISS_NUM
  ,p_sharee_cust_account_id   IN   Number     := FND_API.G_MISS_NUM
  ,p_minisite_id              IN   NUMBER     := FND_API.G_MISS_NUM
  ,p_changeowner              IN   VARCHAR2   := FND_API.G_FALSE

  ,p_Control_Rec              IN   ASO_Quote_Pub.Control_Rec_Type
                                     := ASO_Quote_Pub.G_Miss_Control_Rec
  ,p_Qte_Header_Rec           IN   ASO_Quote_Pub.Qte_Header_Rec_Type
                                     := ASO_Quote_Pub.G_MISS_Qte_Header_Rec
  ,p_hd_Price_Attributes_Tbl  IN   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Attributes_Tbl
  ,p_hd_Payment_Tbl           IN   ASO_Quote_Pub.Payment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_hd_Shipment_TBL          IN   ASO_Quote_Pub.Shipment_tbl_Type
                                     := ASO_Quote_Pub.G_MISS_SHIPMENT_TBL
  ,p_hd_Freight_Charge_Tbl    IN   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Freight_Charge_Tbl
  ,p_hd_Tax_Detail_Tbl        IN   ASO_Quote_Pub.Tax_Detail_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Tax_Detail_Tbl
  ,p_Qte_Line_Tbl             IN   ASO_Quote_Pub.Qte_Line_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_QTE_LINE_TBL
  ,p_Qte_Line_Dtl_Tbl         IN   ASO_Quote_Pub.Qte_Line_Dtl_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_QTE_LINE_DTL_TBL
  ,p_Line_Attr_Ext_Tbl        IN   ASO_Quote_Pub.Line_Attribs_Ext_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_Line_Attribs_Ext_TBL
  ,p_line_rltship_tbl         IN   ASO_Quote_Pub.Line_Rltship_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_Line_Rltship_Tbl
  ,p_Price_Adjustment_Tbl     IN   ASO_Quote_Pub.Price_Adj_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Adj_Tbl
  ,p_Price_Adj_Attr_Tbl       IN   ASO_Quote_Pub.Price_Adj_Attr_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_PRICE_ADJ_ATTR_Tbl
  ,p_Price_Adj_Rltship_Tbl    IN   ASO_Quote_Pub.Price_Adj_Rltship_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Adj_Rltship_Tbl
  ,p_Ln_Price_Attributes_Tbl  IN   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Price_Attributes_Tbl
  ,p_Ln_Payment_Tbl           IN   ASO_Quote_Pub.Payment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_Ln_Shipment_Tbl          IN   ASO_Quote_Pub.Shipment_Tbl_Type
                                     := ASO_Quote_Pub.G_MISS_SHIPMENT_TBL
  ,p_Ln_Freight_Charge_Tbl    IN   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Freight_Charge_Tbl
  ,p_Ln_Tax_Detail_Tbl        IN   ASO_Quote_Pub.Tax_Detail_Tbl_Type
                                     := ASO_Quote_Pub.G_Miss_Tax_Detail_Tbl
  ,p_save_type                IN   NUMBER := FND_API.G_MISS_NUM
  ,x_quote_header_id          OUT NOCOPY  varchar2
  ,x_last_update_date         OUT NOCOPY  DATE

  ,x_Qte_Header_Rec           IN OUT NOCOPY ASO_Quote_Pub.Qte_Header_Rec_Type
  ,x_Hd_Price_Attributes_Tbl  IN OUT NOCOPY ASO_Quote_Pub.Price_Attributes_Tbl_Type
  ,x_Hd_Payment_Tbl          IN OUT NOCOPY ASO_Quote_Pub.Payment_Tbl_Type
  ,x_Hd_Shipment_Tbl          IN OUT NOCOPY ASO_Quote_Pub.Shipment_Tbl_Type
  ,x_Hd_Shipment_Rec          IN OUT NOCOPY ASO_Quote_Pub.Shipment_Rec_Type
  ,x_Hd_Freight_Charge_Tbl    IN OUT NOCOPY ASO_Quote_Pub.Freight_Charge_Tbl_Type
  ,x_Hd_Tax_Detail_Tbl        IN OUT NOCOPY ASO_Quote_Pub.TAX_DETAIL_TBL_TYPE
  ,x_Qte_Line_Tbl             IN OUT NOCOPY ASO_Quote_Pub.Qte_Line_Tbl_Type
  ,x_Qte_Line_Dtl_Tbl         IN OUT NOCOPY ASO_Quote_Pub.Qte_Line_Dtl_Tbl_Type
  ,x_Line_Attr_Ext_Tbl        IN OUT NOCOPY ASO_Quote_Pub.Line_Attribs_Ext_Tbl_Type
  ,x_Line_rltship_tbl         IN OUT NOCOPY ASO_Quote_Pub.Line_Rltship_Tbl_Type
  ,x_Ln_Price_Attributes_Tbl  IN OUT NOCOPY ASO_Quote_Pub.Price_Attributes_Tbl_Type
  ,x_Ln_Payment_Tbl           IN OUT NOCOPY ASO_Quote_Pub.Payment_Tbl_Type
  ,x_Ln_Shipment_Tbl          IN OUT NOCOPY ASO_Quote_Pub.Shipment_Tbl_Type
  ,x_Ln_Freight_Charge_Tbl    IN OUT NOCOPY ASO_Quote_Pub.Freight_Charge_Tbl_Type
  ,x_Ln_Tax_Detail_Tbl        IN OUT NOCOPY ASO_Quote_Pub.TAX_DETAIL_TBL_TYPE
  ,x_Price_Adjustment_Tbl     IN OUT NOCOPY ASO_Quote_Pub.Price_Adj_Tbl_Type
  ,x_Price_Adj_Attr_Tbl       IN OUT NOCOPY ASO_Quote_Pub.Price_Adj_Attr_Tbl_Type
  ,x_Price_Adj_Rltship_Tbl    IN OUT NOCOPY ASO_Quote_Pub.Price_Adj_Rltship_Tbl_Type

  ,X_Return_Status            OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                OUT NOCOPY  NUMBER
  ,X_Msg_Data                 OUT NOCOPY  VARCHAR2
)
is
  l_api_name             CONSTANT VARCHAR2(30)   := 'SAVE';
Line: 4367

  ld_last_update_date    date;
Line: 4387

        select term_id, price_list_id
        from oe_agreements_b
        where agreement_id = p_agreement_id;
Line: 4392

    select quote_status_id
    from aso_quote_statuses_vl
    where status_code = p_status_code;
Line: 4397

        select quote_header_id, pricing_status_indicator, tax_status_indicator from
	aso_quote_headers_all where quote_header_id = qte_header_id;
Line: 4456

  IF(p_save_type <> OP_DELETE_CART) THEN
  IF (IBE_UTIL.G_DEBUGON = l_true) THEN
    IBE_UTIL.DEBUG('SAVE: Calling Validate User');
Line: 4460

  IBE_Quote_Misc_pvt.Validate_User_Update
   (  p_init_msg_list          => p_Init_Msg_List
     ,p_quote_header_id        => p_Qte_Header_Rec.quote_header_id
     ,p_party_id               => p_Qte_Header_Rec.party_id
     ,p_cust_account_id        => p_Qte_Header_Rec.cust_account_id
     ,p_quote_retrieval_number => p_sharee_Number
     ,p_validate_user          => FND_API.G_TRUE
     ,p_save_type              => p_save_type
     ,p_last_update_date       => p_Qte_Header_Rec.last_update_date
     ,x_return_status          => x_return_status
     ,x_msg_count              => x_msg_count
     ,x_msg_data               => x_msg_data    );
Line: 4493

  has not expired because we do not want to allow updates on expired carts*/
  l_is_quote_usable := IBE_QUOTE_MISC_PVT.is_quote_usable(p_qte_header_rec.quote_header_id,
                                                           p_Qte_Header_Rec.party_id,
                                                           p_Qte_Header_Rec.cust_account_id);
Line: 4506

                       ,p_auto_update_active_quote => p_auto_update_active_quote
                       ,x_qte_header_rec           => l_qte_header_rec
                       ,p_hdr_Payment_Tbl          => p_hd_payment_tbl
                       ,x_hdr_payment_tbl          => l_hd_Payment_Tbl
                       ,x_return_status            => x_return_status
                       ,x_msg_count                => x_msg_count
                       ,x_msg_data                 => x_msg_data );
Line: 4568

  /*This code validates the recipient's access level against the minimum required access level for a create/update
  operation which is "F"*/

  IF ( ( p_sharee_Number is not null)
       and ( p_sharee_Number <>  FND_API.G_MISS_NUM)) THEN

    l_privilege_type_code := IBE_Quote_Misc_pvt.GetShareeprivilege(l_qte_header_rec.quote_header_id
                                                                   ,p_sharee_Number);
Line: 4642

  /* Start of CREATE QUOTE or UPDATE QUOTE conditions*/
  /* "Create quote" is invoked if there is no incoming quote_header_id and no quote header id found
     in the database for the operating user, otherwise "Update quote" is invoked*/

  IF l_qte_header_rec.quote_header_id IS NULL
    OR l_qte_header_rec.quote_header_id = FND_API.G_MISS_NUM THEN

    --Fix for bug 2512597
    -- Force the quote_status_id to be 'STORE DRAFT' if there is no input value
    IF l_qte_header_rec.quote_status_id is null OR
      l_qte_header_rec.quote_status_id = fnd_api.g_miss_num then
       for rec_quote_sts_id in c_quote_sts_id('STORE DRAFT') loop
        l_qte_header_rec.quote_status_id := rec_quote_sts_id.quote_status_id;
Line: 4766

         IBE_Util.Debug('In Update Header MinisiteId Dynamic SQL');
Line: 4769

          l_upd_stmnt := 'Update ASO_QUOTE_HEADERS_ALL set minisite_id = :1
                    where quote_header_id = :2';
Line: 4779

              FND_MESSAGE.set_name('IBE', 'IBE_UPDATE_MSITE_HDR_ERR');
Line: 4855

            l_hd_payment_tbl(I).operation_code := 'UPDATE'; -- Bug# 1955991
Line: 4858

          l_hd_payment_tbl(I).last_update_date :=
             IBE_Quote_Misc_pvt.getQuoteLastUpdateDate(l_qte_header_rec.quote_header_id); -- Bug# 1955991
Line: 4880

      /* Added by Sri 09/06 since the header last update date should be the value in the db */
      l_qte_header_rec.last_update_date :=
      IBE_Quote_Misc_pvt.getQuoteLastUpdateDate(l_qte_header_rec.quote_header_id); -- Bug# 1955991
Line: 4893

          l_hd_shipment_tbl(I).operation_code := 'UPDATE';
Line: 4896

        l_hd_shipment_tbl(I).last_update_date :=
             IBE_Quote_Misc_pvt.getQuoteLastUpdateDate(l_qte_header_rec.quote_header_id); -- Bug# 1955991
Line: 4901

/* Added by Sri 09/06 since the header last update date should be the value in the db */
      l_qte_header_rec.last_update_date :=
      IBE_Quote_Misc_pvt.getQuoteLastUpdateDate(l_qte_header_rec.quote_header_id); -- Bug# 1955991
Line: 4957

       UpdateQuoteForSharee(
              p_api_version_number         => p_api_version_number
              ,p_init_msg_list             => FND_API.G_FALSE
                ,p_commit                    => FND_API.G_FALSE
              ,p_sharee_party_id           => p_sharee_party_id
              ,p_sharee_cust_account_id    => p_sharee_cust_account_id
              ,p_control_rec               => p_control_rec
              ,p_qte_header_rec            => l_qte_header_rec
              ,p_Hd_Price_Attributes_Tbl   => p_Hd_Price_Attributes_Tbl
              ,p_Hd_Payment_Tbl            => l_Hd_Payment_Tbl
              ,p_Hd_Shipment_Tbl           => l_Hd_Shipment_Tbl
              ,p_Hd_Tax_Detail_Tbl         => p_Hd_Tax_Detail_Tbl
              ,p_Hd_Freight_Charge_Tbl     => p_Hd_Freight_Charge_Tbl
              ,p_qte_line_tbl              => l_qte_line_tbl
              ,p_Qte_Line_Dtl_Tbl          => l_Qte_Line_Dtl_Tbl
              ,p_Line_rltship_tbl          => p_Line_rltship_tbl
              ,p_Line_Attr_Ext_Tbl         => p_Line_Attr_Ext_Tbl
              ,p_Ln_Price_Attributes_Tbl   => p_Ln_Price_Attributes_Tbl
              ,p_Ln_Payment_Tbl            => l_Ln_Payment_Tbl
              ,p_Ln_Shipment_Tbl           => p_Ln_Shipment_Tbl
              ,p_Ln_Tax_Detail_Tbl         => p_Ln_Tax_Detail_Tbl
              ,p_Ln_Freight_Charge_Tbl     => p_Ln_Freight_Charge_Tbl
              ,p_Price_Adj_Attr_Tbl        => p_Price_Adj_Attr_Tbl
              ,p_Price_Adjustment_Tbl      => p_Price_Adjustment_Tbl
              ,p_Price_Adj_Rltship_Tbl     => p_Price_Adj_Rltship_Tbl
              ,x_qte_header_rec            => x_qte_header_rec
              ,x_qte_line_tbl              => x_qte_line_tbl
              ,X_Return_Status             => X_Return_Status
              ,X_Msg_Count                 => X_Msg_Count
              ,X_Msg_Data                  => X_Msg_Data);
Line: 5020

      IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() starts');
Line: 5021

      IBE_Util.Debug('Save : COUNT: just before aso update' || p_Ln_Price_Attributes_Tbl.count);
Line: 5035

    ASO_Quote_Pub.Update_quote(
            P_Api_Version_Number       => P_Api_Version_Number
           ,P_Init_Msg_List            => FND_API.G_FALSE
           ,P_Commit                   => FND_API.G_FALSE
           ,P_Control_Rec              => p_control_rec
           ,P_qte_header_rec           => l_Qte_Header_Rec
           ,P_Qte_Line_Tbl             => l_Qte_Line_Tbl
            ,p_Line_rltship_tbl        => p_Line_rltship_tbl
            ,p_Qte_Line_Dtl_Tbl        => l_Qte_Line_Dtl_Tbl
            ,p_Hd_Price_Attributes_Tbl => p_Hd_Price_Attributes_Tbl
            ,p_Hd_Payment_Tbl          => l_Hd_Payment_Tbl
            ,p_Hd_Shipment_Tbl         => l_Hd_Shipment_Tbl
            ,p_Hd_Tax_Detail_Tbl       => p_Hd_Tax_Detail_Tbl
            ,p_Ln_Price_Attributes_Tbl => p_Ln_Price_Attributes_Tbl
            ,p_Ln_Payment_Tbl          => l_Ln_Payment_Tbl
            ,p_Ln_Shipment_Tbl         => p_Ln_Shipment_Tbl
            ,p_Ln_Tax_Detail_Tbl       => p_Ln_Tax_Detail_Tbl
            ,p_Price_Adj_Attr_Tbl      => p_Price_Adj_Attr_Tbl
            ,p_Price_Adjustment_Tbl    => p_Price_Adjustment_Tbl
            ,p_Price_Adj_Rltship_Tbl   => p_Price_Adj_Rltship_Tbl
            ,p_Line_Attr_Ext_Tbl       => p_Line_Attr_Ext_Tbl
            ,p_Hd_Freight_Charge_Tbl   => p_Hd_Freight_Charge_Tbl
            ,p_Ln_Freight_Charge_Tbl   => p_Ln_Freight_Charge_Tbl
            ,x_qte_header_rec          => x_Qte_Header_Rec
            ,X_Qte_Line_Tbl            => x_Qte_Line_Tbl
            ,X_Qte_Line_Dtl_Tbl        => x_Qte_Line_Dtl_Tbl
            ,x_Hd_Price_Attributes_Tbl => X_Hd_Price_Attributes_Tbl
            ,X_Hd_Payment_Tbl          => x_Hd_Payment_Tbl
            ,X_Hd_Shipment_Tbl         => x_Hd_Shipment_Tbl
            ,X_Hd_Freight_Charge_Tbl   => x_Hd_Freight_Charge_Tbl
            ,X_Hd_Tax_Detail_Tbl       => x_Hd_Tax_Detail_Tbl
            ,x_Line_Attr_Ext_Tbl       => x_Line_Attr_Ext_Tbl
            ,X_Line_rltship_tbl        => x_Line_Rltship_Tbl
            ,X_Price_Adjustment_Tbl    => x_Price_Adjustment_Tbl
            ,X_Price_Adj_Attr_Tbl      => X_Price_Adj_Attr_Tbl
            ,X_Price_Adj_Rltship_Tbl   => x_Price_Adj_Rltship_Tbl
            ,X_Ln_Price_Attributes_Tbl => X_Ln_Price_Attributes_Tbl
            ,X_Ln_Payment_Tbl          => x_Ln_Payment_Tbl
            ,X_Ln_Shipment_Tbl         => x_Ln_Shipment_Tbl
            ,X_Ln_Freight_Charge_Tbl   => x_Ln_Freight_Charge_Tbl
            ,X_Ln_Tax_Detail_Tbl       => x_Ln_Tax_Detail_Tbl
              ,X_Return_Status           => x_return_status
            ,X_Msg_Count               => x_msg_count
            ,X_Msg_Data                => x_msg_data);
Line: 5089

      IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() finishes : '|| x_return_status);
Line: 5109

  END IF;  -- end of create/update
Line: 5112

  x_last_update_date := x_qte_header_rec.last_update_date;
Line: 5135

     Set_Last_Update_Date(l_qte_header_rec.quote_header_id, x_last_update_date);
Line: 5145

     Set_Last_Update_Date(l_qte_header_rec.quote_header_id, x_last_update_date);
Line: 5155

     Set_Last_Update_Date(l_qte_header_rec.quote_header_id, x_last_update_date);
Line: 5170

PROCEDURE UpdateQuoteForSharee(
  p_api_version_number        IN   NUMBER
  ,p_init_msg_list            IN   VARCHAR2   := FND_API.G_FALSE
  ,p_commit                   IN   VARCHAR2    := FND_API.G_FALSE

  ,p_sharee_Party_Id          IN NUMBER
  ,p_sharee_Cust_account_Id   IN NUMBER
  ,p_changeowner              IN   VARCHAR2   := FND_API.G_FALSE

  ,P_Control_Rec              IN   ASO_Quote_Pub.Control_Rec_Type
  ,P_Qte_Header_Rec              IN   ASO_Quote_Pub.Qte_Header_Rec_Type
                                 := ASO_Quote_Pub.G_MISS_Qte_Header_Rec
  ,p_Hd_Price_Attributes_Tbl  in   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                 := ASO_Quote_Pub.G_MISS_Price_Attributes_Tbl
  ,p_Hd_Payment_Tbl                 in   ASO_Quote_Pub.Payment_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_Hd_Shipment_Tbl                in   ASO_Quote_Pub.Shipment_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_SHIPMENT_Tbl
  ,p_Hd_Tax_Detail_Tbl              in   ASO_Quote_Pub.TAX_DETAIL_TBL_TYPE
                                    := ASO_Quote_Pub.G_MISS_Tax_Detail_Tbl
  ,p_Hd_Freight_Charge_Tbl          in   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Freight_Charge_Tbl

  ,p_qte_line_tbl                   in  ASO_Quote_Pub.Qte_Line_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_QTE_LINE_TBL
  ,p_Qte_Line_Dtl_Tbl               in   ASO_Quote_Pub.Qte_Line_Dtl_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_QTE_LINE_DTL_TBL
  ,p_Line_rltship_tbl               in   ASO_Quote_Pub.Line_Rltship_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Line_Rltship_Tbl
  ,p_Line_Attr_Ext_Tbl              in   ASO_Quote_Pub.Line_Attribs_Ext_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Line_Attribs_Ext_Tbl
  ,p_Ln_Price_Attributes_Tbl        in   ASO_Quote_Pub.Price_Attributes_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Price_Attributes_Tbl
  ,p_Ln_Payment_Tbl                 in   ASO_Quote_Pub.Payment_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_PAYMENT_TBL
  ,p_Ln_Shipment_Tbl                in   ASO_Quote_Pub.Shipment_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_SHIPMENT_TBL
  ,p_Ln_Tax_Detail_Tbl              in   ASO_Quote_Pub.TAX_DETAIL_TBL_TYPE
                                    := ASO_Quote_Pub.G_MISS_Tax_Detail_Tbl
  ,p_Ln_Freight_Charge_Tbl          in   ASO_Quote_Pub.Freight_Charge_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Freight_Charge_Tbl
  ,p_Price_Adj_Attr_Tbl             in   ASO_Quote_Pub.Price_Adj_Attr_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_PRICE_ADJ_ATTR_Tbl
  ,p_Price_Adjustment_Tbl           in   ASO_Quote_Pub.Price_Adj_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Price_Adj_Tbl
  ,p_Price_Adj_Rltship_Tbl          in   ASO_Quote_Pub.Price_Adj_Rltship_Tbl_Type
                                    := ASO_Quote_Pub.G_MISS_Price_Adj_Rltship_Tbl

  ,x_qte_header_rec                 OUT NOCOPY  ASO_Quote_Pub.Qte_Header_Rec_Type
  ,x_qte_line_tbl                   OUT NOCOPY  ASO_Quote_Pub.Qte_Line_Tbl_Type
  ,X_Return_Status                  OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                      OUT NOCOPY  NUMBER
  ,X_Msg_Data                       OUT NOCOPY  VARCHAR2
)
IS
  l_api_name                    CONSTANT VARCHAR2(30)    := 'UpdateQuoteForSharee';
Line: 5260

      IBE_Util.Debug('Begin IBE_Quote_Save_pvt.UpdateQuoteForSharee()');
Line: 5264

   SAVEPOINT    UpdateQuoteForSharee_pvt;
Line: 5306

     IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() starts');
Line: 5309

  ASO_Quote_Pub.Update_Quote(
     P_Api_Version_Number        => P_Api_Version_Number
          ,P_Init_Msg_List            => FND_API.G_FALSE
          ,P_Commit                => FND_API.G_FALSE
          ,P_Control_Rec            => p_control_rec
          ,P_qte_header_rec            => l_Qte_Header_Rec
          ,P_Qte_Line_Tbl            => p_Qte_Line_Tbl
            ,p_Line_rltship_tbl             => p_Line_rltship_tbl
            ,p_Qte_Line_Dtl_Tbl             => p_Qte_Line_Dtl_Tbl
            ,p_Hd_Price_Attributes_Tbl      => p_Hd_Price_Attributes_Tbl
            ,p_Hd_Payment_Tbl               => p_Hd_Payment_Tbl
            ,p_Hd_Shipment_Tbl              => p_Hd_Shipment_Tbl
            ,p_Hd_Tax_Detail_Tbl            => p_Hd_Tax_Detail_Tbl
            ,p_Ln_Price_Attributes_Tbl      => p_Ln_Price_Attributes_Tbl
            ,p_Ln_Payment_Tbl               => p_Ln_Payment_Tbl
            ,p_Ln_Shipment_Tbl              => p_Ln_Shipment_Tbl
            ,p_Ln_Tax_Detail_Tbl            => p_Ln_Tax_Detail_Tbl
            ,p_Price_Adj_Attr_Tbl           => p_Price_Adj_Attr_Tbl
            ,p_Price_Adjustment_Tbl         => p_Price_Adjustment_Tbl
            ,p_Price_Adj_Rltship_Tbl        => p_Price_Adj_Rltship_Tbl
            ,p_Line_Attr_Ext_Tbl            => p_Line_Attr_Ext_Tbl
            ,p_Hd_Freight_Charge_Tbl        => p_Hd_Freight_Charge_Tbl
            ,p_Ln_Freight_Charge_Tbl        => p_Ln_Freight_Charge_Tbl

          ,x_qte_header_rec            => x_Qte_Header_Rec
          ,X_Qte_Line_Tbl            => x_Qte_Line_Tbl
          ,X_Qte_Line_Dtl_Tbl            => lx_Qte_Line_Dtl_Tbl
            ,x_Hd_Price_Attributes_Tbl        => lX_Hd_Price_Attributes_Tbl
            ,X_Hd_Payment_Tbl            => lx_Hd_Payment_Tbl
            ,X_Hd_Shipment_Tbl            => lx_Hd_Shipment_Tbl
            ,X_Hd_Freight_Charge_Tbl        => lx_Hd_Freight_Charge_Tbl
            ,X_Hd_Tax_Detail_Tbl        => lx_Hd_Tax_Detail_Tbl
          ,x_Line_Attr_Ext_Tbl            => lx_Line_Attr_Ext_Tbl
          ,X_Line_rltship_tbl            => lx_Line_Rltship_Tbl
          ,X_Price_Adjustment_Tbl        => lx_Price_Adjustment_Tbl
            ,X_Price_Adj_Attr_Tbl        => lX_Price_Adj_Attr_Tbl
          ,X_Price_Adj_Rltship_Tbl        => lx_Price_Adj_Rltship_Tbl
            ,X_Ln_Price_Attributes_Tbl        => lX_Ln_Price_Attributes_Tbl
            ,X_Ln_Payment_Tbl            => lx_Ln_Payment_Tbl
            ,X_Ln_Shipment_Tbl            => lx_Ln_Shipment_Tbl
            ,X_Ln_Freight_Charge_Tbl        => lx_Ln_Freight_Charge_Tbl
            ,X_Ln_Tax_Detail_Tbl            => lx_Ln_Tax_Detail_Tbl
          ,X_Return_Status                => x_return_status
          ,X_Msg_Count                    => x_msg_count
          ,X_Msg_Data                     => x_msg_data);
Line: 5356

     IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() finishes');
Line: 5372

    l_qte_header_rec.last_update_date :=x_qte_header_rec.last_update_date;
Line: 5380

          IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() starts');
Line: 5383

       ASO_Quote_Pub.Update_quote(
          P_Api_Version_Number        => P_Api_Version_Number
          ,P_Init_Msg_List            => FND_API.G_FALSE
          ,P_Commit                => FND_API.G_FALSE
         ,P_qte_header_rec            => l_Qte_Header_Rec
          ,x_qte_header_rec            => x_Qte_Header_Rec
          ,X_Qte_Line_Tbl            => x_Qte_Line_Tbl
          ,X_Qte_Line_Dtl_Tbl            => lx_Qte_Line_Dtl_Tbl
            ,x_Hd_Price_Attributes_Tbl        => lX_Hd_Price_Attributes_Tbl
            ,X_Hd_Payment_Tbl            => lx_Hd_Payment_Tbl
            ,X_Hd_Shipment_Tbl            => lx_Hd_Shipment_Tbl
            ,X_Hd_Freight_Charge_Tbl        => lx_Hd_Freight_Charge_Tbl
            ,X_Hd_Tax_Detail_Tbl        => lx_Hd_Tax_Detail_Tbl
          ,x_Line_Attr_Ext_Tbl            => lx_Line_Attr_Ext_Tbl
          ,X_Line_rltship_tbl            => lx_Line_Rltship_Tbl
          ,X_Price_Adjustment_Tbl        => lx_Price_Adjustment_Tbl
            ,X_Price_Adj_Attr_Tbl        => lX_Price_Adj_Attr_Tbl
          ,X_Price_Adj_Rltship_Tbl        => lx_Price_Adj_Rltship_Tbl
            ,X_Ln_Price_Attributes_Tbl        => lX_Ln_Price_Attributes_Tbl
            ,X_Ln_Payment_Tbl            => lx_Ln_Payment_Tbl
            ,X_Ln_Shipment_Tbl            => lx_Ln_Shipment_Tbl
            ,X_Ln_Freight_Charge_Tbl        => lx_Ln_Freight_Charge_Tbl
            ,X_Ln_Tax_Detail_Tbl            => lx_Ln_Tax_Detail_Tbl
          ,X_Return_Status                => x_return_status
          ,X_Msg_Count                    => x_msg_count
          ,X_Msg_Data                     => x_msg_data);
Line: 5411

          IBE_Util.Debug('ASO_Quote_Pub.Update_Quote() finishes');
Line: 5433

      IBE_Util.Debug('End   IBE_Quote_Save_pvt.UpdateQuoteForSharee()');
Line: 5438

      ROLLBACK TO UpdateQuoteForSharee_pvt;
Line: 5444

         IBE_Util.Debug('End   IBE_Quote_Save_pvt.UpdateQuoteForSharee()');
Line: 5448

      ROLLBACK TO UpdateQuoteForSharee_pvt;
Line: 5454

         IBE_Util.Debug('End   IBE_Quote_Save_pvt.UpdateQuoteForSharee()');
Line: 5458

      ROLLBACK TO UpdateQuoteForSharee_pvt;
Line: 5470

         IBE_Util.Debug('End   IBE_Quote_Save_pvt.UpdateQuoteForSharee()');
Line: 5473

END UpdateQuoteForSharee;
Line: 5514

  ,x_last_update_date         OUT NOCOPY  DATE
  ,X_Return_Status            OUT NOCOPY  VARCHAR2
  ,X_Msg_Count                OUT NOCOPY  NUMBER
  ,X_Msg_Data                 OUT NOCOPY  VARCHAR2
)

IS

  l_api_name                  CONSTANT VARCHAR2(30)   := 'getHdrDefaultValues';
Line: 5956

       select shipment_id, SHIP_TO_PARTY_SITE_ID
         from ASO_shipments
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               quote_line_id is null;
Line: 5964

       select ship_to_party_id
         from ASO_shipments
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               quote_line_id is null                               and
               SHIP_TO_CUST_ACCOUNT_ID is null                     and
               SHIP_TO_PARTY_SITE_ID is null;
Line: 5975

       select quote_header_id, INVOICE_TO_PARTY_SITE_ID
         from ASO_quote_headers
         where QUOTE_HEADER_ID = l_quote_header_id;
Line: 5982

       select invoice_to_party_id
         from ASO_quote_headers
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               INVOICE_TO_CUST_ACCOUNT_ID is null                  and
               INVOICE_TO_PARTY_SITE_ID is null;
Line: 6024

                                                              opCode  = Update
         if shipTo_partyId is not null                     -> partyId = shipTo_partyId
         else
           there is shipment record but no shipTo_partyId  -> partyId = cookie's
     */

     IF (IBE_UTIL.G_DEBUGON = l_true) THEN
        IBE_Util.Debug('getDefaultAddress: l_party_id                       ='||l_party_id);
Line: 6072

             l_opCode      := 'UPDATE';
Line: 6112

             l_opCode := 'UPDATE';
Line: 6273

       select shipment_id, SHIP_METHOD_CODE
         from ASO_shipments
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               quote_line_id is null;
Line: 6281

       SELECT msite_information1
         FROM ibe_msite_information m, wsh_carrier_ship_methods o, oe_system_parameters_all oesp
         WHERE m.msite_id                    = l_msite_id
           AND m.msite_information_context   = l_ship_mthd
           AND m.msite_information1          = o.ship_method_code
           AND oesp.org_id                   = l_org_id
           AND o.organization_id             = oesp.master_organization_id
           AND o.web_enabled                 = l_web_enabled
           AND o.enabled_flag                = l_enabled_flag
         Order by msite_information1;
Line: 6336

          l_opCode      := 'UPDATE';
Line: 6519

       select payment_id, PAYMENT_TYPE_CODE
         from ASO_payments
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               quote_line_id is null;
Line: 6527

       SELECT msite_information1
         FROM ibe_msite_information a, fnd_lookup_values b
         WHERE a.msite_id                    = l_msite_id
           AND a.msite_information1          = b.lookup_code
           AND a.msite_information1          = 'CREDIT_CARD'
           AND b.LOOKUP_TYPE                 = 'IBE_PAYMENT_TYPE'
           AND b.ENABLED_FLAG                ='Y' AND (b.TAG='Y' or b.TAG is null)
           AND b.language                    = userenv('lang');
Line: 6539

       SELECT msite_information1
         FROM ibe_msite_information a, fnd_lookup_values b
         WHERE a.msite_id                    = l_msite_id
           AND a.msite_information1          = b.lookup_code
           AND a.msite_information1          <> 'CREDIT_CARD'
           AND b.LOOKUP_TYPE                 = 'IBE_PAYMENT_TYPE'
           AND b.ENABLED_FLAG                ='Y' AND (b.TAG='Y' or b.TAG is null)
           AND b.language                    = userenv('lang');
Line: 6592

          l_opCode      := 'UPDATE';
Line: 6835

       select tax_detail_id, tax_exempt_flag
         from ASO_TAX_DETAILS
         where QUOTE_HEADER_ID = l_quote_header_id                 and
               quote_line_id is null;
Line: 6883

          l_opCode        := 'UPDATE';
Line: 6951

       select quote_header_id, end_customer_party_id, end_customer_cust_party_id, end_customer_party_site_id, end_customer_cust_account_id
         from ASO_quote_headers
         where QUOTE_HEADER_ID = l_quote_header_id;
Line: 6958

       select SHIP_TO_CUST_ACCOUNT_ID, ship_to_party_id, ship_to_party_site_id
         from aso_shipments
         where QUOTE_HEADER_ID = l_quote_header_id and
               quote_line_id is null;
Line: 7134

  IBE_Quote_Misc_pvt.validate_user_update(
              p_init_msg_list            => p_Init_Msg_List
             ,p_quote_header_id         => p_quote_id
             ,p_party_id                 => p_party_id
             ,p_cust_account_id          => p_cust_account_id
             ,p_quote_retrieval_number   => p_quote_retrieval_number
             ,p_validate_user            => p_validate_user
             ,x_return_status         => x_return_status
             ,x_msg_count         => x_msg_count
             ,x_msg_data         => x_msg_data
             );
Line: 7201

      this is done because recipients cannot update a cart after it becomes a quote*/
      IF(IBE_UTIL.G_DEBUGON = 'Y') THEN
        IBE_UTIL.DEBUG('Calling share_readonly to downgrade the access levels of  all recipients to R status');
Line: 7300

          x_last_update_date   OUT NOCOPY Date                ,
          x_quote_header_id    OUT NOCOPY NUMBER              ,
          p_last_update_date   IN  Date                       ,
          p_quote_header_id    IN  NUMBER:= FND_API.G_MISS_NUM,
          p_party_id           IN  NUMBER:= FND_API.G_MISS_NUM,
          p_cust_account_id    IN  NUMBER:= FND_API.G_MISS_NUM,
          p_validate_user      IN  VARCHAR2:= FND_API.G_FALSE ,
          P_new_quote_name     IN  VARCHAR2                   ,
          p_retrieval_number   IN  NUMBER   := FND_API.G_MISS_NUM,
          p_minisite_id        IN  NUMBER ) is

  CURSOR  c_check_for_quote(c_quote_header_id NUMBER) IS
     SELECT count(*) is_published_quote
     FROM ASO_QUOTE_HEADERS_ALL
     WHERE quote_header_id = c_quote_header_id
       AND resource_id is not null
       AND publish_flag = 'Y';
Line: 7319

     select count(*) is_shared_cart
     from ibe_sh_quote_access
     where quote_header_id = c_quote_header_id;
Line: 7347

    SELECT order_type_id,currency_code, price_list_id		-- bug 11805700,scnagara
	 FROM aso_quote_headers
	WHERE quote_header_id = p_quote_header_id;
Line: 7360

  lx_last_update_date   DATE;
Line: 7377

     IBE_UTIL.DEBUG('DUPLICATE_CART: p_last_update_date = '||p_last_update_date);
Line: 7417

  IBE_Quote_Misc_pvt.Validate_User_Update
   (  p_init_msg_list   => p_Init_Msg_List
     ,p_quote_header_id => p_quote_header_id
     ,p_party_id        => p_party_id
     ,p_cust_account_id => p_cust_account_id
     ,p_validate_user   => p_validate_user
     ,p_quote_retrieval_number => p_retrieval_number
     ,p_save_type       => OP_DUPLICATE_CART
     ,p_last_update_date => p_last_update_date
     ,x_return_status   => lx_return_status
     ,x_msg_count       => lx_msg_count
     ,x_msg_data        => lx_msg_data
    );
Line: 7548

      ,x_last_update_date         => lx_last_update_date
      ,x_return_status            => x_return_status
      ,x_msg_count                => x_msg_count
      ,x_msg_data                 => x_msg_data
      );
Line: 7667

  ,x_last_update_date         OUT NOCOPY DATE
  ,x_return_status            OUT NOCOPY VARCHAR2
  ,x_msg_count                OUT NOCOPY NUMBER
  ,x_msg_data                 OUT NOCOPY VARCHAR2
) IS
  L_API_VERSION CONSTANT NUMBER       := 1.0;
Line: 7674

  lx_last_update_date   DATE;
Line: 7684

  l_refcursor_query VARCHAR2(1000) :=   'select aql.quote_header_id,
                                               aql.quote_line_id,
                                               aql.inventory_item_id,
                                               aql.organization_id,
	                                       aql.uom_code,
                                               aql.quantity,
	                                       aqld.config_header_id,
	                                       aqld.config_revision_num
                                        from aso_quote_lines_all aql,
                                             aso_quote_line_details AQLD
                                        where aqld.quote_line_id = aql.quote_line_id and
					      aqld.ref_line_id is null and
					      aql.quote_header_id = :1';
Line: 7803

           ,x_last_update_date            => x_last_update_date
           ,X_Return_Status               => x_return_status
           ,X_Msg_Count                   => x_msg_count
           ,X_Msg_Data                    => x_msg_data
           );
Line: 7825

    ,x_last_update_date        => lx_last_update_date
    ,X_Return_Status           => x_Return_Status
    ,X_Msg_Count               => x_Msg_Count
    ,X_Msg_Data                => x_Msg_Data
  );
Line: 7838

 l_Qte_Header_Rec.last_update_date := lx_last_update_date;
Line: 7945

  	SELECT primary_uom_code, service_duration_period_code, service_duration
	FROM mtl_system_items
	WHERE inventory_item_id = p_svc_item_id and organization_id = p_org_id;
Line: 8037

PROCEDURE UPDATE_SUPPORT_AND_QUANTITY(
	p_api_version        		IN  NUMBER,
    p_init_msg_list      		IN  VARCHAR2 := FND_API.G_FALSE,
    p_validation_level   		IN  NUMBER   := FND_API.G_VALID_LEVEL_FULL,
    x_return_status      		OUT NOCOPY VARCHAR2,
    x_msg_count          		OUT NOCOPY NUMBER,
    x_msg_data           		OUT NOCOPY VARCHAR2,

    p_quote_header_id			IN	NUMBER,
    p_quote_line_id_tbl			IN	JTF_NUMBER_TABLE := NULL,
    p_line_quantity_tbl			IN 	JTF_NUMBER_TABLE := NULL,
    p_new_service_id_tbl		IN 	JTF_NUMBER_TABLE := NULL,
   	p_organization_id           IN  NUMBER   := FND_API.G_MISS_NUM,

    p_party_id                  IN  NUMBER   := FND_API.G_MISS_NUM,
    p_cust_account_id           IN  NUMBER   := FND_API.G_MISS_NUM,
    p_sharee_number             IN  NUMBER   := FND_API.G_MISS_NUM,

   	p_minisite_id               IN  NUMBER   := FND_API.G_MISS_NUM,
   	p_price_list_id             IN  NUMBER   := FND_API.G_MISS_NUM,
   	p_currency_code             IN  VARCHAR2 := FND_API.G_MISS_CHAR,
	p_header_pricing_event      IN  VARCHAR2 := FND_API.G_MISS_CHAR,
   	p_save_type                 IN  NUMBER   := FND_API.G_MISS_NUM,
    p_last_update_date			IN 	DATE	:= FND_API.G_MISS_DATE,
    x_last_update_date			IN OUT	NOCOPY DATE
)
IS
  l_api_name	      	CONSTANT VARCHAR2(30) := 'UPDATE_SUPPORT_AND_QUANTITY';
Line: 8090

  l_deleted_svc_map_tbl	JTF_VARCHAR2_TABLE_100 := NULL;
Line: 8098

	SELECT AQL.quote_line_id,ALD.service_ref_line_id,AQL.inventory_item_id
	FROM aso_quote_lines_all AQL, aso_quote_line_details ALD
	WHERE AQL.quote_header_id = p_quote_header_id and AQL.quote_line_id=ALD.quote_line_id
		and AQL.item_type_code='SRV'
	ORDER BY ALD.service_ref_line_id,AQL.inventory_item_id;
Line: 8105

  	SELECT quote_line_id, quantity FROM aso_quote_lines_all
  	WHERE quote_header_id = p_quote_header_id and ITEM_TYPE_CODE='SVA'
  	ORDER BY quote_line_id;
Line: 8110

  	SELECT quantity FROM aso_quote_lines_all
  	WHERE quote_line_id = p_quote_line_id;
Line: 8114

  	SAVEPOINT UPDATE_SUPPORT_LEVEL_AND_QTY;
Line: 8176

			IBE_UTIL.debug('Need to update quantity');
Line: 8180

			IBE_UTIL.debug('No need to update quantity');
Line: 8198

	-- update quantities
	IF l_line_qty_size>0 THEN
		IF (IBE_UTIL.G_DEBUGON = FND_API.G_TRUE) THEN
			IBE_UTIL.debug('updating quantities, l_line_rec_index='||l_line_rec_index);
Line: 8207

			l_quote_line_tbl(l_line_rec_index).operation_code := 'UPDATE';
Line: 8216

			IBE_UTIL.debug('quantities updated, l_line_rec_index='||l_line_rec_index);
Line: 8219

		IBE_UTIL.debug('no quantity updated, l_line_rec_index='||l_line_rec_index);
Line: 8283

				IBE_UTIL.debug('checking if need to update quantity...');
Line: 8291

						l_quote_line_id_tbl.DELETE(i);
Line: 8292

						l_line_quantity_tbl.DELETE(i);
Line: 8333

			IF l_deleted_svc_map_tbl IS NULL THEN
			l_deleted_svc_map_tbl := JTF_VARCHAR2_TABLE_100();
Line: 8336

			l_deleted_svc_map_tbl.EXTEND;
Line: 8337

			l_deleted_svc_map_tbl(l_map_index) := 'DELETE';
Line: 8340

					IBE_UTIL.debug('populating l_deleted_svc_map_tbl table,l_map_index='||l_map_index);
Line: 8345

						l_deleted_svc_map_tbl(l_map_index) := 'KEEP'; -- keep the svc item
Line: 8349

						l_new_service_id_tbl.DELETE(i);
Line: 8356

					IBE_UTIL.debug('l_deleted_svc_map_tbl('||l_map_index||')='||l_deleted_svc_map_tbl(l_map_index));
Line: 8362

			IBE_UTIL.debug('applying l_deleted_svc_map_tbl table, service item='||rec_svc_line.inventory_item_id);
Line: 8363

			IBE_UTIL.debug('l_map_index='||l_map_index||', opcode='||l_deleted_svc_map_tbl(l_map_index));
Line: 8365

		IF l_deleted_svc_map_tbl(l_map_index) = 'DELETE' THEN
			IF (IBE_UTIL.G_DEBUGON = FND_API.G_TRUE) THEN
				IBE_UTIL.debug('deleting svc line, inventory_item_id='||rec_svc_line.inventory_item_id);
Line: 8369

			l_quote_line_tbl(l_line_rec_index).operation_code := 'DELETE';
Line: 8374

				IBE_UTIL.debug('svc line deleted, l_line_rec_index='||l_line_rec_index);
Line: 8430

						l_quote_line_id_tbl.DELETE(i);
Line: 8431

						l_line_quantity_tbl.DELETE(i);
Line: 8478

			IBE_UTIL.debug('nothing to update, returning...');
Line: 8518

	l_quote_header_rec.last_update_date := p_last_update_date;
Line: 8537

    	,p_auto_update_active_quote => FND_API.G_FALSE
    	,p_combinesameitem          => 1

    	,p_sharee_number            => p_sharee_number
    	,p_sharee_party_id          => l_sharee_party_id
    	,p_sharee_cust_account_id   => l_sharee_cust_account_id

    	,p_minisite_id              => p_minisite_id
    	,p_control_rec              => l_control_rec
    	,p_qte_header_rec           => l_quote_header_rec
    	,p_qte_line_tbl             => l_quote_line_tbl
    	,p_qte_line_dtl_tbl         => l_quote_line_dtl_tbl
	    ,p_save_type                => p_save_type
	    ,x_quote_header_id          => l_quote_header_id
	    ,x_last_update_date         => x_last_update_date
	    ,x_return_status            => x_return_status
    	,x_msg_count                => x_msg_count
	    ,x_msg_data                 => x_msg_data);
Line: 8558

		IBE_UTIL.debug('x_last_update_date='||x_last_update_date);
Line: 8566

      ROLLBACK TO UPDATE_SUPPORT_LEVEL_AND_QTY;
Line: 8573

      ROLLBACK TO UPDATE_SUPPORT_LEVEL_AND_QTY;
Line: 8580

      ROLLBACK TO UPDATE_SUPPORT_LEVEL_AND_QTY;
Line: 8588

END UPDATE_SUPPORT_AND_QUANTITY;