Class PriceServices


  • public class PriceServices
    extends java.lang.Object
    PriceServices - Workers and Services class for product price related functionality
    • Constructor Summary

      Constructors 
      Constructor Description
      PriceServices()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> addGeneralResults​(java.util.Map<java.lang.String,​java.lang.Object> result, GenericValue competitivePriceValue, GenericValue specialPromoPriceValue, GenericValue productStore, java.lang.String checkIncludeVat, java.lang.String currencyUomId, java.lang.String productId, java.math.BigDecimal quantity, java.lang.String partyId, LocalDispatcher dispatcher, java.util.Locale locale)  
      static java.util.Map<java.lang.String,​java.lang.Object> calcPriceResultFromRules​(java.util.List<GenericValue> productPriceRules, java.math.BigDecimal listPrice, java.math.BigDecimal defaultPrice, java.math.BigDecimal promoPrice, java.math.BigDecimal wholesalePrice, GenericValue maximumPriceValue, GenericValue minimumPriceValue, boolean validPriceFound, GenericValue averageCostValue, java.lang.String productId, java.lang.String virtualProductId, java.lang.String prodCatalogId, java.lang.String productStoreGroupId, java.lang.String webSiteId, java.lang.String partyId, java.math.BigDecimal quantity, java.lang.String currencyUomId, Delegator delegator, java.sql.Timestamp nowTimestamp, java.util.Locale locale)  
      static java.util.Map<java.lang.String,​java.lang.Object> calculateProductPrice​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Calculates the price of a product from pricing rules given the following input, and of course access to the database:
      static java.util.Map<java.lang.String,​java.lang.Object> calculatePurchasePrice​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Calculates the purchase price of a product
      static boolean checkPriceCondition​(GenericValue productPriceCond, java.lang.String productId, java.lang.String virtualProductId, java.lang.String prodCatalogId, java.lang.String productStoreGroupId, java.lang.String webSiteId, java.lang.String partyId, java.math.BigDecimal quantity, java.math.BigDecimal listPrice, java.lang.String currencyUomId, Delegator delegator, java.sql.Timestamp nowTimestamp)  
      static java.util.List<GenericValue> makeProducePriceRuleList​(Delegator delegator, boolean optimizeForLargeRuleSet, java.lang.String productId, java.lang.String virtualProductId, java.lang.String prodCatalogId, java.lang.String productStoreGroupId, java.lang.String webSiteId, java.lang.String partyId, java.lang.String currencyUomId)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
      • ONE_BASE

        public static final java.math.BigDecimal ONE_BASE
      • PERCENT_SCALE

        public static final java.math.BigDecimal PERCENT_SCALE
      • taxCalcScale

        public static final int taxCalcScale
      • taxFinalScale

        public static final int taxFinalScale
      • taxRounding

        public static final java.math.RoundingMode taxRounding
    • Constructor Detail

      • PriceServices

        public PriceServices()
    • Method Detail

      • calculateProductPrice

        public static java.util.Map<java.lang.String,​java.lang.Object> calculateProductPrice​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)

        Calculates the price of a product from pricing rules given the following input, and of course access to the database:

        • productId
        • partyId
        • prodCatalogId
        • webSiteId
        • productStoreId
        • productStoreGroupId
        • agreementId
        • quantity
        • currencyUomId
        • checkIncludeVat
      • addGeneralResults

        public static java.util.Map<java.lang.String,​java.lang.Object> addGeneralResults​(java.util.Map<java.lang.String,​java.lang.Object> result,
                                                                                               GenericValue competitivePriceValue,
                                                                                               GenericValue specialPromoPriceValue,
                                                                                               GenericValue productStore,
                                                                                               java.lang.String checkIncludeVat,
                                                                                               java.lang.String currencyUomId,
                                                                                               java.lang.String productId,
                                                                                               java.math.BigDecimal quantity,
                                                                                               java.lang.String partyId,
                                                                                               LocalDispatcher dispatcher,
                                                                                               java.util.Locale locale)
      • makeProducePriceRuleList

        public static java.util.List<GenericValue> makeProducePriceRuleList​(Delegator delegator,
                                                                            boolean optimizeForLargeRuleSet,
                                                                            java.lang.String productId,
                                                                            java.lang.String virtualProductId,
                                                                            java.lang.String prodCatalogId,
                                                                            java.lang.String productStoreGroupId,
                                                                            java.lang.String webSiteId,
                                                                            java.lang.String partyId,
                                                                            java.lang.String currencyUomId)
                                                                     throws GenericEntityException
        Throws:
        GenericEntityException
      • calcPriceResultFromRules

        public static java.util.Map<java.lang.String,​java.lang.Object> calcPriceResultFromRules​(java.util.List<GenericValue> productPriceRules,
                                                                                                      java.math.BigDecimal listPrice,
                                                                                                      java.math.BigDecimal defaultPrice,
                                                                                                      java.math.BigDecimal promoPrice,
                                                                                                      java.math.BigDecimal wholesalePrice,
                                                                                                      GenericValue maximumPriceValue,
                                                                                                      GenericValue minimumPriceValue,
                                                                                                      boolean validPriceFound,
                                                                                                      GenericValue averageCostValue,
                                                                                                      java.lang.String productId,
                                                                                                      java.lang.String virtualProductId,
                                                                                                      java.lang.String prodCatalogId,
                                                                                                      java.lang.String productStoreGroupId,
                                                                                                      java.lang.String webSiteId,
                                                                                                      java.lang.String partyId,
                                                                                                      java.math.BigDecimal quantity,
                                                                                                      java.lang.String currencyUomId,
                                                                                                      Delegator delegator,
                                                                                                      java.sql.Timestamp nowTimestamp,
                                                                                                      java.util.Locale locale)
                                                                                               throws GenericEntityException
        Throws:
        GenericEntityException
      • checkPriceCondition

        public static boolean checkPriceCondition​(GenericValue productPriceCond,
                                                  java.lang.String productId,
                                                  java.lang.String virtualProductId,
                                                  java.lang.String prodCatalogId,
                                                  java.lang.String productStoreGroupId,
                                                  java.lang.String webSiteId,
                                                  java.lang.String partyId,
                                                  java.math.BigDecimal quantity,
                                                  java.math.BigDecimal listPrice,
                                                  java.lang.String currencyUomId,
                                                  Delegator delegator,
                                                  java.sql.Timestamp nowTimestamp)
                                           throws GenericEntityException
        Throws:
        GenericEntityException
      • calculatePurchasePrice

        public static java.util.Map<java.lang.String,​java.lang.Object> calculatePurchasePrice​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Calculates the purchase price of a product