Rebates Tips

Tips and Notes

Topic

Tip

Details

Topic

Tip

Details

Single logic for both Line Item and Rebate Record calculations

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.

Rebate Calculation Logic

Displaying inputs for Rebate Records

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.

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.)

Rebate Records

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).

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.

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.

Payout Records binding

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).

Payout Records

Functions on payoutRecords

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.

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.

Rebate Agreement Detail

 

Found an issue in documentation? Write to us.