Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On the Rebate agreement Agreement detail page, there are 2 buttons, which cause document recalculationtwo buttons to recalculate the document. The difference is in how many lines are calculated.

  • Recalculate - – Recalculates all line items are recalculated.

  • Recalculate Changes - recalculate – Recalculates only the line items , which have some changes against changed compared to the previously calculated version. (Note , that the button is on in the line item’s panel with input parameters.)

A change of the a line is, for example:

  • change Change of item’s input field

  • change Change of item’s label

  • change Change of item’s result override

  • change Change of header input field

A line item has the field dirty, which is set by the system to true for each line , which should be recalculated.

  • So for "full" recalculation, all items will be marked dirty.

  • For Recalculate Changes, only lines with some changes.

If you want, you can read the value of the item’s dirty field in the header logic’s post-phase, and do only processing of the recalculated items.

...

  1. The user clicks on Recalculate or Recalculate Changes.

  2. The system calls the Rebate header logic in pre-phase.

    • usually Usually the header logic creates input fields on the header, but it can also change the structure of the document.

  3. The system sets the dirty flag for line items, either for all or only for the modified ones.

  4. for For each "dirty" item the system will:

    1. call Call the Rebate calculation (item) logic (only elements from the group agreement)take .

      1. The logic calculates the results for the Rebate Line Item.

      2. The logic creates Rebate Records.

      3. The logic assigns the Rebate Records to Rebate Record Groups.

    2. Take the logic’s element results, and store it them on the line item.

  5. the The system executes the header logic in post-phase.

    • usually Usually the header logic calculates some summarized results and creates the result fields.

  6. the The user can see the recalculated results on the detail screen.