|
|||||||||
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
|
static java.lang.String |
DETAILED_ITEM_PRICE_ORDER_MANUAL_ADJUSTMENT_SHARE_PROPERTY
|
protected ItemPriceSourceHandler[] |
mItemPriceSourceHandlers
|
protected boolean |
mUsingPriceLists
|
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 | |
---|---|
protected void |
addPriceBeanForInfo(DetailedItemPriceInfo pInfo,
java.util.List pBeans)
Given a DetailedItemPrice info, check the list of beans to see if one has the same unit price and pricing model adjusters. |
double |
calculateItemsOrderManualAdjustmentShare(CommerceItem pCommerceItem)
Adds up the manual adjustment share from the item's detailedItemPriceInfos |
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(CommerceItemRelationship 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. |
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 |
ItemPriceSource |
createItemPriceSource(CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem,
java.lang.String pCurrencyCode)
Creates a new ItemPriceSource object based on the given item and parent item. |
ItemPriceSource |
createItemPriceSource(java.lang.String pProductId,
java.lang.String pSkuId,
java.lang.String pParentSkuId,
java.lang.String pCommerceItemType,
java.lang.String pCurrencyCode)
Instantiates a new ItemPriceSource object with the given parameters. |
OrderPriceInfo |
createOrderPriceInfo()
Returns a new instance of the class defined through the OrderTools.defaultOrderPriceInfoClass
property. |
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 |
deriveUsingPriceLists()
Figure out if the system is configured to use price lists or not. |
boolean |
doesOrderContainPriceLists(Order pOrder)
Returns true if the order contains any price lists on the commerce item price info objects |
void |
doStartService()
Derives some property values based on configuration settings |
java.util.List |
findAdjustmentsByDescription(ItemPriceInfo pItemPriceInfo,
java.lang.String pDescription)
Returns all the PricingAdjustments found in
the price info's adjustments property whose description
matches the given description |
ItemPriceSource |
findMatchingSource(java.util.Collection pItemPriceSource,
CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem,
java.lang.String pCurrencyCode)
Iterates over the collection of ItemPriceSource objects and returns the first one that matches the given item and parent item combination |
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) |
protected void |
generateItemPriceSources(java.util.List pItemPriceSources,
Order pOrder,
CommerceItem pCommerceItem,
CommerceItem pParentCommerceItem,
java.lang.String pCurrencyCode,
java.util.Map pExtraParameters)
Creates a new ItemPriceSource object and calls each handler to populate its values. |
java.util.List |
generateItemPriceSources(Order pOrder,
java.util.Map pExtraParameters)
Generates a List of ItemPriceSource objects based on the pricing information
contained in the given Order. |
java.util.Map |
generateItemPricingSourceMap(java.util.List pItemPriceSources,
java.util.List pCommerceItems,
CommerceItem pParentCommerceItem,
java.lang.String pCurrencyCode)
Maps the CommerceItems to the ItemPriceSource objects |
java.lang.Object |
generateKeyForTieredProcessedItem(CommerceItem pItem)
Called by the tiered pricing calculators to generate the key used to store the quantity info about an Item processed during the pricing operation. |
java.util.List |
generatePriceBeans(CommerceItem pItem)
Given a commerce item, loop through its detailed item price infos and create the price beans. |
java.util.List |
generatePriceBeans(java.util.List<DetailedItemPriceInfo> pInfos)
Given a list of detailed item price infos, loop through each one and create the price beans. |
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 |
ItemPriceSource |
getItemPriceSource(ItemPriceInfo pPriceQuote,
CommerceItem pItem,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method returns the ItemPriceSource mapped to the commerce item
id in the pricing overide Map stored in the extra parameters. |
ItemPriceSourceHandler[] |
getItemPriceSourceHandlers()
Configures an array of ItemPriceSourceHandler components
that are used to generate price overrides. |
ItemPricingEngine |
getItemPricingEngine()
Returns property ItemPricingEngine |
double |
getItemsOrderDiscountShare(Order pOrder,
CommerceItem pItem,
double pDiscount)
Get a particular items order discount share. |
RepositoryItem |
getListPriceListFromOrder(Order pOrder)
Returns the list price list from the order. |
java.util.Locale |
getLocale(java.util.Locale pLocale)
|
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 |
getPriceList(RepositoryItem pProfile,
java.lang.String pPriceListPropertyName,
boolean pUseDefaultPriceList,
java.util.Map pExtraParameters)
Gets the price list. |
RepositoryItem |
getPriceListFromParameters(java.util.Map pExtraParameters,
java.lang.String pPriceListPropertyName)
Get the price list from the extra parameters. |
PriceListManager |
getPriceListManager()
Returns the reference to the PriceListManager which handles the operations of the PriceList |
PricingContextFactory |
getPricingContextFactory()
Factory to create PricingContext instances |
java.util.Locale |
getPricingLocale(RepositoryItem pProfile,
java.lang.String pPriceListPropertyName,
boolean pUseDefaultPriceList,
java.util.Map pExtraParameters,
java.util.Locale pLocale)
Gets the locale for pricing. |
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 |
RepositoryItem |
getSalePriceListFromOrder(Order pOrder)
Returns the sale price list from the order. |
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 |
long |
getTotalQuantityForBulkPricing(java.util.List pItems,
CommerceItem pItem)
Returns the total quantity of the items in the List that match the given pItem. |
boolean |
isGeneratePriceChangedEvents()
If this is true, whenever an order gets repriced and the price is different, a PriceChanged event will be sent |
protected boolean |
isMatchForBulkPricing(CommerceItem pItem1,
CommerceItem pItem2)
determines if the two items should be considered a match for aggregating quantity |
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 |
isUsePassedLocaleAsPricingLocale()
Returns the boolean value of usePassedLocaleAsPricingLocale which if true means getPricingLocale will just return the locale passed into it. |
boolean |
isUsingPriceLists()
Sets property usingPriceLists, which indicates whether the application uses price lists or SKU-based pricing. |
boolean |
isUsingPriceListsExplicitlySet()
This will return true if the value of usingPriceLists has been
explicitly set either through code or through a properties file. |
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 |
setItemPriceSourceHandlers(ItemPriceSourceHandler[] pItemPriceSourceHandlers)
|
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 |
setPriceListManager(PriceListManager pPriceListManager)
Sets property PriceListManager which handles the operations of the PriceList |
void |
setPricingContextFactory(PricingContextFactory pPricingContextFactory)
|
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)
|
void |
setUsePassedLocaleAsPricingLocale(boolean pUsePassedLocaleAsPricingLocale)
Sets property usePassedLocaleAsPricingLocale which if true means getPricingLocale will just return the locale passed into it rather than trying to determine it from the price list or the default Defaults to false. |
void |
setUsingPriceLists(boolean pUsingPriceLists)
Sets property usingPriceLists, which indicates whether the application uses price lists or SKU-based pricing. |
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
public static final java.lang.String DETAILED_ITEM_PRICE_ORDER_MANUAL_ADJUSTMENT_SHARE_PROPERTY
protected ItemPriceSourceHandler[] mItemPriceSourceHandlers
protected boolean mUsingPriceLists
Constructor Detail |
---|
public PricingTools()
Method Detail |
---|
public ItemPriceSourceHandler[] getItemPriceSourceHandlers()
ItemPriceSourceHandler
components
that are used to generate price overrides.
If null, this method will dynamically build the array of handlers from the ItemPriceEngine's preCalculators.
generateItemPriceSources(Order, Map)
public void setItemPriceSourceHandlers(ItemPriceSourceHandler[] pItemPriceSourceHandlers)
public void setPricingContextFactory(PricingContextFactory pPricingContextFactory)
public PricingContextFactory getPricingContextFactory()
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 void setPriceListManager(PriceListManager pPriceListManager)
pPriceListManager
- the new value to setpublic PriceListManager getPriceListManager()
public void setUsePassedLocaleAsPricingLocale(boolean pUsePassedLocaleAsPricingLocale)
pUsePassedLocaleAsPricingLocale
- the new boolean value to setpublic boolean isUsePassedLocaleAsPricingLocale()
public void setUsingPriceLists(boolean pUsingPriceLists)
pUsingPriceLists
- the new boolean value to setpublic boolean isUsingPriceLists()
public boolean isUsingPriceListsExplicitlySet()
usingPriceLists
has been
explicitly set either through code or through a properties file.
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void deriveUsingPriceLists()
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 java.util.Locale getLocale(java.util.Locale pLocale)
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 calculateItemsOrderManualAdjustmentShare(CommerceItem pCommerceItem)
pCommerceItem
-
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 calculateTaxableAmountByAverage(CommerceItemRelationship 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.
pRealationship
- The relationship 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 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
public OrderPriceInfo createOrderPriceInfo() throws PricingException
OrderTools.defaultOrderPriceInfoClass
property.
PricingException
- if there was a problem instantiating the objectprotected 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 sendpublic boolean doesOrderContainPriceLists(Order pOrder)
pOrder
-
public RepositoryItem getListPriceListFromOrder(Order pOrder)
The price list is found by looking for a commerce item that is not on sale with a price list associated.
pOrder
-
public RepositoryItem getSalePriceListFromOrder(Order pOrder)
The price list from the first on sale commerce item in the order is returned. with a price list associated.
pOrder
-
public java.util.Locale getPricingLocale(RepositoryItem pProfile, java.lang.String pPriceListPropertyName, boolean pUseDefaultPriceList, java.util.Map pExtraParameters, java.util.Locale pLocale)
pProfile
- RepositoryItem profilepProfilePriceListPropertyName
- String name of the price list property in the profilepUseDefaultPriceList
- boolean, true to use the default price list if neededpExtraParameters
- Optional map of extra parameters which may include the price listpLocale
- Locale to use if no price list or default locale is found
public RepositoryItem getPriceList(RepositoryItem pProfile, java.lang.String pPriceListPropertyName, boolean pUseDefaultPriceList, java.util.Map pExtraParameters) throws PriceListException
pProfile
- RepositoryItem profilepPriceListPropertyName
- String name of the price list property in the profilepUseDefaultPriceList
- boolean, true to use the default if one isn't found in the profilepExtraParameters
- Optional map of extra parameters which may include the price list
PriceListException
public RepositoryItem getPriceListFromParameters(java.util.Map pExtraParameters, java.lang.String pPriceListPropertyName) throws PriceListException
pExtraParameters
- Map of extra parameters to look uppPriceListPropertyName
- String name of the price list in the extra parameters map,
if null then PriceListManager.priceListPropertyName is used.
PriceListException
public java.util.List generatePriceBeans(CommerceItem pItem)
pItem
- The commerce item to generate beans for
public java.util.List generatePriceBeans(java.util.List<DetailedItemPriceInfo> pInfos)
pInfos
- The list of DetailedItemPriceInfo
protected void addPriceBeanForInfo(DetailedItemPriceInfo pInfo, java.util.List pBeans)
pInfo
- The detailed item price info to get data frompBeans
- List of UnitPriceBeanspublic ItemPriceSource createItemPriceSource(java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, java.lang.String pCommerceItemType, java.lang.String pCurrencyCode)
pProductId
- the productid to which the source appliespSkuId
- the skuid to which the source appliespParentSkuId
- the parent sku id to which the source appliespCommerceItemType
- the commerce item type to which the source appliespCurrencyCode
- the currency to which the source applies.
public ItemPriceSource createItemPriceSource(CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.lang.String pCurrencyCode)
pCommerceItem
- pParentCommerceItem
- pCurrencyCode
- the currency for which the source object can apply
createItemPriceSource(String, String, String, String, String)
public java.util.List generateItemPriceSources(Order pOrder, java.util.Map pExtraParameters)
ItemPriceSource
objects based on the pricing information
contained in the given Order.
One
ItemPriceSource
is generated for each item in the order. Each configured
ItemPriceSource
is called once for each
ItemPriceSource
to populate it values.
pExtraParameters
- Map of extra parameters that will passed through to the handlers
that generate the source objects.
protected void generateItemPriceSources(java.util.List pItemPriceSources, Order pOrder, CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.lang.String pCurrencyCode, java.util.Map pExtraParameters)
pItemPriceSources
- the current list of source objects. the new source object will be appended to this ListpOrder
- the order that contains the commerce itempCommerceItem
- the commerce item from which the source object will be createdpParentCommerceItem
- the parent commerce item of pCommerceItem. this can be nullpCurrencyCode
- pExtraParameters
- public java.util.Map generateItemPricingSourceMap(java.util.List pItemPriceSources, java.util.List pCommerceItems, CommerceItem pParentCommerceItem, java.lang.String pCurrencyCode)
CommerceItems
to the ItemPriceSource
objects
This method is called by the ItemPricingEngine to map a List of source objects to the items being priced in the current pricing operation.
If a CommerceItem
is a CommerceItemContainer
this
method is recursive in order to match the contained items as well.
pItemPriceSources
- the ItemPriceSource objects to match with the items.pCommerceItems
- the CommerceItems to matchpParentCommerceItem
- optional parent commerce item that contains
the list of commerce items. If not null, the parent sku must match
the parent sku in the override.pCurrencyCode
- the currency code of the current pricing operation. This
currency must match the currency code in the ItemPriceSource for it to be mapped to an
item.
ItemPriceSource
public ItemPriceSource findMatchingSource(java.util.Collection pItemPriceSource, CommerceItem pCommerceItem, CommerceItem pParentCommerceItem, java.lang.String pCurrencyCode)
pItemPriceSource
- pCommerceItem
- pParentCommerceItem
- pCurrencyCode
- if provided the currency code must be the same for a successful match
ItemPriceSource.isItemMatch(CommerceItem, CommerceItem)
public ItemPriceSource getItemPriceSource(ItemPriceInfo pPriceQuote, CommerceItem pItem, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters)
ItemPriceSource
mapped to the commerce item
id in the pricing overide Map stored in the extra parameters.
Calculators use this method to determine if an ItemPriceSource was passed into the pricing operation through the extra parameters.
pItem
- the CommerceItem
for which a ItemPriceSource should be returnedpExtraParams
- the pricing operations extra parameters Map
PricingConstants.ITEM_PRICE_SOURCE_MAP_PARAM
public java.util.List findAdjustmentsByDescription(ItemPriceInfo pItemPriceInfo, java.lang.String pDescription)
PricingAdjustments
found in
the price info's adjustments
property whose description
matches the given description
pItemPriceInfo
- the price info containing the adjustments.pDescription
- the description to match
public long getTotalQuantityForBulkPricing(java.util.List pItems, CommerceItem pItem)
This method is used by the bulk pricing calculators to aggregate quantity for matching items so the correct level is used across the items.
pItems
- pItem
-
isMatchForBulkPricing(CommerceItem, CommerceItem)
protected boolean isMatchForBulkPricing(CommerceItem pItem1, CommerceItem pItem2)
pItem1
- pItem2
-
By default, the product id and sku id must be equal to be considered a match.
public java.lang.Object generateKeyForTieredProcessedItem(CommerceItem pItem)
This quantity info is used to maintain tier levels across multiple items that reference the same product/sku combination. By default the key returned is a String concat of the product id and sku id.
pItem
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |