Buy1 get 1 free

6
OEXOEORD: Cannot get 'Buy X Number Of Items And Get X Number Of Items Free To Work As Needed (Doc ID 794013.1) Modified: 17-Jul-2013 Type: PROBLEM In this Document Symptoms Cause Solution 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.2 to 11.5.10.2 [Release 11.5] Information in this document applies to any platform. FORM:OEXOEORD.FMB - Sales Orders SYMPTOMS -- Problem Statement: On 11.5.10.2 in Production: Find that you are entering a sales order of 100 bags and you want the application/promotiomal modifier of buy one, get one free code to look at the sales order quantity and have the promotional quantity of 100 bags given free but despite the ordered quantity of 100 bags as it stands now, the application is still only showing the promotional item of 1 free and not 100 free. For example, if they order 50 bags, should get 500 free items. In addition, we also want to have minimum order quantity of 2, and then only we will give our customers 'Buy X Get X'. EXPECTED BEHAVIOR Expect that if the ordered quantity on the sales order = 100 bags then the promotional modifier of "buy one Get one free" would look at the ordered quantity and show that the customer would get 100 bags free -- Steps To Reproduce: The issue can be reproduced at will with the following steps: 1. Order Management Super User Responsibility 2. Enter sales order for more than one quantity 3. Promotional modifier still only shows that there is only one quantity free -- Business Impact: The issue has the following business impact: Due to this issue, users cannot use the buy one get one free promotional modifier if sales order quantity is more than one item/bag.

Transcript of Buy1 get 1 free

Page 1: Buy1 get 1 free

OEXOEORD: Cannot get 'Buy X Number Of Items And Get X Number Of Items Free To WorkAs Needed (Doc ID 794013.1)

Modified: 17-Jul-2013 Type: PROBLEM

In this Document

Symptoms

Cause

Solution

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

APPLIES TO:

Oracle Advanced Pricing - Version 11.5.10.2 to 11.5.10.2 [Release 11.5]Information in this document applies to any platform.FORM:OEXOEORD.FMB - Sales Orders

SYMPTOMS

-- Problem Statement:On 11.5.10.2 in Production:Find that you are entering a sales order of 100 bags and you want the application/promotiomalmodifier of buy one, get one free code to look at the sales order quantity and have thepromotional quantity of 100 bags given free but despite the ordered quantity of 100 bags as itstands now, the application is still only showing the promotional item of 1 free and not 100 free.

For example, if they order 50 bags, should get 500 free items.

In addition, we also want to have minimum order quantity of 2, and then only we will give our customers 'Buy X Get X'.

EXPECTED BEHAVIORExpect that if the ordered quantity on the sales order = 100 bags then the promotional modifierof "buy one Get one free" would look at the ordered quantity and show that the customer would get100 bags free

-- Steps To Reproduce:The issue can be reproduced at will with the following steps:1. Order Management Super User Responsibility2. Enter sales order for more than one quantity3. Promotional modifier still only shows that there is only one quantity free

-- Business Impact:The issue has the following business impact:Due to this issue, users cannot use the buy one get one free promotional modifier if sales orderquantity is more than one item/bag.

Page 2: Buy1 get 1 free

CAUSE

The issue is caused by the following setup: Modifier is setup at line level using a point break.The setup causes the issue because with this setup the pricing enginewill only review the item quantity for each line individually, it will not consider item quantityon other sales order lines. One get item per line that qualifies for the promotion will be applied.This means that if you have 3 order lines, one would have 3 get item sales order lines.In addition point break will apply the modifier once per line, based on the range defined.

This issue is described in Oracle® Advanced PricingUser’s GuideRelease 11iPart No. B13966-01

Page 3-36

Select the Level that the modifier is applied:

Line: If the line is eligible to receive the modifier, the pricing engine appliesthe modifier at the line level.

Group of Lines: If the pricing request is eligible to receive the modifier, thepricing engine considers the item quantity or item amount consumed for agroup of order lines.

Page 3-41

The following table provides an example of a setup for a point break.Table 3–11 Point Break TypeBreak Type Recurring

Field Value

Break Type Point

Modifier Line Type Discount

Product Attribute Item

Product Attribute Value Item A

Volume Type Item Quantity

Operator Between

UOM Cases

Value From 100

Application Method Amount

The pricing engine interprets this point setup as follows: an order of 100 casesof item A gets a 2 currency unit discount. If you order 200 cases of item A, youreceive a 2 currency unit discount.

Page 3: Buy1 get 1 free

The following table details an example setupfor a recurring price break:

Table 3–12 Recurring Break Type

Break Type Recurring

Modifier Line Type Discount

Product Attribute Item

Product Attribute Value Item A

Volume Type Item Quantity

Operator Between

UOM Cases

Value From 100

Application Method Percent

Value To 9999999999

The pricing engine interprets this recurring setup as order 100 cases of item Aand get a 2 currency unit discount. If you order 200 cases of item A you receivea 4 currency unit discount.

SOLUTION

