Rebate Agreements
This article introduces key concepts of the Rebates module and how to configure the Rebates module to allow the creation of Rebate Agreements. With Rebate Agreements, the end users will be able to define the terms & conditions for the rebates — and be able to calculate forecasts that tell them what the end result of the rebates likely will be.
The next article describes how to further configure the Rebates module to be able to calculate the rebate amounts at the end of — and during — the Rebate Agreement’s validity.
Rebates
A rebate is a variable amount of money that is paid back by the retailer to the buyer at an agreed date, and under agreed conditions. The amount of money is often conditional, for example:
If the customer purchases items for more than
X
EUR between Jan 1st 2023 and Dec 31st 2023, the retailer should pay backY
% of the total invoice price at the beginning of the next year.
Some companies refer to rebates as bonuses.
Several languages do not have a translation for the word rebate. For example, in German and Scandinavian languages, the word rabatt means discount — while there is no other word for rebate.
Rebate Agreement (RBA)
A Rebate Agreement is an agreement of one or more future rebates; the validity date, the payout dates, the parties involved, the conditions, the amounts etc. In Pricefx, this is represented by the Rebate Agreement (RBA) data type.
The structure of the Rebate Agreement resembles that of a Quote, in that it has a Header and multiple Line Items. The header contains information about the agreement as a whole, while the Line Items contain information about the negotiated conditions of the rebates themselves.
Rebate Agreement Header
In the Header section, there is:
A set of fixed inputs that exist natively ([figure_RBA-Header-Example], A).
A set of customizable inputs which are generated by a header logic ([figure_RBA-Header-Example], B).
Rebate Agreement Line Item (RBALI)
The Items section consists of a set of Line Items (RBALI) ([figure_RBA-LineItem], A). Each Line Item represents rebate terms and conditions negotiated for a group of customers and a group of products, commonly including impact of those conditions in the form of calculated Rebate estimations and forecasts. A Rebate Agreement may contain multiple Line Items of different types of rebates, for example:
If the customer purchases
X
% more than the previous year, the retailer pays backY
% of the total invoice price.Retailer pays back
Z
EUR (unconditionally).
A Rebate Agreement may also contain Line Items of the same Rebate Type that are parameterized differently, for example:
If the customer purchases items from product group
A
for more thanX
EUR, the retailer pays backY%
of the total invoice price.If the customer purchases items from product group
B
for more thanZ
EUR, the retailer pays backW%
of the total invoice price.
Each Line Item has a set of inputs ([figure_RBA-LineItem], B), which are populated by the end-user, and a set of outputs ([figure_RBA-LineItem], C) that is the result of the calculation. Typically, the inputs will specify the conditions of the rebate, while the outputs will contain forecasts.
Rebate Type (RBT)
Each Line Item in an Agreement references a Rebate Type, which is an object that determines how a rebate is calculated.
The Rebate Type holds a reference to a Rebate Calculation Logic that performs the calculation. A Rebate Type also has Attribute Columns that are customizable, and can be read by the Logic. Several Rebate Types can thus reference the same logic, but produce different outcomes when used in a Rebate Agreement, if the Attribute Columns of the Rebate Types are configured differently. In this way, Rebate Calculation Logics can be re-used.
Calculating Rebate Agreements
During the negotiation of a Rebate Agreement, the end user can click on the Recalculate button on the Rebate Agreement detail page.
When this button is clicked, then:
The Rebate Header Logic is executed in PrePhase mode.
For each Line Item, the system will execute that Rebate Calculation Logic, which is associated with the Rebate Type of the Line Item.
The Rebate Header Logic is executed in PostPhase mode.
The results/outputs are returned back to the UI and displayed to the user.
When submitted, the Rebate Agreement is locked for editing, recalculated and saved, the approval workflow steps are generated and workflow steps are executed.
Once the Rebate Agreement is locked for editing, it cannot be recalculated manually. It will only be recalculated each time you open it on the screen, but only within the "agreement read-only" context of the calculation logic. Note that in the read-only mode, the header logic is not run, only line items are recalculated. Such result is not saved, only displayed in the UI.
Because the Logics are executed during the negotiation of the Rebate Agreement, i.e., before any transactions have taken place, the rebate amount cannot be calculated yet. Therefore, this calculation typically results in forecasts and estimations of what the final rebate amount may be.
In order for the rebate amount to be calculable,
the Logic needs to produce at least one object of the type Rebate Record (RR).
This is achieved with the Groovy API method rebateRecords.add()
.
The Rebate Record holds a reference to the Line Item’s Rebate Type,
and the copies of all the Line Item input and output values.
How the Rebate Record is used to calculate the rebate amounts is described in the next chapter.
Summary
A Rebate Agreement represents a contract between the buyer and the seller.
A Rebate Agreement has multiple Line Items, which correspond to sets of rebate amounts.
Each Line Item references a Rebate Type, which describes how to calculate a set of rebates (among other things, such as forecasts). Each Rebate Type references a Calculation Logic.
Several Rebate Types may share reusable parts in the same Calculation Logic. To make it possible for the Logic to behave differently for different Rebate Types, use the attribute columns on the Rebate Type to pass “settings” to the logic.
During the negotiation of the Rebate Agreement, the Rebate Calculation Logic typically outputs forecasts.
When a Rebate Agreement is submitted for approval, the Rebate Calculation Logics will produce Rebate Records, which are necessary to later calculate the rebate amounts.
Found an issue in documentation? Write to us.