|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.pricing.priceLists.ItemSalesTieredPriceCalculator
public class ItemSalesTieredPriceCalculator
A calculator which determines the sales tiered price of an item and sets the itemPriceInfo to be that amount.
The definition of tiered pricing can be referenced in ItemTieredPriceCalculator
ItemTieredPriceCalculator
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ItemSalesTieredPriceCalculator()
|
Method Summary | |
---|---|
protected void |
addToSalesLevel(long pQuantity,
double pTotal,
java.util.List pSalesLevel)
|
protected java.util.List |
adjustmentDetailedItemPriceInfo(DetailedItemPriceInfo pOldItemPriceInfo,
java.util.List pSalesLevel,
java.util.List pAdjustments)
Sets the DetailedItemPriceInfo for its ItemPriceInfo. |
ItemPriceSource |
getItemPriceSource(ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method is called by the calculator to return the ItemPriceSource that
should be used to price the given CommerceItem |
protected double |
getListTotalForRange(java.util.List pListLevels,
long pStartRange,
long pEndRange)
Using the given levels for list prices, returns the total list price for the given range. |
java.lang.String |
getPriceLevelPropertyName()
the name of the property for the PriceLevel |
java.util.List |
getPriceLevels(ItemPriceSource pItemPriceSource,
RepositoryItem pPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method is called by the calculator to provide the List of priceLevel repository items used to price the given commerce item. |
java.lang.String |
getPricePropertyName()
the name of the property for the price of each price level |
PricingTools |
getPricingTools()
pricing tools to help with price calculation |
java.lang.String |
getQuantityPropertyName()
the name of the property for the quantity of each price level |
java.lang.String |
getSalesComplexPricePropertyName()
the name of the property for the SalesComplexPrice |
boolean |
populateItemPriceSource(ItemPriceSource pItemPriceSource,
Order pOrder,
CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem,
java.util.Map pExtraParameters)
Generates the ItemPriceSource saleVolumeLevels based on the PricingAdjustments
added by this calculator to the given CommerceItem. |
void |
priceItem(RepositoryItem pPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Sets the tiered price with the given determined price. |
void |
setPriceLevelPropertyName(java.lang.String pPriceLevelPropertyName)
the name of the property for the PriceLevel |
void |
setPricePropertyName(java.lang.String pPricePropertyName)
the name of the property for the price of each price level |
void |
setPricingTools(PricingTools pPricingTools)
pricing tools to help with price calculation |
void |
setQuantityPropertyName(java.lang.String pQuantityPropertyName)
the name of the property for the quantity of each price level |
void |
setSalesComplexPricePropertyName(java.lang.String pSalesComplexPricePropertyName)
the name of the property for the SalesComplexPrice |
boolean |
shouldConsumeSource(ItemPriceSource pItemPriceSource)
This implementation is only here to satisfy the interface. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ItemSalesTieredPriceCalculator()
Method Detail |
---|
public void setPricingTools(PricingTools pPricingTools)
pPricingTools
- new value to setpublic PricingTools getPricingTools()
public void setSalesComplexPricePropertyName(java.lang.String pSalesComplexPricePropertyName)
pSalesComplexPricePropertyName
- new value to setpublic java.lang.String getSalesComplexPricePropertyName()
public void setPriceLevelPropertyName(java.lang.String pPriceLevelPropertyName)
pPriceLevelPropertyName
- new value to setpublic java.lang.String getPriceLevelPropertyName()
public void setQuantityPropertyName(java.lang.String pQuantityPropertyName)
pQuantityPropertyName
- new value to setpublic java.lang.String getQuantityPropertyName()
public void setPricePropertyName(java.lang.String pPricePropertyName)
pPricePropertyName
- new value to setpublic java.lang.String getPricePropertyName()
protected void addToSalesLevel(long pQuantity, double pTotal, java.util.List pSalesLevel)
protected java.util.List adjustmentDetailedItemPriceInfo(DetailedItemPriceInfo pOldItemPriceInfo, java.util.List pSalesLevel, java.util.List pAdjustments)
pQuantity
- The quantity to set in the DetailedItemPriceInfopTotal
- The total amount to set in the DetailedItemPriceInfopPriceQuote
- ItemPriceInfo representing the current price quote for the itempDetailList
- The list of DetailedItemPriceInfo for the current ItemPriceInfopAdjustments
- The list of PriceAdjustment for the current ItemPriceInfo
public void priceItem(RepositoryItem pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
This method calls getPriceLevels
to determine the list of
price levels that should be used to price the item.
priceItem
in interface ItemSchemePriceCalculator
pPrice
- the price as extracted from the PriceListpPriceQuote
- ItemPriceInfo representing the current price quote for the itempItem
- The item to pricepPricingModel
- A RepositoryItem representing a PricingModelpLocale
- the locale in which this item should be pricedpProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was a problem pricing the input pItem#getPriceLevels(RepositoryItem, ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
public java.util.List getPriceLevels(ItemPriceSource pItemPriceSource, RepositoryItem pPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
This method first checks for a ItemPriceSource
and returns its sale volume levels. Otherwise,
it returns the levels from the given price repository item.
pItemPriceSource
- the ItemPriceSource
that is being use to price the item. The value can be null when
no source is being used.pPrice
- the price object found for the item. This value can be null when a price source is being used.pPriceQuote
- the current price infopItem
- the item being pricedpPricingModel
- pLocale
- pProfile
- pExtraParameters
- the extra parameter map
PricingException
public ItemPriceSource getItemPriceSource(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
ItemPriceSource
that
should be used to price the given CommerceItem
getItemPriceSource
in interface ItemPriceSourceHandler
pPriceQuote
- the new ItemPriceInfo for that's being generated in the pricing operationpItem
- the commerce item that's being pricedpPricingModel
- the current pricing modelpLocale
- the localepProfile
- the customer profile referencepExtraParameters
- the extra parameter map passed to the pricing operation.
PricingTools.getItemPriceSource(ItemPriceInfo, CommerceItem, RepositoryItem, Locale, RepositoryItem, Map)
public boolean populateItemPriceSource(ItemPriceSource pItemPriceSource, Order pOrder, CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.util.Map pExtraParameters)
ItemPriceSource saleVolumeLevels
based on the PricingAdjustments
added by this calculator to the given CommerceItem. The PricingAdjustments are used to reverse engineer the levels used to originally price
the item. Note that the levels can only be determined up to the last one used to originally price the item.
populateItemPriceSource
in interface ItemPriceSourceHandler
pItemPriceSource
- the source being generated and populated with pricing data.pOrder
- the OrderpCommerceItem
- the item for which the source is being createdpParentCommerceItem
- the item that contained pCommerceItempExtraParameters
- a Map of extra parameters objects that was passed to the initial call to generate the source objects.
ItemPriceSource
properties were updatedprotected double getListTotalForRange(java.util.List pListLevels, long pStartRange, long pEndRange)
This method is used when reverse engineering the sale calculator adjustments into the original tier levels.
Since the adjustment values added by the sale calculator are relative to the list cost, the list must be known to calculate the sale tier price.
pListLevels
- the list price levelspStartRange
- the start of the range for which the total list price is determinedpEndRange
- the end of the range for which the total list price is determine
public boolean shouldConsumeSource(ItemPriceSource pItemPriceSource)
priceListScheme
in the ItemPriceSource
shouldConsumeSource
in interface ItemPriceSourceHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |