DBA Data[Home] [Help]

APPS.PON_NEGOTIATION_HELPER_PVT SQL Statements

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

Line: 38

  SELECT MIN(disp_line_number)
  INTO x_min_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'GROUP', 'LINE')
  AND SUB_LINE_SEQUENCE_NUMBER > p_value;
Line: 89

  SELECT MAX(DISP_LINE_NUMBER)
  INTO x_max_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'LINE', 'GROUP')
  AND SUB_LINE_SEQUENCE_NUMBER < p_value;
Line: 114

  SELECT GROUP_TYPE, LINE_NUMBER
  INTO l_group_type, l_line_number
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_auction_header_id
  AND DISP_LINE_NUMBER = x_max_disp_line_num;
Line: 131

    SELECT NVL (MAX(DISP_LINE_NUMBER), x_max_disp_line_num)
    INTO x_max_disp_line_num
    FROM PON_AUCTION_ITEM_PRICES_ALL
    WHERE AUCTION_HEADER_ID = p_auction_header_id
    AND PARENT_LINE_NUMBER = l_line_number;
Line: 160

  SELECT REQUEST_ID
  INTO x_request_id
  FROM PON_AUCTION_HEADERS_ALL
  WHERE AUCTION_HEADER_ID = p_auction_header_id;
Line: 215

  SELECT
    LINE_NUMBER
  INTO
    l_line_number
  FROM
    PON_PRICE_ELEMENTS
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id AND
    (PRICING_BASIS = 'FIXED_AMOUNT' OR PRICING_BASIS = 'PER_UNIT') AND
    ROWNUM = 1;
Line: 289

  SELECT
    PAIP.LINE_NUMBER
  INTO
    l_line_number
  FROM
    PON_AUCTION_ITEM_PRICES_ALL PAIP,
    PON_PRICE_ELEMENTS PPE
  WHERE
    PAIP.AUCTION_HEADER_ID = p_auction_header_id AND
    PPE.AUCTION_HEADER_ID = p_auction_header_id AND
    PAIP.LINE_NUMBER = PPE.LINE_NUMBER AND
    PAIP.PURCHASE_BASIS = 'GOODS' AND
    PPE.PRICING_BASIS = 'FIXED_AMOUNT' AND
    ROWNUM = 1;
Line: 376

  SELECT
    NVL (number_of_lines, 0),
    NVL (max_internal_line_num, 0),
    NVL (max_document_line_num, 0)
  INTO
    l_number_of_lines,
    x_max_internal_line_num,
    x_max_document_line_num
  FROM
    pon_auction_headers_all
  WHERE
    auction_header_id = p_auction_header_id;
Line: 391

    SELECT
      GREATEST (x_max_internal_line_num, NVL(MAX(items.line_number),0)),
      GREATEST (x_max_document_line_num, NVL(MAX(DECODE (items.group_type, 'LOT_LINE', 0, 'GROUP_LINE', 0, items.sub_line_sequence_number)),0)),
      NVL (MAX(items.disp_line_number), 0)
    INTO
      x_max_internal_line_num,
      x_max_document_line_num,
      x_max_disp_line_num
    FROM
      pon_auction_item_prices_all items
    WHERE
      items.auction_header_id = p_auction_header_id;
Line: 469

  SELECT
    COUNT(LINE_NUMBER)
  INTO
    x_number_of_lines
  FROM
    PON_AUCTION_ITEM_PRICES_ALL
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id;
Line: 529

  SELECT
    LINE_NUMBER
  INTO
    l_line_number
  FROM
    PON_AUCTION_ITEM_PRICES_ALL
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id AND
    ROWNUM = 1;
Line: 607

  SELECT MAX(LINE_NUMBER)
  INTO l_max_line_number
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID=p_auction_header_id;
Line: 632

      DELETE FROM
        pon_attribute_scores
      WHERE
        auction_header_id = p_auction_header_id AND
        line_number >= l_batch_start AND
        line_number <= l_batch_end;
Line: 640

      DELETE FROM
        pon_auction_attributes
      WHERE
        auction_header_id = p_auction_header_id AND
        sequence_number < 0 AND
        line_number >= l_batch_start AND
        line_number <= l_batch_end;
Line: 649

      UPDATE
        pon_auction_attributes
      SET
        scoring_type = 'NONE',
        weight = 0,
        last_update_date = sysdate,
        last_updated_by = FND_GLOBAL.user_id
      WHERE
        auction_header_id = p_auction_header_id AND
        line_number >= l_batch_start AND
        line_number <= l_batch_end;
Line: 728

    SELECT
      'Y'
    INTO
      x_has_price_elements
    FROM
      pon_price_elements
    WHERE
      auction_header_id = p_auction_header_id AND
      rownum = 1;
Line: 798

    SELECT
      'Y'
    INTO
      x_has_supplier_price_elements
    FROM
      pon_price_elements
    WHERE
      auction_header_id = p_auction_header_id AND
      pf_type = 'SUPPLIER' AND
      rownum = 1;
Line: 869

    SELECT
      'Y'
    INTO
      x_has_buyer_price_elements
    FROM
      pon_price_elements
    WHERE
      auction_header_id = p_auction_header_id AND
      pf_type = 'BUYER' AND
      rownum = 1;
Line: 917

                                  being deleted. This method can be called once
                                  after a set of lines have been deleted and it will do
                                  the sync for all.
               3. p_add_pf - 'Y' implies the new price factors have to be added
                                 else it is 'N'
               4. p_del_pf - 'Y' implies the deleted price factors have to be removed
                                 else it is 'N'
               5. x_result - return status.
               6. x_error_code - error code
               7. x_error_message - The actual error message
  COMMENT    : This procedure will synchronise the price factor
               values table when the price factors of a line is added/deleted/modified
====================================================================================*/

PROCEDURE SYNC_PF_VALUES_ITEM_PRICES(
           p_auction_header_id IN NUMBER,
           p_line_number IN NUMBER,
           p_add_pf IN VARCHAR2,
           p_del_pf IN VARCHAR2,
           x_result OUT NOCOPY  VARCHAR2,
           x_error_code OUT NOCOPY VARCHAR2,
           x_error_message OUT NOCOPY VARCHAR2)
is
l_module_name VARCHAR2 (30);
Line: 959

                        message => 'Inserting newly added/modified price factors...'
                        );
