Maximum discount should treat unit and fixed price discounts separately

Description

The maximum discount calculations introduced for determine the maximum discount for a charge using an aggregate i.e.:

If the calculated discount exceeds this amount, it is set to the max discount.
E.g, for a %50 discount, on a $10 unit with a %25 max discount, and a $10 fixed price with a %100 max discount, this yields a discount of $10, as the max discount is $12.50.

The calculation should instead be based on the individual prices, i.e.:

For the example above, this yields $7.50 as:

  • max discounted unit price: $2.50

  • max discounted fixed price: $5

TODO - need to determine how to handle multiple discounts of different types

If the Discount Type has its Include Include Fixed Amount unticked, then the max discount on the fixed price should not be used.

Environment

None

Activity

Details

Assignee

Reporter

Original estimate

Time tracking

3.5h logged

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created May 6, 2019 at 11:48 PM
Updated August 6, 2024 at 1:22 AM
Who's Looking?