java.lang.Object
com.broadleafcommerce.promotion.offer.service.autoconfigure.properties.OfferRoundingProperties
com.broadleafcommerce.promotion.offer.service.autoconfigure.properties.OrderOfferRoundingProperties

public class OrderOfferRoundingProperties extends OfferRoundingProperties
Properties related to offer rounding behaviors for order typed offers.
Author:
Sunny Yu
  • Constructor Details

    • OrderOfferRoundingProperties

      public OrderOfferRoundingProperties()
  • Method Details

    • isRoundDiscountsByItemUnit

      public boolean isRoundDiscountsByItemUnit()
      Whether to round the offer discounts at the item unit level instead of the order level for order typed offers.

      For example, if we have an order with an item that is $99.99 and has a quantity of 3 with applied offer of 20% off order, then the 20% off discount would be rounded at the item unit level. That is, $99.99 x 20% = $19.998, after rounding it would be $20 discount per item unit, then $20 x quantity of 3, then the order's total discount would be $60.

      Whereas if rounding is done at the order level, it'd be $99.99 x 3 x 20% = $59.994, and after rounding the order's total discount would be $59.99.

      Note that the rounding mode used in this example is RoundingMode.HALF_EVEN, other rounding mode would have different values.

    • setRoundDiscountsByItemUnit

      public void setRoundDiscountsByItemUnit(boolean roundDiscountsByItemUnit)
      Whether to round the offer discounts at the item unit level instead of the order level for order typed offers.

      For example, if we have an order with an item that is $99.99 and has a quantity of 3 with applied offer of 20% off order, then the 20% off discount would be rounded at the item unit level. That is, $99.99 x 20% = $19.998, after rounding it would be $20 discount per item unit, then $20 x quantity of 3, then the order's total discount would be $60.

      Whereas if rounding is done at the order level, it'd be $99.99 x 3 x 20% = $59.994, and after rounding the order's total discount would be $59.99.

      Note that the rounding mode used in this example is RoundingMode.HALF_EVEN, other rounding mode would have different values.

    • toString

      public String toString()
      Overrides:
      toString in class OfferRoundingProperties
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class OfferRoundingProperties
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class OfferRoundingProperties
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class OfferRoundingProperties