To configure the Rebates module, so that you can create new Rebate Agreements, take the following steps:
- Make sure you have the following prerequisites ready:
- Customer master
- Product master
- Datamart
- Create a Rebate calculation logic.
- Create a Condition Type.
- Create a Rebate Agreement.
- Create Rebate Records.
- Create a workflow for rebate and payout approval.
- Create an allocation calculation logic for allocating data to a Datamart.
...
Element Name | Calculation Context | Groovy | Note |
---|---|---|---|
ProductGroup | api.productGroupEntry() | The conditions are typically negotiated for a group of products. | |
CustomerGroup | api.customerGroupEntry() | The conditions are typically negotiated for a group of customers. | |
RebateDiscount |
| The negotiated condition – in this case the discount in percentage. | |
AbortOnInputGeneration | if (api.isInputGenerationExecution()) api.abortCalculation() | isInputGenerationExecution is supported from version 10.0, in older versions use isSyntaxCheck . | |
Today | return api.targetDate() | This is to be able to simulate different "today". | |
StartDate | return (api.currentItem()?.startDate) ? api.parseDate("yyyy-MM-dd",api.currentItem().startDate) : new Date() | ||
EndDate | return (api.currentItem()?.endDate) ? api.parseDate("yyyy-MM-dd",api.currentItem().endDate) : new Date() | ||
EndDateOrToday | return (api.getElement("Today") < api.getElement("EndDate")) ? api.getElement("Today") : api.getElement("EndDate") | ||
ActualSales |
| How much money were actually spent in the time frame. The number comes from Datamart for the specified period. | |
Rebate |
| SimpleRebate calculation – we will pay back the customer the negotiated percentage of the spendings on the given group of products. | |
ForecastSales |
| ||
ForecastRebate |
| ||
RebateRecordCreate | Agreement |
| Every agreement line will generate one Rebate Record (i.e., there will be only one payout at the end of the year). |
RRInput | RebateRecord | api.userEntry("RRInput") | This is an example of how to make an input specific for the Rebate Record. |
CalculationBase | RebateRecord |
| Calculation base specifies a filter which finds the sales transactions related to this Rebate Record. |
...