The compensation logic does all 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.
-
-
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 - such element 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. But 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 scheduled Plan Calculation Task to create/delete compensation records, if necessary. For example, if the compensation plan is defined for seller group and compensation records are for individual sellers, then when the group changes, e.g. one seller is moved to another branch, we must remove his compensation records from the old group.
-
generateAccrualRecords - can be used in 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 specific groups, then it is the same as if you would assign it into all 3 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 compensation
syntax-check
to build input field definition for compensation item
compensation
standard
1) to calculate the results (e.g. prices) and provide warnings and alerts for compensation item, 2) to generate the Compensation Records
compensationReadOnly
standard
to calculate the results (e.g. prices) and provide warnings and alerts for compensation item once the compensation plan is already approved
compensationRecord
syntax-check
to build input field definition for compensation record
compensationRecord
standard
to calculate the results (e.g. prices) and provide warnings and alerts for compensation record
generateCompensationRecords
standard
used in scheduled Sales Compensation Calculation (of type Plan Calculation Task) to calculate items after compensation submission. In this phase we allow to manipulate with COR. So the logic is allowed to generate Compensation Records.
generateAccrualRecords
standard
used in scheduled Sales Compensation Calculation (of type Plan Calculation Task) to generate Accrual Records for each Compensation Record. The logic can not manipulate with 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 compensation
syntax-check
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 Quote Header logic pre-phase, and data placed to api.global by execution of previous quote 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
syntax-check
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 compensation
syntax-check
input field definitions for the RALI
compensation
standard
elements result values will appears as results of the RALI
compensationReadOnly
standard
elements result appears as results of the RALI
api.global
- data stored here will persist until next execution of this logic for another compensation line item (within one recalculation process)compensationRecord
syntax-check
input field definitions for the COR, but also for the RALI (otherwise those would not display on the COR detail page)
compensationRecord
standard
elements result mapped to the COR (mapping done by naming convention – the columns of COR must have the same name as 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.