Rebate Calculations
Logic:
There is a single logic for both Line Item and Rebate Record calculations, so there is a mechanism, how to set up which code of which elements serve which purposes/scenarios. 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 the result of rebate record. The reason for such design is that a big part of calculations performed on the Line Item are also performed on the Rebate Records, so this is the way to avoid duplication of code. For details see Rebate Calculation Logic.
Although the inputs are copied from the rebate agreement line item into the rebate record, the UI will only render those inputs that are created during syntax check. This means that if an input is generated within an logic element that has the calculation context set to agreement, this input field will not be visible on the rebate record detail screen. For details see Rebate Records.
Calculation order:
When a Rebate Record calculation job runs, it sorts the Rebate Records by agreement.uniqueName and rank, so records with a lower rank get calculated first. (Ideally there are no dependencies between Rebate Record calculations, so avoid using the Rank field for this purpose.) For details see Rebate Records.
Different Logic for Rebate Records
The Calculation tab also allows you to specify a logic, which would then be used to calculate the Rebate Records (instead of the logic set on the Condition Type). This is an option in advanced simulation scenarios where the Rebate Record calculation logic deviates too much from the regular accruals calculation logic. For details see Rebate Calculations.
Not Possible to Delete Default Rebate Calculation
Users are not allowed to delete the default Rebate Calculation (since it is necessary to have it for the Rebate Records Mass Submit action). For details see Rebate Calculations.
Rebate Records
Creation
There are no Rebate Records created by default for the line, so you always have to use the function
add()
to add the Rebate Records, otherwise there will be no Rebate Record for the line item. For details see Creation of Rebate Records.The Rebate Records (created by the line item logic) will appear in the list of Rebate Records only after you save the Rebate Agreement. For details see Creation of Rebate Records.
Payout Records
The 'payoutRecords' binding is only available from a Rebate Record calculation context, i.e., the logic that calculates rebate records in a Rebate Record Calculation task (one default task is created automatically for every Rebates module implementation). For details see Payout Records.
During logic testing, the functions on payoutRecords do not do anything, so no records will be stored into database, and ultimately if you will try to read the records using
payoutRecords. find(Filter.isNotNull("name")
, you will get an empty list. For details see Payout Records.
Email Attachments Not Sent
If you want to include attachments in the email sent to approvers, verify that the configuration option Disable Attachments is not enabled. For details see Rebate Agreement Detail.