Sales Compensation Calculation Logic

Since version 9.0

The compensation logic does the following:

  • Calculates Compensation Line Item (COLI). Tasks of those logic elements are to:

    • Create definitions of input fields for the line item.

    • Calculate the results of the line item.

    • Create the Compensation Records for this line item.

  • Calculates Compensation Record (COR). Tasks of those elements are to:

    • Calculate the results of the Compensation Record.

    • Optionally also:

      • Create definitions of input fields specific for the Compensation Record.

      • Create the Accrual Records for this Compensation Record and calculate their results.

There is only a single logic for both Compensation Line Item and Compensation Record calculations, so there is a mechanism to set up which code of which elements serves which purpose/scenario. For example, a code of one element can be executed in two different scenarios – to calculate the result of a line item, and also to calculate a result of a Compensation Record. The reason for such design is that a big part of calculations performed on the line item is also performed on the Compensation Records, so this is the way to avoid duplication of code.

Logic API

  • Logic Nature: compensationAgreement

    • Logic Type: Calculation/Pricing

  • Element Group (also called Calculation Contexts) – Every element of the logic can belong to one or more element groups which then determines in which scenario the code of the element will be used. The groups are:

    • compensation – The element’s code will be executed for a Compensation line item (e.g. to define item’s inputs, calculate item’s results and generate the Compensation Records).

    • compensationReadOnly – The element’s code will be executed for a line item, but only if the Plan is already approved and is "read-only". Such elements are executed when the user opens an approved plan, so that the user can see e.g. new compensation estimations. The calculation results are NOT stored.

    • compensationRecord – The element’s code will be executed for a Compensation Record (i.e. to prepare input fields definitions, to calculate results, and create & calculate Accrual Records).

    • generateCompensationRecords – Can be used in a scheduled Plan Calculation Task to create/delete Compensation Records, if necessary. For example, if the Compensation Plan is defined for a seller group and Compensation Records are for individual sellers, then when the group changes, e.g. one seller is moved to another branch, you must remove this user’s Compensation Records from the old group.

    • generateAccrualRecords – Can be used in a scheduled Plan Calculation Task to create accrual records for a set of Compensation Records. For example, it could be used to solve the problem of storing historical data. Transactional data in the Datamart can change, but we have to be able to show what numbers were used for compensation calculation. So the solution for that could be to store aggregated transaction data as accrual records.

    • (no group selected) – When you do not assign the element into a specific group, it is the same as if you would assign it into all three groups.

  • Execution Types – The code of logic elements can be executed in several different scenarios/purposes as a combination of execution mode and element group:

Element Group

Mode

Scenario/Purpose

Element Group

Mode

Scenario/Purpose

compensation

Input Generation

Builds the input field definition for a compensation item.

compensation

Standard

1) Calculates results (e.g. prices) and provides warnings and alerts for a compensation item. 2) Generates the Compensation Records.

compensationReadOnly

Standard

Calculates results (e.g. prices) and provides warnings and alerts for a compensation item once the compensation plan is approved.

compensationRecord

Input Generation

Builds the input field definition for a compensation record.

compensationRecord

Standard

Calculates results (e.g. prices) and provides warnings and alerts for a compensation record.

generateCompensationRecords

Standard

Used in scheduled Sales Compensation Calculation (of the type Plan Calculation Task) to calculate items after compensation submission. In this phase it is possible to manipulate COR. So the logic is allowed to generate Compensation Records.

generateAccrualRecords

Standard

Used in scheduled Sales Compensation Calculation (of the type Plan Calculation Task) to generate Accrual Records for each Compensation Record. The logic cannot manipulate COR but can create Accrual Records.

  • Information provided to the logic – Varies based on the scenario.

Element Group

Mode

Input Parameters

Binding Variables

Current Item

api.global

Element Group

Mode

Input Parameters

Binding Variables

Current Item

api.global

compensation

Input Generation

 

 

 

 

compensation

Standard

Values of line item inputs, values from inherited inputs of parent folders and header

compensationRecords : IRebateRecordManager

 

Data placed to api.global in the Compensation Header logic pre-phase and data placed to api.global by execution of the previous line (within one recalculation process)

compensationReadOnly

Standard

Values of line item inputs, values from inherited inputs of parent folders and header

compensationRecords : IRebateRecordManager

COLI (Compensation Agreement Line Item)

 

compensationRecord

Input Generation

 

 

COR (Compensation Record)

 

compensationRecord

Standard

Values of compensation record inputs, copy of values of line item inputs

calculationBase : DMDataSlice, accrualRecords : AccrualRecord-Manager

COR (Compensation Record)

 

generateCompensationRecords

Standard

 

compensationRecords : IRebateRecordManager, calculationBase : DMDataSlice,

COLI as Map

 

generateAccrualRecords

Standard

 

compensationRecords : IRebateRecordManager, accrualRecords : PayoutRecordManager

COR as Map

 

  • Expected logic execution outcome:

Element Group

Mode

Expected Logic Result/Outcome

Element Group

Mode

Expected Logic Result/Outcome

compensation

Input Generation

Input field definitions for the COLI.

compensation

Standard

Elements result values appears as a result of the COLI.

compensationReadOnly

Standard

Elements result appears as a result of the COLI.

api.global – Data stored here will persist until the next execution of this logic for another compensation line item (within one recalculation process).

compensationRecord

Input Generation

Input field definitions for the COR, but also for the COLI (otherwise those would not display on the COR detail page).

compensationRecord

Standard

Elements result mapped to the COR (mapping done by naming convention – the COR columns must have the same names as the elements).

generateCompensationRecords

Standard

The logic is expected to modify the list of line item’s compensation records. Results of elements will be ignored.

generateAccrualRecords

Standard

The logic is expected to modify the list of accrual records linked to the given compensation record. Results of elements will be ignored.

Found an issue in documentation? Write to us.

Â