DBA Data[Home] [Help]

APPS.OE_DELAYED_REQUESTS_UTIL SQL Statements

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

Line: 18

   Select sum(Percent) Per_total
   From oe_sales_credits sc,
	   oe_sales_credit_types sct
   Where line_id = p_line_id
   And sct.sales_credit_type_id = sc.sales_credit_type_id
   And sct.quota_flag = 'Y';
Line: 182

 SELECT Line_id, item_type_code,line_set_id,
	   Service_reference_line_id,
	   inventory_item_id,
	   service_reference_type_code --Bug 4946843
 FROM   OE_ORDER_LINES_ALL
 WHERE  Line_id = l_line_id;
Line: 190

 SELECT /* MOAC_SQL_CHANGE */ line_id, header_id
 FROM   OE_ORDER_LINES
 WHERE  service_reference_line_id
             in (SELECT line_id
                 FROM   oe_order_lines_all
                 WHERE top_model_line_id = l_line_id1)
 AND   line_id <> l_line_id and
 inventory_item_id = l_temp_inv_item_id;
Line: 262

       Select '1', sales_credit_id, nvl(percent,0)
       INTO    l_temp, l_sales_credit_id, l_q_percent
       from  oe_sales_credits
       Where header_id = i.header_id
       AND   line_id = i.line_id
       And   sales_credit_type_id = l_sales_credit_type_id
       AND   salesrep_id          = l_salesrep_id;
Line: 294

	   Select quota_flag
	   Into   l_new_quota_flag
	   From   oe_sales_credit_types
	   Where  sales_credit_type_id = l_new_sales_credit_type_id;
Line: 301

	     Select quota_flag
	     Into   l_old_quota_flag
	     From   oe_sales_credit_types
	     Where  sales_credit_type_id = l_old_sales_credit_type_id;
Line: 320

            Select nvl(sum(Percent),0) Per_total
            Into  l_per_total
            From  oe_sales_credits sc,
                  oe_sales_credit_types sct
            Where header_id = i.header_id
            AND   line_id = i.line_id
            And   sct.sales_credit_type_id = sc.sales_credit_type_id
            And   sct.quota_flag = 'Y';
Line: 359

        IF l_operation = OE_GLOBALS.G_OPR_UPDATE THEN

          oe_msg_pub.add('In Update');
Line: 365

            Select nvl(sum(Percent),0) Per_total
            Into  l_per_total
            From  oe_sales_credits sc,
                  oe_sales_credit_types sct
            Where header_id = i.header_id
            AND   line_id = i.line_id
            And   sct.sales_credit_type_id = sc.sales_credit_type_id
            And   sct.quota_flag = 'Y';
Line: 409

           l_Line_Scredit_tbl(l_count).Operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 412

        ELSIF l_operation = OE_GLOBALS.G_OPR_DELETE
	   AND   l_percent = l_q_percent THEN

           l_count := l_count + 1;
Line: 420

           l_Line_Scredit_tbl(l_count).Operation := OE_GLOBALS.G_OPR_DELETE;
Line: 465

       l_Line_Scredit_tbl.DELETE;
Line: 498

PROCEDURE UPDATE_LINK_TO_LINE_ID
( x_return_status OUT NOCOPY Varchar2

                  ,p_top_model_line_id  IN NUMBER
                 )
IS
BEGIN

        null;
Line: 508

END UPDATE_LINK_TO_LINE_ID;
Line: 544

     SELECT  'DUPLICATE_DISCOUNT'
	INTO    l_duplicate
	FROM    oe_price_adjustments
	WHERE   header_id = l_header_id
	AND     discount_id = l_discount_id
	AND     price_adjustment_id <> Nvl(l_entity_id, -1)
	AND     line_id IS NULL;
Line: 573

      SELECT  'DUPLICATE_DISCOUNT'
	 INTO    l_duplicate
	 FROM    oe_price_adjustments
	 WHERE   header_id = l_header_id
	 AND     discount_id = l_discount_id
	 AND     line_id = l_line_id
	 AND     price_adjustment_id <> Nvl(l_entity_id, -1);
Line: 646

SELECT count(p.price_adjustment_id)
FROM   oe_price_adjustments p
WHERE  p.header_id = l_header_id
AND    (p.line_id = l_line_id
OR      p.line_id IS NULL) ;
Line: 653

SELECT p.line_id
FROM   oe_price_adjustments p
WHERE  p.header_id = l_header_id
AND    p.line_id IS NOT NULL
ORDER by p.line_id;
Line: 684

          SELECT  count(d.name)
	     INTO  l_count
	     FROM  oe_price_adjustments adj,
                oe_discount_lines dln,
	           oe_discounts d
	     WHERE adj.header_id = l_header_id
	     AND   Nvl(adj.line_id, l_line_id) = l_line_id
          AND   d.discount_id = adj.discount_id
	     AND   dln.discount_line_id = adj.discount_line_id
	     AND   dln.price IS NOT NULL
	     AND   ROWNUM = 1;
Line: 717

      SELECT  count(adj.price_adjustment_id)
	 INTO    l_count
	 FROM    oe_price_adjustments adj
	 WHERE   adj.header_id = l_header_id
	 AND     Nvl(adj.line_id, l_line_id) = l_line_id
	 AND     exists
		   (SELECT 'fixed_price'
		    FROM   oe_discount_lines dln
		    WHERE  dln.discount_line_id = l_discount_line_id
		    AND    dln.price IS NOT NULL)
	 AND ROWNUM = 1;
Line: 748

      SELECT  d.name
	 INTO    l_fixed_price
	 FROM    oe_price_adjustments adj,
              oe_discount_lines dln,
	         oe_discounts d
	 WHERE   adj.header_id = l_header_id
	 AND     Nvl(adj.line_id, l_line_id) = l_line_id
      AND     d.discount_id = adj.discount_id
	 AND     dln.discount_line_id = adj.discount_line_id
	 AND     dln.price IS NOT NULL
	 AND     ROWNUM = 1;
Line: 833

SELECT  p.price_adjustment_id, Nvl(p.line_id, -1) line_id
  FROM  oe_price_adjustments p,
        oe_order_lines o
 WHERE  p.header_id = l_header_id
  AND   o.header_id = l_header_id
  AND  (p.line_id = o.line_id
   OR   p.line_id IS NULL)
ORDER  BY p.line_id;
Line: 844

SELECT Nvl(SUM(percent), 0)
  FROM oe_price_adjustments p
 WHERE header_id = l_header_id
   AND  line_id IS NULL;
Line: 851

SELECT Nvl(SUM(percent), 0) + l_percent_total
  FROM oe_price_adjustments
 WHERE header_id = l_header_id
   AND  line_id = l_line_id;
Line: 859

