com.ibm.commerce.order.calculation
Interface CalculationCodeCalculateCmd

All Superinterfaces:
BusinessPolicyCommand, CalculationCmd, TaskCommand
All Known Implementing Classes:
CalculationCodeCalculateCmdImpl

public interface CalculationCodeCalculateCmd
extends CalculationCmd

Given a calculation code and a list of items, this command will calculate the value of the calculation code for each item.

For sales/shipping tax only, the caller has to specify the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store. This command will calculate the value of the calculation code for each tax category specified.

For more information, refer to the default implementation of this command, CalculationCodeCalculateCmdImpl.

This is also the base interface that commands registered as calculation methods of type "CalculationCodeCalculate" must extend.

This command is registered as the following bootstrap calculation methods:

Calculation Method ID Calculation Usage ID Name
-3 -1 CalculationCodeCalculate (discount)
-23 -2 CalculationCodeCalculate (shipping)
-43 -3 CalculationCodeCalculate (sales tax)
-63 -4 CalculationCodeCalculate (shipping tax)
-5003 -5 CalculationCodeCalculate (coupon)

Field Summary
static java.lang.String COPYRIGHT
          The IBM copyright notice field.
static java.lang.String defaultCommandClassName
          The default implementation of this command.
static java.lang.String NAME
          The name of this command.
 
Method Summary
 java.math.BigDecimal[] getValues()
          Returns the values corresponding to the items.
 java.math.BigDecimal[] getValues(java.lang.Integer anTaxCategoryId)
          Returns the values for a tax category.
 void setCode(CalculationCodeAccessBean aabCode)
          Sets the calculation code.
 void setItems( Item[] aItems)
          Sets the items.
 void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
          Sets the tax categories that should be active during execution.
 
Methods inherited from interface com.ibm.commerce.order.calculation. CalculationCmd
getCurrency, getCustomProperties, getCustomProperty, getTimestamp, getUsageId, setCurrency, setCustomProperties, setCustomProperty, setTimestamp, setUsageId
 
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand
getPolicyId, getRequestProperties, setPolicyId, setRequestProperties
 

Field Detail
public static final java.lang.String COPYRIGHT
The IBM copyright notice field.
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
The name of this command.
See Also:
Constant Field Values

defaultCommandClassName

public static final java.lang.String defaultCommandClassName
The default implementation of this command.
See Also:
Constant Field Values
Method Detail

getValues

public java.math.BigDecimal[] getValues()
Returns the values corresponding to the items.
Returns:
the values.

getValues

public java.math.BigDecimal[] getValues(java.lang.Integer anTaxCategoryId)
Returns the values for a tax category.
Parameters:
anTaxCategoryId - the tax category ID.
Returns:
the values for the tax category.

setCode

public void setCode(CalculationCodeAccessBean aabCode)
Sets the calculation code.
Parameters:
aabCode - the calculation code.

setItems

public void setItems(Item[] aItems)
Sets the items.
Parameters:
aItems - the items.

setTaxCategoryIds

public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
Sets the tax categories that should be active during execution. Normally that would be all sales/shipping tax categories defined in the current store. For sales/shipping tax only.
Parameters:
anTaxCategoryIds - the tax category IDs.