DBA Data[Home] [Help]

APPS.OE_ORDER_ADJ_PVT SQL Statements

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

Line: 39

   SELECT list_type_code
     INTO l_list_type
     FROM QP_LIST_HEADERS
    WHERE LIST_HEADER_ID = p_price_list_id;
Line: 66

   SELECT enforce_price_list_flag
     INTO l_flag
     FROM OE_BLANKET_LINES_EXT E
    WHERE E.ORDER_NUMBER = p_blanket_number
      AND E.LINE_NUMBER = p_blanket_line_number;
Line: 95

Select Unit_Price,
       Adjusted_Unit_Price,
       priced_quantity,
       priced_uom_code
From   QP_PREQ_LINES_TMP
Where  Line_Id = p_line_id;
Line: 103

Select line_id,
       blanket_number,
       blanket_line_number,
       unit_selling_price,
       ordered_quantity,
       order_quantity_uom,
       inventory_item_id,
       line_set_id,
       fulfilled_flag,
       header_id,
       line_category_code,
       commitment_id,
       transaction_phase_code --for bug 3108881
From   OE_ORDER_LINES
Where  Line_Id = p_line_id;
Line: 177

    FOR update_line IN c_line(p_line_rec.line_id) LOOP

      IF update_line.line_category_code = 'ORDER'
         AND update_line.blanket_number IS NOT NULL
      THEN

       IF l_debug_level > 0 THEN
          oe_debug_pub.add('OEXVADJB log blanket request');
Line: 185

          oe_debug_pub.add('old SP :'||update_line.unit_selling_price);
Line: 189

       OE_Order_Cache.Load_Order_Header(update_line.header_id);
Line: 191

       IF nvl(update_line.transaction_phase_code,'F') = 'F' THEN

	       OE_Delayed_Requests_Pvt.Log_Request
	       (p_entity_code               => OE_GLOBALS.G_ENTITY_ALL
      	 	,p_entity_id                 => update_line.line_id
       		,p_requesting_entity_code    => OE_GLOBALS.G_ENTITY_LINE
       		,p_requesting_entity_id      => update_line.line_id
       		,p_request_type              => OE_GLOBALS.G_PROCESS_RELEASE
       		-- Old values
       		,p_param1                    => update_line.blanket_number
       		,p_param2                    => update_line.blanket_line_number
       		,p_param3                    => update_line.ordered_quantity
       		,p_param4                    => update_line.order_quantity_uom
       		,p_param5                    => update_line.unit_selling_price
       		,p_param6                    => update_line.inventory_item_id
       		-- New values
       		,p_param11                   => update_line.blanket_number
       		,p_param12                   => update_line.blanket_line_number
       		,p_param13                   => update_line.ordered_quantity
       		,p_param14                   => update_line.order_quantity_uom
       		,p_param15                   => l_selling_price
       		,p_param16                   => update_line.inventory_item_id
       		-- Other parameters
       		,p_param8                    => update_line.fulfilled_flag
       		,p_param9                    => update_line.line_set_id
       		,p_request_unique_key1       =>
                        OE_Order_Cache.g_header_rec.transactional_curr_code
       		,x_return_status             => l_return_status
       		);
Line: 227

       		IF update_line.line_set_id IS NOT NULL THEN
         		OE_Delayed_Requests_Pvt.Log_Request
         		  (p_entity_code               => OE_GLOBALS.G_ENTITY_ALL
         		  ,p_entity_id                 => update_line.line_set_id
         		  ,p_requesting_entity_code    => OE_GLOBALS.G_ENTITY_LINE
         		  ,p_requesting_entity_id      => update_line.line_id
         		  ,p_request_type              => 'VALIDATE_RELEASE_SHIPMENTS'
         		  ,p_request_unique_key1       => update_line.blanket_number
         		  ,p_request_unique_key2       => update_line.blanket_line_number
         		  ,p_param1                    =>
                        	OE_Order_Cache.g_header_rec.transactional_curr_code
         		  ,x_return_status             => l_return_status
         		  );
Line: 251

      IF update_line.commitment_id IS NOT NULL
         AND OE_Commitment_Pvt.Do_Commitment_Sequencing THEN

           oe_debug_pub.add('Logging delayed request for Commitment.', 2);
Line: 257

           p_entity_id                  => update_line.line_id,
           p_requesting_entity_code     => OE_GLOBALS.G_ENTITY_LINE,
           p_requesting_entity_id       => update_line.line_id,
           p_request_type               => OE_GLOBALS.G_CALCULATE_COMMITMENT,
           x_return_status              => l_return_status);
Line: 270

  Update Oe_Order_Lines
  Set    Unit_Selling_Price= l_selling_price,
         Unit_List_Price = l_unit_price,
         unit_selling_price_per_pqty = l_qp_adjusted_unit_price,
         unit_list_price_per_pqty = l_qp_unit_price,
         pricing_quantity         = l_pricing_quantity,
         pricing_quantity_uom     = l_pricing_quantity_uom,
         tax_value                = l_tax_value,
         lock_control             = lock_control +1
  Where  Line_id = p_line_rec.line_id;
Line: 282

  oe_line_adj_util.delete_row(p_line_id => p_line_rec.line_id);
Line: 294

 Select c.name,
        a.list_line_no
 From   qp_preq_ldets_tmp a,
        qp_preq_lines_tmp b,
        qp_list_headers_vl c
 Where  b.line_id = p_line_id
 And    b.line_index = a.line_index
 And    a.created_from_list_header_id = c.list_header_id
 And    a.automatic_flag = 'Y'
 And    a.pricing_status_code = 'N'
 And    a.created_from_list_line_type <> 'PLL';
Line: 389

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_header_adj_rec.header_Id;
Line: 433

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_old_header_adj_rec.header_id;
Line: 497

        ELSIF l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Adj_rec.db_flag := FND_API.G_TRUE;
Line: 532

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'HEADER_ADJ'
  		,p_entity_id         		=> l_header_adj_rec.price_adjustment_id
    		,p_header_id         		=> l_header_adj_rec.header_Id);
Line: 548

         OR l_header_adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        adj_debug('Check Attributes Security');
Line: 640

            IF l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Header_Adj.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Header_Adj_rec              => l_Header_Adj_rec
                );
Line: 669

    IF NOT (l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE
               AND OE_Header_Adj_Security.g_check_all_cols_constraint = 'Y')
    AND  l_control_rec.check_security THEN

        adj_debug('Check Entity Security');
Line: 698

           OE_DEBUG_PUB.add('OEXVADJB:calling to insert audit history reason for header adj in pre_write_process', 2);
Line: 704

           oe_debug_pub.add('OEXVADJB:After calling to insert audit history');
Line: 707

            IF l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Header_Adj_Util.Delete_Row
                (   p_price_adjustment_id         => l_Header_Adj_rec.price_adjustment_id
                );
Line: 713

		-- Log a delayed request to cause repricing due to deleted
		-- record
		-- NOTE: Requesting entity is header, not header adj. as the adj. itself
		-- has been deleted and this request should be deleted when the order is
		-- deleted. Should be revisited if the entity logged against is changed
		-- to header.
		  	IF OE_Globals.G_RECURSION_MODE <> 'Y' AND
			   l_header_adj_rec.list_line_type_code NOT IN ('COST','TAX')
		     then

			        adj_debug('Log header level PRICE_ADJ');
Line: 742

                l_Header_Adj_rec.last_update_date := SYSDATE;
Line: 743

                l_Header_Adj_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 744

                l_Header_Adj_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 746

                IF l_Header_Adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_Adj_Util.Update_Row (l_Header_Adj_rec);
Line: 755

                    OE_Header_Adj_Util.Insert_Row (l_Header_Adj_rec);
Line: 797

      OE_DBI_UTIL.Update_DBI_Log( x_return_status  => l_return_status);
Line: 820

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_ADJ,
		  	   p_entity_id => l_header_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 838

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_ADJ,
		  	   p_entity_id => l_header_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 850

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_ADJ,
		  	   p_entity_id => l_header_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 993

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_line_adj_rec.line_id;
Line: 1045

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_old_line_adj_rec.line_id;
Line: 1151

        ELSIF l_Line_Adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_Adj_rec.db_flag := FND_API.G_TRUE;
Line: 1187

            OE_MSG_PUB.update_msg_context(
		 p_entity_code			=> 'LINE_ADJ'
  		,p_entity_id         		=> l_line_adj_rec.price_adjustment_id
    		,p_header_id         		=> l_line_adj_rec.header_id
    		,p_line_id           		=> l_line_adj_rec.line_id);
Line: 1205

         OR l_line_adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        adj_debug('Check Attributes Security',2);
Line: 1325

            IF l_Line_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Line_Adj.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Line_Adj_rec                => l_Line_Adj_rec
                );
Line: 1332

			 adj_debug('After OE_Validate_Line_Adj.delete ',2);
Line: 1388

           OE_DEBUG_PUB.add('OEXVADJB:calling to insert audit history for line adj from  pre_write_process', 2);
Line: 1393

           OE_DEBUG_PUB.add('OEXVADJB:After calling to insert audit history for line adj from  pre_write_process', 2);
Line: 1396

            IF l_Line_Adj_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Line_Adj_Util.Delete_Row
                (   p_price_adjustment_id         => l_Line_Adj_rec.price_adjustment_id
                );
