com.ibm.commerce.order.calculation
Interface CalculationScaleLookupCmd
- All Superinterfaces:
- BusinessPolicyCommand, CalculationCmd, ECCommand, TaskCommand
- All Known Subinterfaces:
- NetPriceCalculationScaleLookupCmd, NetPriceWithQuantityAsResultMultiplierCalculationScaleLookupCmd, NetShippingCalculationScaleLookupCmd, NonDiscountedPriceCalculationScaleLookupCmd, QuantityCalculationScaleLookupCmd, QuantitySpreadByNetPriceCalculationScaleLookupCmd, TaxableNetPriceCalculationScaleLookupCmd, TaxableNetPricePlusNetShippingCalculationScaleLookupCmd, TaxableUnitPriceCalculationScaleLookupCmd, TaxableUnitPricePlusUnitShippingCalculationScaleLookupCmd, UnitPriceCalculationScaleLookupCmd, UnitShippingCalculationScaleLookupCmd, WeightCalculationScaleLookupCmd, WeightSpreadByNetPriceCalculationScaleLookupCmd
- public interface CalculationScaleLookupCmd
- extends CalculationCmd
This method is called by CalculationRuleCalculate
to identify:
- base monetary value
- lookup number
- result multiplier
- weight of each
item
of a calculation scale.
This class has two sub-classes, so that Administration User Interfaces can
restrict the list of available CalculationScaleLookupMethods to only the
sub-set that is appropriate for a specific sub-class of CalculationScale.
(QuantityCalculationScaleLookupMethods are appropriate for
QuantityCalculationScales, and MonetaryCalculationScaleLookupMethods are
appropriate for MonetaryCalculationScales.)
Given a set of OrderItems, a CalculationRule, and a CalculationScale,
determine a "lookup number" that can be compared with the CalculationRanges
in the CalculationScale to lookup a RangeLookupResult. Also determine a "base
monetary value" that can be used by a CalculationRangeMethod
. Also return a "result multiplier" by which the
result of the CalculationRangeMethod should be multiplied, and a set of
methematical weights that can be used to spread the result over the set of
OrderItems.
For example, for a percentage discount by quantity, the "lookup number" would
be the sum of the "actual quantities", and the "base monetary value" would be
the sum of the "net prices" of the OrderItems. The "result multiplier" would
be one, and the methematical weights would be the "actual quantities" of the
OrderItems.
For example, for a percentage tax rate that includes shipping charges, both
the "lookup number" and the "base monetary value" would be the sum of the
"net prices" plus the sum of the shipping charges. The "result multiplier"
would be one, and the mathematical weights would be the "net price" plus the
shipping charge of each OrderItem.
For example, for a percentage tax rate that uses a scale that specifies no
tax for children's shoes under $30, both the "lookup number" and the "base
monetary value" would be the sum of the "net prices" of each OrderItem
divided by the "result multiplier". The "result multiplier" would be the sum
of the OrderItem quantities, and the mathematical weights would be the "net
prices" of the OrderItems.
For example, for a percentage tax rate that uses a scale that specifies no
tax for meals under $4, both the both the "lookup number" and the "base
monetary value" would be the sum of the "net prices" of each OrderItem. The
"result multiplier" would be one, and the mathematical weights would be the
"net prices" of the OrderItems.
If a currency or a QuantityUnit cannot be converted, throw a conversion
error.
- See Also:
CalculationRuleCalculateCmd
,
Item
,
CalculationRangeCmd
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
COPYRIGHT
public static final java.lang.String COPYRIGHT
defaultCommandClassName
public static final java.lang.String defaultCommandClassName
NAME
public static final java.lang.String NAME
getBaseMonetaryValue
public java.math.BigDecimal getBaseMonetaryValue()
- Returns the base monetary value.
getLookupNumber
public java.math.BigDecimal getLookupNumber()
- Returns the lookup number.
getResultMultiplier
public java.math.BigDecimal getResultMultiplier()
- Returns the result multiplier.
getWeights
public java.math.BigDecimal[] getWeights()
- Returns the weights of the items.
setItems
public void setItems(Item[] aItems)
- Sets the items.
setRule
public void setRule(CalculationRuleAccessBean aabRule)
- Sets the calculation rule.
setScale
public void setScale(CalculationScaleAccessBean aabScale)
- Sets the calculation scale.