SELECT NVL( MAX(SUM(PERCENT)), 0) + l_percent_total
  FROM OE_PRICE_ADJUSTMENTS P, OE_ORDER_LINES L
 WHERE P.HEADER_ID = l_header_id
   AND P.LINE_ID IS NOT NULL
   AND P.LINE_ID = L.LINE_ID
GROUP BY P.line_id;
Line: 1042

  l_api_name                  CONSTANT VARCHAR2(30) := 'Insert_Order';
Line: 1052

  l_select_flag			VARCHAR2(1);
Line: 1163

    OE_DEBUG_PUB.ADD('Inserting Included Items', 2);
Line: 1186

                             , p_calling_action => 'UPDATE'
                             , p_delayed_request=> FND_API.G_TRUE
                             , p_msg_count      => l_msg_count
                             , p_msg_data       => l_msg_data
                             , p_return_status  => l_return_status
                             );
Line: 1226

/* procedure insert_rma_scredit_adjustment
   To insert sales credit of corresponding RMA lines.
   if sales credit exists on the existing line, delete them first,
   then insert new ones taken from the referenced line.
   Price adjustments has been moved to apply change attributes
*/
Procedure INSERT_RMA_SCREDIT_ADJUSTMENT
(p_line_id       IN  NUMBER
,x_return_status OUT NOCOPY VARCHAR2

)
IS
l_Line_Scredit_tbl 	OE_Order_PUB.Line_Scredit_Tbl_Type;
Line: 1245

l_api_name 		CONSTANT VARCHAR(30) := 'INSERT_RMA_SCREDIT_ADJUSTMENT';
Line: 1255

  OE_DEBUG_PUB.ADD('RMA: In INSERT_RMA_SCREDIT_ADJUSTMENT',1);
Line: 1263

   SELECT header_id, reference_header_id, reference_line_id,split_by
         ,SOURCE_DOCUMENT_TYPE_ID --added source document id as a part of 6778016
     INTO l_header_id,l_ref_header_id, l_ref_line_id, l_split_by
          ,l_src_doc_type_id           --added l_src_doc_type_id as a part of 6778016
     FROM oe_order_lines
    WHERE line_id = p_line_id;
Line: 1293

          OE_DEBUG_PUB.ADD('There are no existing sales credits to delete',1);
Line: 1302

      l_x_Line_Scredit_tbl(I).operation := OE_GLOBALS.G_OPR_DELETE;
Line: 1307

    l_Line_Scredit_tbl.DELETE;
Line: 1309

  END IF; /* end delete existing sales credit */
Line: 1316

   SELECT header_id, reference_header_id, reference_line_id
     INTO l_header_id,l_ref_header_id, l_ref_line_id
     FROM oe_order_lines
    WHERE line_id = p_line_id;
Line: 1351

  END IF; /* end inserting sales credit */
Line: 1406

    l_Line_Scredit_tbl.DELETE;
Line: 1408

  END IF; /* end inserting sales credit */
Line: 1410

  oe_debug_pub.add('Exit INSERT_RMA_SCREDIT_ADJUSTMENT',1);
Line: 1430

            ,   'INSERT_RMA_SCREDIT_ADJUSTMENT'
            );
Line: 1434

END INSERT_RMA_SCREDIT_ADJUSTMENT;
Line: 1567

              l_Line_Adj_tbl(l_counter).operation := OE_GLOBALS.G_OPR_DELETE;
Line: 1626

            l_Line_Adj_tbl(l_counter+I).updated_flag                := NULL;
Line: 1627

            l_Line_Adj_tbl(l_counter+I).update_allowed	             := NULL;
Line: 1655

        l_Line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 1718

    l_tax_rec_out_tbl.delete;
Line: 1914

      SELECT header_id
        INTO l_header_id
        FROM oe_order_lines
       WHERE line_id = l_request_rec.entity_id;
Line: 2078

      SELECT header_id
        INTO l_header_id
        FROM oe_order_lines
       WHERE line_id = l_request_rec.entity_id;
Line: 2259

PROCEDURE Insert_Set
  (p_request_rec	IN oe_order_pub.request_rec_type,
x_return_status OUT NOCOPY VARCHAR2)

  IS
l_return_status VARCHAR2(30);
Line: 2270

    OE_SET_UTIL.Insert_Into_Set
                 (p_set_request_tbl => p_set_request,
                  p_Push_Set_Date => 'N',
                  X_Return_Status  => l_return_status,
                  x_msg_count      => x_msg_count,
                  x_msg_data       => x_msg_data);
Line: 2315

            ,   'Insert_Set'
            );
Line: 2327

End Insert_Set;
Line: 2387

              SELECT header_id
              INTO   l_header_id
              FROM   oe_order_lines_all
              WHERE  line_id = p_entity_id;
Line: 2463

  l_selelect_line_tbl     OE_GLOBALS.Selected_Record_Tbl;
Line: 2470

              SELECT header_id
              INTO   l_header_id
              FROM   oe_order_lines_all
              WHERE  line_id = p_entity_id;
Line: 2490

    ( p_selected_line_tbl => l_selelect_line_tbl,
      p_record_count      => 1,
      p_set_name          => p_fulfillment_set_name,
      p_set_type          => 'FULFILLMENT',
      p_operation         => l_action,
      p_header_id         => l_header_id,
      x_Set_Id            => l_set_id,
      x_return_status     => x_return_status,
      x_msg_count         => l_msg_count ,
      x_msg_data          => l_msg_data);
Line: 2543

    SELECT line_id
    FROM   oe_order_lines_all
    WHERE  header_id = p_header_id
           AND service_bill_option_code = 'FPOM'
           AND service_bill_profile_id IS NOT NULL
		   AND service_start_date is NOT NULL --16621149
		   AND service_end_date is NOT NULL --16621149
		   AND NVL(FULFILLED_FLAG,'N') = 'N';
Line: 2618

			   oe_debug_pub.ADD( ' Start Date,End Date are NULL, so Update FirstPeriod Amt and EndDate to NULL');
Line: 2622

		UPDATE oe_order_lines_all
		SET    service_first_period_amount = l_first_period_amt,
		       service_first_period_enddate = l_first_period_enddate
		WHERE  line_id = p_line_id;
Line: 2631

          Oe_Order_Util.Update_Global_Picture ( p_Upd_New_Rec_If_Exists => FALSE,
												p_header_id => l_line_rec.header_id,
												p_old_line_rec => l_old_line_tbl(1),
												p_line_rec => l_line_tbl(1),
												p_line_id => l_line_rec.line_id,
												x_index => l_global_index,
												x_return_status => l_return_status );
Line: 2639

				oe_debug_pub.add('S.F.P.A: after update global picture, status: ' || l_return_status, 1 ) ;
Line: 2696

		-- Update the current line being processed
		UPDATE oe_order_lines_all
		SET    service_first_period_amount = l_first_period_amt,
		       service_first_period_enddate = l_first_period_enddate
		WHERE  line_id = l_rec.line_id;