Line: 1402

		-- Log a delayed request to cause repricing due to deleted
		-- record
		-- NOTE: Requesting entity is line, not line adj. as the adj. itself
		-- has been deleted and this request should be deleted when the line gets
		-- deleted. Should be revisited if the entity logged against is changed
		-- to line.
		  	IF OE_Globals.G_RECURSION_MODE <> 'Y' and
			   l_Line_adj_rec.list_line_type_code NOT IN ('COST','TAX')
               THEN

				/* 1905650 - G_PRICE_ADJ request should be logged against LINE entity,
	    			   not against LINE_ADJ entity
				   1503357 - Minor change to handle header level adjustments
	 			*/

			        if (l_line_adj_rec.line_id is NULL) Then
				   oe_delayed_requests_pvt.log_request(
					p_entity_code     => OE_GLOBALS.G_ENTITY_ALL,
					p_entity_id              => l_Line_adj_rec.header_id,
					p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
					p_requesting_entity_id   => l_Line_adj_rec.header_id,
					p_request_type           => OE_GLOBALS.G_PRICE_ADJ,
					x_return_status          => l_return_status);
Line: 1459

                l_Line_Adj_rec.last_update_date := SYSDATE;
Line: 1460

                l_Line_Adj_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 1461

                l_Line_Adj_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 1463

                IF l_Line_Adj_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
                    oe_debug_pub.add(' updating list line id:'||l_Line_Adj_rec.list_line_id);
Line: 1467

                    OE_Line_Adj_Util.Update_Row (l_Line_Adj_rec);
Line: 1474

       			 adj_debug('Before  insert row',2);
Line: 1475

                    OE_Line_Adj_Util.Insert_Row (l_Line_Adj_rec);
Line: 1476

       			 adj_debug('After  insert row',2);
Line: 1518

      OE_DBI_UTIL.Update_DBI_Log( x_return_status  => l_return_status);
Line: 1547

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_ADJ,
		  	   p_entity_id => l_line_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 1564

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_ADJ,
		  	   p_entity_id => l_line_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 1576

oe_delayed_requests_pvt.delete_request(p_entity_code =>OE_GLOBALS.G_ENTITY_LINE_ADJ,
		  	   p_entity_id => l_line_adj_rec.Price_adjustment_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 1710

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_header_Price_Att_rec.header_Id;
Line: 1754

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id
               FROM   OE_ORDER_HEADERS_ALL
               WHERE  header_id = l_old_header_Price_Att_rec.header_Id;
Line: 1815

        ELSIF l_Header_Price_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Price_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Price_Att_rec.db_flag := FND_API.G_TRUE;
Line: 1849

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'HEADER_ADJ'
  		,p_entity_id         		=> l_header_Price_Att_rec.order_price_attrib_id
    		,p_header_id         		=> l_header_Price_Att_rec.header_Id);
Line: 1929

            IF l_Header_Price_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Header_Pattr.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Header_Price_Attr_rec              => l_Header_Price_Att_rec
                );
Line: 1960

            IF l_Header_Price_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Header_PAttr_Util.Delete_Row
                (   p_order_price_attrib_id         => l_Header_Price_Att_rec.order_price_attrib_id
                );
Line: 1966

		-- Log a delayed request to cause repricing due to deleted
		-- record
--2442012

   /*     		OE_delayed_requests_Pvt.log_request(
				p_entity_code 			=> OE_GLOBALS.G_ENTITY_HEader_Price_Att,
				p_entity_id         	=> l_Header_Price_Att_Rec.Header_Id,
				p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEader_Price_Att,
				p_requesting_entity_id   => l_Header_Price_Att_Rec.Header_Id,
		 		p_param1                 => l_Header_Price_Att_Rec.Header_Id,
                 	        p_param2                 => 'LINE',
		 		p_request_type           => OE_GLOBALS.G_PRICE_ORDER,
		 		x_return_status          => l_return_status);
Line: 2000

					/*Select booked_flag	Into
						l_booked_flag
					From OE_Order_Headers where
					Header_id =	l_Header_Price_Att_Rec.Header_Id;
Line: 2049

                l_Header_Price_Att_rec.last_update_date := SYSDATE;
Line: 2050

                l_Header_Price_Att_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 2051

                l_Header_Price_Att_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 2053

                IF l_Header_Price_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Header_PAttr_Util.Update_Row (l_Header_Price_Att_rec);
Line: 2061

                    oe_debug_pub.add('  Before calling pattr_util.insert_row');
Line: 2063

                    select OE_ORDER_PRICE_ATTRIBS_S.nextval
                    into   l_header_price_att_rec.order_price_attrib_id
                    from dual;
Line: 2067

                    OE_Header_PAttr_Util.Insert_Row (l_Header_Price_Att_rec);
Line: 2102

			oe_delayed_requests_pvt.delete_request
			(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_ADJ,
		  	   p_entity_id => l_header_Price_Att_rec.order_price_attrib_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 2123

			oe_delayed_requests_pvt.delete_request
				(p_entity_code =>OE_GLOBALS.G_ENTITY_HEADER_ADJ,
		  	   p_entity_id => l_header_Price_Att_rec.order_price_attrib_id,
	                   p_request_type => NULL,
	                   x_return_status => l_return_status);
Line: 2269

        ELSIF l_Header_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Adj_Att_rec.db_flag := FND_API.G_TRUE;
Line: 2303

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'ADJ_ATTS'
  		,p_entity_id         		=> l_Header_Adj_Att_rec.Price_adj_attrib_id);
Line: 2344

            IF l_Header_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                Oe_Header_Price_Aattr_util.Delete_Row
                (   p_Price_Adj_Attrib_id         => l_Header_Adj_Att_rec.Price_adj_attrib_id
                );
Line: 2354

                l_Header_Adj_Att_rec.last_update_date := SYSDATE;
Line: 2355

                l_Header_Adj_Att_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 2356

                l_Header_Adj_Att_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 2358

                IF l_Header_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    Oe_Header_Price_Aattr_util.Update_Row (l_Header_Adj_Att_rec);
Line: 2367

                    Oe_Header_Price_Aattr_util.Insert_Row (l_Header_Adj_Att_rec);
Line: 2548

        ELSIF l_Header_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Header_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Header_Adj_Assoc_rec.db_flag := FND_API.G_TRUE;
Line: 2582

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'ADJ_ATTS'
  		,p_entity_id         		=> l_Header_Adj_Assoc_rec.Price_Adj_assoc_id);
Line: 2623

            IF l_Header_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                Oe_Header_Adj_Assocs_util.Delete_Row
                (   p_Price_Adj_assoc_id         => l_Header_Adj_Assoc_rec.Price_Adj_assoc_id
                );
Line: 2633

                l_Header_Adj_Assoc_rec.last_update_date := SYSDATE;
Line: 2634

                l_Header_Adj_Assoc_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 2635

                l_Header_Adj_Assoc_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 2637

                IF l_Header_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    Oe_Header_Adj_Assocs_util.Update_Row (l_Header_Adj_Assoc_rec);
Line: 2646

                    Oe_Header_Adj_Assocs_util.Insert_Row (l_Header_Adj_Assoc_rec);
Line: 2814

            SELECT order_source_id, orig_sys_document_ref, change_sequence,
            source_document_type_id, source_document_id, orig_sys_line_ref,
            source_document_line_id, orig_sys_shipment_ref
            INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
            l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
            l_source_document_line_id, l_orig_sys_shipment_ref
            FROM   OE_ORDER_LINES_ALL
            WHERE  line_id = l_Line_price_att_rec.Line_Id;
Line: 2866

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = l_old_Line_price_att_rec.Line_Id;
Line: 2935

        ELSIF l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_price_att_rec.db_flag := FND_API.G_TRUE;
Line: 2968

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'LINE_PATTS'
  		,p_entity_id         		=> l_Line_price_att_rec.order_price_attrib_id
    		,p_header_id         		=> l_Line_price_att_rec.header_Id
    		,p_line_id           		=> l_Line_price_att_rec.line_id);
Line: 2987

         OR l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_UPDATE)
   THEN

        adj_debug('Check Attributes Security');
Line: 3077

            IF l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Validate_Line_Pattr.Entity_Delete
                (   x_return_status               => l_return_status
                ,   p_Line_price_attr_rec              => l_Line_Price_Att_rec
                );
Line: 3108

            IF l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                OE_Line_Pattr_Util.Delete_Row
                (   p_order_price_attrib_id         => l_Line_price_att_rec.order_price_attrib_id
                );
Line: 3135

				Select booked_flag,Shipped_quantity into
				l_booked_flag,l_Shipped_quantity
				From OE_Order_lines where
				Line_id =	l_Line_Price_Att_rec.Line_Id;
Line: 3183

                l_Line_price_att_rec.last_update_date := SYSDATE;
Line: 3184

                l_Line_price_att_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 3185

                l_Line_price_att_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 3187

                IF l_Line_price_att_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    OE_Line_Pattr_Util.Update_Row (l_Line_price_att_rec);
Line: 3200

                    select OE_ORDER_PRICE_ATTRIBS_S.nextval
                    into   l_Line_price_att_rec.order_price_attrib_id
                    from dual;
Line: 3204

                    OE_Line_Pattr_Util.Insert_Row (l_Line_price_att_rec);
Line: 3303

PROCEDURE Insert_Adj_Atts
(p_Line_Adj_attribs_tbl          IN OE_Order_PUB.Line_Adj_Att_Tbl_Type
)
is
  I PLS_INTEGER;
Line: 3327

    Select OE_PRICE_ADJ_ATTRIBS_S.nextval
    Into   l_line_adj_att_tbl(i).price_adj_attrib_id
    From   dual;
Line: 3339

End Insert_Adj_Atts;
Line: 3424

        ELSIF l_Line_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_Adj_Att_rec.db_flag := FND_API.G_TRUE;
Line: 3458

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'ADJ_ATTS'
  		,p_entity_id         		=> l_Line_Adj_Att_rec.Price_adj_attrib_id);
Line: 3520

            IF l_Line_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN

                Oe_Line_Price_Aattr_util.Delete_Row
                (   p_Price_Adj_Attrib_id         => l_Line_Adj_Att_rec.Price_adj_attrib_id
                );
Line: 3530

                l_Line_Adj_Att_rec.last_update_date := SYSDATE;
Line: 3531

                l_Line_Adj_Att_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 3532

                l_Line_Adj_Att_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 3534

                IF l_Line_Adj_Att_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN

                    Oe_Line_Price_Aattr_util.Update_Row (l_Line_Adj_Att_rec);
Line: 3543

                    Oe_Line_Price_Aattr_util.Insert_Row (l_Line_Adj_Att_rec);
Line: 3642

PROCEDURE Insert_Adj_Assocs
(p_Line_Adj_Assoc_tbl          IN OE_Order_PUB.Line_Adj_Assoc_Tbl_Type
)
is
  I PLS_INTEGER;
Line: 3665

    Select oe_price_adj_assocs_s.nextval
    Into   l_line_adj_assoc_tbl(i).price_adj_assoc_id
    From   dual;
Line: 3765

        ELSIF l_Line_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_UPDATE
        OR    l_Line_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_DELETE
        THEN

            l_Line_Adj_Assoc_rec.db_flag := FND_API.G_TRUE;
Line: 3799

      	   OE_MSG_PUB.update_msg_context(
	 	 p_entity_code			=> 'ADJ_ATTS'
  		,p_entity_id         		=> l_Line_Adj_Assoc_rec.Price_Adj_assoc_id);
Line: 3841

            IF l_Line_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_DELETE THEN


     	        adj_debug('deleting line adj assocs',2);
Line: 3845

                Oe_Line_Adj_Assocs_util.Delete_Row
                (   p_Price_Adj_assoc_id         => l_Line_Adj_Assoc_rec.Price_Adj_assoc_id
                );
Line: 3853

                l_Line_Adj_Assoc_rec.last_update_date := SYSDATE;
Line: 3854

                l_Line_Adj_Assoc_rec.last_updated_by := FND_GLOBAL.USER_ID;
Line: 3855

                l_Line_Adj_Assoc_rec.last_update_login := FND_GLOBAL.LOGIN_ID;
Line: 3857

                IF l_Line_Adj_Assoc_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
     	            adj_debug('updating line adj assocs',2);
Line: 3859

                    Oe_Line_Adj_Assocs_util.Update_Row (l_Line_Adj_Assoc_rec);
Line: 3862

     	            adj_debug('inserting into line adj assocs',2);
Line: 3866

                    Oe_Line_Adj_Assocs_util.Insert_Row (l_Line_Adj_Assoc_rec);
Line: 3973

	select nvl(enforce_line_prices_flag,'N') into l_enforce_price_flag
	from oe_line_types_v where line_type_id=OE_Order_PUB.G_Line.Line_Type_id;
Line: 3982

	select nvl(enforce_line_prices_flag,'N') into l_enforce_price_flag
	from oe_Order_types_v where Order_type_id=OE_Order_PUB.g_hdr.Order_Type_Id;
Line: 4010

             select /* MOAC_SQL_CHANGE */ nvl(enforce_line_prices_flag,'N') into px_order_enforce_list_price
             from oe_transaction_types_all o,oe_order_headers h
             where h.header_id=p_header_id and h.order_type_id=o.transaction_type_id
             and o.transaction_type_code=l_literal_order;
