Вы находитесь на странице: 1из 5

How to Set Up a Modifier to Discount Lines Based on the Accumulated Ordered Quantity [ID 1059506.

1] Modified 15-FEB-2011 Type HOWTO Status MODERATED

In this Document Goal Solution Modifier Setup Attribute Linking: Example Quote: Example Code Changes to APPS.QP_RUNTIME_SOURCE Example Table Structure Used by API to accumulate totals:

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

Applies to:
Oracle Advanced Pricing - Version: 11.5.10 to 12.0.6 - Release: 11.5 to 12.0 Information in this document applies to any platform.

Goal
My Requirement is to set up a modifier to discount lines based on the accumulated ordered quantity of an item on the order. For example, if a customer orders 3 lines of the same item that is eligible for a discount, then each line is priced based on the accumulated value of the previous qualifying line for the same product.
Volume Attribute From 1 6 11 Volume Attribute To 5 10 15 Adjustment Amount ( Percent) 5% 10 % 15 %

When this discount is applied, the accumulated values and adjustment amounts are calculated as follows:
Line No. 1.1 1.2 1.3 Quantity Accumulated 3 6 4 Value Adjustment 0 3 9 Amount 5% 8.33 % 13.75 %

The accumulation value and discounts are evaluated as follows:

The first line -- 1.1 -- is given a discount of 5% because an accumulation value of 0 is passed and the order quantity of 3 satisfies the range 1-5. Line 1.2 is evaluated with starting at the accumulated value of 3. Two of the ordered quantity 6 fall within the range of 1-5 and 4 fall within the range 6-10 resulting in an 8.33% adjustment. Line 1.3 is evaluated with a starting point of (3+6) = 9 passed by the calling application and an order quantity of 4. One of quantity 4 falls within range 6-10 and 3 fall within the range of 11-15 resulting in a 13.75% adjustment.

Solution
This functionality is described in: Oracle Advanced Pricing User's Guide Release 11i Part No. B13966-03 Using Accumulated Range Breaks. . . . . . . . . . . . . . . . . . . . . . . . . . 3-36 Using Accumulated Range Breaks Setting up modifiers with accumulated range breaks provides additional flexibility to existing price break processing. Using accumulated range breaks, you can set up range price breaks that accumulate within and across orders based on some attribute value (for example, quantity) that is accumulated from previous orders or order lines. The pricing engine uses the accumulation value as the starting point of the break calculation. Advanced Pricing does not store these accumulated values. The value is passed by the calling application in the engine request or the engine dynamically sources the attribute from a customer API. etc..... ========== AND ============= Oracle Advanced Pricing Implementation Manual Release 11i Part No. B14385-03 Setting up Runtime Sourcing for Accumulated Range Breaks . . . . . . . . . . . . . 8-15 Setting up Runtime Sourcing for Accumulated Range Breaks Unlike attribute mapping, runtime sourcing can only be used for accumulated range breaks. During accumulated range break calculations, the pricing engine calls the Runtime Sourcing API to acquire an accumulation value for the accumulation attribute (defined as RUNTIME SOURCE in the Attribute Mapping setup). The RUNTIME SOURCED API is a PL/SQL function that returns the accumulation value. etc..... The Following Screenshots show an example of how to set up the Modifier, Attribute Mapping and an Example Quote where this has been applied. Additionaly an example of changes to the API and supporting tables have also been provided.

Modifier Setup

Profile: QP: Accumulation Attribute to YES Modifier: Level: Line Modifier Type: Price Break Header Pricing Phase: List Line Adjustment Product Attribute: Item Number Product Attribute Value: 1000LCL Volume Type: Item Quantity Break Type: Range UOM: ECH Adjustment Type: Surcharge Accumulation Attribute: Total Item Quantity

Attribute Linking:

Example Quote:

Example Code Changes to APPS.QP_RUNTIME_SOURCE


CREATE OR REPLACE PACKAGE BODY APPS.QP_RUNTIME_SOURCE AS --Note: The return value of this function will be considered as a previous count. FUNCTION Get_numeric_attribute_value ( p_list_line_id IN NUMBER, p_list_line_no IN VARCHAR2, p_order_header_id IN NUMBER, p_order_line_id IN NUMBER, p_price_effective_date IN DATE, p_req_line_attrs_tbl IN ACCUM_REQ_LINE_ATTRS_TBL, p_accum_rec IN ACCUM_RECORD_TYPE ) RETURN NUMBER IS

v_cust_class VARCHAR2 (240); v_order_type VARCHAR2 (240); v_req accum_req_line_attrs_rec; i NUMBER; accum_value NUMBER; ln_acc_qty NUMBER; BEGIN /* Change the logic as per your requirement */ DELETE xx_accumulated_range_breaks WHERE quote_header_id = p_order_header_id AND quote_line_number >= p_order_line_id; /* Change the logic as per your requirement */ SELECT NVL (SUM (item_quantity), 0) INTO ln_acc_qty FROM xx_accumulated_range_breaks WHERE quote_header_id = p_order_header_id; /* Change the logic as per your requirement */ INSERT INTO xx_accumulated_range_breaks VALUES ( p_order_header_id, p_order_line_id, (SELECT quantity FROM aso_quote_lines_all WHERE quote_header_id = p_order_header_id AND quote_line_id = p_order_line_id AND ROWNUM = 1), SYSDATE ); RETURN ln_acc_qty; EXCEPTION WHEN OTHERS THEN NULL; END; END QP_RUNTIME_SOURCE;

Example Table Structure Used by API to accumulate totals:

CREATE TABLE XX_ACCUMULATED_RANGE_BREAKS ( QUOTE_HEADER_ID NUMBER, QUOTE_LINE_NUMBER NUMBER, ITEM_QUANTITY NUMBER, WHEN DATE );

Attachments

Attribute_Linking_1.png (121.38 KB) Attribute_Linking_2.png (103.22 KB) Attribute_Linking_3.png (124.03 KB)

Example_Quote.png (141.91 KB) Modifier_1.png (91.1 KB) Price_Break_Header.png (91.99 KB) Related

Products

Oracle E-Business Suite > Order Management > Price Management > Oracle Advanced Pricing

Keywords ADJUSTMENT; ASO_QUOTE_LINES_ALL; QP_RUNTIME_SOURCE; LINE ADJUSTMENT; PRODUCT ATTRIBUTE; PRICE BREAK; VOLUME; ATTRIBUTE MAPPING Back to top
Article Rating Rate this document Excellent Good Poor Did this document help you? Yes No Just browsing How easy was it to find this document? Very easy Somewhat easy Not easy Cancel Important Note: this feedback may be anonymously visible to other customers until processed by Oracle Support. Comments
Provide feedback for this article. Please use 'Contact Us' for other feedba

Вам также может понравиться