Line: 2706

          Oe_Order_Util.Update_Global_Picture ( p_Upd_New_Rec_If_Exists => FALSE,
												p_header_id => l_line_rec.header_id,
												p_old_line_rec => l_old_line_tbl(1),
												p_line_rec => l_line_tbl(1),
												p_line_id => l_line_rec.line_id,
												x_index => l_global_index,
												x_return_status => l_return_status );
Line: 2714

				oe_debug_pub.add('S.F.P.A: after update global picture, status: ' || l_return_status, 1 ) ;
Line: 2745

PROCEDURE Update_shipping
-----------------------------------------------------------------------*/
PROCEDURE Update_shipping
( p_update_shipping_tbl     IN  OE_ORDER_PUB.request_tbl_type
, p_line_id                 IN  NUMBER
, p_operation               IN  VARCHAR2
, x_return_status OUT NOCOPY VARCHAR2)

IS
  l_update_shipping_index    NUMBER := 0;
Line: 2755

  l_update_lines_tbl         OE_ORDER_PUB.request_tbl_type;
Line: 2756

  l_update_lines_index       NUMBER := 0;
Line: 2759

  oe_debug_pub.add('Entering UTIL.Update_Shipping'||p_line_id, 1);
Line: 2765

  l_update_shipping_index := p_update_shipping_tbl.FIRST;
Line: 2767

  WHILE l_update_shipping_index IS NOT NULL
  LOOP

    IF  p_update_shipping_tbl(l_update_shipping_index).request_type
                                  = OE_GLOBALS.G_UPDATE_SHIPPING
    THEN

      l_update_lines_index := l_update_lines_index + 1;
Line: 2775

      l_update_lines_tbl(l_update_lines_index)
                                  := p_update_shipping_tbl(l_update_shipping_index);
Line: 2780

    l_update_shipping_index := p_update_shipping_tbl.NEXT(l_update_shipping_index);
Line: 2784

  OE_Shipping_Integration_PVT.Update_Shipping_From_OE
  ( p_update_lines_tbl    =>  l_update_lines_tbl,
    x_return_status       =>  x_return_status);
Line: 2791

    l_update_shipping_index := p_update_shipping_tbl.FIRST;
Line: 2792

    WHILE l_update_shipping_index IS NOT NULL
    LOOP

    IF  p_update_shipping_tbl(l_update_shipping_index).request_type
                                     = OE_GLOBALS.G_UPDATE_SHIPPING
    THEN

      IF  NOT(p_line_id = p_update_shipping_tbl(l_update_shipping_index).entity_id AND
              p_operation
          = p_update_shipping_tbl(l_update_shipping_index).request_unique_key1)
      THEN

        oe_debug_pub.add
        ('deleting req '|| p_update_shipping_tbl(l_update_shipping_index).entity_id);
Line: 2807

        OE_Delayed_Requests_PVT.Delete_Request
        (p_entity_code => p_update_shipping_tbl(l_update_shipping_index).entity_code
        ,p_entity_id   => p_update_shipping_tbl(l_update_shipping_index).entity_id
        ,p_request_Type => p_update_shipping_tbl(l_update_shipping_index).request_type
        ,p_request_unique_key1
               => p_update_shipping_tbl(l_update_shipping_index).request_unique_key1
        ,x_return_status => x_return_status);
Line: 2819

    l_update_shipping_index := p_update_shipping_tbl.NEXT(l_update_shipping_index);
Line: 2827

  OE_Debug_PUB.Add('Exiting OE_Delayed_Requests_Util.Update_Shipping',1);
Line: 2837

        , 'Update_Shipping'
        );
Line: 2841

END Update_Shipping;
Line: 2875

				OE_Delayed_Requests_PVT.Delete_Request
				(p_entity_code 	=> p_ship_confirmation_tbl(l_shipping_index).entity_code
                	,p_entity_id     	=> p_ship_confirmation_tbl(l_shipping_index).entity_id
                	,p_request_Type    	=> p_ship_confirmation_tbl(l_shipping_index).request_type
                	,p_request_unique_key1	=> p_ship_confirmation_tbl(l_shipping_index).request_unique_key1
			 	,x_return_status   	=> x_return_status);
Line: 2968

, p_deleted_options_tbl IN OE_Order_PUB.request_tbl_type
, p_updated_options_tbl IN OE_Order_PUB.request_tbl_type
, x_return_status OUT NOCOPY VARCHAR2

)
IS
l_return_status       VARCHAR2(1);
Line: 2984

   select booked_flag
   into l_complete_flag
   from oe_order_lines
   where line_id = p_top_model_line_id;
Line: 2994

             p_deleted_options_tbl => p_deleted_options_tbl,
             p_updated_options_tbl => p_updated_options_tbl,
             p_validate_flag       => 'Y',
             p_complete_flag       => l_complete_flag,
             x_valid_config        => l_valid_config,
             x_complete_config     => l_complete_config,
             x_return_status       => l_return_status);
Line: 3191

/* procedure insert_rma_options_included
   to insert options and included items
   for the corresponding RMA lines.
*/
Procedure INSERT_RMA_OPTIONS_INCLUDED
(p_line_id IN NUMBER
,x_return_status OUT NOCOPY VARCHAR2

)
IS

l_number               	     NUMBER := 0;
Line: 3203

l_api_name 		          CONSTANT VARCHAR(30) := 'INSERT_RMA_OPTIONS_INCLUDED';
Line: 3223

     SELECT l.header_id, l.line_id, l.ordered_quantity
	 FROM oe_order_lines l,mtl_system_items m
     WHERE l.top_model_line_id = l_top_model_line_id
     AND nvl(l.ato_line_id,1) 	= nvl(l_ato_line_id,nvl(l.ato_line_id,1))
     AND l.link_to_line_id = nvl(l_link_to_line_id,l.link_to_line_id)
	 AND line_id <> l_reference_line_id
     AND l.header_id 	= l_header_id
	 AND l.inventory_item_id = m.inventory_item_id
	 AND nvl(m.returnable_flag,'Y') = 'Y'
     AND nvl(l.cancelled_flag,'N') = 'N'
	 AND m.organization_id =
        OE_Sys_Parameters.VALUE_WNPS('MASTER_ORGANIZATION_ID')
        ORDER BY LINE_NUMBER , SHIPMENT_NUMBER ,NVL(OPTION_NUMBER, -1),
        NVL(COMPONENT_NUMBER,-1),NVL(SERVICE_NUMBER,-1);
Line: 3243

  OE_DEBUG_PUB.ADD('Entering INSERT_RMA_OPTIONS_INCLUDED',1);
Line: 3297

	  select oe_sets_s.nextval into l_fulfillment_set_id from dual;