Line: 4025

  	  select nvl(enforce_line_prices_flag,'N') into x_line_enforce_list_price
	  from oe_line_types_v where line_type_id=p_line_type_id;
Line: 4043

		select rounding_factor into g_rounding_factor_rec.rounding_factor from
		qp_list_headers_b where list_header_id=p_list_header_id;
Line: 4348

                    Select list_type_code into
                         px_Req_LINE_DETAIL_tbl(l_RLD_Index).created_from_list_type_code
                    from qp_list_headers_b where
                    list_header_id= p_Line_Adj_rec.List_Header_Id;
Line: 4359

			  px_Req_LINE_DETAIL_tbl(l_RLD_Index).override_flag := p_Line_Adj_rec.update_allowed;
Line: 4475

	select flex_title, pricing_context, pricing_attribute1,
	pricing_attribute2 , pricing_attribute3 , pricing_attribute4 , pricing_attribute5 ,
	pricing_attribute6 , pricing_attribute7 , pricing_attribute8 , pricing_attribute9 ,
	pricing_attribute10 , pricing_attribute11 , pricing_attribute12 , pricing_attribute13 ,
	pricing_attribute14 , pricing_attribute15 , pricing_attribute16 , pricing_attribute17 ,
	pricing_attribute18 , pricing_attribute19 , pricing_attribute20 , pricing_attribute21 ,
	pricing_attribute22 , pricing_attribute23 , pricing_attribute24 , pricing_attribute25 ,
	pricing_attribute26 , pricing_attribute27 , pricing_attribute28 , pricing_attribute29 ,
	pricing_attribute30 , pricing_attribute31 , pricing_attribute32 , pricing_attribute33 ,
	pricing_attribute34 , pricing_attribute35 , pricing_attribute36 , pricing_attribute37 ,
	pricing_attribute38 , pricing_attribute39 , pricing_attribute40 , pricing_attribute41 ,
	pricing_attribute42 , pricing_attribute43 , pricing_attribute44 , pricing_attribute45 ,
	pricing_attribute46 , pricing_attribute47 , pricing_attribute48 , pricing_attribute49 ,
	pricing_attribute50 , pricing_attribute51 , pricing_attribute52 , pricing_attribute53 ,
	pricing_attribute54 , pricing_attribute55 , pricing_attribute56 , pricing_attribute57 ,
	pricing_attribute58 , pricing_attribute59 , pricing_attribute60 , pricing_attribute61 ,
	pricing_attribute62 , pricing_attribute63 , pricing_attribute64 , pricing_attribute65 ,
	pricing_attribute66 , pricing_attribute67 , pricing_attribute68 , pricing_attribute69 ,
	pricing_attribute70 , pricing_attribute71 , pricing_attribute72 , pricing_attribute73 ,
	pricing_attribute74 , pricing_attribute75 , pricing_attribute76 , pricing_attribute77 ,
	pricing_attribute78 , pricing_attribute79 , pricing_attribute80 , pricing_attribute81 ,
	pricing_attribute82 , pricing_attribute83 , pricing_attribute84 , pricing_attribute85 ,
	pricing_attribute86 , pricing_attribute87 , pricing_attribute88 , pricing_attribute89 ,
	pricing_attribute90 , pricing_attribute91 , pricing_attribute92 , pricing_attribute93 ,
	pricing_attribute94 , pricing_attribute95 , pricing_attribute96 , pricing_attribute97 ,
	pricing_attribute98 , pricing_attribute99 , pricing_attribute100
	,Override_Flag
 from oe_order_price_attribs a
 where (a.line_id is null and a.header_id = p_header_id )
union all
	select flex_title, pricing_context, pricing_attribute1,
	pricing_attribute2 , pricing_attribute3 , pricing_attribute4 , pricing_attribute5 ,
	pricing_attribute6 , pricing_attribute7 , pricing_attribute8 , pricing_attribute9 ,
	pricing_attribute10 , pricing_attribute11 , pricing_attribute12 , pricing_attribute13 ,
	pricing_attribute14 , pricing_attribute15 , pricing_attribute16 , pricing_attribute17 ,
	pricing_attribute18 , pricing_attribute19 , pricing_attribute20 , pricing_attribute21 ,
	pricing_attribute22 , pricing_attribute23 , pricing_attribute24 , pricing_attribute25 ,
	pricing_attribute26 , pricing_attribute27 , pricing_attribute28 , pricing_attribute29 ,
	pricing_attribute30 , pricing_attribute31 , pricing_attribute32 , pricing_attribute33 ,
	pricing_attribute34 , pricing_attribute35 , pricing_attribute36 , pricing_attribute37 ,
	pricing_attribute38 , pricing_attribute39 , pricing_attribute40 , pricing_attribute41 ,
	pricing_attribute42 , pricing_attribute43 , pricing_attribute44 , pricing_attribute45 ,
	pricing_attribute46 , pricing_attribute47 , pricing_attribute48 , pricing_attribute49 ,
	pricing_attribute50 , pricing_attribute51 , pricing_attribute52 , pricing_attribute53 ,
	pricing_attribute54 , pricing_attribute55 , pricing_attribute56 , pricing_attribute57 ,
	pricing_attribute58 , pricing_attribute59 , pricing_attribute60 , pricing_attribute61 ,
	pricing_attribute62 , pricing_attribute63 , pricing_attribute64 , pricing_attribute65 ,
	pricing_attribute66 , pricing_attribute67 , pricing_attribute68 , pricing_attribute69 ,
	pricing_attribute70 , pricing_attribute71 , pricing_attribute72 , pricing_attribute73 ,
	pricing_attribute74 , pricing_attribute75 , pricing_attribute76 , pricing_attribute77 ,
	pricing_attribute78 , pricing_attribute79 , pricing_attribute80 , pricing_attribute81 ,
	pricing_attribute82 , pricing_attribute83 , pricing_attribute84 , pricing_attribute85 ,
	pricing_attribute86 , pricing_attribute87 , pricing_attribute88 , pricing_attribute89 ,
	pricing_attribute90 , pricing_attribute91 , pricing_attribute92 , pricing_attribute93 ,
	pricing_attribute94 , pricing_attribute95 , pricing_attribute96 , pricing_attribute97 ,
	pricing_attribute98 , pricing_attribute99 , pricing_attribute100
	,Override_Flag
 from oe_order_price_attribs a
 where (p_line_id is not null and a.line_id = p_line_id )
	  ;
