Use Pricing Promotions With Sales Orders
Apply a pricing promotion as an incentive to increase sales with your customers, such as buy one get one free (BOGO), or apply a discount according to the values in attributes on the sales order.
See:
Use Extensions
You can also use an order management extension to add an item to a sales order to reward a customer who purchase a larger quantity. For example, if your customer orders a quantity of 5 for the AS54888 desktop computer, then add a free AS9000 router on another order line on the same order.
- Use the setProductNumber parameter of the createLineParams method to specify the item that you want to add.
- Use the setOrderedQuantity parameter of createLineParams to specify the quantity for the item that you want to add.
- Use an IF statement to specify the quantity that you want to use as the threshold that determines whether to add a new line.
- You can use createLineParams to set the ProductNumber, OrderedUOM, and OrderedQuantity attributes on new lines that you add. You can't use it to set any other attribute.
For example:
import oracle.apps.scm.doo.common.extensions.CreateLineParams;
if (!"SUBMIT_AFTR_VALID".equals(header.getAttribute("CustomerPONumber"))) return; /* This line is only for testing purposes. Remove it after you successfully test this extension.*/
def createLineParams = new CreateLineParams();
createLineParams.setProductNumber("AS9000");
/* Specify the item.
that you want to add on the new line.*/
createLineParams.setOrderedUOM("Each")
createLineParams.setOrderedQuantity(1); /* Specify the quantity for the item that you're adding on the new line. */
def lines = header.getAttribute("Lines");
while (lines.hasNext()) {
def line = lines.next();
def isClosed = line.isClosed()
def isCanceled = line.isCanceled()
def isTransformed = line.isTransformed()
def transformLines = line.getTransformedLines();
if (isClosed || isCanceled || isTransformed || transformLines.size() != 0) {
continue;
}
if (line.getAttribute("ProductNumber") == "AS54888" && line.getAttribute("OrderedQuantity") >= 5)
/* Specify the quantity that you want to use as the threshold that determines when to add a new line. */
{
line.createNewLine(createLineParams);
}
}
For details, see Overview of Creating Order Management Extensions.