Line: 3299

       insert into oe_sets
          ( SET_ID, SET_NAME, SET_TYPE, HEADER_ID, SHIP_FROM_ORG_ID,
               SHIP_TO_ORG_ID,SCHEDULE_SHIP_DATE, SCHEDULE_ARRIVAL_DATE,
               FREIGHT_CARRIER_CODE, SHIPPING_METHOD_CODE,
               SHIPMENT_PRIORITY_CODE, SET_STATUS,
               CREATED_BY, CREATION_DATE, UPDATED_BY, UPDATE_DATE,
               UPDATE_LOGIN, INVENTORY_ITEM_ID,ORDERED_QUANTITY_UOM,
               LINE_TYPE_ID,SHIP_TOLERANCE_ABOVE, SHIP_TOLERANCE_BELOW)
       values
          ( l_fulfillment_set_id, to_char(l_fulfillment_set_id),
               'FULFILLMENT_SET',l_orig_line_rec.header_id,
			null,null, null,null,null,
               null,null,null, 0,sysdate,0, sysdate,
               0,null,null,null,null,null
          );
Line: 3315

        Insert into oe_line_sets(Line_id, Set_id, SYSTEM_REQUIRED_FLAG)
        Values (p_line_id, l_fulfillment_set_id, 'Y');
Line: 3430

   	     -- Insert into Fulfillment set
          Insert into oe_line_sets(Line_id, Set_id, SYSTEM_REQUIRED_FLAG)
          Values (l_line_tbl(I).line_id, l_fulfillment_set_id, 'Y');
Line: 3434

   		-- Insert RMA Sales Credits and Adjustments
		INSERT_RMA_SCREDIT_ADJUSTMENT
                 ( x_return_status      => l_return_status
                  ,p_line_id            => l_line_tbl(I).line_id
                 );
Line: 3440

   		-- Insert RMA Lot and Serial Numbers
		INSERT_RMA_LOT_SERIAL
                 ( x_return_status      => l_return_status
                  ,p_line_id            => l_line_tbl(I).line_id
                 );
Line: 3451

  END IF; /* end inserting lines */
Line: 3453

  OE_DEBUG_PUB.ADD(' Exiting INSERT_RMA_OPTIONS_INCLUDED',1);
Line: 3472

            ,   'INSERT_RMA_OPTIONS_INCLUDED'
            );
Line: 3476

END INSERT_RMA_OPTIONS_INCLUDED;
Line: 3478

/* procedure insert_rma_lot_serial
   to insert lot and serial numbers
   for the corresponding RMA lines.

* Bug7195205 : All serial numbers from referenced header are inserted in case
*              of partial return RMA
*/
Procedure INSERT_RMA_LOT_SERIAL
(p_line_id        IN NUMBER
,x_return_status OUT NOCOPY VARCHAR2

)
IS

l_number               	     NUMBER := 0;
Line: 3493

l_api_name 		          CONSTANT VARCHAR(30) := 'INSERT_RMA_LOT_SERIAL';
Line: 3520

SELECT decode(msi.lot_control_code,2,'Y','N'),
       decode(msi.serial_number_control_code,2,'Y',5,'Y',6,'Y','N'),
       primary_uom_code
  FROM mtl_system_items msi
 WHERE msi.inventory_item_id = l_inventory_item_id
   AND msi.organization_id = p_ref_org_id;
Line: 3530

SELECT decode(msi.lot_control_code,2,'Y','N'),
       decode(msi.serial_number_control_code,2,'Y',5,'Y',6,'Y','N'),
       primary_uom_code
  FROM mtl_system_items msi
 WHERE msi.inventory_item_id = l_inventory_item_id
   AND msi.organization_id =
              OE_Sys_Parameters.VALUE_WNPS('MASTER_ORGANIZATION_ID');
Line: 3542

SELECT u.lot_number,
       ABS(SUM(u.transaction_quantity)) transaction_quantity,
       ABS(SUM(u.secondary_transaction_quantity)) secondary_transaction_quantity -- INVCONV
 FROM  mtl_transaction_lot_numbers u,
       mtl_lot_numbers l,
       mtl_material_transactions m
WHERE  m.transaction_id = u.transaction_id
  AND  u.inventory_item_id = l_inventory_item_id
  AND  m.transaction_source_type_id = 2
  AND  m.trx_source_line_id = l_reference_line_id
  AND  m.ORGANIZATION_ID = l_ship_from_org_id
  AND  m.INVENTORY_ITEM_ID = l_inventory_item_id
  and  u.organization_id=l.organization_id
  and  u.inventory_item_id=l.inventory_item_id
  and  u.lot_number = l.lot_number
GROUP  BY u.lot_number;
Line: 3561

SELECT DISTINCT u.serial_number
  FROM mtl_unit_transactions_all_v u,
       mtl_material_transactions m
 WHERE m.transaction_id = u.transaction_id
   AND m.INVENTORY_ITEM_ID = l_inventory_item_id
   AND u.serial_number = NVL(l_serial_number,u.serial_number)
   AND u.inventory_item_id = l_inventory_item_id
   AND m.transaction_source_type_id = 2
   AND m.trx_source_line_id = l_reference_line_id
   AND m.organization_id = l_ship_from_org_id
   AND m.transaction_action_id = 1
   AND m.transaction_type_id = 33;
Line: 3575

SELECT DISTINCT t.lot_number,
        u.serial_number
 FROM mtl_unit_transactions_all_v u,
      mtl_material_transactions m,
      mtl_transaction_lot_val_v t
WHERE u.serial_number = NVL(l_serial_number,u.serial_number)
  AND u.INVENTORY_ITEM_ID = t.inventory_item_id
  AND t.serial_transaction_id = u.transaction_id
  AND t.INVENTORY_ITEM_ID = m.INVENTORY_ITEM_ID
  AND m.transaction_id = t.transaction_id
  AND m.transaction_source_type_id = 2
  AND m.trx_source_line_id = l_reference_line_id
  AND m.ORGANIZATION_ID = l_ship_from_org_id
  AND m.INVENTORY_ITEM_ID = l_inventory_item_id;
Line: 3596

  OE_DEBUG_PUB.ADD(' Entering INSERT_RMA_LOT_SERIAL',1);
Line: 3642

    oe_debug_pub.add('RMA: rma_lot_serial.DELETE_ROW', 2);
Line: 3647

      l_x_Lot_Serial_tbl(I).operation := OE_GLOBALS.G_OPR_DELETE;
Line: 3652

    l_Lot_serial_tbl.DELETE;
Line: 3654

  END IF; /* end delete existing lot serial numbers */
Line: 3816

  END IF; /* end inserting lot serial numbers */
Line: 3857

    l_Lot_serial_tbl.DELETE;
Line: 3859

  OE_DEBUG_PUB.ADD(' Exiting INSERT_RMA_LOT_SERIAL',1);
Line: 3880

            ,   'INSERT_RMA_LOT_SERIAL'
            );
Line: 3884

END INSERT_RMA_LOT_SERIAL;
Line: 3911

       l_line_tbl.DELETE(I);
Line: 4098

         Select list_line_type_code
         Into   l_list_line_type_code
         From   qp_list_lines
         Where  list_line_id = to_number(p_adjust_tbl(I).param3);
Line: 4224

PROCEDURE INSERT_SERVICE_FOR_OPTIONS
(p_serviced_line_id  IN NUMBER
,x_return_status OUT NOCOPY VARCHAR2

)

IS

l_number                      NUMBER := 0;
Line: 4233

l_api_name                    CONSTANT VARCHAR(30) := 'INSERT_SERVICE_FOR_OPTIONS';
Line: 4285

     SELECT max(l.service_number) service_number
	FROM   oe_order_lines l
     WHERE  l.header_id = l_header_id
     AND    l.line_number   = l_line_number
     AND    l.shipment_number = l_shipment_number
     AND    nvl(l.option_number,0) = nvl(l_option_number,0)
     AND    nvl(l.component_number,0) = nvl(l_component_number,0);
Line: 4296

  OE_DEBUG_PUB.ADD('Entering INSERT_SERVICE_FOR_OPTIONS',1);
Line: 4310

     SELECT /* MOAC_SQL_CHANGE */ h.order_number
     INTO   l_order_number
     FROM   oe_order_headers_all h, oe_order_lines l
     WHERE  h.header_id = l.header_id
     AND    h.header_id = l_orig_line_rec.header_id
	AND    rownum = 1;
Line: 4333

      SELECT 'Y'
        INTO l_prg
        FROM oe_price_adjustments prg, oe_price_adj_assocs a,
               oe_price_adjustments p
              WHERE prg.line_id = l_reference_line_rec.line_id
              AND prg.list_line_type_code = 'PRG'
              AND prg.price_adjustment_id = a.price_adjustment_id
              AND p.price_adjustment_id = a.rltd_price_adj_id
              AND p.line_id = l_orig_line_rec.line_id
              AND l_orig_line_rec.item_type_code = 'SERVICE' AND l_orig_line_rec.SUBSCRIPTION_ENABLE_FLAG <> 'Y'
              AND ROWNUM <2;
