public class ExchangeOrderDiscountCalculator extends OrderDiscountCalculator
The order promotions that are applied are those that have been applied to the promotion evaluation order. The value of each order promotion is a pre-calcuated and stored in the ReturnRequest.
This calculator overrides getAdjuster to return the pre-calcuated value of the promotion. It also
overrides getDicountType to always return the Constants.AMOUNT_OFF type.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
protected ReturnManager |
mReturnManager |
AMOUNT_INCREASE_TYPE, AMOUNT_OFF_TYPE, FIXED_PRICE_TYPE, ILLEGAL_TYPE, mPromotionTools, PERCENT_OFF_TYPESERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
ExchangeOrderDiscountCalculator() |
| Modifier and Type | Method and Description |
|---|---|
protected MatchingObject |
findMatchingObject(OrderPriceInfo pPriceQuote,
java.util.List pPriceQuotes,
java.util.List pItems,
RepositoryItem pPricingModel,
RepositoryItem pProfile,
java.util.Locale pLocale,
Order pOrder,
java.util.Map pExtraParameters)
Overrides the base behavior to unconditionally return a MatchingObject.
|
protected double |
getAdjuster(RepositoryItem pPricingModel,
java.util.Map pExtraParameters)
Overrides the base behavior to return the pre-calculated value for the promotion
that's stored in the ReturnRequest
|
protected java.lang.String |
getDiscountType(RepositoryItem pPricingModel,
java.util.Map pExtraParameters)
Overrides the base behavior to always return the amount off type
|
ReturnManager |
getReturnManager() |
void |
priceOrder(OrderPriceInfo pPriceQuote,
Order pOrder,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Overrides the based behavior to look for a return request passed through the extra parameters map.
|
void |
setReturnManager(ReturnManager pReturnManager)
Sets the ReturnManager
|
adjustOrderSubTotal, adjustShippingGroupSubtotalPriceInfos, applyAdjustmentToNonTaxablePriceInfo, applyAdjustmentToSubtotalPriceInfo, applyAdjustmentToTaxablePriceInfo, computeGroupSubtotal, computeGroupSubtotal, computeGroupSubtotal, createCurrentShareMap, doStartService, getAmountToDiscount, getAmountToDiscount, getDetailsToReceiveDiscountShare, getItemsToReceiveDiscountShare, getNonDiscountableTotal, getNonTaxableShippingGroupTotal, getPricingTools, getTaxableShippingGroupTotal, getTotalForShippingGroups, getTotalShareValueForShippingGroup, isSaveDetailsOrderDiscountShare, isSaveItemsOrderDiscountShare, setPricingTools, setSaveDetailsOrderDiscountShare, setSaveItemsOrderDiscountShare, updateItemsDiscountShare, updateItemsDiscountShare, updateShippingItemsSubtotalMapsadjust, adjustAmount, adjustAmount, getDiscountType, getPricingModelProperties, getPromotionTools, getQualifierService, getQualifierService, isNegativeAmountException, setNegativeAmountException, setPricingModelProperties, setPromotionTools, setQualifierServiceaddLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static final java.lang.String CLASS_VERSION
protected ReturnManager mReturnManager
public void setReturnManager(ReturnManager pReturnManager)
pReturnTools - the ReturnManagerspublic ReturnManager getReturnManager()
public void priceOrder(OrderPriceInfo pPriceQuote, Order pOrder, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceOrder in interface OrderPricingCalculatorpriceOrder in class OrderDiscountCalculatorpPriceQuote - OrderPriceInfo representing the current price quote for the orderpOrder - The order to pricepPricingModel - A RepositoryItems representing a PricingModelpProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingExceptionOrderDiscountCalculator.updateItemsDiscountShare(Order, double, double, double, String, long),
OrderDiscountCalculator.adjustShippingGroupSubtotalPriceInfos(String, OrderPriceInfo, Order, Locale, RepositoryItem, Map, Map, Map)protected double getAdjuster(RepositoryItem pPricingModel, java.util.Map pExtraParameters) throws PricingException
getAdjuster in class DiscountCalculatorServicepPricingModel - RepositoryItem pricing modelpExtraParameters - Map of optional extra parameters, may be nullPricingException - if the method fails to get a valid double adjusterReturnRequest.getExchangeOrderPromotionValue()protected java.lang.String getDiscountType(RepositoryItem pPricingModel, java.util.Map pExtraParameters) throws PricingException
getDiscountType in class DiscountCalculatorServicepPricingModel - RepositoryItem pricing modelpExtraParameters - Map of optional extra parametersPricingException - if the method fails to determine a valid discount type.Constants.AMOUNT_OFFprotected MatchingObject findMatchingObject(OrderPriceInfo pPriceQuote, java.util.List pPriceQuotes, java.util.List pItems, RepositoryItem pPricingModel, RepositoryItem pProfile, java.util.Locale pLocale, Order pOrder, java.util.Map pExtraParameters) throws PricingException