Line: 5467

			SELECT concatenated_segments
			INTO   px_line_rec.ordered_item
			FROM   mtl_system_items_kfv
			WHERE  inventory_item_id = px_line_rec.inventory_item_id
			AND    organization_id = l_org_id;
Line: 5487

	select modified_from from oe_price_adjustments
	where line_id=px_line_rec.line_id
		and list_line_type_code='IUE';
Line: 5500

			SELECT concatenated_segments
			INTO   px_line_rec.ordered_item
			FROM   mtl_system_items_kfv
			WHERE  inventory_item_id = px_line_rec.inventory_item_id
			AND    organization_id = l_org_id;
Line: 5786

                Select 'x' into l_dummy from dual
                where exists (select 'x' from oe_agreements_vl where
                agreement_id = l_line_tbl(line_Tbl_Index).agreement_id and
               ( trunc(nvl(l_line_tbl(line_Tbl_Index).PRICING_DATE,sysdate))
                between
                trunc(nvl(start_date_active, nvl(l_line_tbl(line_Tbl_Index).PRICING_DATE,sysdate)))
                and
                trunc(nvl(end_date_active, nvl(l_line_tbl(line_Tbl_Index).PRICING_DATE, sysdate)))));
Line: 5800

               select name, revision into l_agreement_name, l_revision
               from oe_agreements_vl where agreement_id =
               l_line_tbl(line_Tbl_Index).agreement_id;
Line: 5959

			Select 'x' into l_dummy from dual
                        Where exists
                        (select 'x' from
                        oe_order_price_attribs oopa
			where
		        nvl(oopa.line_id,l_Line_Tbl(line_Tbl_Index).line_id) = l_Line_Tbl(line_Tbl_Index).line_id
		      and oopa.header_id = l_header_id2);
Line: 6071

                         Select 'x' into l_dummy
                         from dual where
                         exists(select 'x' from oe_order_lines
                                Where header_id = l_header_id
                                and   calculate_price_flag in ('Y','P')
                                and item_type_code not in ('CONFIG', 'INCLUDED'));
Line: 6090

                     Select 'p' into l_dummy
                     from dual where
                     exists (select 'x' from oe_order_lines
                             where header_id = l_header_id
                             and calculate_price_flag in ('N', 'P')
			     and cancelled_flag = 'N'
                             and item_type_code not in ('CONFIG', 'INCLUDED') );
Line: 6143

		  Select 'x' into l_dummy from dual
                  where exists(
                   Select 'X' from oe_order_price_attribs oopa
		   where oopa.header_id = l_header_id2 and oopa.line_id is null);
Line: 6342

Function Update_Adj_Line_rec(
		p_Line_Adj_Rec		in out nocopy OE_Order_Pub.Line_Adj_Rec_Type
		,p_req_line_detail_Rec   qp_preq_grp.line_detail_rec_type
		)
Return Boolean
is
l_updated_Flag		Boolean := False;
Line: 6354

			p_Line_Adj_Rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 6358

		adj_debug('Entering oe_order_Adj_pvt.Update_Adj_Line_rec',1);
Line: 6359

		G_STMT_NO := 'Update_Adj_Line_rec#10';
Line: 6365

			l_updated_Flag := True;
Line: 6372

			l_updated_Flag := True;
Line: 6379

			l_updated_Flag := True;
Line: 6386

			l_updated_Flag := True;
Line: 6390

                      if (not l_updated_flag) and p_Line_Adj_Rec.list_line_type_code = 'CIE' Then
                       adj_debug('CIE:to delete coupon'||p_req_line_detail_rec.list_line_no);
Line: 6393

                         QP_COUPON_PVT.Delete_Coupon(p_req_line_detail_Rec.list_line_no,
                                                     x_return_status,
                                                     x_return_status_txt
                                                    );
Line: 6405

			l_updated_Flag := True;
Line: 6415

				l_updated_Flag := True;
Line: 6417

				adj_debug('Value error , The term is not updated '||p_req_line_detail_Rec.substitution_From);
Line: 6428

			 	l_updated_Flag := True;
Line: 6430

				adj_debug('Value error , The term is not updated '||p_req_line_detail_Rec.substitution_to);
Line: 6440

			l_updated_Flag := True;
Line: 6449

			l_updated_Flag := True;
Line: 6456

			l_updated_Flag := True;
Line: 6467

			l_updated_Flag := True;
Line: 6474

			l_updated_Flag := True;
Line: 6477

		   if not OE_GLOBALS.Equal(p_Line_Adj_Rec.update_allowed,
					p_req_line_detail_Rec.Override_flag) Then
			p_Line_Adj_Rec.update_allowed :=  p_req_line_detail_Rec.Override_flag;
Line: 6480

			l_updated_Flag := True;
Line: 6486

			l_updated_Flag := True;
Line: 6492

			l_updated_Flag := True;
Line: 6498

			l_updated_Flag := True;
Line: 6504

			l_updated_Flag := True;
Line: 6510

			l_updated_Flag := True;
Line: 6516

			l_updated_Flag := True;
Line: 6522

			l_updated_Flag := True;
Line: 6528

			l_updated_Flag := True;
Line: 6534

			l_updated_Flag := True;
Line: 6540

			l_updated_Flag := True;
Line: 6546

			l_updated_Flag := True;
Line: 6552

			l_updated_Flag := True;
Line: 6559

			l_updated_Flag := True;
Line: 6565

			l_updated_Flag := True;
Line: 6570

			l_updated_Flag := True;
Line: 6576

			l_updated_Flag := True;
Line: 6581

			l_updated_Flag := True;
Line: 6587

			l_updated_Flag := True;
Line: 6593

			l_updated_Flag := True;
Line: 6600

			l_updated_Flag := True;
Line: 6607

			l_updated_Flag := True;
Line: 6613

               l_updated_Flag := True;
Line: 6631

		adj_debug('Exiting oe_order_Adj_pvt.Update_Adj_Line_rec',1);
Line: 6633

	Return l_updated_Flag;
Line: 6635

End Update_Adj_Line_rec;
Line: 6736

      	            px_line_adj_Tbl(x_Adj_Index).Updated_Flag := 'N';
Line: 6742

      	              px_line_adj_Tbl(x_Adj_Index).Updated_Flag := 'N';
Line: 6744

/* Taking out nocopy this part to be set in update_adj_line_rec: Manish */

--		Else
--     	              px_Line_Adj_Tbl(x_Adj_Index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 6753

                oe_debug_pub.add('updated_flag:'||px_Line_Adj_Tbl(x_Adj_Index).updated_Flag);
Line: 6754

		if px_Line_Adj_Tbl(x_Adj_Index).updated_Flag = 'Y' Then
				-- User has updated this record Do not touch this
			px_Line_Adj_Tbl(x_Adj_Index).Operation :=  FND_API.G_MISS_CHAR;
Line: 6765

									OE_GLOBALS.G_OPR_DELETE
		      AND
		      nvl(px_Line_Adj_Tbl(x_Adj_Index).adjusted_amount_per_pqty,0) >=
					nvl(p_req_line_detail_Rec.adjustment_amount,0)
		Then
			-- Retain the freight charge of higher amount.
			Null;
Line: 6774

		elsif Not Update_Adj_Line_rec(
					p_Line_Adj_Rec			=>	px_Line_Adj_Tbl(x_Adj_Index)
					,p_req_line_detail_Rec  	=> p_req_line_detail_Rec
					)
		Then
			-- There is no change in the adjustment record

			px_Line_Adj_Tbl(x_Adj_Index).Operation := FND_API.G_MISS_CHAR;
Line: 6788

                          px_line_adj_tbl(x_adj_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 6791

	     End If; -- Check Updated_Flag
Line: 6808

                                        p_delete_flag           in Varchar2 default 'Y'
					) Is
L_Line_Adj_Assoc_Tbl		OE_Order_Pub.line_adj_Assoc_tbl_Type;
Line: 6834

	-- Append to the tbl with Delete flag set.
	-- The row would be removed from this structure if there is a match.

	G_STMT_NO := 'Query_Adj_Assocs#20';
Line: 6845

                If p_delete_flag = 'Y' Then
		  p_Line_Adj_Assoc_Tbl(l_index).Operation :=  OE_GLOBALS.G_OPR_DELETE;
Line: 6878

x_updated_flag out nocopy varchar2,

                                p_multiple_events       in VARCHAR2 Default 'N'
                                )
is
l_Pricing_Phase_id		Index_Tbl_Type;
Line: 6891

l_mark_for_delete Varchar2(1);
Line: 6917

        x_updated_flag := 'N';
Line: 6920

          IF l_Line_Adj_Tbl(i).updated_flag = 'Y' and x_updated_flag = 'N' THEN
            x_updated_flag := 'Y';
Line: 6930

             l_mark_for_delete:='Y';
Line: 6935

               l_mark_for_delete := 'Y';
Line: 6937

               l_mark_for_delete := 'N';
Line: 6940

             l_mark_for_delete := 'N';
Line: 6943

          adj_debug('Delete ' || l_Line_adj_tbl(i).price_adjustment_id || '? ' || l_mark_for_delete);
Line: 6945

          If l_mark_for_delete = 'Y' Then
		G_STMT_NO := 'Append_Adjustment_Lines#30';
Line: 6956

	     elsif nvl(l_Line_Adj_Tbl(i).Updated_Flag,'N') = 'N' or
		    l_Line_Adj_Tbl(i).Updated_Flag = fnd_api.g_miss_char then
                        adj_debug('BCT'||l_Line_Adj_Tbl(i).price_adjustment_id);
Line: 6959

			L_Line_Adj_Tbl(i).operation := OE_GLOBALS.G_OPR_DELETE;
Line: 6995

             If px_line_adj_tbl(px_line_adj_tbl.count).operation = OE_GLOBALS.G_OPR_DELETE
      Then
             Query_Adj_Assocs(p_price_adjustment_id=>px_line_adj_tbl(px_line_adj_tbl.count).price_adjustment_id,
	  	 p_Adj_Index		=> px_line_adj_tbl.count,
	 	 p_Line_Adj_Assoc_Tbl 	=> px_line_adj_Assoc_tbl,
                 p_delete_flag          => 'Y');
Line: 7006

                 p_delete_flag          => 'N');
Line: 7079

	-- Append to the tbl with Delete flag set.
	-- The row would be removed from this structure if there is a match.

	G_STMT_NO := 'Query_Adj_Attribs#20';
Line: 7088

		p_Line_Adj_Att_Tbl(l_index).Operation :=  OE_GLOBALS.G_OPR_DELETE;
Line: 7136

		-- Do not delete the record from oe_order_Price_adj_Attribs

		If p_Line_Adj_Att_Tbl(i).Operation = OE_GLobals.g_opr_delete then
			p_Line_Adj_Att_Tbl(i).Operation := FND_API.G_MISS_CHAR;
Line: 7194

		-- Do not delete the record from oe_order_Price_adj_Attribs

		If p_Line_Adj_Att_Tbl(i).Operation = oe_globals.g_opr_delete Then
			p_Line_Adj_Att_Tbl(i).Operation := FND_API.G_MISS_CHAR;
Line: 7241

	select PRICING_ATTR_VALUE_FROM into l_inventory_item_id
	from oe_price_adj_attribs opaa
	where price_adjustment_id =p_price_Adjustment_Id and
		Flex_Title ='QP_ATTR_DEFNS_PRICING' and
		Pricing_Context='ITEM' and
		Pricing_attribute='PRICING_ATTRIBUTE1' and
		Rownum < 2;
Line: 7250

	Select inventory_item_id into l_inventory_item_id
	from oe_price_adjustments opa,oe_order_lines_all ola
	where opa.line_id=ola.line_id and
		opa.price_adjustment_id=p_price_Adjustment_Id;
Line: 7319

		-- Find the "Other Item" Line and update the attributes

		adj_debug('The PRG already exists '||p_Price_Adjustment_Id);
Line: 7342

			-- Update The Adjustment Record of the "Other Item"
                        -- bug 1843872, find whether the discount line is in memory
                        j := p_line_adj_tbl.first;
Line: 7362

			p_Line_Adj_Assoc_Tbl.delete(i);
Line: 7375

			 If Update_Adj_Line_rec(
					p_Line_Adj_Rec			=>	l_line_Adj_Rec
					,p_req_line_detail_Rec  	=> 	p_req_line_detail_Tbl(p_Line_Detail_Index)
					)
			 Then
				-- There is a Change is the Adjsutment Record
      	   		        l_Line_Adj_Rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 7395

                             adj_debug('delete line'||p_rltd_lines_prcd(l_req_line_index));
Line: 7411

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

      select nvl(sum(ordered_quantity),0),nvl(sum(pricing_quantity),0)
      into l_tot_qty,l_tot_price_qty
      from oe_order_lines
      where split_from_line_id = l_line_rec.line_id
      and  header_id = l_line_rec.header_id;
Line: 7469

         oe_debug_pub.add('bug 2412868 in update1:');
Line: 7476

         oe_debug_pub.add('bug 2412868 in update:');
Line: 7637

					SELECT concatenated_segments
					INTO   l_line_rec.ordered_item
					FROM   mtl_system_items_kfv
					WHERE  inventory_item_id = l_line_rec.inventory_item_id
					AND    organization_id = l_org_id;
Line: 7670

		-- Insert Adjustment Records

		-- Check If this Related Adjustment Line Has Already been processed in an earlier loop

		G_STMT_NO := 'Process_Other_Item_Line#40';
Line: 7683

		  If Update_Adj_Line_rec(
					p_Line_Adj_Rec			=>	p_Line_Adj_Tbl(l_Adj_Index)
					,p_req_line_detail_Rec  	=> p_req_line_detail_Tbl(p_Line_Detail_Index)
					)
		  Then
      	   	p_line_adj_Tbl(l_Adj_Index).Updated_Flag := 'N';
Line: 7831

Function find_updated_adjustments(
	p_header_id 			number default null
	,p_Line_id 			number default null
	,p_Line_Adj_Tbl 		oe_order_pub.line_adj_tbl_type
	)
Return boolean
is
i		pls_integer;
Line: 7844

		p_Line_Adj_Tbl(i).updated_flag = 'Y' and
		p_Line_Adj_Tbl(i).Applied_Flag = 'Y' then
		Return True; -- Atleast one adjustment has been updated
Line: 7851

end find_updated_adjustments;
Line: 7879

Select/*+ ordered use_nl(qpq qppa qpll qplh) */ min(qpll.operand)
 From
      qp_qualifiers qpq
 ,    qp_pricing_attributes qppa
 ,    qp_list_lines qpll
 ,    qp_list_headers_b qplh
 ,    qp_price_req_sources qpprs
 where
 qpq.qualifier_context='CUSTOMER'
 and qpq.qualifier_attribute='QUALIFIER_ATTRIBUTE15'
 and qpq.qualifier_attr_value='Y'
 and qppa.list_header_id=qplh.list_header_id
 and qplh.Active_flag='Y'
 and qpprs.request_type_code = p_request_type_code
 and qpprs.source_system_code=qplh.source_system_code
 and    qppa.pricing_phase_id  = 2
 and    qppa.qualification_ind = 6
 and qppa.product_attribute_context ='ITEM'
 and qppa.product_attribute='PRICING_ATTRIBUTE1'
 and qppa.product_attr_value= p_inventory_item_id
 and qppa.excluder_flag = 'N'
 and qppa.list_header_id=qpq.list_header_id
 and qppa.list_line_id=qpll.list_line_id
 and  p_pricing_date between nvl(trunc(qplh.start_date_active),p_pricing_date)
 and nvl(trunc(qplh.End_date_active),p_pricing_date);
Line: 7918

					SELECT concatenated_segments
					INTO   l_msg_text
					FROM   mtl_system_items_kfv
					WHERE  inventory_item_id = p_inventory_item_id
					AND    organization_id = l_org_id;
Line: 7939

					Select hold_id into l_hold_source_rec.hold_id
					from oe_hold_definitions where type_code='GSA';
Line: 7967

          select 'Y' into l_gsa_released from
          oe_order_holds ooh,oe_hold_sources ohs,oe_hold_releases ohr
          where ooh.line_id = p_line_id
          and ooh.hold_source_id = ohs.hold_source_id
          and ohr.hold_release_id = ooh.hold_release_id
          and ohs.hold_id = l_hold_source_rec.hold_id
          and ohr.created_by <> 1
          and ohr.release_reason_code <> 'PASS_GSA';
Line: 8031

					Select hold_id into l_hold_source_rec.hold_id
					from oe_hold_definitions where type_code='GSA';
Line: 8220

                p_line_tbl(i).operation = oe_globals.G_OPR_UPDATE)
            OR p_honor_price_flag = 'N'  --bug 2503186
            OR  -- OPM 2547940 start - for copy of order OR split from shipping - need to re-price as these lines
                -- as may have freeze price for calulate price flag when pricing by quantity2
             (
                   ( l_process)
                   and  (l_item_rec.ont_pricing_qty_source = 1 ) -- price by quantity 2
                   and  ( p_line_tbl(i).calculate_price_flag In ('N','P') )
		   and ( p_line_tbl(i).split_by is not null )
		   and ( p_line_tbl(i).split_from_line_id is not null and p_line_tbl(i).split_from_line_id <> FND_API.G_MISS_NUM)
             ) --  OPM 2547940 end


         Then
	 adj_debug('Processing Line id '||p_line_tbl(i).line_id,2);
Line: 8236

	 If p_Line_Tbl(i).operation in (oe_globals.g_opr_delete, oe_globals.g_opr_lock) or
            (p_Line_Tbl(i).Unit_list_price is null
             and p_Line_Tbl(i).Unit_list_price_per_pqty is null)
         Then
            adj_debug('Line '||p_line_tbl(i).line_id||' price is not calculated');
Line: 8299

			  p_Line_Adj_Tbl(j).Operation <> OE_Globals.G_OPR_DELETE and
			  nvl(p_Line_Adj_Tbl(j).applied_flag,'N')='Y' and
/* Modified the nvl to 'N' in the above statement to fix the bug 2164508 */
			  p_Line_Adj_Tbl(j).list_line_type_code in ('DIS','SUR','FREIGHT_CHARGE','PBH')
		  then

                        --adj_debug('BCT+fullfilled calculate');
Line: 8340

						  p_Line_Adj_Tbl(j).Price_Adjustment_id <> fnd_api.g_miss_num )) and (nvl(p_line_adj_assoc_Tbl(j1).operation,'xxyz') <>  OE_GLOBALS.G_OPR_DELETE)
					)  Then
				  l_assoc_exist := TRUE;
Line: 8372

						  p_Line_Adj_Tbl(j).Price_Adjustment_id <> fnd_api.g_miss_num )) And (nvl(p_line_adj_assoc_Tbl(j1).operation,'xxyz') <>  OE_GLOBALS.G_OPR_DELETE)

					)  Then

				adj_debug('Got an association Rltd_index '||p_line_adj_assoc_Tbl(j1).Rltd_Adj_index,2);
Line: 8409

                                            IF p_Line_Adj_Tbl(j2).updated_flag = 'Y' and p_Line_Adj_Tbl(j).updated_flag <> 'Y' THEN
                                                p_Line_Adj_Tbl(j).updated_flag := 'Y';
Line: 8621

                      If p_Line_Adj_Tbl(j).updated_flag = 'N' Then
                        p_Line_Adj_Tbl(j).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 8789

	 End If ; -- Of lines.operation in update or create
Line: 8808

		select nvl(transactional_curr_code,'USD') into l_currency_code from oe_order_headers
		where header_id=p_header_id;
Line: 8829

   Order no longer qualifies for PRG modifier.  Either delete (or) update
   the free goods lines, depending on whether they are shipped or not
*/
PROCEDURE change_prg_lines(p_price_adjustment_id IN NUMBER,
			   p_line_tbl            IN OUT NoCopy  OE_Order_PUB.Line_Tbl_Type,
			   p_line_adj_tbl        IN OUT NoCopy  OE_Order_PUB.Line_Adj_Tbl_Type,
			   p_delete_prg_lines    IN OUT NoCopy  index_tbl_type) IS

 Cursor prg_lines is
  Select radj.line_id
  from oe_price_adjustments radj,
  oe_price_adj_assocs assoc
  where radj.price_adjustment_id =assoc.rltd_price_adj_id and
  assoc.price_adjustment_id = p_price_adjustment_id;
Line: 8845

  Select pricing_phase_id
  from qp_event_phases
  where pricing_event_code like 'BOOK';
Line: 8864

   select pricing_phase_id
   into pricing_ph_id
   from oe_price_adjustments
   where price_adjustment_id = p_price_adjustment_id;
Line: 8915

       l_line_rec.operation := OE_GLOBALS.G_OPR_DELETE;
Line: 8916

       p_delete_prg_lines(l_line_rec.line_id) := l_line_rec.line_id;
Line: 8922

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

          p_delete_prg_lines(l_line_rec.line_id) := l_line_rec.line_id;
Line: 8928

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

l_updated_flag varchar2(1);
Line: 9065

l_preinsert_manual_adj  VARCHAR2(1):= Nvl(Fnd_Profile.Value('ONT_PREINSERT_MANUAL_ADJ'),'N');
Line: 9071

l_delete_prg_lines   index_tbl_type;
Line: 9161

			Select name into l_price_list
			from qp_list_headers_vl where
			list_header_id = l_line_rec.price_list_id;
Line: 9201

                            Update Oe_Order_Lines
                            set    Unit_Selling_Price = Null,Unit_list_price = Null
                            where  line_id = l_line_rec.line_id;
Line: 9205

                            oe_line_adj_util.delete_row(p_line_id => l_line_rec.line_id);
Line: 9213

                            Oe_Debug_Pub.add('Oe_Order_Adj_Pvt:Failed to update price:'||SQLERRM);
Line: 9252

				Select name into l_price_list
				from qp_list_headers_vl a,qp_list_lines b where
				b.list_line_id =  to_number(substr(p_req_line_tbl(i).status_text,1,
									instr(p_req_line_tbl(i).status_text,',')-1))
				and a.list_header_id=b.list_header_id
				;
Line: 9270

				Select name into l_price_list
				from qp_list_headers_vl a,qp_list_lines b where
				b.list_line_id =  to_number(substr(p_req_line_tbl(i).status_text,
									instr(p_req_line_tbl(i).status_text,',')+1))
				and a.list_header_id=b.list_header_id	;
Line: 9351

				( QP_PREQ_GRP.G_STATUS_UPDATED,
                                  QP_PREQ_GRP.G_STATUS_GSA_VIOLATION,
                                  QP_PREQ_GRP.G_STATUS_UNCHANGED) and
	   nvl(p_req_line_tbl(i).processed_code,'0') <> QP_PREQ_GRP.G_BY_ENGINE
	   and p_req_line_tbl(i).price_flag IN ('Y','P') )

	   or  -- OPM 2547940 start
	       -- pricing by quantity2 - this is for case when order line is split from shipping and new line gets generated
	       -- and this line has to be re-priced for catchweight pricing for OPM if pricing in secondary quantity
	   ( ( oe_line_util.dual_uom_control -- INVCONV
              (l_line_rec.inventory_item_id
              ,l_line_rec.ship_from_org_id
              ,l_item_rec) )
                   and  p_req_line_tbl(i).line_Type_code ='LINE'
                   and  (l_item_rec.ont_pricing_qty_source = 'S' ) -- price by quantity 2 -- INVCONV
                   and  ( p_req_line_tbl(i).price_flag In ('N','P') )
		   and ( l_line_rec.split_by is not null )
		   and ( l_line_rec.split_from_line_id is not null and l_line_rec.split_from_line_id <> FND_API.G_MISS_NUM) )
                 -- OPM 2547940 end

           --we do not want to go in this loop if price_flag is set up 'N' because
           --engine doesn't look at the line and will not return adjustments. In this
           --case we DON't want to remove the adjustments that engine doesn't return.
	then

	 G_STMT_NO := 'process_adjustments11.5';
Line: 9428

                                x_updated_flag => l_updated_flag,
                                p_multiple_events => p_multiple_events);
Line: 9441

		(p_req_line_tbl(i).status_code in ( QP_PREQ_GRP.G_STATUS_UPDATED ,
					QP_PREQ_GRP.G_STATUS_GSA_VIOLATION)
                 --btea
                 --In this case even engine doesn't update the order (status = UNCHANGED)
                 --because of one of the lined is frozen,
                 --there can be some order level adjustments in database which
                 --need to be pulled out by append_adjustment_lines routine
                 or (p_req_line_tbl(i).status_code = QP_PREQ_GRP.G_STATUS_UNCHANGED
--                     and p_any_frozen_line = TRUE -- bug 1675449
				 ))
	Then
		G_STMT_NO := 'Process_Adjustments#35';
Line: 9459

                   l_header_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 9473

                                x_updated_flag     => l_updated_flag,
                                p_multiple_events  => p_multiple_events);
Line: 9480

        select oe_msg_request_id_s.nextval into l_request_id from dual;
Line: 9481

        OE_MSG_PUB.INSERT_MESSAGE(OE_MSG_PUB.COUNT_MSG, l_request_id,'U');
Line: 9524

               SELECT order_source_id, orig_sys_document_ref, change_sequence,
               source_document_type_id, source_document_id, orig_sys_line_ref,
               source_document_line_id, orig_sys_shipment_ref
               INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
               l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
               l_source_document_line_id, l_orig_sys_shipment_ref
               FROM   OE_ORDER_LINES_ALL
               WHERE  line_id = p_req_line_tbl(i).line_id;
Line: 9576

				QP_PREQ_GRP.G_STATUS_UPDATED ,QP_PREQ_GRP.G_STATUS_GSA_VIOLATION )
			and nvl(p_req_line_tbl( p_req_line_detail_Tbl(j).line_index).processed_code,'0')
			    <> QP_PREQ_GRP.G_BY_ENGINE

                        --only process/insert automatic adjustments, with freight charge as exception
                        and (p_req_line_detail_Tbl(j).automatic_flag = 'Y' or
                             (p_req_line_detail_Tbl(j).automatic_flag = 'N' and (p_req_line_detail_Tbl(j).list_line_type_code = 'FREIGHT_CHARGE' or l_preinsert_manual_adj = 'Y' )))
			and (
				((
                                  ( l_line_tbl.exists( p_req_line_detail_Tbl(j).line_index)
                                    and
				    oe_line_util.Get_Return_Item_Type_Code
                                    (l_line_tbl( p_req_line_detail_Tbl(j).line_index))<> 'INCLUDED'
                                  )
				  Or not l_line_tbl.exists (p_req_line_detail_Tbl(j).line_index )

                                  )
                                  And
                                  G_CHARGES_FOR_INCLUDED_ITEM = 'N'
                                )
                                Or
                                G_CHARGES_FOR_INCLUDED_ITEM = 'Y'
			     )


	   then
                --adj_debug('BCT+Engine returned status fullfilled');
Line: 9643

			   	-- Updated the Terms at Line Level
			   	If p_req_line_detail_Tbl(j).Substitution_Attribute ='QUALIFIER_ATTRIBUTE1' Then
				   	adj_debug('Payment_term updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9649

				   	adj_debug('shipping_method_code updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9653

				   	adj_debug('freight_terms_code updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9680

			   	-- Updated the Terms at Line Level
			   	If p_req_line_detail_Tbl(j).Substitution_Attribute ='QUALIFIER_ATTRIBUTE1' Then
				   	adj_debug('Payment_term updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9685

				   	adj_debug('shipping_method_code updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9688

				   	adj_debug('freight_terms_code updated to '||p_req_line_detail_Tbl(j).Substitution_to);
Line: 9692

				   	l_header_rec.operation :=  OE_GLOBALS.G_OPR_UPDATE;
Line: 9722

			-- Delete
			-- Subsequently these rows would be reinstated
			-- Delete is cascaded to children when adjustment is deleted.


			G_STMT_NO := 'process_adjustments#60';
Line: 9741

							 OE_GLOBALS.G_OPR_UPDATE ) Then
				-- This Record Needs to be processed
		    	  if p_req_line_tbl( p_req_line_detail_Tbl(j).line_index).line_type_code =  'LINE'
			  Then

			   if  p_req_line_detail_Tbl(j).list_line_type_code ='IUE' then
			   -- Do not give item upgrades to config items.
				If l_line_tbl( p_req_line_detail_Tbl(j).line_index).top_model_line_id is null
				or  l_line_tbl( p_req_line_detail_Tbl(j).line_index).top_model_line_id= fnd_api.g_miss_num
				then
				If  -- Allow Item upgrade only if the order is not booked.
				nvl(l_line_tbl( p_req_line_detail_Tbl(j).line_index).booked_flag,'N')
							= 'N'
		          then

			     -- Set the Line Item to the new item

				   Set_item_for_iue(
					px_line_rec   => l_line_tbl( p_req_line_detail_Tbl(j).line_index)
					,p_req_line_detail_rec => p_req_line_detail_Tbl(j)
					);
Line: 9819

					-- Inserts Rows into Line_Tbl and Adjustments

					G_STMT_NO := 'process_adjustments#90';
Line: 9863

	   end if;  -- Status_code = Updated.
Line: 9889

                       SELECT order_source_id, orig_sys_document_ref, change_sequence,
                       source_document_type_id, source_document_id, orig_sys_line_ref,
                       source_document_line_id, orig_sys_shipment_ref
                       INTO l_order_source_id, l_orig_sys_document_ref, l_change_sequence,
                       l_source_document_type_id, l_source_document_id, l_orig_sys_line_ref,
                       l_source_document_line_id, l_orig_sys_shipment_ref
                       FROM   OE_ORDER_LINES_ALL
                       WHERE  line_id = p_req_line_tbl(p_req_line_detail_tbl(j).line_index).line_id;
Line: 9938

         			select oe_msg_request_id_s.nextval into g_request_id from dual;
Line: 9940

      			OE_MSG_PUB.INSERT_MESSAGE(OE_MSG_PUB.COUNT_MSG, G_REQUEST_ID,'U');
Line: 9941

      			OE_MSG_PUB.DELETE_MSG(OE_MSG_PUB.COUNT_MSG);
Line: 9967

  and l_line_adj_tbl(l_line_details_prcd(p_Req_Related_Lines_Tbl(i).Line_Detail_Index)).updated_flag = 'N'
			Then
                                If G_DEBUG Then
				adj_debug('RLTD: line detail '||p_Req_Related_Lines_Tbl(i).Line_Detail_Index,2);
Line: 10095

 		    IF (l_line_adj_tbl(i).operation = oe_globals.g_opr_delete
			  and l_line_adj_tbl(i).list_line_type_code='PRG') THEN

                        adj_debug('Need to delete/update free goods line');
Line: 10104

                           p_delete_prg_lines    => l_delete_prg_lines);
Line: 10278

      	l_line_tbl_final(l).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 10340

            AND l_Line_Adj_Tbl(i).operation IN (OE_GLOBALS.G_OPR_CREATE, OE_GLOBALS.G_OPR_UPDATE, OE_GLOBALS.G_OPR_DELETE)
            AND l_Line_Adj_Tbl(i).list_line_type_code NOT IN ('FREIGHT_CHARGE','TAX','COST')
            AND nvl(g_pass_all_lines,'N') <> 'Y' THEN
	    -- This is a header level adjustments, and not a freight charge.
            -- Need to log a delayed request to apply this header level adjustment
            -- to all lines on this order if not all lines were passed to pricing engine.

            adj_debug('Logging request to update all lines for header level adjustment.', 1);
Line: 10360

	-- Update the Header Level TERM Substitution on all Lines.
	If l_header_rec.operation = oe_globals.g_opr_update then
	  If l_line_adj_tbl(i).list_line_type_code = 'TSN' and
		l_line_adj_tbl(i).modifier_level_code ='ORDER'
	  then
		adj_debug('In Header TSN ');
Line: 10367

		-- Loop through all the lines and update
		j:= l_Line_Tbl_Final.first;
Line: 10399

                                        l_Line_Tbl_Final(j).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 10456

		l_line_adj_tbl.delete(i);
Line: 10457

	Elsif l_line_adj_tbl(i).operation = oe_globals.g_opr_update and
		( l_line_adj_tbl(i).price_adjustment_id is null or
		l_line_adj_tbl(i).price_adjustment_id = fnd_api.g_miss_num ) then
		l_line_adj_tbl(i).operation := oe_globals.g_opr_Create;
Line: 10463

	      l_delete_prg_lines.exists(l_line_adj_tbl(i).line_id) THEN
              l_line_adj_tbl.delete(i);
Line: 10489

		l_line_adj_Att_tbl.delete(i);
Line: 10495

			l_line_adj_Att_tbl.delete(i);
Line: 10497

			l_line_adj_Att_tbl.delete(i);
Line: 10518

		l_Line_Adj_Assoc_tbl.delete(i);
Line: 10522

					l_Line_Adj_Assoc_tbl.delete(i);
Line: 10525

			l_Line_Adj_Assoc_tbl.delete(i);
Line: 10528

			l_Line_Adj_Assoc_tbl.delete(i);
Line: 10535

                    l_Line_Adj_Assoc_tbl.delete(i);
Line: 10578

                     l_line_tbl_Final.delete(j);
Line: 10698

          ,p_delete        => FND_API.G_TRUE
          ,x_return_status => x_return_status
          );
Line: 10777

 Select e.Pricing_Phase_Id,nvl(p.user_freeze_override_flag,p.freeze_override_flag) freeze_override_flag
		   from qp_event_Phases e, qp_pricing_phases p
		   where e.pricing_phase_id = p.pricing_phase_id and
		   trunc(sysdate) between Trunc(nvl(start_date_active,sysdate)) and
			 trunc(nvl(End_Date_Active,sysdate))
                       and e.pricing_event_code IN
                    (SELECT decode(rownum
          ,1 ,substr(p_pricing_event,1,instr(l_event_code1,',',1,1)-1)
          ,2 ,substr(p_pricing_event , instr(l_event_code1,',',1,rownum-1) + 1,
             instr(l_event_code1,',',1,rownum)-1 - instr(l_event_code1,',',1,rownum-1))
          ,3 ,substr(p_pricing_event , instr(l_event_code1,',',1,rownum-1) + 1,
              instr(l_event_code1,',',1,rownum)-1 - instr(l_event_code1,',',1,rownum-1))
          ,4 ,substr(p_pricing_event , instr(l_event_code1,',',1,rownum-1) + 1,
              instr(l_event_code1,',',1,rownum)-1 - instr(l_event_code1,',',1,rownum-1))
          ,5 ,substr(p_pricing_event , instr(l_event_code1,',',1,rownum-1) + 1,
              instr(l_event_code1,',',1,rownum)-1 - instr(l_event_code1,',',1,rownum-1))
          ,6 ,substr(p_pricing_event , instr(l_event_code1,',',1,rownum-1) + 1,
              instr(l_event_code1,',',1,rownum)-1 - instr(l_event_code1,',',1,rownum-1)))
         FROM  qp_event_phases
         WHERE rownum < 7);
Line: 10799

G_Pricing_Phase_Id_Tbl.delete;
Line: 10887

       SELECT 1 into l_tmp_no from dual where exists (
        select 1 from qp_list_headers_b qh
        , oe_order_headers_all oh
        where qh.currency_code = oh.transactional_curr_code
        and oh.header_id =  l_header_id
        and qh.source_system_code='AMS'
        and qh.active_flag = 'Y');
Line: 10944

  select 'x' from qp_event_phases ep
  where ep.pricing_event_code = p_control_rec.pricing_event
  and trunc(sysdate) between trunc(nvl(start_date_active, sysdate)) and
				  trunc(nvl(end_date_active, sysdate));
Line: 10949

  select 'x' from qp_event_phases ep
  where ep.pricing_event_code IN ('BATCH','BOOK','SHIP')
  and trunc(sysdate) between trunc(nvl(start_date_active, sysdate)) and
				  trunc(nvl(end_date_active, sysdate));*/
Line: 10955

  select 'x' from qp_event_phases ep
  where instr(p_control_rec.pricing_event||',',
ep.pricing_event_code||',') > 0
  and trunc(sysdate) between trunc(nvl(start_date_active, sysdate)) and
                                  trunc(nvl(end_date_active, sysdate));
Line: 10963

  select 'x' from dual where
   exists (select 'x' from oe_order_lines where header_id = p_header_id
           and calculate_price_flag in ('Y','P'));
Line: 11046

     OE_BULK_PRICE_PVT.Update_Pricing_Attributes(p_line_tbl => x_line_tbl);
Line: 11147

l_updated_flag varchar2(1);
Line: 11253

	    l_line_tbl(l_line_index).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 11261

                                , x_updated_flag        =>l_updated_flag);
Line: 11263

                 If (l_updated_flag = 'Y' and l_line_tbl(l_line_index).calculate_price_flag = 'Y') THEN
                    If l_set_price_flag_on_manual = 'Y' Then
                     l_line_tbl(l_line_index).calculate_price_flag := 'P';
Line: 11277

                                ,x_updated_flag => l_updated_flag);
Line: 11288

                        p_delete_flag  =>  'N');
Line: 11313

	    l_Line_Adj_Tbl.delete(i);
Line: 11316

            L_Line_Adj_Tbl(i).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 11427

          l_line_tbl.delete(i);
Line: 11503

		 p_selected_records	       Oe_Globals.Selected_Record_Tbl
		,P_price_level	               varchar2
                ,p_header_id                   Number  default null
,x_Return_Status out nocopy varchar2

,x_msg_count out nocopy number

,x_msg_data out nocopy varchar2

		)
is
l_Price_Control_rec		QP_PREQ_GRP.control_record_type;
Line: 11528

Select 'Y'
From OE_PRICE_ADJUSTMENTS a,  OE_ORDER_LINES_ALL b
Where b.line_id = p_line_id
AND   b.header_id = a.header_id
And   a.list_line_type_code = 'PRG';
Line: 11541

last_record_line_id             Number := p_selected_records(p_selected_records.count).id1;
Line: 11561

                   i := p_selected_records.first;
Line: 11563

                       L_line_id := p_selected_records(i).id1;
Line: 11599

                       i := p_selected_records.next(i);
Line: 11612

                   i := p_selected_records.first;
Line: 11614

                          oe_debug_pub.add('id1 : ' || p_selected_records(i).id1);
Line: 11615

                          oe_debug_pub.add('org_id : ' || p_selected_records(i).org_id);
Line: 11616

                          oe_debug_pub.add('id3 : ' || p_selected_records(i).id3);
Line: 11617

                          l_line_id := p_selected_records(i).id1;
Line: 11618

                          l_org_id := p_selected_records(i).org_id;
Line: 11619

                          L_header_id := p_selected_records(i).id3;
Line: 11679

                                L_x_line_tbl.delete;
Line: 11695

                          i := p_selected_records.next(i);
Line: 11712

                                L_x_line_tbl.delete;
Line: 11717

                IF p_selected_records(1).id3 IS NULL THEN
                   L_id3 := FALSE;
Line: 11721

                   i := p_selected_records.first;
Line: 11723

                       l_header_id := p_selected_records(i).id1;
Line: 11724

                       l_org_id := p_selected_records(i).org_id;
Line: 11740

                       /*Select booked_flag into l_booked_flag from oe_order_headers_all
                       where header_id=l_header_id; */
Line: 11770

                       i := p_selected_records.next(i);
Line: 11773

                   i := p_selected_records.first;
Line: 11775

                       l_header_id := p_selected_records(i).id3;
Line: 11776

                       l_org_id := p_selected_records(i).org_id;
Line: 11783

                          Select booked_flag into l_booked_flag from oe_order_headers_all
                          where header_id=l_header_id;
Line: 11813

                       i := p_selected_records.next(i);
Line: 11895

Select 'Y'
From OE_PRICE_ADJUSTMENTS a,  OE_ORDER_LINES_ALL b
Where b.line_id = p_line_id
AND   b.header_id = a.header_id
And   a.list_line_type_code = 'PRG';
Line: 12011

                  Select booked_flag into l_booked_flag from oe_order_headers_all
                        where header_id=l_header_id;
Line: 12397

Purpose     : Insert manual overriable adjustment into Oe_Price_Adjustments
Called by   : Mass Change pld
Known Issues: Doesn't handle order level manual overriable adjustment
****************************************************************************************************/
Procedure Create_Manual_Adjustments(p_line_id In Number)
As
l_return_stauts   Varchar2(15);
Line: 12442

       Select 'Y' Into l_found
       From Dual
       Where exists (Select 'X' From Oe_Price_Adjustments
                     Where  line_id = p_line_id
                     and    list_line_id = l_manual_adj_tbl(i).list_line_id);
Line: 12463

         l_line_adj_tbl(1).update_allowed        := l_manual_adj_tbl(i).override_flag;
Line: 12467

         l_line_adj_tbl(1).updated_flag          := 'N';
Line: 12470

         Select Oe_Price_Adjustments_S.Nextval
         Into   l_line_adj_tbl(1).price_adjustment_id
         From   dual;
Line: 12568

       select ld.automatic_flag, ld.line_index, ld.modifier_level_code,
       ld.line_quantity, ld.line_detail_type_code,
       ld.CREATED_FROM_LIST_LINE_TYPE list_line_type_code,
       ld.list_line_no, ld.operand_value,
       ld.CREATED_FROM_LIST_LINE_ID list_line_id,
       ld.CREATED_FROM_LIST_HEADER_ID list_header_id,
       ld.pricing_phase_id, ll.override_flag, ld.operand_calculation_code,
       ld.ADJUSTMENT_AMOUNT, ll.CHARGE_TYPE_CODE, ll.CHARGE_SUBTYPE_CODE,
       l.line_type_code, l.line_id, ld.PRICE_BREAK_TYPE_CODE,
       ld.pricing_group_sequence
       from QP_PREQ_LINES_TMP l, QP_PREQ_LDETS_TMP ld, QP_LIST_LINES ll
       where l.line_index = ld.line_index
         and ld.CREATED_FROM_LIST_LINE_ID = ll.LIST_LINE_ID
         and ld.PRICING_STATUS_CODE = QP_PREQ_GRP.G_STATUS_NEW
       ORDER BY ld.list_line_no; -- bug 6323362
Line: 12760

/* --5598523 No need for this code as change done by this logic is not reflected while inserting data
   --into qp tables because direct insert is done using global str and hence changes made here are not used.
      --In the case of Order level manual adjustments we will need to set calculate price
      --flag for all the lines to 'N'and summary line to 'Y'
     If p_level = 'ORDER' or l_profile_value = 'Y' Then
       l_req_line_tbl(l_req_line_tbl.count).price_flag := 'N';
Line: 12788

         Select 'x' into l_dummy from dual
         Where exists
         (select 'x' from
         oe_order_price_attribs oopa
         where
         nvl(oopa.line_id,l_Line_Tbl(line_Tbl_Index).line_id) = l_Line_Tbl(line_Tbl_Index).line_id
         and oopa.header_id = l_header_id2);
Line: 12892

		Select 'x' into l_dummy from dual
                where exists(
                  Select 'X' from oe_order_price_attribs oopa
		where oopa.header_id = l_header_id2 and oopa.line_id is null);
Line: 12929

      l_control_rec.temp_table_insert_flag := 'N';
Line: 13127

                 x_manual_adj_tbl.delete(j);
Line: 13145

		 x_manual_adj_tbl.delete(j);
Line: 13295

SELECT 'X'
FROM
         qp_list_headers_b qh,
         qp_list_lines ql,
         qp_pricing_attributes qppr
WHERE  ql.list_line_id = qppr.list_line_id
AND    ql.automatic_flag = 'N'
AND    qh.list_header_id = ql.list_header_id
AND    qh.active_flag = 'Y'
AND    qh.list_type_code not in ('AGR','PRL')
AND    ql.list_line_type_code <> 'PLL'
AND    (ql.list_line_type_code IN ('PRG','OID') OR ql.modifier_level_code =
'LINEGROUP')
AND    qppr.product_attribute_context='ITEM'     -- bug#7488440
AND    qppr.product_attribute='PRICING_ATTRIBUTE3'  -- bug#7488440
AND    qppr.product_attr_value='ALL'    -- bug#7488440
AND    qppr.pricing_phase_id
         IN ( SELECT  distinct a.pricing_phase_id
              FROM qp_pricing_phases a , qp_event_phases b
              WHERE
              a.pricing_phase_id = b.pricing_phase_id
--              AND (a.oid_exists = 'Y' OR a.line_group_exists = 'Y' OR a.rltd_exists = 'Y')  -- bug#7488440
              AND    b.pricing_event_code in (SELECT decode(rownum
          ,1 ,substr(p_event_code,1,instr(p_event_code1,',',1,1)-1)
          ,2 ,substr(p_event_code , instr(p_event_code1,',',1,rownum-1) + 1,
             instr(p_event_code1,',',1,rownum)-1 -
instr(p_event_code1,',',1,rownum-1))
          ,3 ,substr(p_event_code , instr(p_event_code1,',',1,rownum-1) + 1,
              instr(p_event_code1,',',1,rownum)-1 -
instr(p_event_code1,',',1,rownum-1))
          ,4 ,substr(p_event_code , instr(p_event_code1,',',1,rownum-1) + 1,
              instr(p_event_code1,',',1,rownum)-1 -
instr(p_event_code1,',',1,rownum-1))
          ,5 ,substr(p_event_code , instr(p_event_code1,',',1,rownum-1) + 1,
              instr(p_event_code1,',',1,rownum)-1 -
instr(p_event_code1,',',1,rownum-1))
          ,6 ,substr(p_event_code , instr(p_event_code1,',',1,rownum-1) + 1,
              instr(p_event_code1,',',1,rownum)-1 -
instr(p_event_code1,',',1,rownum-1)))
         FROM  qp_event_phases
         WHERE rownum < 7))
AND    ROWNUM = 1;