Line: 4374

	  SELECT l.header_id,
		  l.line_id,
		  l.shipment_number,
		  l.line_number,
		  l.option_number,
                  l.component_number,
		  l.service_txn_reason_code,
		  l.service_txn_comments,
		  l.service_duration,
		  l.service_period,
		  l.service_start_date,
		  l.service_end_date,
		  l.service_coterminate_flag,
		  l.ordered_quantity
	  FROM   oe_order_lines l
	  WHERE  l.top_model_line_id = l_service_reference_line_id
	  AND    l.item_type_code = 'INCLUDED'
	  AND    exists (select null from mtl_system_items mtl where
		    mtl.inventory_item_id = l.inventory_item_id and
		    mtl.serviceable_product_flag = 'Y' and
			 mtl.organization_id=OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID') );
Line: 4398

	  SELECT l.header_id,
		  l.line_id,
		  l.shipment_number,
		  l.line_number,
		  l.option_number,
                  l.component_number,
		  l.service_txn_reason_code,
		  l.service_txn_comments,
		  l.service_duration,
		  l.service_period,
		  l.service_start_date,
		  l.service_end_date,
		  l.service_coterminate_flag,
		  l.ordered_quantity
	  FROM   oe_order_lines l
	  WHERE  l.top_model_line_id = l_service_reference_line_id
          AND    l.top_model_line_id <> l.line_id     -- For bug 2938790
	  AND    l.item_type_code in ('INCLUDED','CLASS','OPTION', 'KIT') -- For bug 2447402
	  AND    exists (select null from mtl_system_items mtl where
			 mtl.inventory_item_id = l.inventory_item_id and
			 mtl.serviceable_product_flag = 'Y' and
			 mtl.organization_id=OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID') );
Line: 4437

     OE_Delayed_Requests_PVT.Delete_Request
			(p_entity_code   => OE_GLOBALS.G_ENTITY_LINE
                        ,p_entity_id     => l_child.line_id
                        ,p_request_Type  => OE_GLOBALS.G_CASCADE_OPTIONS_SERVICE
                        ,x_return_status => x_del_req_ret_status);
Line: 4591

	l_line_tbl.DELETE;
Line: 4592

   END IF;  /* End inserting lines */
Line: 4593

  OE_DEBUG_PUB.ADD('Exiting INSERT_SERVICE_FOR_OPTIONS',1);
Line: 4614

            ,  'INSERT_SERVICE_FOR_OPTIONS'
            );
Line: 4618

END INSERT_SERVICE_FOR_OPTIONS;
Line: 4651

   SELECT l.header_id,
          l.line_id,
          l.service_txn_reason_code,
          l.service_txn_comments,
          l.service_duration,
          l.service_period,
          l.service_start_date,
	  l.service_end_date,
	  l.service_coterminate_flag,
          l.order_quantity_uom,
          l.inventory_item_id,
          l.subscription_enable_flag
   FROM oe_order_lines l
   where l.service_reference_line_id=l_top_model_line_id
   and l.item_type_code = 'SERVICE'
   and l.service_reference_type_code = 'ORDER';
Line: 4669

     SELECT max(l.service_number) service_number
	FROM   oe_order_lines l
     WHERE  l.header_id = l_header_id
     AND    l.line_number   = l_line_number
     AND    l.shipment_number = l_shipment_number
     AND    nvl(l.option_number,0) = nvl(l_option_number,0)
     AND    nvl(l.component_number,0) = nvl(l_component_number,0);    --bug 2447402
Line: 4692

     SELECT /* MOAC_SQL_CHANGE */ h.order_number
     INTO   l_order_number
     FROM   oe_order_headers_all h, oe_order_lines l
     WHERE  h.header_id = l.header_id
     AND    h.header_id = l_orig_line_rec.header_id
	AND    rownum = 1;
Line: 4710

     SELECT 'Y'
        INTO l_prg_exist
        FROM oe_price_adjustments prg, oe_price_adj_assocs a,
               oe_price_adjustments p
              WHERE prg.line_id = l_top_model_line_id
              AND prg.list_line_type_code = 'PRG'
              AND prg.price_adjustment_id = a.price_adjustment_id
              AND p.price_adjustment_id = a.rltd_price_adj_id
              AND p.line_id = l_child.line_id
              AND l_child.SUBSCRIPTION_ENABLE_FLAG <> 'Y'
              AND ROWNUM <2;
Line: 4838

	l_line_tbl.DELETE;
Line: 4839

   END IF;  /* End inserting lines */
Line: 4968

             when new lines are inserted to a SCHEDULE SET. A set being
             a user defined ship or arrival set, or a system defined
             ATO or SMC PTO model. When multiple lines are inserted
             to the same set, this procedure is called once for all the
             lines of the set.
-------------------------------------------------------------------*/
Procedure Schedule_Line
( p_sch_set_tbl     IN  OE_ORDER_PUB.request_tbl_type
, x_return_status OUT NOCOPY VARCHAR2)

IS
l_ship_set_id        NUMBER := null;
Line: 5020

      l_line_rec.operation             :=  OE_GLOBALS.G_OPR_UPDATE;
Line: 5061

                     SELECT ship_set_id,arrival_set_id
                     INTO l_ship_set_id,l_arrival_set_id
                     FROM oe_order_lines_all
                     WHERE line_id = l_line_rec.ato_line_id;
Line: 5260

                 UPDATE OE_ORDER_LINES_ALL
                 SET
                     (SCHEDULE_SHIP_DATE,
                      SCHEDULE_ARRIVAL_DATE,
                      SHIP_FROM_ORG_ID,
                      SHIP_SET_ID,
                      ARRIVAL_SET_ID) =
                     (SELECT null,
                             null,
                             decode(re_source_flag,'Y',ship_from_org_id,null),
                             null,
                             null
                      FROM OE_ORDER_LINES_ALL
                      WHERE line_id=l_line_rec.line_id)
                 WHERE line_id = l_line_rec.line_id;
Line: 5277

                 UPDATE OE_ORDER_LINES_ALL
                 SET
                     SCHEDULE_SHIP_DATE    = l_old_line_rec.schedule_ship_date,
                     SCHEDULE_ARRIVAL_DATE = l_old_line_rec.schedule_arrival_date,
                     SHIP_FROM_ORG_ID      = l_old_line_rec.ship_from_org_id,
                     SHIP_SET_ID           = null,
                     ARRIVAL_SET_ID        = null
                 WHERE line_id = l_line_rec.line_id;
Line: 5402

  l_tax_rec_out_tbl.delete;
Line: 5452

      SELECT TAX_VALUE
      INTO l_old_total_tax
      FROM oe_order_lines_all
      WHERE line_id          = p_entity_id_tbl(i).entity_id;
Line: 5464

          oe_debug_pub.add('Updateing tax value from '||TO_CHAR(l_old_total_tax)|| ' To ' ||TO_CHAR(l_total_tax) ,2);
Line: 5468

        UPDATE OE_ORDER_LINES_ALL
        SET TAX_VALUE    = l_total_tax,
          TAX_LINE_VALUE = l_total_tax - l_tax_on_charge  --TaxER
        WHERE line_id    = p_entity_id_tbl(i).entity_id;
Line: 5474

        SELECT payment_type_code
        INTO l_payment_type_code
        FROM oe_order_lines_all
        WHERE line_id = l_line_rec.line_id;
Line: 5488

          Oe_Order_Util.Update_Global_Picture ( p_Upd_New_Rec_If_Exists => FALSE,
p_header_id => l_line_rec.header_id,
p_old_line_rec => l_old_line_tbl(1),
 p_line_rec => l_line_tbl(1),
 p_line_id => l_line_rec.line_id,
x_index => l_global_index,
x_return_status => l_return_status );
Line: 5496

            oe_debug_pub.add('8825061: after update global picture, status: ' || l_return_status, 1 ) ;
Line: 5603

        l_l_line_adj_tbl.delete;
Line: 5613

        l_l_line_adj_tbl.delete;
Line: 5631

                AND l_l_line_adj_tbl(J).OPERATION <> OE_GLOBALS.G_OPR_UPDATE
                THEN
                l_match_flag                            := 'Y';
Line: 5634

                l_l_line_adj_tbl(J).OPERATION           :=OE_GLOBALS.G_OPR_UPDATE;
Line: 5642

                           UPDATE OE_PRICE_ADJUSTMENTS
                           SET ADJUSTED_AMOUNT              = l_tax_rec_out_tbl(I).tax_amount,
                               OPERAND                      = l_tax_rec_out_tbl(I).tax_rate,
                               tax_Rate_id                  = l_tax_rec_out_tbl(I).tax_rate_id,
                               LAST_UPDATE_DATE             = sysdate,
                               APPLIED_FLAG                 = Nvl(l_tax_rec_out_tbl(I).amount_includes_tax_flag,'N'),   --for bug#12895421
                               LAST_UPDATED_BY              = FND_GLOBAL.USER_ID,
                               LAST_UPDATE_LOGIN            = FND_GLOBAL.LOGIN_ID
                           WHERE price_adjustment_id      = l_l_line_adj_tbl(J).price_adjustment_id;
Line: 5652

                         l_l_line_adj_tbl(J).OPERATION := OE_GLOBALS.G_OPR_UPDATE;
Line: 5665

               AND l_l_line_adj_tbl(J).OPERATION <> OE_GLOBALS.G_OPR_UPDATE
               THEN
                l_match_flag                            := 'Y';
Line: 5668

                l_l_line_adj_tbl(J).OPERATION           :=OE_GLOBALS.G_OPR_UPDATE;
Line: 5676

                  UPDATE OE_PRICE_ADJUSTMENTS
                  SET ADJUSTED_AMOUNT            = l_tax_rec_out_tbl(I).tax_amount,
                    OPERAND                      = l_tax_rec_out_tbl(I).tax_rate,
                    tax_Rate_id                  = l_tax_rec_out_tbl(I).tax_rate_id,
                    LAST_UPDATE_DATE             = sysdate,
                    applied_flag                 = Nvl(l_tax_rec_out_tbl(I).amount_includes_tax_flag,'N'),--for bug#12895421
                    LAST_UPDATED_BY              = FND_GLOBAL.USER_ID,
                    LAST_UPDATE_LOGIN            = FND_GLOBAL.LOGIN_ID
                  WHERE price_adjustment_id      = l_l_line_adj_tbl(J).price_adjustment_id;
Line: 5685

                  l_l_line_adj_tbl(J).OPERATION := OE_GLOBALS.G_OPR_UPDATE;
Line: 5695

            SELECT OE_PRICE_ADJUSTMENTS_S.nextval INTO l_price_adjustment_id FROM DUAL;
Line: 5699

            l_adj_rec.last_update_date    := SYSDATE;
Line: 5700

            l_adj_rec.last_updated_by     := FND_GLOBAL.USER_ID;
Line: 5701

            l_adj_rec.last_update_login   := FND_GLOBAL.LOGIN_ID;
Line: 5709

              oe_debug_pub.add('Inserting the Adj record '|| TO_CHAR(l_adj_rec.price_adjustment_id),2);
Line: 5722

            OE_LINE_ADJ_UTIL.INSERT_ROW(p_Line_Adj_rec => l_adj_rec);
Line: 5734

            DELETE
            FROM OE_PRICE_ADJUSTMENTS
            WHERE PRICE_ADJUSTMENT_ID = l_l_line_adj_tbl(J).price_adjustment_id;
Line: 5750

      SELECT SUM(ADJUSTED_AMOUNT)
      INTO l_old_total_tax
      FROM oe_price_adjustments
      WHERE header_id         = p_entity_id_tbl(i).entity_id
      AND line_id            IS NULL
      AND list_line_type_code = 'TAX' ;
Line: 5760

          oe_debug_pub.add('Updateing tax value from '||TO_CHAR(l_old_total_tax)|| ' To ' ||TO_CHAR(l_total_tax) ,2);
Line: 5764

        SELECT payment_type_code
        INTO l_payment_type_code
        FROM oe_order_headers_all
        WHERE header_id = l_header_rec.header_id;
Line: 5775

        SELECT COUNT(1)
        INTO l_return
        FROM oe_order_lines_all
        WHERE 1                =1
        AND header_id          = l_header_rec.header_id
        AND line_category_code = 'RETURN';
Line: 5835

        l_l_header_adj_tbl.delete;
Line: 5845

        l_l_header_adj_tbl.delete;
Line: 5864

              AND l_l_header_adj_tbl(J).OPERATION <> OE_GLOBALS.G_OPR_UPDATE
              THEN
                l_match_flag                              := 'Y';
Line: 5867

                l_l_header_adj_tbl(J).OPERATION           :=OE_GLOBALS.G_OPR_UPDATE;
Line: 5875

                  UPDATE OE_PRICE_ADJUSTMENTS
                  SET ADJUSTED_AMOUNT              = l_tax_rec_out_tbl(I).tax_amount,
                    OPERAND                        = l_tax_rec_out_tbl(I).tax_rate,
                    tax_Rate_id                    = l_tax_rec_out_tbl(I).tax_rate_id,
                    LAST_UPDATE_DATE               = sysdate,
                    applied_flag                   = Nvl(l_tax_rec_out_tbl(I).amount_includes_tax_flag,'N') ,  ----for bug#12895421
                    LAST_UPDATED_BY                = FND_GLOBAL.USER_ID,
                    LAST_UPDATE_LOGIN              = FND_GLOBAL.LOGIN_ID
                  WHERE price_adjustment_id        = l_l_header_adj_tbl(J).price_adjustment_id;
Line: 5884

                  l_l_header_adj_tbl(J).OPERATION := OE_GLOBALS.G_OPR_UPDATE;
Line: 5893

            SELECT OE_PRICE_ADJUSTMENTS_S.nextval INTO l_price_adjustment_id FROM DUAL;
Line: 5898

            l_h_adj_rec.last_update_date    := SYSDATE;
Line: 5899

            l_h_adj_rec.last_updated_by     := FND_GLOBAL.USER_ID;
Line: 5900

            l_h_adj_rec.last_update_login   := FND_GLOBAL.LOGIN_ID;
Line: 5908

              oe_debug_pub.add('Inserting the Adj record '|| TO_CHAR(l_adj_rec.price_adjustment_id),2);
Line: 5921

            OE_Header_Adj_Util.INSERT_ROW(p_Header_Adj_rec => l_h_adj_rec);
Line: 5934

            DELETE
            FROM OE_PRICE_ADJUSTMENTS
            WHERE PRICE_ADJUSTMENT_ID = l_l_header_adj_tbl(J).price_adjustment_id;
Line: 5947

  l_tax_rec_out_tbl.delete;
Line: 5953

  l_tax_rec_out_tbl.delete;
Line: 5954

  l_l_line_adj_tbl.delete;
Line: 5955

  l_l_header_adj_tbl.DELETE ;
Line: 5958

  l_tax_rec_out_tbl.delete;
Line: 5959

  l_l_line_adj_tbl.delete;
Line: 5960

  l_l_header_adj_tbl.DELETE;
Line: 5963

  l_tax_rec_out_tbl.delete;
Line: 5964

  l_l_line_adj_tbl.delete;
Line: 5965

  l_l_header_adj_tbl.DELETE;
Line: 5975

  l_tax_rec_out_tbl.delete;
Line: 5976

  l_l_line_adj_tbl.delete;
Line: 5977

  l_l_header_adj_tbl.DELETE;
Line: 5998

**--Update the Internal Sales Order with the Req header id, Req line Ids, Req number and line numbers.
**--Check for return status
**--Handle Exceptions
 */
l_int_req_Ret_sts varchar2(1);
Line: 6016

SELECT  created_by
       ,org_id
FROM    OE_ORDER_HEADERS
WHERE   header_id = p_header_id;
Line: 6022

SELECT  line_id
        ,order_quantity_uom
        ,ordered_quantity
        ,sold_to_org_id
        ,inventory_item_id
        ,schedule_ship_date
        ,org_id
        ,ship_from_org_id
        ,subinventory
        ,source_document_id
        ,source_document_line_id
        ,item_type_code
FROM    OE_ORDER_LINES
WHERE   header_id = p_header_id;
Line: 6038

SELECT employee_id
FROM fnd_user
WHERE user_id = p_user_id;
Line: 6043

SELECT b.location_id,
       b.organization_id
FROM hz_party_sites_V a
    ,PO_LOCATION_ASSOCIATIONS b
WHERE a.party_site_use_id =  b.SITE_USE_ID
and b.customer_id = p_cust_id
and primary_per_type = 'Y'
and site_use_type = 'SHIP_TO';
Line: 6151

        Update OE_Order_Headers
        set source_document_Id = l_req_header_rec.requisition_header_id
            ,orig_sys_document_ref = l_req_header_rec.segment1
            ,source_document_type_id = OE_GLOBALS.G_ORDER_SOURCE_INTERNAL -- i.e 10  for internal
            ,order_source_id         = OE_GLOBALS.G_ORDER_SOURCE_INTERNAL --i.e 10 for internal
        Where header_id = p_ord_header_id;
Line: 6157

        oe_debug_pub.add('auto_create_internal_req after hdr update ',2);
Line: 6164

                Update Oe_Order_lines
                Set    source_document_id = l_req_header_rec.requisition_header_id
                       ,source_document_line_id = l_req_line_tbl(k).requisition_line_id
                       ,source_document_type_id = OE_GLOBALS.G_ORDER_SOURCE_INTERNAL -- i.e 10  for internal
                       ,orig_sys_document_ref=  l_req_header_rec.segment1
                       ,orig_sys_line_ref = l_req_line_tbl(k).line_num
                where oe_order_lines.line_id = l_req_line_tbl(k).source_doc_line_reference;
Line: 6174

       oe_debug_pub.add('auto_create_internal_req after line update ',2);
Line: 6231

     SELECT return.price_request_code,
            referenced.pricing_quantity,
            referenced.price_request_code
     FROM   OE_ORDER_LINES_ALL return , OE_ORDER_LINES_ALL referenced
     WHERE  return.line_id = p_line_id
            and referenced.line_id = return.reference_line_id;
Line: 6240

     SELECT parent.header_id,
            parent.pricing_quantity,
            parent.line_id
     FROM   OE_ORDER_LINES_ALL child, OE_ORDER_LINES_ALL parent
     WHERE  child.line_id = p_line_id
        and parent.line_id = child.split_from_line_id;
Line: 6341

       update oe_order_lines_All
       set price_request_code = l_ret_price_request_code
       where line_id = p_line_id;
Line: 6415

SELECT order_source_id, orig_sys_document_ref, sold_to_org_id, change_sequence
INTO l_order_source_id, l_orig_sys_document_ref, l_sold_to_org_id, l_change_sequence
FROM oe_order_headers
WHERE header_id=l_header_id;
Line: 6546

      select OE_XML_MESSAGE_SEQ_S.nextval
      into l_itemkey
      from dual;
Line: 6561

   Insert Into OE_HEADER_ACKS (header_id, acknowledgment_type, last_ack_code, request_id, sold_to_org_id, change_sequence)
   Values (l_header_id, l_acknowledgment_type, l_flow_status_code, l_itemkey,
           l_sold_to_org_id, l_change_sequence);
Line: 6566

          oe_debug_pub.add(  'AFTER HEADER INSERT') ;
Line: 6632

      OE_Delayed_Requests_PVT.G_Delayed_Requests.Delete(l_count_old);
Line: 6650

       oe_debug_pub.add(  'BEFORE BULK INSERT OF LINES') ;
Line: 6654

        INSERT INTO OE_LINE_ACKS
            (header_id
            ,line_id
            ,acknowledgment_type
            ,last_ack_code
            ,request_id
            ,sold_to_org_id
            ,change_sequence)
        VALUES
            (l_bulk_line_rec.header_id(j)
            ,l_bulk_line_rec.line_id(j)
            ,l_acknowledgment_type
            ,l_bulk_line_rec.last_ack_code(j)
            ,l_bulk_line_rec.request_id(j)
            ,l_bulk_line_rec.sold_to_org_id(j)
            ,l_bulk_line_rec.change_sequence(j)
            );
Line: 6673

       oe_debug_pub.add(  'AFTER BULK INSERT OF LINES') ;
Line: 6831

Procedure Name : Update_Requisition_Info
Input Params   : P_Header_id - Primary key of the order header
                 P_Line_id - Primary key of the order line. This parameter
                             will be null for order header cancellation
                 P_Requisition_Header_id - Primary key of the requisition
                                           header
                 P_Requisition_Line_id - Primary key of the requisition line
                 p_Line_ids - String variable containing line_ids delimited
                              by comma ?Q,?R. Will be populated only if it is
                              a partial order cancellation
                 p_num_records - Number of total order line records cancelled
                                 while processing partial order cancellation
                 P_Quantity_Change - It will denote net change in order quantity
                                     with respective single requisition line.
                                     If it is greater than 0 then it is an
                                     increment in the quantity, while if it is
                                     less than 0 then it is a decrement in the
                                     ordered quantity. If it is 0 then it
                                     indicates there is no change in ordered
                                     quantity value
                 P_New_Schedule_Ship_Date - It will denote the change in
                                            Schedule Ship Date
                 P_Cancel_Order - It will denote whether internal sales order
                                  is cancelled or not. If it is cancelled then
                                  respective Purchasing api will be called to
                                  trigger the requisition header cancellation.
Output Params  : X_Return_Status - The return status of the API
                                   (Expected/Unexpected/Success)
Brief Description : This program unit is added for IR ISO Change
                    management project, so as to trigger the new
                    program unit OE_Process_Requisition_Pvt.Updat
                    e_Internal_Requisition introduced as part of
                    this project, and responsible for calling several
                    Purchasing APIs based on the action performed
                    on the internal sales order header/line.

                    Possible actions can be:
                       Header Level FULL Cancellation
                       Header Level PARTIAL Cancellation
                       Line Level Cancellation
                       Line Ordered Quantity update
                       Line Schedule Ship/Arrival Date update
                       Line Ordered Quantity and Schedule Ship/Arrival
                       Date update

-- For details on IR ISO CMS project, please refer to FOL >
-- OM Development > OM GM > 12.1.1 > TDD > IR_ISO_CMS_TDD.doc
*/

Procedure Update_Requisition_Info -- Package Body
( p_header_id              IN NUMBER    -- Param5 or Entity id
, p_line_id                IN NUMBER   -- Entity id
, P_Line_ids               IN VARCHAR2 -- Long_Param1
, P_num_records            IN NUMBER   -- Param6
, P_Requisition_Header_id  IN NUMBER    -- Param3
, P_Requisition_Line_id    IN NUMBER DEFAULT NULL   -- Param4
, P_Quantity_Change        IN NUMBER DEFAULT NULL   -- Param1
, P_Quantity2_Change       IN NUMBER DEFAULT NULL --Bug 14211120
, P_New_Schedule_Ship_Date IN DATE -- Date_Param1
, P_Cancel_order           IN BOOLEAN -- Param2
, x_return_status OUT NOCOPY varchar2
)
IS
--
l_return_status       VARCHAR2(30);
Line: 6906

    oe_debug_pub.ADD('Entering delayed request utility for Update_Requisition_Info',1);
Line: 6909

    oe_debug_pub.ADD(' Number of shipment Lines updated '||p_num_records,5);
Line: 6932

      select nvl(ordered_quantity,0)
      into   l_new_ord_quantity
      from   oe_order_lines_all
      where  line_id = p_line_id;
Line: 6945

  OE_Process_Requisition_Pvt.Update_Internal_Requisition
  ( P_Header_id               => p_header_id
  , P_Line_id                 => p_line_id
  , p_line_ids                => p_line_ids
  , p_num_records             => p_num_records
  , P_Req_Header_id           => P_Requisition_Header_id
  , P_Req_Line_id             => P_Requisition_Line_id
  , P_Quantity_Change         => P_Quantity_Change
  , P_Quantity2_Change        => P_Quantity2_Change --Bug 14211120
  , P_New_Schedule_Ship_Date  => l_New_Schedule_Ship_Date
  , P_Cancel_Order            => P_Cancel_order
  , P_Cancel_line             => l_cancel_line
  , X_msg_count               => l_msg_count
  , X_msg_data                => l_msg_data
  , X_return_status           => l_return_status
  );
Line: 6971

    oe_debug_pub.ADD('Exiting delayed request utility for Update_Requisition_Info',1);
Line: 6983

      , 'Update_Requisition_Info'
      );
Line: 6986

END Update_Requisition_Info;