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