174: -- Count the number of price adjustments related to this
175: -- line which reference a manual discount
176: SELECT price_adjustment_id
177: INTO l_price_adjustment_id
178: FROM OE_PRICE_ADJUSTMENTS
179: WHERE HEADER_ID = P_HEADER_ID
180: AND LINE_ID = P_LINE_ID
181: AND NVL( AUTOMATIC_FLAG, 'N' ) = 'N'
182: AND (list_line_type_code = 'DIS'
192: -- now calculate the total percentage on this
193: -- order line, excluding manual discounts
194: SELECT NVL( SUM( NVL( Adjusted_amount, 0) ), 0)
195: INTO l_adjustment_total
196: FROM oe_price_adjustments
197: WHERE header_id = p_header_id
198: AND ((p_apply_order_adjs_flag = 'Y'
199: AND line_id IS NULL)
200: OR