Class PriceAdjustment

  • public class PriceAdjustment
    extends Object
    This class is in charge of calculating prices for Discounts & Promotions of Price Adjustment type. It is intended to be used from callouts so final price can be seen in advance when editing/creating the line, opposite to the rest of promotions that are not calculated until the document is posted. This is done in this way to keep backwards compatibility.
    • Constructor Detail

      • PriceAdjustment

        public PriceAdjustment()
    • Method Detail

      • calculatePriceActual

        public static BigDecimal calculatePriceActual​(BaseOBObject orderOrInvoice,
                                                      Product product,
                                                      BigDecimal qty,
                                                      BigDecimal priceStd)
        Calculates price actual from price standard applying the Price Adjustments that fit the rules.
      • calculatePriceStd

        public static BigDecimal calculatePriceStd​(BaseOBObject orderOrInvoice,
                                                   Product product,
                                                   BigDecimal qty,
                                                   BigDecimal priceActual)
        Calculates price standard from price actual reverse applying the Price Adjustments that fit the rules.