|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.commerce.pricing.OrderSubtotalCalculator
public class OrderSubtotalCalculator
Computes the rawSubtotal
and amount
of an OrderPriceInfo
that corresponds to
the input Order. Unlike the many discount calculators, there is no rule that
determines whether the subtotal should be calculated. The Order's subtotal is
always calculated by adding up the amount
s of the ItemPriceInfos that
the order contains.
If a pricing model (discount) is passed in, it is ignored.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
DETAILED_ITEM_PRICE_AMOUNT_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 | |
---|---|
OrderSubtotalCalculator()
|
Method Summary | |
---|---|
protected double |
calculatePriceFromOrderItems(Order pOrder)
calculates a price from the sum of the order's item prices |
protected double |
calculateShippingGroupSubtotal(OrderPriceInfo pPriceQuote,
Order pOrder,
ShippingGroup pShippingGroup,
java.util.Map pItemQuantities,
java.util.Map pItemPrices,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
This method calculates the subtotal of the shipping group. |
void |
doStartService()
Overrides GenericService's doStartService method to check for null properties |
OrderManager |
getOrderManager()
order manager to consult for various order-related functions |
PricingTools |
getPricingTools()
the PricingTools service to consult for pricing help |
void |
priceOrder(OrderPriceInfo pPriceQuote,
Order pOrder,
RepositoryItem pPricingModel,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Price a single order within a context. |
void |
setOrderManager(OrderManager pOrderManager)
order manager to consult for various order-related functions |
void |
setPricingTools(PricingTools pPricingTools)
the PricingTools service to consult for pricing help |
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 final java.lang.String CLASS_VERSION
public static final java.lang.String DETAILED_ITEM_PRICE_AMOUNT_PROPERTY
Constructor Detail |
---|
public OrderSubtotalCalculator()
Method Detail |
---|
public void setPricingTools(PricingTools pPricingTools)
pPricingTools
- new value to setpublic PricingTools getPricingTools()
public void setOrderManager(OrderManager pOrderManager)
pOrderManager
- new value to setpublic OrderManager getOrderManager()
public void priceOrder(OrderPriceInfo pPriceQuote, Order pOrder, RepositoryItem pPricingModel, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
priceOrder
in interface OrderPricingCalculator
pPriceQuote
- OrderPriceInfo representing the current price quote for the orderpOrder
- The order to pricepPricingModel
- A RepositoryItems representing a PricingModelpProfile
- The user's profilepExtraParameters
- A Map of extra parameters to be used in the pricing, may be null
PricingException
atg.commerce.pricing.PricingTools.#isShippingSubtotalUsesAverageItemPrice
protected double calculatePriceFromOrderItems(Order pOrder)
pOrder
- the order whose item prices will be summed
protected double calculateShippingGroupSubtotal(OrderPriceInfo pPriceQuote, Order pOrder, ShippingGroup pShippingGroup, java.util.Map pItemQuantities, java.util.Map pItemPrices, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws PricingException
shippingItemsSubtotalPriceInfos taxableShippingItemsSubtotalPriceInfos nonTaxableShippingItemsSubtotalPriceInfos
pPriceQuote
- The price info for the orderpOrder
- The order containing the shipping grouppShippingGroup
- The shipping group being pricedpItemQuantities
- A map mapping a commerce item to a quantity. The incoming quantity will be the total
quantity of that item that has been included in the subtotal of other shipping groups.
The quantity will be increased by the quantity contained in pShippingGrouppItemPrices
- A map mapping a commerce item to a price. The price is the total price of the item that has been included
in the subtotals of other shipping groups. Once the pItemQuantities for a given item is reached
this value is used to resolve any potential rounding errors. The pItemPrices for a particular item
will be increased by the price of the item that pShippingGroup's subtotal used.pLocale
- The locale in which all pricing operations should be performedpProfile
- The owner of pOrderpExtraParameters
- Any extra processing information. Unused by this method.
PricingException
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if a required property is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |