Package org.apache.ofbiz.product.price
Class PriceServices
java.lang.Object
org.apache.ofbiz.product.price.PriceServices
PriceServices - Workers and Services class for product price related functionality
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddGeneralResults
(Map<String, Object> result, GenericValue competitivePriceValue, GenericValue specialPromoPriceValue, GenericValue productStore, String checkIncludeVat, String currencyUomId, String productId, BigDecimal quantity, String partyId, LocalDispatcher dispatcher, Locale locale) calcPriceResultFromRules
(List<GenericValue> productPriceRules, BigDecimal listPrice, BigDecimal defaultPrice, BigDecimal promoPrice, BigDecimal wholesalePrice, GenericValue maximumPriceValue, GenericValue minimumPriceValue, boolean validPriceFound, GenericValue averageCostValue, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, String currencyUomId, Delegator delegator, Timestamp nowTimestamp, Locale locale) calculateProductPrice
(DispatchContext dctx, Map<String, ? extends Object> context) Calculates the price of a product from pricing rules given the following input, and of course access to the database:calculatePurchasePrice
(DispatchContext dctx, Map<String, ? extends Object> context) Calculates the purchase price of a productstatic boolean
checkPriceCondition
(GenericValue productPriceCond, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, BigDecimal listPrice, String currencyUomId, Delegator delegator, Timestamp nowTimestamp) static List<GenericValue>
makeProducePriceRuleList
(Delegator delegator, boolean optimizeForLargeRuleSet, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, String currencyUomId)
-
Constructor Details
-
PriceServices
public PriceServices()
-
-
Method Details
-
calculateProductPrice
public static Map<String,Object> calculateProductPrice(DispatchContext dctx, Map<String, ? extends Object> context) Calculates the price of a product from pricing rules given the following input, and of course access to the database:
- productId
- productCategoryId
- partyId
- partyClassificationGroupId
- prodCatalogId
- webSiteId
- productStoreId
- productStoreGroupId
- agreementId
- quantity
- currencyUomId
- checkIncludeVat
-
addGeneralResults
public static Map<String,Object> addGeneralResults(Map<String, Object> result, GenericValue competitivePriceValue, GenericValue specialPromoPriceValue, GenericValue productStore, String checkIncludeVat, String currencyUomId, String productId, BigDecimal quantity, String partyId, LocalDispatcher dispatcher, Locale locale) -
makeProducePriceRuleList
public static List<GenericValue> makeProducePriceRuleList(Delegator delegator, boolean optimizeForLargeRuleSet, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, String currencyUomId) throws GenericEntityException - Throws:
GenericEntityException
-
calcPriceResultFromRules
public static Map<String,Object> calcPriceResultFromRules(List<GenericValue> productPriceRules, BigDecimal listPrice, BigDecimal defaultPrice, BigDecimal promoPrice, BigDecimal wholesalePrice, GenericValue maximumPriceValue, GenericValue minimumPriceValue, boolean validPriceFound, GenericValue averageCostValue, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, String currencyUomId, Delegator delegator, Timestamp nowTimestamp, Locale locale) throws GenericEntityException - Throws:
GenericEntityException
-
checkPriceCondition
public static boolean checkPriceCondition(GenericValue productPriceCond, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, BigDecimal listPrice, String currencyUomId, Delegator delegator, Timestamp nowTimestamp) throws GenericEntityException - Throws:
GenericEntityException
-
calculatePurchasePrice
public static Map<String,Object> calculatePurchasePrice(DispatchContext dctx, Map<String, ? extends Object> context) Calculates the purchase price of a product
-