|
|||||||||
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.messaging.SourceSinkTemplate atg.commerce.pricing.PricingTools
public class PricingTools
A class which can perform a variety of pricing functions across different types of PricingEngine. It simplifies interaction with a spectrum of PricingEngines. It also has a number of static currency-related methods for use by all pricing engines.
The pricing engines themselves are not tasked with assigning prices to a given CommerceItem.
ShippingGroup or Order. They generate "quotes" whose price info objects can then be associated
with the objects. The pricing methods in this class are designed to perform that association
for the developer automatically. For example, if one invokes the priceOrderTotal
method that will execute the Item Pricing Engine, assign each ItemPriceInfo
to
each CommerceItem, then execute the Shipping Pricing Engine, and assign all shipping costs
to the ShippingGroups, calculate the order subtotal through the Order Pricing Engine, and
determine the amount of taxes owed through the Tax Pricing Engine. Finally it takes the
shipping and tax totals and assigns those into the OrderPriceInfo
object of the
order supplied.
The other methods follow the same methodology, where they generate a quote from a pricing engine and then assign that new price to the object.
There are three main ways one can supply pricing models for pricing. Each type of pricing has overloaded methods which perform these three different styles.
Properties:
ItemPricingEngine
,
TaxPricingEngine
,
ShippingPricingEngine
,
OrderPricingEngine
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
DETAILED_ITEM_PRICE_AMOUNT_PROPERTY
|
static java.lang.String |
DETAILED_ITEM_PRICE_ORDER_DISCOUNT_SHARE_PROPERTY
|
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 | |
---|---|
PricingTools()
Constructs an instanceof PricingTools |
Method Summary | |
---|---|
ItemPriceInfo |
calculatePrice(RepositoryItem pProduct,
RepositoryItem pSku,
long pQuantity)
Return a price for the given quantity of the product and sku. |
ItemPriceInfo |
calculatePrice(RepositoryItem pProduct,
RepositoryItem pSku,
long pQuantity,
boolean pIgnorePromotions,
RepositoryItem pProfile,
java.util.Locale pLocale,
java.util.Map pExtraParameters)
Return a price for the given quantity of the product and sku |
double |
calculateTaxableAmount(CommerceItem pItem,
Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Calculates the taxable amount of an item. |
double |
calculateTaxableAmount(ShippingGroupCommerceItemRelationship pRelationship,
Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Calculates the taxable amount of an relationship. |
double |
calculateTaxableAmountByAverage(ShippingGroupCommerceItemRelationship pRelationship,
Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method does the same thing as calcualteTaxableAmount except the
an average amount is used for the items rather than the actual amount. |
void |
compareClosenessQualifiers(java.util.List pClosenessQualifiers1,
java.util.List pClosenessQualifiers2,
java.lang.String pJMSType,
Order pOrder,
RepositoryItem pProfile)
Checks to see if the closenessQualifiers in the pClosenessQualifiers1 parameter are contained in pClosenessQualifiers2. |
protected void |
compareQualifiers(AmountInfo pOldPriceInfo,
AmountInfo pNewPriceInfo,
Order pOrder,
RepositoryItem pProfile)
|
DetailedItemPriceInfo |
createDetailedItemPriceInfo()
Returns a new instance of the of the class defined through the detailedItemPriceInfoClass property. |
DetailedItemPriceInfo |
createDetailedItemPriceInfo(DetailedItemPriceInfo pDetailedItemPriceInfo)
Returns a new instance of the of the class defined through the detailedItemPriceInfoClass property. |
protected DetailedItemPriceInfo |
createInitialSubSkuDetailedPriceInfo(double pTotalPrice,
ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
java.lang.String pAdjustmentDescription,
atg.core.util.Range pRange)
Create the initial DetailedItemPriceInfos with the given price for the given range |
PriceChanged |
createPriceChangedEvent(Order pOrder,
RepositoryItem pProfile,
CommerceIdentifier pRepricedObject,
AmountInfo pOldPrice)
This method will create a PriceChanged event and send it. |
CommerceItem |
createPricingCommerceItem(java.lang.String pCatalogRefId,
java.lang.String pProductId,
long pQuantity)
Creates a temporary commerceItem object for pricing |
protected AmountInfo |
createSubSkuPriceInfo()
Returns a new instance of the class defined through the subSkuPriceInfoClass
property. |
void |
firePromotionClosenessMessage(java.lang.String pJMSType,
Order pOrder,
RepositoryItem pProfile,
RepositoryItem pClosenessQualifier)
Constructs and sends a PromotionClosenessMessage of the given JMS type (PromotionClosenessQualification or PromotionClosenessDisqualification) |
double |
getAverageItemPrice(CommerceItem pCommerceItem)
This method will return the average price for a given commerce item. |
CatalogTools |
getCatalogTools()
The CatalogTools used to retrieve skus and products |
MessageSender |
getClosenessQualificationMessageSender()
|
CommerceItemManager |
getCommerceItemManager()
Manager class used to manipulate commerce items |
static java.lang.String |
getCurrencySymbol(java.util.Locale pLocale)
Returns the currency symbol for the given locale |
static java.lang.String |
getCurrencySymbol(java.lang.String pLocale)
Returns the currency symbol for the given locale |
static java.text.DecimalFormatSymbols |
getDecimalFormatSymbols(java.util.Locale pLocale)
Returns the DecimalFormatSymbols object for the given locale |
static java.text.DecimalFormatSymbols |
getDecimalFormatSymbols(java.lang.String pLocale)
Returns the DecimalFormatSymbols object for the given locale |
java.util.Locale |
getDefaultLocale()
Returns property DefaultLocale. |
java.lang.Class |
getDetailedItemPriceInfoClass()
The class that is used for detailed item price infos. |
DetailedItemPriceTools |
getDetailedItemPriceTools()
The class for providing various methods for manipulating DetailedItemPriceInfos |
static java.lang.String |
getInternationalCurrencySymbol(java.util.Locale pLocale)
Returns the currency code for the given locale |
static java.lang.String |
getInternationalCurrencySymbol(java.lang.String pLocale)
Returns the currency code for the given locale |
ItemPricingEngine |
getItemPricingEngine()
Returns property ItemPricingEngine |
double |
getItemsOrderDiscountShare(Order pOrder,
CommerceItem pItem,
double pDiscount)
Get a particular items order discount share. |
java.lang.String |
getLoggingIdentifier()
Returns property LoggingIdentifier |
IdGenerator |
getMessageIdGenerator()
The service that generates Ids for all messages. |
java.lang.String |
getMessageIdSpaceName()
The name of the idspace to get our message ids from |
java.lang.String |
getNextMessageId()
Returns the next unique Id for commerce messages. |
OrderManager |
getOrderManager()
Manager class used to manipulate commerce items |
OrderPricingEngine |
getOrderPricingEngine()
Returns property OrderPricingEngine |
OrderTools |
getOrderTools()
The order tools from which to get the default itemPriceInfo class |
RepositoryItem |
getProfile(java.lang.String pProfileId)
Gets the profile repository item with the given id |
java.lang.String |
getProfileItemType()
|
MutableRepository |
getProfileRepository()
|
java.lang.String |
getPromotionClosenessDisqualificationJMSType()
|
java.lang.String |
getPromotionClosenessQualificationJMSType()
|
java.lang.String |
getRangeClassType()
The class used when creating range objects. |
atg.core.util.RangeComparator |
getRangeComparator()
The object that is used to compare ranges |
double |
getRelationshipsSubtotal(java.util.List pRelationships,
java.lang.String pDetailProperty)
This method will return the sum of the amounts of all the DetailedItemPriceInfos that refer to an item in any of these relationship. |
int |
getRoundingDecimalPlaces()
number of decimal places to which prices should be rounded |
java.lang.String |
getScenarioEventPort()
The name of the port to send pricing events to |
double |
getShipItemRelPriceTotal(ShippingGroupCommerceItemRelationship pRelationship,
java.lang.String pDetailProperty)
Sum the amount for all the details that refer to a specific relationship If the range of the relationship is null, 0.0 is returned. |
ShippingGroupCommerceItemRelationship |
getShippingGroupCommerceItemRelationship(CommerceItem pItem,
DetailedItemPriceInfo pPriceInfo)
Return a ShippingGroupCommerceItemRelationship based on the commerceItem and a DetailedItemPriceInfo. |
ShippingPricingEngine |
getShippingPricingEngine()
Returns property ShippingPricingEngine |
java.lang.Class |
getSubSkuPriceInfoClass()
Returns property PriceInfoClass |
TaxPricingEngine |
getTaxPricingEngine()
Returns property TaxPricingEngine |
boolean |
isGeneratePriceChangedEvents()
If this is true, whenever an order gets repriced and the price is different, a PriceChanged event will be sent |
boolean |
isSendEventsWithNoProfile()
It is possible for some orders to have a null profile (if the user was anonymous). |
boolean |
isSendPromotionClosenessMessages()
|
boolean |
isShippingSubtotalUsesAverageItemPrice()
If true, a shipping groups subtotal is calculated by multiplying each item prices' average by the quantity in the given shipping group. |
boolean |
isTaxable(CommerceItem pItem,
ItemPriceInfo pItemPriceInfo,
OrderPriceInfo pOrderPriceInfo,
Order pOrder,
ShippingPriceInfo pShippingPriceInfo,
ShippingGroup pShippingGroup,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Determines whether a CommerceItem is taxable. |
boolean |
isUseDefaultLocaleIfNotSpecified()
Whether to use the default locale if one is not specified |
boolean |
needsRounding(double pNumber)
This method determines whether the input number needs to be rounded based on the value of the roundingDecimalPlaces property. |
void |
performPricingOperation(java.lang.String pPricingOperation,
Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Dispatch off of the Pricing Operation constant supplied to determine what type of pricing should be performed. |
void |
priceEachItem(java.util.List pCommerceItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
protected void |
priceEachItem(java.util.List pCommerceItems,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateItemRanges)
Price all the items, and set each of their priceInfo to the result. |
void |
priceEachItem(java.util.List pCommerceItems,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
void |
priceEachItem(java.util.List pCommerceItems,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
void |
priceItem(CommerceItem pCommerceItem,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the single item, and set it's priceInfo to the result. |
protected void |
priceItem(CommerceItem pCommerceItem,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateItemRanges)
Price all the single item, and set it's priceInfo to the result. |
void |
priceItem(CommerceItem pCommerceItem,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the single item, and set it's priceInfo to the result. |
void |
priceItem(CommerceItem pCommerceItem,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the single item, and set it's priceInfo to the result. |
protected double |
priceItemsForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
protected double |
priceItemsForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateOrderRanges)
Price all the items, and set each of their priceInfo to the result. |
double |
priceItemsForOrderTotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
double |
priceItemsForOrderTotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price all the items, and set each of their priceInfo to the result. |
protected double |
priceOrderForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the sub total and any order level discounts. |
protected double |
priceOrderForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateOrderRanges)
Price the sub total and any order level discounts. |
double |
priceOrderForOrderTotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the sub total and any order level discounts. |
double |
priceOrderForOrderTotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the sub total and any order level discounts. |
OrderPriceInfo |
priceOrderSubtotal(Order pOrder,
java.util.Collection pItemPricingModels,
java.util.Collection pOrderPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, but not shipping and taxes. |
OrderPriceInfo |
priceOrderSubtotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, but not shipping and taxes. |
OrderPriceInfo |
priceOrderSubtotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, but not shipping and taxes. |
OrderPriceInfo |
priceOrderSubtotalShipping(Order pOrder,
java.util.Collection pItemPricingModels,
java.util.Collection pShippingPricingModels,
java.util.Collection pOrderPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all shipping costs, but not taxes. |
OrderPriceInfo |
priceOrderSubtotalShipping(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all shipping costs, but not taxes. |
OrderPriceInfo |
priceOrderSubtotalShipping(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all shipping costs, but not taxes. |
OrderPriceInfo |
priceOrderSubtotalTax(Order pOrder,
java.util.Collection pItemPricingModels,
java.util.Collection pOrderPricingModels,
java.util.Collection pTaxPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all taxes, but not shipping. |
OrderPriceInfo |
priceOrderSubtotalTax(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all taxes, but not shipping. |
OrderPriceInfo |
priceOrderSubtotalTax(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order subtotal, including each item, and all taxes, but not shipping. |
OrderPriceInfo |
priceOrderTotal(Order pOrder)
Computes the order total, including each item, all shipping groups and taxes. |
OrderPriceInfo |
priceOrderTotal(Order pOrder,
java.util.Collection pItemPricingModels,
java.util.Collection pShippingPricingModels,
java.util.Collection pOrderPricingModels,
java.util.Collection pTaxPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order total, including each item, all shipping groups and taxes. |
OrderPriceInfo |
priceOrderTotal(Order pOrder,
java.util.Locale pLocale)
Computes the order total, including each item, all shipping groups and taxes. |
OrderPriceInfo |
priceOrderTotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order total, including each item, all shipping groups and taxes. |
OrderPriceInfo |
priceOrderTotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Computes the order total, including each item, all shipping groups and taxes. |
double |
priceShippingForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price each shipping group, and set their priceInfo's to the result This method will regenerate order ranges if necessary |
protected double |
priceShippingForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateOrderRanges)
Price each shipping group, and set their priceInfo's to the result |
double |
priceShippingForOrderTotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price each shipping group, and set their priceInfo's to the result. |
double |
priceShippingForOrderTotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price each shipping group, and set their priceInfo's to the result. |
double |
priceTaxForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the taxes for the entire order This method will regenerate order ranges if necessary |
protected double |
priceTaxForOrderTotal(Order pOrder,
java.util.Collection pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
boolean pGenerateOrderRanges)
Price the taxes for the entire order |
double |
priceTaxForOrderTotal(Order pOrder,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the taxes for the entire order. |
double |
priceTaxForOrderTotal(Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price the taxes for the entire order. |
double |
round(double pNumber)
Rounds the input number to the number of decimal places specified by the roundingDecimalPlaces property. |
double |
round(double pNumber,
int pRoundingDecimalPlaces)
Rounds the input number to the number of decimal places specified by the pRoundingDecimalPlaces argument. |
double |
roundDown(double pNumber)
Rounds the input number to the number of decimal places specified by the roundingDecimalPlaces property. |
void |
sendPriceChangedEvent(PriceChanged pMessage)
This method will send the given PriceChanged event on the scenarioEventPort port. |
protected void |
sendPromotionClosenessQualificationMessage(PromotionClosenessMessage pMessage)
Sends the given PromotionClosenessMessage. |
void |
setCatalogTools(CatalogTools pCatalogTools)
|
void |
setClosenessQualificationMessageSender(MessageSender pClosenessQualificationMessageSender)
Sets the component that fires PromotionClosenessQualification and PromotionClosenessDisqualification events |
void |
setCommerceItemManager(CommerceItemManager pCommerceItemManager)
|
void |
setDefaultLocale(java.util.Locale pDefaultLocale)
Sets property DefaultLocale |
void |
setDetailedItemPriceInfoClass(java.lang.Class pDetailedItemPriceInfoClass)
|
void |
setGeneratePriceChangedEvents(boolean pGeneratePriceChangedEvents)
|
void |
setItemPricingEngine(ItemPricingEngine pItemPricingEngine)
Sets property ItemPricingEngine |
void |
setLoggingIdentifier(java.lang.String pLoggingIdentifier)
Sets property LoggingIdentifier |
void |
setMessageIdGenerator(IdGenerator pMessageIdGenerator)
|
void |
setMessageIdSpaceName(java.lang.String pMessageIdSpaceName)
|
void |
setOrderManager(OrderManager pOrderManager)
|
void |
setOrderPricingEngine(OrderPricingEngine pOrderPricingEngine)
Sets property OrderPricingEngine |
void |
setOrderTools(OrderTools pOrderTools)
|
void |
setProfileItemType(java.lang.String pProfileItemType)
|
void |
setProfileRepository(MutableRepository pProfileRepository)
|
void |
setPromotionClosenessDisqualificationJMSType(java.lang.String pPromotionClosenessDisqualificationJMSType)
Sets the JMS type of the PromotionClosenessDisqualification message |
void |
setPromotionClosenessQualificationJMSType(java.lang.String pPromotionClosenessQualificationJMSType)
Sets the JMS type of the PromotionClosenessQualification message |
void |
setRangeClassType(java.lang.String pRangeClassType)
|
void |
setRangeComparator(atg.core.util.RangeComparator pRangeComparator)
|
void |
setRoundingDecimalPlaces(int pRoundingDecimalPlaces)
number of decimal places to which prices should be rounded |
void |
setScenarioEventPort(java.lang.String pScenarioEventPort)
|
void |
setSendEventsWithNoProfile(boolean pSendEventsWithNoProfile)
|
void |
setSendPromotionClosenessMessages(boolean pSendPromotionClosenessMessages)
boolean indicating if the promotion-closeness JMS messages should be sent. |
void |
setShippingPricingEngine(ShippingPricingEngine pShippingPricingEngine)
Sets property ShippingPricingEngine |
void |
setShippingSubtotalUsesAverageItemPrice(boolean pShippingSubtotalUsesAverageItemPrice)
|
void |
setSubSkuPrice(CommerceItem pSubItem,
double pUnitPrice,
PricingAdjustment pAdjustment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
java.lang.String pMsg,
RepositoryItem pPriceList)
Create and set the priceinfo object for a subsku. |
void |
setSubSkuPriceInfoClass(java.lang.Class pSubSkuPriceInfoClass)
Sets property SubSkuPriceInfoClass |
void |
setSubSkuSalePrice(CommerceItem pSubItem,
double pSalePrice,
PricingAdjustment pAdjustment,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
java.lang.String pMsg,
RepositoryItem pPriceList)
Update the priceinfo object for a subsku with a sale price. |
void |
setTaxPricingEngine(TaxPricingEngine pTaxPricingEngine)
Sets property TaxPricingEngine |
void |
setUseDefaultLocaleIfNotSpecified(boolean pUseDefaultLocaleIfNotSpecified)
|
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate |
---|
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, receiveMessage, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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
public static final java.lang.String DETAILED_ITEM_PRICE_AMOUNT_PROPERTY
public static final java.lang.String DETAILED_ITEM_PRICE_ORDER_DISCOUNT_SHARE_PROPERTY
Constructor Detail |
---|
public PricingTools()
Method Detail |
---|
public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
public CommerceItemManager getCommerceItemManager()
public void setOrderManager(OrderManager pOrderManager)
public OrderManager getOrderManager()
public void setRangeClassType(java.lang.String pRangeClassType)
public java.lang.String getRangeClassType()
public void setRoundingDecimalPlaces(int pRoundingDecimalPlaces)
pRoundingDecimalPlaces
- new value to setpublic int getRoundingDecimalPlaces()
public void setLoggingIdentifier(java.lang.String pLoggingIdentifier)
public java.lang.String getLoggingIdentifier()
public void setSubSkuPriceInfoClass(java.lang.Class pSubSkuPriceInfoClass)
public java.lang.Class getSubSkuPriceInfoClass()
public void setItemPricingEngine(ItemPricingEngine pItemPricingEngine)
public ItemPricingEngine getItemPricingEngine()
public void setOrderPricingEngine(OrderPricingEngine pOrderPricingEngine)
public OrderPricingEngine getOrderPricingEngine()
public void setTaxPricingEngine(TaxPricingEngine pTaxPricingEngine)
public TaxPricingEngine getTaxPricingEngine()
public void setShippingPricingEngine(ShippingPricingEngine pShippingPricingEngine)
public ShippingPricingEngine getShippingPricingEngine()
public void setProfileRepository(MutableRepository pProfileRepository)
public MutableRepository getProfileRepository()
public void setProfileItemType(java.lang.String pProfileItemType)
public java.lang.String getProfileItemType()
public void setShippingSubtotalUsesAverageItemPrice(boolean pShippingSubtotalUsesAverageItemPrice)
public boolean isShippingSubtotalUsesAverageItemPrice()
PricingTools.getShipItemRelSubtotal
default value is true
public void setRangeComparator(atg.core.util.RangeComparator pRangeComparator)
public atg.core.util.RangeComparator getRangeComparator()
public void setDefaultLocale(java.util.Locale pDefaultLocale)
public java.util.Locale getDefaultLocale()
public DetailedItemPriceTools getDetailedItemPriceTools()
public void setDetailedItemPriceInfoClass(java.lang.Class pDetailedItemPriceInfoClass)
public java.lang.Class getDetailedItemPriceInfoClass()
public void setGeneratePriceChangedEvents(boolean pGeneratePriceChangedEvents)
public boolean isGeneratePriceChangedEvents()
PriceChanged
public void setMessageIdGenerator(IdGenerator pMessageIdGenerator)
public IdGenerator getMessageIdGenerator()
public void setMessageIdSpaceName(java.lang.String pMessageIdSpaceName)
public java.lang.String getMessageIdSpaceName()
public void setScenarioEventPort(java.lang.String pScenarioEventPort)
public java.lang.String getScenarioEventPort()
public void setSendEventsWithNoProfile(boolean pSendEventsWithNoProfile)
public boolean isSendEventsWithNoProfile()
public void setCatalogTools(CatalogTools pCatalogTools)
public CatalogTools getCatalogTools()
public void setOrderTools(OrderTools pOrderTools)
public OrderTools getOrderTools()
public void setUseDefaultLocaleIfNotSpecified(boolean pUseDefaultLocaleIfNotSpecified)
public boolean isUseDefaultLocaleIfNotSpecified()
public void setClosenessQualificationMessageSender(MessageSender pClosenessQualificationMessageSender)
pMessageSender
- the component that fires PromotionClosenessQualification
and PromotionClosenessDisqualification eventspublic MessageSender getClosenessQualificationMessageSender()
public void setPromotionClosenessDisqualificationJMSType(java.lang.String pPromotionClosenessDisqualificationJMSType)
pPromotionClosenessDisqualificationJMSType
- the JMS type of the
PromotionClosenessDisqualificationMessagepublic java.lang.String getPromotionClosenessDisqualificationJMSType()
public void setPromotionClosenessQualificationJMSType(java.lang.String pPromotionClosenessQualificationJMSType)
pPromotionClosenessQualificationJMSType
- the JMS type of the
PromotionClosenessQualificationMessagepublic java.lang.String getPromotionClosenessQualificationJMSType()
public void setSendPromotionClosenessMessages(boolean pSendPromotionClosenessMessages)
pSendPromotionClosenessMessages
- boolean indicating if the
promotion-closeness JMS messages should be sent.public boolean isSendPromotionClosenessMessages()
public static java.lang.String getInternationalCurrencySymbol(java.lang.String pLocale)
DecimalFormatSymbols.getInternationalCurrencySymbol()
public static java.lang.String getInternationalCurrencySymbol(java.util.Locale pLocale)
DecimalFormatSymbols.getInternationalCurrencySymbol()
public static java.lang.String getCurrencySymbol(java.lang.String pLocale)
DecimalFormatSymbols.getCurrencySymbol()
public static java.lang.String getCurrencySymbol(java.util.Locale pLocale)
DecimalFormatSymbols.getCurrencySymbol()
public static java.text.DecimalFormatSymbols getDecimalFormatSymbols(java.lang.String pLocale)
DecimalFormatSymbols
public static java.text.DecimalFormatSymbols getDecimalFormatSymbols(java.util.Locale pLocale)
DecimalFormatSymbols
public PriceChanged createPriceChangedEvent(Order pOrder, RepositoryItem pProfile, CommerceIdentifier pRepricedObject, AmountInfo pOldPrice) throws PricingException
pRepricedObject
must be
pOrder
. If other price change events are needed,
this method should be extended. For example, if you want to
create a ShippingPriceChangedEvent, you should extend this
method to look for a ShippingGroup as the
pRepricedObject
You will probably want the
type
of the PriceChange message to reflect the
kind of price change.
pOrder
- The order that was repricedpProfile
- The owner of the orderpOldPrice
- The previous price of the order
PricingException
public void sendPriceChangedEvent(PriceChanged pMessage)
scenarioEventPort
port.
pMessage
- The scenario event to sendpublic java.lang.String getNextMessageId()
public CommerceItem createPricingCommerceItem(java.lang.String pCatalogRefId, java.lang.String pProductId, long pQuantity) throws CommerceException
pCatalogRefId
- the id of the skupProductId
- the id of the productpQuantity
- the quantity
CommerceException
public RepositoryItem getProfile(java.lang.String pProfileId) throws RepositoryException
pProfileId
- the id of the profile to retrieve
RepositoryException
- if there was an error while retrieving the profilepublic OrderPriceInfo priceOrderTotal(Order pOrder) throws PricingException
amount
of the OrderPriceInfo for the order is updated to include the total shipping and taxes.
This method will use the default locale and fetches the user profile directly from
the order.
This method will regenerate order ranges
PriceChanged
event will be thrown
pOrder
- the order to price
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderTotal(Order pOrder, java.util.Locale pLocale) throws PricingException
amount
of the OrderPriceInfo for the order is updated to include the total shipping and taxes.
This method will use the locale given. If the given locale is null, it will use the
default locale if useDefaultLocaleIfNotSpecified is true. Otherwise, it will call
ServletUtil to determine the user's locale. This method fetches the user profile
directly from the order.
This method will regenerate order ranges
PriceChanged
event will be thrown
pOrder
- the order to pricepLocale
- the locale to consider when pricing
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderTotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
amount
of the OrderPriceInfo for the order is updated to include the total shipping and taxes.
This method will regenerate order ranges
PriceChanged
event will be thrown
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderTotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
amount
of the OrderPriceInfo for the order is updated to include the total shipping and taxes.
This method will regenerate order ranges
PriceChanged
event will be thrown
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderTotal(Order pOrder, java.util.Collection pItemPricingModels, java.util.Collection pShippingPricingModels, java.util.Collection pOrderPricingModels, java.util.Collection pTaxPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
amount
of the OrderPriceInfo for the order is updated to include the total shipping and taxes.
This method will regenerate order ranges
PriceChanged
event will be thrown
pOrder
- the order to pricepItemPricingModels
- the pricing models that affect itemspShippingPricingModels
- the pricing models that affect shippingpOrderPricingModels
- the pricing models that affect the order (e.g. sub total)pTaxPricingModels
- the pricing models that affect taxespLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderSubtotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
PriceChanged
event will be thrown
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderSubtotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
PriceChanged
event will be thrown
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderSubtotal(Order pOrder, java.util.Collection pItemPricingModels, java.util.Collection pOrderPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
generatePriceChangedEvents
then a
PriceChanged
event will be thrown
pOrder
- the order to pricepItemPricingModels
- the pricing models that affect itemspOrderPricingModels
- the pricing models that affect the order (e.g. sub total)pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationcreatePriceChangedEvent(atg.commerce.order.Order, atg.repository.RepositoryItem, atg.commerce.order.CommerceIdentifier, atg.commerce.pricing.AmountInfo)
public OrderPriceInfo priceOrderSubtotalShipping(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic OrderPriceInfo priceOrderSubtotalShipping(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic OrderPriceInfo priceOrderSubtotalShipping(Order pOrder, java.util.Collection pItemPricingModels, java.util.Collection pShippingPricingModels, java.util.Collection pOrderPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepItemPricingModels
- the pricing models that affect itemspShippingPricingModels
- the pricing models that affect shippingpOrderPricingModels
- the pricing models that affect the order (e.g. sub total)pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic OrderPriceInfo priceOrderSubtotalTax(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic OrderPriceInfo priceOrderSubtotalTax(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic OrderPriceInfo priceOrderSubtotalTax(Order pOrder, java.util.Collection pItemPricingModels, java.util.Collection pOrderPricingModels, java.util.Collection pTaxPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepItemPricingModels
- the pricing models that affect itemspOrderPricingModels
- the pricing models that affect the order (e.g. sub total)pTaxPricingModels
- the pricing models that affect taxespLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic void priceItem(CommerceItem pCommerceItem, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic void priceItem(CommerceItem pCommerceItem, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic void priceItem(CommerceItem pCommerceItem, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected void priceItem(CommerceItem pCommerceItem, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateItemRanges) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateItemRanges
- If this is true, CommerceItemManager.generateRangeForItem
is called for each item
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangeForItem(atg.commerce.order.CommerceItem)
public void priceEachItem(java.util.List pCommerceItems, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic void priceEachItem(java.util.List pCommerceItems, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic void priceEachItem(java.util.List pCommerceItems, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected void priceEachItem(java.util.List pCommerceItems, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateItemRanges) throws PricingException
pCommerceItems
- the items to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateItemRanges
- If this is true, CommerceItemManager.generateRangeForItem
is called for each item
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangeForItem(atg.commerce.order.CommerceItem)
public double priceItemsForOrderTotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceItemsForOrderTotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceItemsForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceItemsForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateOrderRanges) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateOrderRanges
- If this is true, CommerceItemManager.generateRangesForOrder
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangesForOrder(atg.commerce.order.Order)
public double priceShippingForOrderTotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceShippingForOrderTotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceShippingForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceShippingForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateOrderRanges) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateOrderRanges
- If this is true, CommerceItemManager.generateRangesForOrder
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangesForOrder(atg.commerce.order.Order)
public double priceOrderForOrderTotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceOrderForOrderTotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceOrderForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceOrderForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateOrderRanges) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateOrderRanges
- If this is true, CommerceItemManager.generateRangesForOrder
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangesForOrder(atg.commerce.order.Order)
public double priceTaxForOrderTotal(Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceTaxForOrderTotal(Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax).pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic double priceTaxForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationprotected double priceTaxForOrderTotal(Order pOrder, java.util.Collection pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, boolean pGenerateOrderRanges) throws PricingException
pOrder
- the order to pricepPricingModels
- the pricing models used in this pricingpLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be nullpGenerateOrderRanges
- If this is true, CommerceItemManager.generateRangesForOrder
PricingException
- if there was an error while computing the pricing informationCommerceItemManager.generateRangesForOrder(atg.commerce.order.Order)
public void performPricingOperation(java.lang.String pPricingOperation, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
atg.commerce.pricing.PricingConstants
interface. They include:
ORDER_TOTAL
ORDER_SUBTOTAL
ORDER_SUBTOTAL_SHIPPING
ORDER_SUBTOTAL_TAX
ITEMS
SHIPPING
ORDER
TAX
NO_REPRICE
pPricingOperation
- the pricing operation to performpOrder
- the order to pricepPricingModels
- the PricingModelHolder is an object which contains all the
pricing models associated with a user (i.e. item, shipping, order and tax). If this is null,
then the pricing models are extracted from the profile through the pricing engines.pLocale
- the locale of the user, may be nullpProfile
- the user, may be nullpExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
- if there was an error while computing the pricing informationpublic boolean isTaxable(CommerceItem pItem, ItemPriceInfo pItemPriceInfo, OrderPriceInfo pOrderPriceInfo, Order pOrder, ShippingPriceInfo pShippingPriceInfo, ShippingGroup pShippingGroup, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
pItem
- the Item whose taxablility is in questionpItemPriceInfo
- the price of the item whose taxability is in questionpOrderPriceInfo
- the price of the order in which pItem residespOrder
- the order in which pItem residespShippingPriceInfo
- the price of the shippingGroup in which pItem residespShippingGroup
- the shippingGroup in which pItem residespLocale
- the locale in which the item is being taxedpProfile
- the person for whom pItem may be taxedpExtraParameters
- any extra information that this method may need to determine
whether pItem is taxable.
PricingException
- if something prevented PricingTools from
determining whether the item is taxable.public double calculateTaxableAmount(CommerceItem pItem, Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
isTaxable
is false) then 0.0 is returned. Otherwise
the items order discount share is subtracted from its amount.
pItem
- The CommerceItem whose taxable amount is returnedpOrder
- The order containing the itempLocale
- The users localepProfile
- The current users profilepExtraParameters
- any extra information that this method may need
PricingException
public double calculateTaxableAmount(ShippingGroupCommerceItemRelationship pRelationship, Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
isTaxable
is
false) then 0.0 is returned. Otherwise the relationships order
discount share is subtracted from its amount. These two numbers
are calculated by adding the relevant properties for each of the
details withing the same range as the relationship.
pItem
- The CommerceItem whose taxable amount is returnedpOrder
- The order containing the itempLocale
- The users localepProfile
- The current users profilepExtraParameters
- any extra information that this method may need
PricingException
getShipItemRelPriceTotal(atg.commerce.order.ShippingGroupCommerceItemRelationship, java.lang.String)
public double calculateTaxableAmountByAverage(ShippingGroupCommerceItemRelationship pRelationship, Order pOrder, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
calcualteTaxableAmount
except the
an average amount is used for the items rather than the actual amount. This is only
relevant if shippingSubtotalUsesAverageItemPrice
is true.
pItem
- The CommerceItem whose taxable amount is returnedpOrder
- The order containing the itempLocale
- The users localepProfile
- The current users profilepExtraParameters
- any extra information that this method may need
PricingException
getShipItemRelPriceTotal(atg.commerce.order.ShippingGroupCommerceItemRelationship, java.lang.String)
public double getAverageItemPrice(CommerceItem pCommerceItem)
shippingSubtotalUsesAverageItemPrice
pCommerceItem
- The item whose average price is returned
public boolean needsRounding(double pNumber)
roundingDecimalPlaces
property.
That is to say, if the input number has more decimal places than N,
where N is the value of roundingDecimalPlaces
, then the
input number needs to be rounded.
pNumber
- the number that may need to be rounded
public double round(double pNumber)
roundingDecimalPlaces
property. Rounds 1 through 4 down,
and 5 through 9 up.
pNumber
- the number to be rounded
public double round(double pNumber, int pRoundingDecimalPlaces)
pRoundingDecimalPlaces
argument. Rounds 1 through 4 down,
and 5 through 9 up.
pNumber
- the number to be roundedpRoundingDecimalPlaces
- the number of decimal places to round to
public double roundDown(double pNumber)
roundingDecimalPlaces
property. Rounds all numbers beyond the
desired number of decimal places to zero.
pNumber
- the number to be rounded
public double getShipItemRelPriceTotal(ShippingGroupCommerceItemRelationship pRelationship, java.lang.String pDetailProperty) throws PricingException
pRelationship
- The relationship to return the subtotal for, using the details within
the same rangepDetailProperty
-
PricingException
public double getRelationshipsSubtotal(java.util.List pRelationships, java.lang.String pDetailProperty) throws PricingException
pRelationships
- The list of relationships to get the amounts forpDetailProperty
- The name of the property in the relationships DetailedItemPriceInfos to sum
PricingException
public double getItemsOrderDiscountShare(Order pOrder, CommerceItem pItem, double pDiscount)
pOrder
- The order containing the itempItem
- The commerce itempDiscount
- The size of the discountpublic ItemPriceInfo calculatePrice(RepositoryItem pProduct, RepositoryItem pSku, long pQuantity) throws PricingException
pProduct
- The product being pricedpSku
- The sku being pricedpQuantity
- The quantity of the sku being priced
PricingException
public ItemPriceInfo calculatePrice(RepositoryItem pProduct, RepositoryItem pSku, long pQuantity, boolean pIgnorePromotions, RepositoryItem pProfile, java.util.Locale pLocale, java.util.Map pExtraParameters) throws PricingException
pProduct
- The product being pricedpSku
- The sku being pricedpQuantity
- The quantity of the sku being pricedpIgnorePromotions
- If true, then no promotions will be considered. If false
then promotions as calculated by priceItem will applypProfile
- The profile used during the price calculationpLocale
- The locale used during the price calculationpExtraParameters
- Any extra parameters that should be considered
PricingException
public ShippingGroupCommerceItemRelationship getShippingGroupCommerceItemRelationship(CommerceItem pItem, DetailedItemPriceInfo pPriceInfo)
pItem
- The commerceItempPriceInfo
- The DetailedItemPriceInfo
protected AmountInfo createSubSkuPriceInfo() throws PricingException
subSkuPriceInfoClass
property.
PricingException
- if there was a problem instantiating the objectpublic DetailedItemPriceInfo createDetailedItemPriceInfo() throws PricingException
detailedItemPriceInfoClass
property.
PricingException
- if there was a problem instantiating the objectpublic DetailedItemPriceInfo createDetailedItemPriceInfo(DetailedItemPriceInfo pDetailedItemPriceInfo) throws PricingException
detailedItemPriceInfoClass
property.
This method also calls detailedItemPriceInfo.copyDetailProperties with
the given detail
PricingException
- if there was a problem instantiating the objectprotected DetailedItemPriceInfo createInitialSubSkuDetailedPriceInfo(double pTotalPrice, ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, java.lang.String pAdjustmentDescription, atg.core.util.Range pRange) throws PricingException
pTotalPrice
- The total price that the new DetailedItemPriceInfos must account forpPriceQuote
- The current working price of pItem
.pItem
- The item that is currently being priced.pPricingModel
- the discount that will be set in the PricingAdjustment (usually null)pProfile
- the person for whom the items are to be discounted (currently ignored)pLocale
- the locale in which the items are to be discounted (currently ignored)pExtraParameters
- any extra information that this method might need to set the
prices of a number of the qualifying item (currently ignored)pAdjustmentDescription
- This is the adjustment description used when creating all new PricingAdjustments
PricingException
public void setSubSkuPrice(CommerceItem pSubItem, double pUnitPrice, PricingAdjustment pAdjustment, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, java.lang.String pMsg, RepositoryItem pPriceList) throws PricingException
pSubItem
- The commerce item corresponding to the sku that need to be pricedpUnitPrice
- The working price of the single subskupAdjustment
- The adjustment associated with this price computation.pPricingModel
- A RepositoryItem representing a PricingModelpLocale
- The user's localepProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
You may override the price list in the profile by providing a price
list (or price list id) in this map. Use profilePriceListPropertyName
as the keypMsg
- This is the adjustment description used when creating new PricingAdjustmentspPriceList
- The priceInfo's pricelist is set to this object.
PricingException
public void setSubSkuSalePrice(CommerceItem pSubItem, double pSalePrice, PricingAdjustment pAdjustment, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, java.lang.String pMsg, RepositoryItem pPriceList) throws PricingException
pSubItem
- The commerce item corresponding to the sku that need to be pricedpSalePrice
- The working price of the single subskupAdjustment
- The adjustment associated with this price computation.pPricingModel
- A RepositoryItem representing a PricingModelpLocale
- The user's localepProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
You may override the price list in the profile by providing a price
list (or price list id) in this map. Use profilePriceListPropertyName
as the keypMsg
- This is the adjustment description used when creating new PricingAdjustmentspPriceList
- The priceInfo's pricelist is set to this object.
PricingException
public void compareClosenessQualifiers(java.util.List pClosenessQualifiers1, java.util.List pClosenessQualifiers2, java.lang.String pJMSType, Order pOrder, RepositoryItem pProfile)
pClosenessQualifiers1
- the Map of closenessQualifiers that are to be
compared against pClosenessQualifiers2pClosenessQualifiers2
- the Map of closenessQualifiers that
pClosenessQualifiers1 is to be compared against.pJMSType
- the JMS type of the message to send if a closenessQualifier
found in pClosenessQualifiers1 is not contained in pClosenessQualifiers2pOrder
- the order that the closenessQualifiers pertain topProfile
- the owner of the orderprotected void compareQualifiers(AmountInfo pOldPriceInfo, AmountInfo pNewPriceInfo, Order pOrder, RepositoryItem pProfile)
public void firePromotionClosenessMessage(java.lang.String pJMSType, Order pOrder, RepositoryItem pProfile, RepositoryItem pClosenessQualifier)
pJMSType
- The JMS type of the messagepOrder
- The order that the closenessQualifier is associated withpProfile
- The owner of the orderpPromotion
- The promotion that is close to being qualified forpClosenessQualifier
- The closenessQualifier that the order satisfiesprotected void sendPromotionClosenessQualificationMessage(PromotionClosenessMessage pMessage)
pMessage
- the message to send
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |