You are on page 1of 11

The following steps outline the setup that may be used to calculate the manual freight charge based

on the order lines total.

1. Create the following custom package.


Please note this is sample code and is being provided as a suggestion for the code needed for to meet this business need. Since this is custom code it is the Customers responsibility to thoroughly test and maintain the code. CREATE OR REPLACE PACKAGE XX_GET_LINE_USP_PUB AS FUNCTION XX_GET_USP_LINE(p_line_id IN NUMBER) RETURN NUMBER; END XX_GET_LINE_USP_PUB; / CREATE OR REPLACE PACKAGE BODY XX_GET_LINE_USP_PUB AS FUNCTION XX_GET_USP_LINE(p_line_id IN NUMBER) RETURN NUMBER IS p_line_usp number; CURSOR get_USP_lines_cur (p_line_id in number) IS Select unit_selling_price From oe_order_lines_all Where line_id = p_line_id; BEGIN OPEN get_USP_lines_cur (p_line_id); FETCH get_USP_lines_cur INTO p_line_usp; CLOSE get_USP_lines_cur; RETURN p_line_usp; EXCEPTION WHEN OTHERS THEN RETURN NULL; END XX_GET_USP_LINE; End XX_GET_LINE_USP_PUB; / Commit;

2. Set up a custom pricing attribute to capture the sales order lines unit selling price.
Responsibility: Oracle Pricing Manager Navigate to: Setup > Attribute Management > Context and Attributes FIND on : type = Pricing Context code = PRICING ATTRIBUTE Add a line as follows under the ATTRIBUTE section. code = LN_SUBTOT(or what you prefer to call it) name = LN_SUBTOT Description = Order subtotal minus tax minus freight precedence =200 (or whatever you prefer) application name = Advanced Pricing Column mapped: pricing_attribute47 (or another pricing attribute if this one is already in use) value set: QP: Number (or any other numeric value set you choose) Save.

--Warning: Be sure to assign the value set QP: Number or another numeric value set.

3. Next, in order to use this new attribute, a sourcing rule must be defined.
Responsibility: Oracle Pricing Manager Navigate to: Setup > Attribute Management > Attribute Linking and Mapping FIND on: Pricing Transaction Entity = Order Fulfillment and Context Type = Pricing Context Place cursor on code = PRICING ATTRIBUTE Click the button Link Attributes Add a lines as follows: Code = LN_SUBTOT Level = Line Attribute Mapping Method = ATTRIBUTE MAPPING Check all of the following: LOV Enabled, Use in Limits, Attribute Mapping Click on the Attribute Mapping button For request type = ONT enter... Application Name = Advanced Pricing Under Order Level, enter.... User source type = PL/SQL API User value string = XX_GET_LINE_USP_PUB.XX_GET_USP_LINE(OE_ORDER_PUB.G_LINE.line_id) Check Enabled. Save.

4. Run Build Attribute Mapping Rules.


Responsibility: Oracle Pricing Manager Navigate to Reports

5. Create a formula
Navigate to: Pricing Formula > Formula Setup Create a new formula. Name = ks-ln-frt (or whatever you wish to name it) Formula = nvl(2,3) *(1/4) This formula would evaluate the line_total * modifier value/100 Step 1: Modifier Value Step 2: Formula type=Pricing Attribute, Pricing Attribute Context = Pricing Attribute, Pricing attribute = LN_SUBTOT Step 3: Formula type=Numeric constant, component =0 (zero) Step 4: Formula type=Numeric constant, component =100 Save.

6. From top menu, select Tools > Build Formula Package.

7. Create a new manual freight charge as follows:

Note: make sure pricing phase = Line Charges Manual

--Note: Make sure that value = 20 as well as formula being entered. 8. Run QP: Maintains Denomalized Data in QP Qualifiers for this modifier
Responsibility: Oracle Pricing Manager Navigate to Reports

9. Re-run build Attribute mapping rules.


This will help with performance since attribute is now used in a modifier. Responsibility: Oracle Pricing Manager Navigate to Reports

10. Retest the issue.


Enter a new order (not a copied order as some characteristics may also be copied) Enter a sales order line and apply manual adjustment for 11.24935062% Discount and save. The list price = 385 Auto 25% discount and manual discount for 11.24935062% are now applied. (can be verified thru actions > view adjustments) Unit selling price should show as = 245.53

11. Do Actions > Charges and Freight Costs


Select the manual freight modifier created in step #8 above, and click Apply then OK to return to the sales order form.

12. Click on the Order Information tab.


Charges, on the bottom right side, should now show as 49.09

You might also like