-- To implement the solution, please execute the following steps::1. Go into the responsibility: Oracle Pricing ManagerNavigate to: Modifiers > Modifier SetupEither query the existing modifier and add an end date as yesterday to the current modifier lineor create a new modifier.Enter a line as follows:level: group of linesmodifier type: promotional goodspricing phase: modifiers for the BOOK eventproduct attribute: All Itemsproduct attribute value: ALLvolume type: Item Quantitybreak type: RecurringUOM: Ea (or whatever UOM you need)Value from: 1Value to: 9999999999

Do not enter a line for additional buy products.

Enter a get line as follows:get product attribute: item number

Page 4: Buy1 get 1 free

get product value: <enter you get item>UOM: Ea (or whatever UOM you need)enter the get price by seleting the price list from the list of valuesapplication method: Percentvalue: 100Save.

2. Run QP: Maintains the denormalized data in QP QualifiersResponsibility = Oracle Pricing ManagerNavigate: ReportsSelect 'single request' then 'OK'Name: QP: Maintains the denormalized data in QP QualifiersParameters:Enter the list header id (low) by selecting the modifier from theLOV (list of values).

Enter the list header id (high) by selecting the modifier from the LOV.

Leave last parameter as default (ALL)

Click OK then Submit Request

3. Retest the issue to ensure it works correctly for quantity > 2.

4. One will need to create a custom package/function to accomplish this desired functionality for minimum order quantity is 2 in order to receive this buy 1 get 1 free promotion. The following text is sample SQL used on an internal instance.

This is only a sample and should be used to develop one's own package/function to meet business needs. Due to the fact this is a customized package, it is the Customer's responsibility to thoroughly test and to maintainthe packageas well as make modifications as needed to the code to meet your business requirements.

CREATE OR REPLACE PACKAGE XX_GET_ORDER_TOT_QTY_PUB AS FUNCTION XX_GET_TOT_QTY(p_header_id IN NUMBER) RETURN NUMBER; END XX_GET_ORDER_TOT_QTY_PUB; /

CREATE OR REPLACE PACKAGE BODY XX_GET_ORDER_TOT_QTY_PUB AS FUNCTION XX_GET_TOT_QTY(p_header_id IN NUMBER) RETURN NUMBER IS p_order_sum number; CURSOR get_sum_order_lines_cur (l_header_id NUMBER) IS Select sum(ordered_quantity) From oe_order_lines_all Where header_id = l_header_id; BEGIN OPEN get_sum_order_lines_cur (p_header_id); FETCH get_sum_order_lines_cur INTO p_order_sum; CLOSE get_sum_order_lines_cur; RETURN p_order_sum; EXCEPTION WHEN OTHERS THEN RETURN NULL; END XX_GET_TOT_QTY; End XX_GET_ORDER_TOT_QTY_PUB; /

Commit;

Page 5: Buy1 get 1 free

5. Set up a custom pricing qualifier attribute to capture total order quantity. Responsibility: Oracle Pricing Manager Navigate to: Setup > Attribute Management > Context and Attributes FIND on : type = Qualifier Context code = ORDER Add a line as follows under the “ATTRIBUTE” section. code = ORD_QTY_SUBTOT (or what you prefer to call it) name = ORD_QTY_SUBTOT Description = Order quantity precedence =201 application name = Advanced Pricing Column mapped: pricing_attribute39 (or another pricing attribute if this one is already in use) value set: QP: Number Save.

6. 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 = Qualifier Context Place cursor on code = ORDER Click the button “Link Attributes” Add a lines as follows: Code = ORD_QTY_SUBTOT Level = Both 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.... Global object name = OE_ORDER_PUB.G_HDR User source type = PL/SQL API User value string = XX_GET_ORDER_TOT_QTY_PUB. XX_GET_TOT_QTY(OE_ORDER_PUB.G_HDR.header_id) Check Enabled. Save.

Under Line Level, enter.... Global object name = OE_ORDER_PUB.G_LINE User source type = PL/SQL API User value string = XX_GET_ORDER_TOT_QTY_PUB. XX_GET_TOT_QTY(OE_ORDER_PUB.G_LINE.header_id) Check Enabled. Save.

7. Run Build Attribute Mapping Rules.

8. Run Attribute Mapping Errors Report to check/fix any errors.

9. Add this qualifier to the modifier Navigate to: Modifiers > Modifier Setup Query the modifier (in example screenshots provided this would be ks-pro-1-1). Click on List Qualifiers Add a line as follows:

Page 6: Buy1 get 1 free

Grouping number = -1 Qualifier Context: Order Qualifier Attribute: ORD_QTY_SUBTOT Operator: BETWEEN Value from: 2 Value to: 9999999999 Click OK. Save.

10. Run QP: Maintains Denormalized Data in QP Qualifiers for the modifier

11. Retest with a brand new sales order Example test one may wish to perform: Responsibility = Order Management Super User (or equivalent) Navigate to: Orders, Returns > Sales Orders Enter a new header record, click on line items tab Entere line 1.1 for an item with ordered quantity = 1 Save and book the order. Promotion should not be applied. Update ordered quantity on line 1.1 from 1 to 2 and save.

Promotion should now apply and new line (2.1) is created for the 'get item'.

12. Migrate the solution as appropriate to other environments.