Package org.apache.ofbiz.product.price
Class PriceServices
- java.lang.Object
-
- org.apache.ofbiz.product.price.PriceServices
-
public class PriceServices extends java.lang.Object
PriceServices - Workers and Services class for product price related functionality
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
static java.math.BigDecimal
ONE_BASE
static java.math.BigDecimal
PERCENT_SCALE
static java.lang.String
resource
static int
taxCalcScale
static int
taxFinalScale
static java.math.RoundingMode
taxRounding
-
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 productstatic 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)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
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
-
-
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
-
-