Line: 963

                insert into PON_LARGE_NEG_PF_VALUES (auction_header_id,price_element_type_id,pricing_basis,
                                         supplier_seq_number,value,creation_date,created_by,last_update_date,last_updated_by,last_update_login)
                                         select distinct PPE.auction_header_id,PPE.price_element_type_id,PPE.pricing_basis,
                                         PBP.sequence,null,sysdate,fnd_global.user_id,sysdate,fnd_global.user_id,fnd_global.login_id
                                         from
                                         PON_PRICE_ELEMENTS PPE, PON_BIDDING_PARTIES PBP
                                         where
                                         PPE.auction_header_id = p_auction_header_id and
                                         PBP.auction_header_id = p_auction_header_id and
                                         PPE.line_number = p_line_number and
                                         PPE.pf_type = 'BUYER' and
                                         not exists (
                                         select pf_values.price_element_type_id,pf_values.pricing_basis
                                         from
                                         PON_LARGE_NEG_PF_VALUES pf_values
                                         where auction_header_id = p_auction_header_id
                                         and PPE.price_element_type_id = pf_values.price_element_type_id
                                         and PPE.pricing_basis = pf_values.pricing_basis
                                         and rownum = 1);
Line: 989

                        message => 'Removing the deleted/modified price factors...'
                        );
Line: 993

    delete from PON_LARGE_NEG_PF_VALUES pf_values
    where
    auction_header_id = p_auction_header_id and
                not exists (
                select PPE.price_element_type_id,PPE.pricing_basis
                from
                PON_PRICE_ELEMENTS PPE
                where auction_header_id = p_auction_header_id
                and PPE.price_element_type_id = pf_values.price_element_type_id
                and PPE.pricing_basis = pf_values.pricing_basis
                and PPE.pf_type = 'BUYER'
                and rownum = 1);
Line: 1038

                            DELETE_SUPPLIER => Delete the price factor values for a supplier
                                                who is deleted
               4. x_result - return status.
               5. x_error_code - error code
               6. x_error_message - The actual error message
  COMMENT    : This procedure will synchronise the price factor
               values when a supplier is added/deleted
====================================================================================*/

PROCEDURE SYNC_PF_VALUES_BIDDING_PARTIES(
                p_auction_header_id IN NUMBER,
                p_supplier_seq_num IN NUMBER,
                p_action IN VARCHAR2,
                x_result OUT NOCOPY  VARCHAR2,
                x_error_code OUT NOCOPY VARCHAR2,
                x_error_message OUT NOCOPY VARCHAR2)
is
        l_supplier_seq_num  NUMBER := null;
Line: 1086

                SELECT 'Y'
                INTO l_supplier_exists
                FROM pon_large_neg_pf_values
                WHERE auction_header_id = p_auction_header_id and supplier_seq_number = p_supplier_seq_num and rownum = 1;
Line: 1101

                        select supplier_seq_number into l_supplier_seq_num from PON_LARGE_NEG_PF_VALUES
                        where auction_header_id = p_auction_header_id
                        and rownum = 1;
Line: 1118

                         insert into PON_LARGE_NEG_PF_VALUES (auction_header_id,price_element_type_id,pricing_basis,
                                                 supplier_seq_number,value,creation_date,created_by,last_update_date,last_updated_by,last_update_login)
                                                 select auction_header_id,price_element_type_id,pricing_basis,
                                                 p_supplier_seq_num,null,sysdate,fnd_global.user_id,sysdate,fnd_global.user_id,fnd_global.login_id
                                                 from
                                                 PON_LARGE_NEG_PF_VALUES
                                                 where
                                                 auction_header_id = p_auction_header_id and
                                                 supplier_seq_number = l_supplier_seq_num;
Line: 1136

                         insert into PON_LARGE_NEG_PF_VALUES (auction_header_id,price_element_type_id,pricing_basis,
                                                 supplier_seq_number,value,creation_date,created_by,last_update_date,last_updated_by,last_update_login)
                                                 select distinct auction_header_id,price_element_type_id,pricing_basis,
                                                 p_supplier_seq_num,null,sysdate,fnd_global.user_id,sysdate,fnd_global.user_id,fnd_global.login_id
                                                 from
                                                 PON_PRICE_ELEMENTS
                                                 where
                                                 auction_header_id = p_auction_header_id and
                                                 pf_type = 'BUYER';
Line: 1155

   elsif p_action = 'DELETE_SUPPLIER' then
                IF (FND_LOG.level_statement >= FND_LOG.g_current_runtime_level) THEN
                        FND_LOG.string (log_level => FND_LOG.level_statement,
                        module => g_module_prefix || l_module_name,
                        message => 'deleting price factors for the deleted supplier with sequence number: '||p_supplier_seq_num
                        );
Line: 1163

     delete from PON_LARGE_NEG_PF_VALUES
     where
     auction_header_id = p_auction_header_id AND
     supplier_seq_number = p_supplier_seq_num;
Line: 1195

PROCEDURE Delete_Payment_Attachments (
  p_auction_header_id IN NUMBER,
  p_curr_from_line_number IN NUMBER,
  p_curr_to_line_number IN NUMBER
) IS

l_module_name VARCHAR2 (30);
Line: 1203

CURSOR delete_attachments IS
	SELECT distinct (TO_NUMBER(pk2_value)) line_number
        FROM   FND_ATTACHED_DOCUMENTS fnd
    WHERE
           fnd.pk1_value = p_auction_header_id
	 AND   fnd.pk2_value between  to_char(p_curr_from_line_number) and to_char(p_curr_to_line_number)
         AND   fnd.entity_name = 'PON_AUC_PAYMENTS_SHIPMENTS';
Line: 1212

  l_module_name := 'Delete_Payment_Attachments';
Line: 1223

      message => 'before Call FND_ATTACHED_DOCUMENTS2_PKG.DELETE_ATTACHMENTS = ' || l_module_name);
Line: 1227

    FOR delete_attachments_rec IN delete_attachments LOOP
      IF (FND_LOG.level_procedure >= FND_LOG.g_current_runtime_level) THEN
          FND_LOG.string (log_level => FND_LOG.level_procedure,
           module => g_module_prefix || l_module_name,
           message => 'Deleting fnd attachments for all the payments for line ' ||delete_attachments_rec.line_number||'='|| l_module_name);
Line: 1234

       FND_ATTACHED_DOCUMENTS2_PKG.DELETE_ATTACHMENTS
        (x_entity_name  => 'PON_AUC_PAYMENTS_SHIPMENTS',
         x_pk1_value => p_auction_header_id,
         x_pk2_value => delete_attachments_rec.line_number,
	 x_delete_document_flag => 'Y');
Line: 1244

      message => 'After Call FND_ATTACHED_DOCUMENTS2_PKG.DELETE_ATTACHMENTS = ' || l_module_name);
Line: 1253

END Delete_Payment_Attachments;
Line: 1256

   PROCEDURE : delete_all_lines
   PARAMETERS: 1. x_result - return status.
               2. x_error_code - error code
               3. x_error_message - The actual error message
               4. p_auction_header_id - The auction header id
   COMMENT   : This procedure deletes all the lines in the negotiation
               and also its children
======================================================================*/

PROCEDURE delete_all_lines (
  x_result OUT NOCOPY VARCHAR2,
  x_error_code OUT NOCOPY VARCHAR2,
  x_error_message OUT NOCOPY VARCHAR2,
  p_auction_header_id IN NUMBER
) IS

--Cursor to find out lines that have attachments
CURSOR lines_with_attachements IS
  SELECT
    DISTINCT (TO_NUMBER(pk2_value)) line_number
  FROM
    fnd_attached_documents
  WHERE
    entity_name = 'PON_AUCTION_ITEM_PRICES_ALL' AND
    pk1_value = to_char(p_auction_header_id) AND
    pk2_value IS NOT NULL;
Line: 1285

  SELECT
    line_number, org_id
  FROM
    pon_auction_item_prices_all
  WHERE
    auction_header_id = t_auction_header_id AND
    requisition_number IS NOT NULL;
Line: 1320

  l_module_name := 'delete_all_lines';
Line: 1341

  SELECT
    paha.bid_ranking,
    paha.line_attribute_enabled_flag,
    pad.doctype_group_name,
    paha.rfi_line_enabled_flag,
    paha.pf_type_allowed,
    paha.contract_type,
    paha.global_agreement_flag,
    paha.large_neg_enabled_flag,
    paha.auction_origination_code,
    paha.progress_payment_type,
    paha.price_tiers_indicator,
    paha.doctype_Id   -- Federal Fields Project
  INTO
    l_bid_ranking,
    l_line_attribute_enabled_flag,
    l_doctype_group_name,
    l_rfi_line_enabled_flag,
    l_pf_type_allowed,
    l_contract_type,
    l_global_agreement_flag,
    l_large_neg_enabled_flag,
    l_auction_origination_code,
    l_progress_payment_type,
    l_price_tiers_indicator,
    l_doctype_id
  FROM
    pon_auction_headers_all paha,
    pon_auc_doctypes pad
  WHERE
    paha.auction_header_id = p_auction_header_id AND
    paha.doctype_id = pad.doctype_id;
Line: 1374

  SELECT NVL (MAX (line_number), 0)
  INTO l_max_line_number
  FROM pon_auction_item_prices_all
  where auction_header_id = p_auction_header_id;
Line: 1388

        message => 'Found that this auction is a federal auction. Call delete all lines APi for Federal docs');
Line: 1392

      po_negotiations_sv1.update_sol_ref_delete_all(p_auction_header_id => p_auction_header_id,
                                                    x_return_status => x_result,
			                                              x_error_msg => x_error_message,
                                                    x_error_code => x_error_code);
Line: 1416

      PON_AUCTION_PKG.delete_negotiation_line_ref(
        x_negotiation_id => p_auction_header_id,
        x_negotiation_line_num => backing_req_line.line_number,
        x_org_id => backing_req_line.org_id,
        x_error_code => x_error_code);
Line: 1438

    FND_ATTACHED_DOCUMENTS2_PKG.delete_attachments (
      x_entity_name =>'PON_AUCTION_ITEM_PRICES_ALL',
      x_pk1_value => p_auction_header_id,
      x_pk2_value => attachment_line.line_number,
      x_pk3_value => NULL,
      x_pk4_value => NULL,
      x_pk5_value => NULL);
Line: 1475

          message => 'Before call Delete_Payment_Attachments = ' || l_module_name);
Line: 1478

      Delete_Payment_Attachments(
          p_auction_header_id => p_auction_header_id,
          p_curr_from_line_number => l_batch_start,
          p_curr_to_line_number => l_batch_end);
Line: 1490

      DELETE FROM
        pon_auc_payments_shipments
      WHERE
        auction_header_id = p_auction_header_id AND
        line_number >= l_batch_start AND
        line_number <= l_batch_end;
Line: 1513

        DELETE FROM
          pon_attribute_scores
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1540

        DELETE FROM
          pon_auction_attributes
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1559

        DELETE FROM
          pon_price_elements
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1573

        DELETE FROM
          pon_pf_supplier_values
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1601

            message => 'Price tiers indicator is not none , so need to delete Price tiers.');
Line: 1605

        DELETE FROM
          pon_auction_shipments_all
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1625

        DELETE FROM
          pon_price_differentials
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1644

        DELETE FROM
          pon_party_line_exclusions
        WHERE
          auction_header_id = p_auction_header_id AND
          line_number >= l_batch_start AND
          line_number <= l_batch_end;
Line: 1661

            DELETE FROM
                pon_auction_item_prices_ext_b
            WHERE
                auction_header_id = p_auction_header_id AND
                line_number >= l_batch_start AND
                line_number <= l_batch_end;
Line: 1677

        DELETE FROM pon_auction_attr_mapping_b
        WHERE       auction_header_id = p_auction_header_id
        AND         line_number >= l_batch_start
        AND         line_number <= l_batch_end
        AND         mapping_type IN ('ITEM_LINE', 'CAT_LINE');
Line: 1685

      DELETE FROM
        pon_auction_item_prices_all
      WHERE
        auction_header_id = p_auction_header_id AND
        line_number >= l_batch_start AND
        line_number <= l_batch_end;
Line: 1717

    DELETE FROM
      pon_large_neg_pf_values
    WHERE
      auction_header_id = p_auction_header_id;
Line: 1733

    DELETE FROM
      pon_auction_exhibit_details
    WHERE auction_header_id = p_auction_header_id
      AND IS_CDRL='N';
Line: 1753

    UPDATE
      pon_bidding_parties
    SET
      access_type = 'FULL'
    WHERE
      auction_header_id = p_auction_header_id AND
      access_type = 'RESTRICTED' AND
      (trading_partner_id, vendor_site_id) NOT IN
      (SELECT trading_partner_id, vendor_site_id
       FROM pon_party_line_exclusions
       WHERE auction_header_id = p_auction_header_id);
Line: 1791

END delete_all_lines;
Line: 1794

   PROCEDURE : delete_single_line
   PARAMETERS: 1. x_result - return status.
               2. x_error_code - error code
               3. x_error_message - The actual error message
               4. p_auction_header_id - The auction header id
               5. p_line_number - The line to be deleted
               6. p_group_type - The group type of the line to be
                  deleted.
               7. p_origination_code - The origination code for this line
               8. p_org_id - The org id for this line
               9. p_parent_line_number - The parent line number for
                   this line
               10. p_sub_line_sequence_number - The sub line sequence
                   number for this line
   COMMENT   : This procedure will delete the given line. If it is a lot
               or a group then all the lot line and group lines will
               also be deleted.
======================================================================*/

PROCEDURE delete_single_line (
  x_result OUT NOCOPY VARCHAR2, --1
  x_error_code OUT NOCOPY VARCHAR2, --2
  x_error_message OUT NOCOPY VARCHAR2, --3
  p_auction_header_id IN NUMBER, --4
  p_line_number IN NUMBER, --5
  p_group_type IN VARCHAR2, --6
  p_origination_code IN VARCHAR2, --7
  p_org_id IN NUMBER, --8
  p_parent_line_number IN NUMBER, --9
  p_sub_line_sequence_number IN NUMBER, --10
  x_number_of_lines_deleted IN OUT NOCOPY NUMBER --11
) IS

