public class TaxDiscountCalculator extends DiscountCalculatorService implements TaxPricingCalculator
Qualifier.findQualifyingOrder for this purpose. If it gets back an order,
a TaxPriceInfo is computed based on the input PricingModel (RepositoryItem).
The discount to apply can be passed in as a DiscountStructure object via the extra parameters map with key
Constants.DISCOUNT_STRUCTURE
or it can be determined from the discountType and adjuster properties of the pricing model.
Qualifier| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
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 |
|---|
TaxDiscountCalculator() |
| Modifier and Type | Method and Description |
|---|---|
void |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
protected double |
getAmountToDiscount(TaxPriceInfo pPriceQuote,
Order pOrder,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This will return the amount that will eventually be discounted.
|
PricingTools |
getPricingTools()
pricing tools to help with generating prices
|
void |
priceTax(TaxPriceInfo pPriceQuote,
Order pOrder,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Tax an order within a context.
|
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with generating prices
|
adjust, adjustAmount, adjustAmount, getAdjuster, getDiscountType, 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 void setPricingTools(PricingTools pPricingTools)
pPricingTools - new value to setpublic PricingTools getPricingTools()
public void priceTax(TaxPriceInfo pPriceQuote, Order pOrder, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceTax in interface TaxPricingCalculatorpPriceQuote - TaxPriceInfo representing the tax quote for the orderpOrder - The order to taxpPricingModel - A Collection of RepositoryItems representing PricingModelspProfile - The user's profilepExtraParameters - A Map of extra parameters to be used in the pricing, may be nullPricingExceptionprotected double getAmountToDiscount(TaxPriceInfo pPriceQuote, Order pOrder, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pPriceQuote - TaxPriceInfo representing the current price quote for the taxpOrder - The order that will be discounted (ignored by default)pPricingModel - A RepositoryItems representing a PricingModel (ignored by default)pProfile - The user's profile (ignored by default)pExtraParameters - A Map of extra parameters to be used in the pricing, may be null (ignored by default)PricingExceptionpublic void doStartService()
throws ServiceException
GenericServicedoStartService in class GenericServiceServiceException - if the Service had a problem starting up