Professional Documents
Culture Documents
Custom Hook
An Oracle White Paper
Apr 2009
Ignore Pricing for Order Lines Custom Hook
OVERVIEW
1
Important implementation Notes:
The sales order line with an item setup to ignore pricing will be completely
ignored by pricing engine for any other processing. Here are a few examples.
Example 1:
An item Item_A has been identified as a zero priced item by the custom hook.
The item is included in item category cat_A.. If a modifier is set up for
application to category cat_A, it will not be applied to the sales order line that
has ordered item item_A.
Example 2:
Item A and Item B belong to Item Category CAT1. A modifier line is setup for
this Item Category, where the group quantity is from 10-99, and then it will
apply a 10% discount. Item B has been identified as a zero priced item by the
custom hook. The following Order is booked.
Order line 1 - Item A - qty 8
Order line 2 - Item B - qty 15
The CAT1 group quantity would be 8 and not 23 (8+15), since order line 2 is for
an item that is setup as a zero priced item, which means that it is not considered
by the pricing engine. Therefore, this modifier for group quantity 10-99 would
not apply.
Example 3:
Item_0 and Item_1 belong to Item Category CAT_A. A modifier line is setup for
the Item Category CAT_A, where the group amount is from 1000-99999, and
then it will apply a 10% discount. Item_1 has been identified as a zero priced
item by the custom hook. The following Order is booked.
Order line 1 Item_0 - qty 8 with unit list price 100.
Order line 2 Item_1 - qty 10 with unit list price as 100.
The CAT_A group amount would be 800 and not 1800 (800+1000), since order
line 2 is for an item that is setup as a zero priced item, which means that it is not
considered by the pricing engine. Therefore, this modifier for group amount
1000-99999 would not apply.
Customer needs to evaluate the scenarios similar to the ones explained above
and then design the ignore items pattern logic for the custom hook.
2
Ignore Pricing Custom Hook Implementation
No Is such a pattern
available?
Yes
End
3
Pricing Engine Execution
An overview of pricing engine execution for this functionality is depicted in the
following diagram
Yes
Is it a zero price
item?
No Yes
Source all the line attributes. Set the price for this line as zero.
No changes made to the item Source only needed attributes.
line and calculate_price_flag.
Set calculate_price_flag to N to
prevent any further pricing changes.
4
Implementing QP_custom_ignore.Ignore_itemline_for_pricing
5
Implementation Examples.
Example 1:
User has identified following 4 items as zero priced items. These are mostly the
configured option items that are attached to majority of the models sold by the
company using sales order form.
Item Inventory_item_id
A 11111
B 22222
C 33333
D 44444
CREATE OR REPLACE PACKAGE BODY QP_CUSTOM_IGNORE AS
PROCEDURE IGNORE_ITEMLINE_FOR_PRICING(
p_request_type_code IN VARCHAR2
IS
l_item_id VARCHAR2(240);
BEGIN
l_item_id := OE_ORDER_PUB.G_LINE.inventory_item_id;
x_ignore := 'Y';
x_default_price_list_id := 12345;
Else
x_ignore := 'N';
x_default_price_list_id := 0;
end if;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
6
end if;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
7
Example 2:
The user has identified a line flow say, zero_price_line. If the line_type_code
is defaulted/updated to this value before a pricing call then pricing for these lines
should be ignored and the price should be set to zero in sales order line.
CREATE OR REPLACE PACKAGE BODY QP_CUSTOM_IGNORE AS
PROCEDURE IGNORE_ITEMLINE_FOR_PRICING(p_request_type_code IN
VARCHAR2
IS
BEGIN
IF (OE_ORDER_PUB.G_LINE.line_type_code = 'ZERO_PRICE_LINE')
THEN
x_ignore := 'Y';
x_default_price_list_id := 12345;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
8
Example 3
User has designed a specific format to name the option items those need to be
considered as zero priced. The names of these items end with _zp tag.
CREATE OR REPLACE PACKAGE BODY QP_CUSTOM_IGNORE AS
PROCEDURE IGNORE_ITEMLINE_FOR_PRICING(p_request_type_code IN
VARCHAR2
) IS
BEGIN
x_ignore := 'Y';
x_default_price_list_id := 12345;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
9
Example 4
) IS
l_zp_attribute VARCHAR2(240);
BEGIN
FROM mtl_system_items_b
x_ignore := 'Y';
x_default_price_list_id := 12345;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
10
Example 5
User has designed to have a special item category (category_id = 55555) and
assign only those items that are to be considered as zero price items to that item
category.
CREATE OR REPLACE PACKAGE BODY QP_CUSTOM_IGNORE AS
PROCEDURE IGNORE_ITEMLINE_FOR_PRICING (
p_request_type_code IN VARCHAR2
) IS
l_zp VARCHAR2(1);
BEGIN
AND inventory_item_id =
OE_ORDER_PUB.G_LINE.inventory_item_id);
x_ignore := 'Y';
x_default_price_list_id := 12345;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
11
Example 6
p_request_type_code IN VARCHAR2
IS
l_zp VARCHAR2(1) := N;
BEGIN
WHERE inventory_item_id =
OE_ORDER_PUB.G_LINE.inventory_item_id);
x_ignore := 'Y';
x_default_price_list_id := 12345;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
ELSE
x_ignore := 'N';
x_default_price_list_id := 0;
END IF;
END IGNORE_ITEMLINE_FOR_PRICING;
END QP_CUSTOM_IGNORE;
12
More Implementation Notes
13
Ignore Pricing for Order Lines Custom Hook
April, 2009
Authors: Rajendra Badadare, Smitha Balaraman.
Co-Authors: Shankar Kattamanchi, Dharmender Gupta, Kelli Stone.
Copyright Oracle Corporation 2009
All Rights Reserved Printed in the U.S.A.
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
415.506.7000
Fax 415.506.7200
14