Ensure Discount Does Not Generate Negative Fixed Charge
This enhancement ensures that when a discount is applied to a fixed rate type, the ensuing Charge Amount is not less than zero. Previously, if the discount to apply was greater than the pre-discount Amount, the Charge was generated with a negative total Amount, resulting in a credit to the customer.
For example, a Discount Amount of $10 was set on a Subscription Item with a Fixed Rate Type with Quantity: 1 and Rate: $5. Previously, the Charge would generate with Quantity: 1, List Rate: $5, Discount: $10 (resulting in an Amount of -$5).
This change ensures that the maximum discount applied cannot be greater than the pre-discount amount. In the above example, the pre-discount amount is calculated as $5 (Quantity * List Rate), resulting in a maximum Discount Amount of $5, and a final Charge Amount of $0.
Currently this behavior change only applies to Fixed Charges; previous behavior still applies to all other Charge Types.