Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To build a new project in PromotionManager, we will take the following steps: 

  1. Create a contract calculation logic for each of the two line items in the contract.
  2. Create a contract term type for each of the calculation logics.
  3. Set up Price Records – map contract attributes to Price Record fields.
  4. Create a calculation logic for accessing the Price Records.
  5. Typically, you will also to set up an approval workflow logic in Workflow Logics (of Contract type).

Create Contract Calculation Logics

We will create two contract calculation logics that define user inputs and pass the entered values on to Price Records. To start, go to Configuration > Calculation Logic > Contracts and click 'Add'.

Volume Discount Calculation Logic

The volume discount logic will include the following elements:

...

Element NameLabelFormula Expression
CustomerGroupCustomer Groupapi.customerGroupEntry()
ProductGroupProduct Groupapi.productGroupEntry()
ContractTermTypeContract Term Type

def nameFilter = Filter.equal("uniqueName", api.currentItem()?.contractTermType)
def ctt = api.find("CTT", nameFilter)
return ctt?.getAt(0)

ValidFromValid From

def dateString = api.dateUserEntry("ValidFrom")

def date = api.parseDate("yyyy-MM-dd",dateString)

api.currentItem()?.startDate = date //we need to set the override here to be copied to the Price Record
return date

ValidToValid To

def dateString = api.dateUserEntry("ValidTo")

def date = api.parseDate("yyyy-MM-dd", dateString)
api.currentItem()?.endDate = date //we need to set the override here to be copied to Price Record
return date

VolumeDiscountVolume Discount

def volumeDiscountEntry = api.multiTierEntry("VolumeDiscount", "Qty", "%")

return volumeDiscountEntry?.asMap()

Net Price Calculation Logic

The net price logic will include the following elements:

...

Element NameLabelFormula Expression
CustomerGroupCustomer Groupapi.customerGroupEntry()
ProductGroupProduct Groupapi.productGroupEntry()
ContractTermTypeContract Term Type

def nameFilter = Filter.equal("uniqueName", api.currentItem()?.contractTermType)
def ctt = api.find("CTT", nameFilter)
return ctt?.getAt(0)

ValidFromValid From

def dateString = api.dateUserEntry("ValidFrom")

def date = api.parseDate("yyyy-MM-dd",dateString)

api.currentItem()?.startDate = date //we need to set the override here to be copied to the Price Record
return date

ValidToValid To

def dateString = api.dateUserEntry("ValidTo")

def date = api.parseDate("yyyy-MM-dd", dateString)
api.currentItem()?.endDate = date //we need to set the override here to be copied to Price Record
return date

NetPriceNet Price
return api.userEntry("Net Price")?:0

Create Contract Term Types

A Contract term type represents an item in the promotional offer. We will create two contract term types, one for the volume discount and one for the net price promotion. We will assign the previously created calculation logics to them.

  1. Go to 'PromotionManager' > 'Contract Term Types'.
  2. Click 'Add' and enter the name and label.
  3. Select the corresponding Pricing logic.
  4. (Optional) Define the value of the Waterfall Element and other attributes.
    In the Waterfall Element, you can indicate which field (of the Quote or Datamart) is influenced by this contract condition. This can be used, for example, when the Quote Line searches for the appropriate Price Record (which was generated from the Contract Term Type).

Set Up Price Records

Price Records are created automatically from the Contract lines but you can influence the content of the resulting fields. In our case most of the things go automatically, we only need an additional "VolumeDiscount" element.

SourceDestination Price Record
Field NameField Label
currentItem().startDatevalidAfter
currentItem().endDateexpiryDate
Logic element named "VolumeDiscount"
VolumeDiscount

For more details see Price Records Generation from Contract/wiki/spaces/KB/pages/99570364.

Create Logic to Access the Price Records

This example shows how to find an appropriate Price Record on the Quote Line Item.

...