l_module_name VARCHAR2 (30);
Line: 1856

  SELECT
    DISTINCT (TO_NUMBER(fad.pk2_value)) line_number
  FROM
    fnd_attached_documents fad,
		pon_auction_item_prices_all paip
  WHERE
    fad.entity_name = 'PON_AUCTION_ITEM_PRICES_ALL' AND
    fad.pk1_value = TO_CHAR(p_auction_header_id) AND
    paip.auction_header_id = p_auction_header_id AND
    fad.pk2_value = paip.line_number AND
		(paip.line_number = p_line_number OR paip.parent_line_number = p_line_number);
Line: 1871

  SELECT
    line_number, org_id
  FROM
    pon_auction_item_prices_all
  WHERE
    auction_header_id = p_auction_header_id AND
		(line_number = p_line_number OR parent_line_number = p_line_number) AND
    requisition_number IS NOT NULL;
Line: 1882

CURSOR delete_payments_attachments IS
  SELECT
    DISTINCT (TO_NUMBER(fad.pk2_value)) line_number
  FROM
    fnd_attached_documents fad,
		pon_auction_item_prices_all paip
  WHERE
    fad.entity_name = 'PON_AUC_PAYMENTS_SHIPMENTS' AND
    fad.pk1_value = TO_CHAR(p_auction_header_id) AND
    paip.auction_header_id = p_auction_header_id AND
    fad.pk2_value = paip.line_number AND
		(paip.line_number = p_line_number OR paip.parent_line_number = p_line_number);
Line: 1897

  l_module_name := 'delete_single_line';
Line: 1924

  SELECT
    paha.bid_ranking,
    paha.line_attribute_enabled_flag,
    pad.doctype_group_name,
    paha.rfi_line_enabled_flag,
    paha.pf_type_allowed,
    paha.contract_type,
    paha.global_agreement_flag,
    paha.large_neg_enabled_flag,
    paha.auction_origination_code,
    paha.amendment_number,
    paha.auction_round_number,
    paha.progress_payment_type,
    paha.price_tiers_indicator,
    paha.doctype_id
  INTO
    l_bid_ranking,
    l_line_attribute_enabled_flag,
    l_doctype_group_name,
    l_rfi_line_enabled_flag,
    l_pf_type_allowed,
    l_contract_type,
    l_global_agreement_flag,
    l_large_neg_enabled_flag,
    l_auction_origination_code,
    l_amendment_number,
    l_auction_round_number,
    l_progress_payment_type,
    l_price_tiers_indicator,
    l_doctype_id
  FROM
    pon_auction_headers_all paha,
    pon_auc_doctypes pad
  WHERE
    paha.auction_header_id = p_auction_header_id AND
    paha.doctype_id = pad.doctype_id;
Line: 1965

    SELECT
      max_document_line_num
    INTO
      l_header_max_document_line_num
    FROM
      pon_auction_headers_all
    WHERE
      auction_header_id = p_auction_header_id;
Line: 1977

        message => 'The selected row is of type LINE/LOT_LINE/GROUP_LINE');
Line: 1994

      SELECT
        line_number
      INTO
        l_line_number
      FROM
        pon_auction_item_prices_all
      WHERE
        auction_header_id = p_auction_header_id and
        line_number = p_line_number;
Line: 2011

        x_number_of_lines_deleted := 0;
Line: 2020

    DELETE FROM
      pon_attribute_scores
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2029

        message => 'Deleted the entry in pon_attribute_scores');
Line: 2032

    DELETE FROM
      pon_auction_attributes
    WHERE
      auction_header_id = p_auction_header_id and
      line_number = p_line_number;
Line: 2041

        message => 'Entry in pon_auction_attributes deleted');
Line: 2044

    DELETE FROM
      pon_pf_supplier_values
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2053

        message => 'Deleted the entry in pon_pf_supplier_values');
Line: 2056

    DELETE FROM
      pon_price_elements
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2065

        message => 'Deleted the entry in pon_price_elements');
Line: 2068

    DELETE FROM
      pon_price_differentials
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2077

        message => 'Deleted the entry in pon_price_differentials');
Line: 2080

    DELETE FROM
      pon_auction_shipments_all
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2089

        message => 'Deleted the entry in pon_auction_shipments_all');
Line: 2098

           message => 'Delete attachments for  pon_auc_payments_shipments');
Line: 2103

      Delete_Payment_Attachments(
          p_auction_header_id => p_auction_header_id,
          p_curr_from_line_number => p_line_number,
          p_curr_to_line_number => p_line_number);
Line: 2112

           message => 'Deleted the attachments for  pon_auc_payments_shipments');
Line: 2115

      DELETE FROM
        pon_auc_payments_shipments
      WHERE
        auction_header_id = p_auction_header_id AND
        line_number = p_line_number;
Line: 2124

        message => 'Deleted the entry in pon_auc_payments_shipments');
Line: 2128

    DELETE FROM
      pon_party_line_exclusions
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2137

        message => 'Deleted the entry in PON_PARTY_LINE_EXCLUSIONS');
Line: 2142

            DELETE FROM
                pon_auction_item_prices_ext_b
            WHERE
                auction_header_id = p_auction_header_id AND
                line_number = p_line_number;
Line: 2157

      DELETE FROM pon_auction_attr_mapping_b
      WHERE       auction_header_id = p_auction_header_id
      AND         line_number = p_line_number
      AND         mapping_type IN ('ITEM_LINE', 'CAT_LINE');
Line: 2164

    SELECT exhibit_number
    INTO l_exhibit_number
    FROM pon_auction_item_prices_all
    WHERE auction_header_id = p_auction_header_id AND
          line_number = p_line_number;
Line: 2170

    DELETE FROM
      pon_auction_item_prices_all
    WHERE
      auction_header_id = p_auction_header_id AND
      line_number = p_line_number;
Line: 2179

        message => 'Deleted the entry in pon_auction_headers_all');
Line: 2183

       Deleting Exhibit Details whenever an ELIN is deleted.
       The API will handle whether Exhibit Details should be deleted or not.
    */
    IF(l_exhibit_number IS NOT NULL) THEN
        BEGIN
            PON_EXHIBITS_PKG.DELETE_EXHIBIT_DETAILS(p_auction_header_id,l_exhibit_number);
Line: 2193

       whenever a line is deleted
       */
    IF(l_exhibit_number IS NULL) THEN
       BEGIN
          PON_EXHIBITS_PKG.UPDATE_EXHIBIT_DETAILS(p_auction_header_id,p_line_number);
Line: 2229

    FND_ATTACHED_DOCUMENTS2_PKG.delete_attachments (
      x_entity_name =>  'PON_AUCTION_ITEM_PRICES_ALL',
      x_pk1_value => p_auction_header_id,
      x_pk2_value => p_line_number);
Line: 2237

        message => 'Deleted the line attachments');
Line: 2246

        message => 'Found that this auction is a federal auction. Call delete all lines APi for Federal docs');
Line: 2251

      po_negotiations_sv1.update_sol_ref_delete_line(p_auction_header_id => p_auction_header_id,
                                                     p_auction_line_number => p_line_number,
                                                     x_return_status => x_result,
			                                               x_error_msg => x_error_message,
                                                     x_error_code => x_error_code);
Line: 2258

      PON_AUCTION_PKG.delete_negotiation_line_ref(
        x_negotiation_id => p_auction_header_id,
        x_negotiation_line_num => p_line_number,
        x_org_id => p_org_id,
        x_error_code => x_error_code);
Line: 2273

        message => 'Deleted the line backing requisitions if any');
Line: 2282

      UPDATE
        pon_auction_item_prices_all
      SET
        modified_flag = 'Y',
        modified_date = sysdate,
        last_amendment_update = l_amendment_number
     WHERE
        auction_header_id = p_auction_header_id AND
        line_number = p_parent_line_number;
Line: 2297

      UPDATE
        PON_AUCTION_ITEM_PRICES_ALL
      SET
        MODIFIED_FLAG = 'Y',
        MODIFIED_DATE = SYSDATE
     WHERE
        AUCTION_HEADER_ID = p_auction_header_id AND
        LINE_NUMBER = p_parent_line_number;
Line: 2308

    x_number_of_lines_deleted := 1;
Line: 2313

    SELECT
      count(line_number)
    INTO
      x_number_of_lines_deleted
    FROM
      pon_auction_item_prices_all
    WHERE
      auction_header_id = p_auction_header_id AND
      (line_number = p_line_number OR parent_line_number = p_line_number);
Line: 2338

            message => 'This is an MAS auction so need to delete scores');
Line: 2343

        DELETE FROM
          pon_attribute_scores pas
        WHERE
          pas.auction_header_id = p_auction_header_id AND
          (
            pas.line_number = p_line_number OR
            EXISTS
              (
                SELECT
                  paip.line_number
                FROM
                  pon_auction_item_prices_all paip
                WHERE
                  paip.parent_line_number = p_line_number AND
                  paip.auction_header_id = p_auction_header_id AND
                  paip.line_number = pas.line_number
              )
           );
Line: 2366

      DELETE FROM
        pon_auction_attributes paa
      WHERE
        paa.auction_header_id = p_auction_header_id AND
        (
          paa.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = paa.line_number
            )
         );
Line: 2400

      DELETE FROM
        pon_pf_supplier_values ppsv
      WHERE
        ppsv.auction_header_id = p_auction_header_id AND
        (
          ppsv.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = ppsv.line_number
            )
         );
Line: 2421

      DELETE FROM
        pon_price_elements ppe
      WHERE
        ppe.auction_header_id = p_auction_header_id AND
        (
          ppe.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = ppe.line_number
            )
         );
Line: 2448

           message => 'Delete attachments for  pon_auc_payments_shipments');
Line: 2452

    FOR delete_attachments_rec IN delete_payments_attachments LOOP
      IF (FND_LOG.level_procedure >= FND_LOG.g_current_runtime_level) THEN
          FND_LOG.string (log_level => FND_LOG.level_procedure,
           module => g_module_prefix || l_module_name,
           message => 'Deleting fnd attachments for payments for line number ' ||delete_attachments_rec.line_number||'='|| l_module_name);
Line: 2459

       FND_ATTACHED_DOCUMENTS2_PKG.DELETE_ATTACHMENTS
        (x_entity_name  => 'PON_AUC_PAYMENTS_SHIPMENTS',
         x_pk1_value => p_auction_header_id,
         x_pk2_value => delete_attachments_rec.line_number,
	 x_delete_document_flag => 'Y');
Line: 2469

           message => 'Deleted the attachments for  pon_auc_payments_shipments');
Line: 2472

       DELETE FROM
      pon_auc_payments_shipments paps
       WHERE
        paps.auction_header_id = p_auction_header_id AND (
        paps.line_number = p_line_number OR
	EXISTS
	(
	 SELECT
	 paip.line_number
	 FROM
	 pon_auction_item_prices_all paip
	 WHERE
	   paip.parent_line_number = p_line_number AND
           paip.auction_header_id = p_auction_header_id AND
	   paip.line_number = paps.line_number
	)
      );
Line: 2493

        message => 'Deleted the entry in pon_auc_payments_shipments');
Line: 2511

          message => 'Price tiers indicator is not none , so need to delete Price tiers.');
Line: 2516

      DELETE FROM
        pon_auction_shipments_all pasa
      WHERE
        pasa.auction_header_id = p_auction_header_id AND
        (
          pasa.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = pasa.line_number
            )
         );
Line: 2551

          message => 'This is an RFI or Global Agreement. Need to delete price diffs.');
Line: 2556

      DELETE FROM
        pon_price_differentials ppd
      WHERE
        ppd.auction_header_id = p_auction_header_id AND
        (
          ppd.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = ppd.line_number
            )
        );
Line: 2588

      DELETE FROM
        pon_party_line_exclusions pple
      WHERE
        pple.auction_header_id = p_auction_header_id AND
        (
          pple.line_number = p_line_number OR
          EXISTS
            (
              SELECT
                paip.line_number
              FROM
                pon_auction_item_prices_all paip
              WHERE
                paip.parent_line_number = p_line_number AND
                paip.auction_header_id = p_auction_header_id AND
                paip.line_number = pple.line_number
            )
       );
Line: 2617

      FND_ATTACHED_DOCUMENTS2_PKG.delete_attachments (
        x_entity_name =>'PON_AUCTION_ITEM_PRICES_ALL',
        x_pk1_value => p_auction_header_id,
        x_pk2_value => attachment_line.line_number,
        x_pk3_value => NULL,
        x_pk4_value => NULL,
        x_pk5_value => NULL);
Line: 2652

        PON_AUCTION_PKG.delete_negotiation_line_ref(
          x_negotiation_id => p_auction_header_id,
          x_negotiation_line_num => backing_req_line.line_number,
          x_org_id => backing_req_line.org_id,
          x_error_code => x_error_code);
Line: 2681

      DELETE FROM pon_auction_attr_mapping_b
      WHERE       auction_header_id = p_auction_header_id
      AND         (line_number = p_line_number OR
                   ( line_number IN ( SELECT line_number
                                      FROM   pon_auction_item_prices_all
                                      WHERE  auction_header_id = p_auction_header_id
                                      AND    parent_line_number = p_line_number) ) )
      AND         mapping_type IN ('ITEM_LINE', 'CAT_LINE');
Line: 2692

    DELETE FROM
      pon_auction_item_prices_all
    WHERE
      auction_header_id = p_auction_header_id AND
      (line_number = p_line_number OR parent_line_number = p_line_number);
Line: 2731

  UPDATE
    pon_bidding_parties
  SET
    access_type = 'FULL'
  WHERE
    auction_header_id = p_auction_header_id AND
    access_type = 'RESTRICTED' AND
    (trading_partner_id, vendor_site_id) NOT IN
    (SELECT distinct trading_partner_id, vendor_site_id
     FROM pon_party_line_exclusions
     WHERE auction_header_id = p_auction_header_id);
Line: 2762

END delete_single_line;
Line: 2835

      message  => 'Selecting the maximum sub_line_sequence_number from the header');
Line: 2840

  SELECT
    NVL(MAX_DOCUMENT_LINE_NUM,0)
  INTO
    l_max_document_line_num
  FROM
    PON_AUCTION_HEADERS_ALL
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id;
Line: 2865

  SELECT
    LINE_NUMBER
  BULK COLLECT INTO
    l_line_number
  FROM
    PON_AUCTION_ITEM_PRICES_ALL
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id AND
    GROUP_TYPE IN ('LOT', 'GROUP', 'LINE') AND
    SUB_LINE_SEQUENCE_NUMBER > l_max_document_line_num AND
    DISP_LINE_NUMBER > p_min_disp_line_number_parent
  ORDER BY
    DISP_LINE_NUMBER;
Line: 2903

    SELECT
      NVL (MAX (SUB_LINE_SEQUENCE_NUMBER), 0)
    INTO
      l_max_sub_line_sequence_number
    FROM
      PON_AUCTION_ITEM_PRICES_ALL
    WHERE
      AUCTION_HEADER_ID = p_auction_header_id AND
      DISP_LINE_NUMBER < p_min_disp_line_number_parent AND
      GROUP_TYPE IN ('LINE','LOT', 'GROUP');
Line: 2952

    UPDATE
      PON_AUCTION_ITEM_PRICES_ALL
    SET
      SUB_LINE_SEQUENCE_NUMBER = l_sub_line_seq_number (x),
      DOCUMENT_DISP_LINE_NUMBER = l_sub_line_seq_number (x),
      LAST_UPDATE_DATE = SYSDATE,
      LAST_UPDATE_LOGIN = l_login_id,
      LAST_UPDATED_BY = l_user_id
    WHERE
      AUCTION_HEADER_ID = p_auction_header_id AND
      LINE_NUMBER = l_line_number (x);
Line: 2975

  SELECT
    CHILDREN.LINE_NUMBER,
    NVL (PARENT.MAX_SUB_LINE_SEQUENCE_NUMBER, 0),
    CHILDREN.PARENT_LINE_NUMBER,
    PARENT.DOCUMENT_DISP_LINE_NUMBER
  BULK COLLECT INTO
    l_line_number,
    l_parent_max_sub_line_seq_num,
    l_parent_line_number,
    l_parent_doc_disp_line_number
  FROM
    PON_AUCTION_ITEM_PRICES_ALL CHILDREN,
    PON_AUCTION_ITEM_PRICES_ALL PARENT
  WHERE
    CHILDREN.AUCTION_HEADER_ID = p_auction_header_id AND
    PARENT.AUCTION_HEADER_ID = p_auction_header_id AND
    PARENT.LINE_NUMBER = CHILDREN.PARENT_LINE_NUMBER AND
    CHILDREN.GROUP_TYPE IN ('LOT_LINE', 'GROUP_LINE') AND
    CHILDREN.SUB_LINE_SEQUENCE_NUMBER > NVL(PARENT.MAX_SUB_LINE_SEQUENCE_NUMBER,0) AND
    (CHILDREN.DISP_LINE_NUMBER > p_min_disp_line_number_child  OR
    CHILDREN.DISP_LINE_NUMBER > p_min_disp_line_number_parent)
  ORDER BY
    CHILDREN.DISP_LINE_NUMBER;
Line: 3024

      SELECT
        NVL (MAX (SUB_LINE_SEQUENCE_NUMBER), 0)
      INTO
        l_current_max_sub_line_seq
      FROM
        PON_AUCTION_ITEM_PRICES_ALL
      WHERE
        AUCTION_HEADER_ID = p_auction_header_id AND
        PARENT_LINE_NUMBER = p_min_child_parent_line_num AND
        DISP_LINE_NUMBER < p_min_disp_line_number_child;
Line: 3099

    UPDATE PON_AUCTION_ITEM_PRICES_ALL
    SET
      SUB_LINE_SEQUENCE_NUMBER = l_sub_line_seq_number (x),
      DOCUMENT_DISP_LINE_NUMBER = l_document_disp_line_number (x),
      LAST_UPDATE_DATE = SYSDATE,
      LAST_UPDATE_LOGIN = l_login_id,
      LAST_UPDATED_BY = l_user_id
    WHERE
      AUCTION_HEADER_ID = p_auction_header_id AND
      LINE_NUMBER = l_line_number (x);
Line: 3131

  SELECT
    LINE_NUMBER
  BULK COLLECT INTO
    l_line_number
  FROM
    PON_AUCTION_ITEM_PRICES_ALL
  WHERE
    AUCTION_HEADER_ID = p_auction_header_id AND
    DISP_LINE_NUMBER > l_min_disp_line_number
  ORDER BY
    DISP_LINE_NUMBER;
Line: 3158

    SELECT
      MAX(sub_line_sequence_number)
    INTO
      l_temp_char
    FROM
      pon_auction_item_prices_all
    WHERE
      auction_header_id = p_auction_header_id and
      group_type IN ('LOT', 'LINE', 'GROUP');
Line: 3202

      message  => 'Calling bulk update to set the new disp_line_number');
Line: 3207

  UPDATE PON_AUCTION_ITEM_PRICES_ALL
  SET DISP_LINE_NUMBER = l_new_disp_line_number (x)
  WHERE LINE_NUMBER = l_line_number(x)
  AND AUCTION_HEADER_ID = p_auction_header_id;
Line: 3214

  SELECT
    MAX(sub_line_sequence_number)
  INTO
    x_last_line_number
  FROM
    pon_auction_item_prices_all
  WHERE
    auction_header_id = p_auction_header_id and
    group_type IN ('LOT', 'LINE', 'GROUP');
Line: 3284

  SELECT MIN(disp_line_number)
  INTO x_curr_min_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_curr_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'GROUP', 'LINE')
  AND SUB_LINE_SEQUENCE_NUMBER > p_value;
Line: 3291

  SELECT MIN(disp_line_number)
  INTO x_prev_min_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_prev_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'GROUP', 'LINE')
  AND SUB_LINE_SEQUENCE_NUMBER > p_value;
Line: 3353

  SELECT MAX(DISP_LINE_NUMBER)
  INTO x_curr_max_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_curr_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'LINE', 'GROUP')
  AND SUB_LINE_SEQUENCE_NUMBER < p_value;
Line: 3360

  SELECT MAX(DISP_LINE_NUMBER)
  INTO x_prev_max_disp_line_num
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_prev_auction_header_id
  AND GROUP_TYPE IN ('LOT', 'LINE', 'GROUP')
  AND SUB_LINE_SEQUENCE_NUMBER < p_value;
Line: 3385

  SELECT GROUP_TYPE, LINE_NUMBER
  INTO l_curr_group_type, l_curr_line_number
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_curr_auction_header_id
  AND DISP_LINE_NUMBER = x_curr_max_disp_line_num;
Line: 3391

  SELECT GROUP_TYPE, LINE_NUMBER
  INTO l_prev_group_type, l_prev_line_number
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID = p_prev_auction_header_id
  AND DISP_LINE_NUMBER = x_prev_max_disp_line_num;
Line: 3411

    SELECT NVL (MAX(DISP_LINE_NUMBER), x_curr_max_disp_line_num)
    INTO x_curr_max_disp_line_num
    FROM PON_AUCTION_ITEM_PRICES_ALL
    WHERE AUCTION_HEADER_ID = p_curr_auction_header_id
    AND PARENT_LINE_NUMBER = l_curr_line_number;
Line: 3419

    SELECT NVL (MAX(DISP_LINE_NUMBER), x_prev_max_disp_line_num)
    INTO x_prev_max_disp_line_num
    FROM PON_AUCTION_ITEM_PRICES_ALL
    WHERE AUCTION_HEADER_ID = p_prev_auction_header_id
    AND PARENT_LINE_NUMBER = l_prev_line_number;
Line: 3438

   PROCEDURE : DELETE_DISCUSSIONS
   PARAMETERS: 1. x_result - return status.
               2. x_error_code - error code
               3. x_error_message - The actual error message
               4. p_auction_header_id - The auction header id
   COMMENT   : This procedure deletes all the discussions  in the negotiation
               and also its children
======================================================================*/

PROCEDURE DELETE_DISCUSSIONS (
  x_result OUT NOCOPY VARCHAR2,
  x_error_code OUT NOCOPY VARCHAR2,
  x_error_message OUT NOCOPY VARCHAR2,
  p_auction_header_id IN NUMBER
) IS


l_module_name VARCHAR2 (30);
Line: 3461

  l_module_name := 'DELETE_DISCUSSIONS';
Line: 3472

    SELECT discussion_id
    INTO l_discussion_id
    FROM pon_discussions
    WHERE pk1_value  = p_auction_header_id;
Line: 3482

      DELETE FROM
        PON_TE_RECIPIENTS
      WHERE
        ENTRY_ID IN ( SELECT ENTRY_ID
	              FROM PON_THREAD_ENTRIES
	              WHERE DISCUSSION_ID = l_discussion_id);
Line: 3492

          message => 'PON_TE_RECIPIENTS records deleted');
Line: 3496

      DELETE FROM
        PON_TE_VIEW_AUDIT
      WHERE
        ENTRY_ID IN ( SELECT ENTRY_ID
	              FROM PON_THREAD_ENTRIES
	              WHERE DISCUSSION_ID = l_discussion_id);
Line: 3506

          message => 'PON_TE_VIEW_AUDIT records deleted');
Line: 3509

      DELETE FROM
          PON_THREAD_ENTRIES
      WHERE
          DISCUSSION_ID = l_discussion_id;
Line: 3517

            message => 'PON_THREAD_ENTRIES  records deleted');
Line: 3520

      DELETE FROM
          PON_THREADS
      WHERE
          DISCUSSION_ID = l_discussion_id;
Line: 3528

            message => 'PON_THREADS  records deleted');
Line: 3531

      DELETE FROM
          PON_DISCUSSIONS
      WHERE
          DISCUSSION_ID = l_discussion_id;
Line: 3539

            message => 'PON_DISCUSSIONS  records deleted');
Line: 3560

END DELETE_DISCUSSIONS;
Line: 3563

   PROCEDURE : UPDATE_STAG_LINES_CLOSE_DATES
   PARAMETERS: 1. p_auction_header_id - The auction header id
               2. p_first_line_close_date - The staggered closing interval
               3. p_staggered_closing_interval - The auction header id
               4. x_last_line_close_date - The close date of the last line
               5. x_result - return status.
               6. x_error_code - error code
               7. x_error_message - The actual error message
   COMMENT   : This procedure updates the close dates of the lines when
               the draft negotiation is saved
======================================================================*/

	PROCEDURE UPDATE_STAG_LINES_CLOSE_DATES(
  x_result OUT NOCOPY VARCHAR2,
  x_error_code OUT NOCOPY VARCHAR2,
  x_error_message OUT NOCOPY VARCHAR2,
	p_auction_header_id in Number,
	p_first_line_close_date in date,
	p_staggered_closing_interval in number,
  p_start_disp_line_number in number,
  x_last_line_close_date out nocopy date
  )
	is
	   l_line_number                    PON_NEG_COPY_DATATYPES_GRP.NUMBER_TYPE;
Line: 3599

            module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
            message  => 'Entered PON_NEGOTIATION_HELPER_PVT.UPDATE_LINES_CLOSE_DATES'
                        || ', p_auction_header_id = ' || p_auction_header_id
                        || ', p_first_line_close_date = ' || p_first_line_close_date
                        || ', p_staggered_closing_interval = ' || p_staggered_closing_interval
                        || ', p_start_disp_line_number = ' || p_start_disp_line_number
            );
Line: 3610

	      SELECT max(disp_line_number)
	      INTO l_max_line_number
	      FROM pon_auction_item_prices_all WHERE auction_header_id = p_auction_header_id;
Line: 3616

          module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
          message  => 'l_max_line_number : ' || l_max_line_number
          );
Line: 3627

              module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
              message  => 'p_start_disp_line_number > l_max_line_number; so returning'
Line: 3632

            select nvl (max(close_bidding_date), p_first_line_close_date)
            into x_last_line_close_date
            from pon_auction_item_prices_all
            where auction_header_id = p_auction_header_id;
Line: 3643

          select nvl (max(close_bidding_date), (p_first_line_close_date - l_stag_interval))
          into l_curr_close_date
          from pon_auction_item_prices_all
          where auction_header_id = p_auction_header_id
          and disp_line_number < p_start_disp_line_number;
Line: 3655

            module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
            message  => 'l_batch_size : ' || l_batch_size
                      ||'; l_stag_interval : ' || l_stag_interval
Line: 3675

            module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
            message  => 'Finished setting the batching loop limits; l_batch_start : '||l_batch_start
Line: 3686

                module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                message  => 'Processing the batch from l_batch_start : ' || l_batch_start
                            ||' to l_batch_end : ' || l_batch_end || ' ;  bulk collecting the records now'
Line: 3692

              select line_number, close_bidding_date, group_type
              bulk collect into
               l_line_number, l_close_date, l_group_type
              from pon_auction_item_prices_all
              WHERE auction_header_id = p_auction_header_id
              AND disp_line_number >= l_batch_start
              AND disp_line_number <= l_batch_end
              order by disp_line_number;
Line: 3705

                      module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                      message  => 'setting up the close dates array'
                      );
Line: 3722

                      module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                      message  => 'Last close date for this batch is x_last_line_close_date : '  || to_char (x_last_line_close_date, 'dd-mon-yyyy hh24:mi:ss')
                                   ||'; now bulk updating the PON_AUCTION_ITEM_PRICES_ALL'
Line: 3729

                 UPDATE PON_AUCTION_ITEM_PRICES_ALL
                  set close_bidding_date = l_close_date(x)
                 WHERE auction_header_id = p_auction_header_id
                 AND line_number = l_line_number(x);
Line: 3736

                      module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                      message  => 'Committing the batch now'
                      );
Line: 3745

                      module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                      message  => 'Updating the batch limits for next iteration'
                      );
Line: 3760

                      module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
                      message  => 'New limits are l_batch_start : ' || l_batch_start
                                 || '; l_batch_end : ' || l_batch_end
Line: 3777

              module  =>  g_module_prefix || 'UPDATE_STAG_LINES_CLOSE_DATES',
              message  => 'Exitting the method with '
                          || 'x_last_line_close_date : '||x_last_line_close_date
                          || '; x_result : '||x_result
Line: 3809

  SELECT Count(1) into l_lines_lots_groups_count
  FROM pon_auction_item_prices_all
  WHERE group_type IN ('LINE', 'LOT', 'GROUP')
        AND auction_header_id = p_auction_header_id;
Line: 3937

    SELECT
      'Y'
    INTO
      x_has_price_tiers
    FROM
      pon_auction_shipments_all
    WHERE
      auction_header_id = p_auction_header_id AND
      rownum = 1;
Line: 3999

 *              5. p_delete_price_tiers -- Flag to indicate if price tiers to be removed or not
 * COMMENT   : This methods deletes all the lines in the DB table PON_AUCTION_SHIPMENTS_ALL,
 *	            for the given auction header id, sets the modify falg for new round and amendments
 *                 and sets the default price break settings.
 *======================================================================*/

PROCEDURE HANDLE_CHANGE_PRICE_TIERS (
  x_result OUT NOCOPY VARCHAR2,
  x_error_code OUT NOCOPY VARCHAR2,
  x_error_message OUT NOCOPY VARCHAR2,
  p_auction_header_id IN NUMBER,
  p_delete_price_tiers IN VARCHAR2
 ) IS

l_module_name VARCHAR2 (30);
Line: 4037

      message  => 'Entered the procedure ; p_auction_header_id : ' || p_auction_header_id || ' ; p_delete_price_tiers : '|| p_delete_price_tiers);
Line: 4042

  SELECT price_tiers_indicator,
         amendment_number,
         auction_round_number
  INTO l_prev_price_tiers_indicator,
       l_amendment_number,
       l_round_number
  FROM pon_auction_headers_all
  WHERE auction_header_id = p_auction_header_id;
Line: 4060

  SELECT MAX(LINE_NUMBER)
  INTO l_max_line_number
  FROM PON_AUCTION_ITEM_PRICES_ALL
  WHERE AUCTION_HEADER_ID=p_auction_header_id;
Line: 4073

  IF (p_delete_price_tiers = 'Y') THEN--{

      --
      --Check if the auction is an amendment or new round.
      --If yes, fetch the max line number of the previous round.
      --
      IF (l_amendment_number > 0) THEN

        --this is an amendment
        l_is_amendment := true;
Line: 4083

        SELECT max_internal_line_num
        INTO l_parent_auc_max_line_number
        FROM pon_auction_headers_all
        WHERE auction_header_id =
            (SELECT auction_header_id_prev_amend
        FROM pon_auction_headers_all
        WHERE auction_header_id = p_auction_header_id);
Line: 4101

        SELECT max_internal_line_num
        INTO l_parent_auc_max_line_number
        FROM pon_auction_headers_all
        WHERE auction_header_id =
           (SELECT auction_header_id_prev_round
            FROM pon_auction_headers_all
            WHERE auction_header_id = p_auction_header_id);
Line: 4155

            UPDATE pon_auction_item_prices_all
            SET price_break_type = 'NONE',
                price_break_neg_flag = 'Y'
            WHERE auction_header_id = p_auction_header_id
                AND line_number >= l_batch_start
                AND line_number <= l_batch_end;
Line: 4164

        IF (p_delete_price_tiers = 'Y') THEN--{
            --
            -- Delete the entries from the shipments table for this auction
            --
            IF (FND_LOG.level_statement>= FND_LOG.g_current_runtime_level) THEN
                  FND_LOG.string(log_level => FND_LOG.level_statement,
                     module  =>  g_module_prefix || l_module_name,
                    message  => 'Deleting the entries from the shipments table for negotiation ' || p_auction_header_id
                            || ' and line_number between ' || l_batch_start ||' and ' || l_batch_end );
Line: 4175

            DELETE FROM
                pon_auction_shipments_all
            WHERE
                auction_header_id = p_auction_header_id AND
                line_number >= l_batch_start AND
                line_number <= l_batch_end;
Line: 4197

                DELETE FROM
                    pon_price_differentials
                WHERE
                    auction_header_id = p_auction_header_id AND
                    shipment_number > -1 AND
                    line_number >= l_batch_start AND
                    line_number <= l_batch_end;
Line: 4226

                  UPDATE pon_auction_item_prices_all
                  SET has_quantity_tiers = 'N',
                      has_shipments_flag = 'N',
                      modified_flag = decode(least(line_number,l_parent_auc_max_line_number),
                               line_number,'Y', modified_flag),
                      modified_date = SYSDATE
                  WHERE
                    auction_header_id = p_auction_header_id AND
                    (has_quantity_tiers = 'Y' OR has_shipments_flag = 'Y') AND
                    line_number >= l_batch_start AND
                    line_number <= l_batch_end;
Line: 4246

              UPDATE pon_auction_item_prices_all
              SET has_quantity_tiers = 'N',
                  has_shipments_flag = 'N'
              WHERE
                 auction_header_id = p_auction_header_id AND
                (has_quantity_tiers = 'Y' OR has_shipments_flag = 'Y') AND
                 line_number >= l_batch_start AND
                 line_number <= l_batch_end;
Line: 4257

        END IF; --} --p_delete_price_tiers = 'Y'
Line: 4321

  SELECT name
  INTO
  v_doctype_name
  FROM
  pon_auc_doctypes_tl
  WHERE
  doctype_id = p_doctype_id and
  language = 'US';