com.ibm.commerce.taxation.commands
Class GetDisplayTaxesCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.TaskCommandImpl
-
- com.ibm.commerce.taxation.commands.GetDisplayTaxesCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, GetDisplayTaxesCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
- Direct Known Subclasses:
- GetDisplayVATTaxesCmdImpl
public class GetDisplayTaxesCmdImpl extends TaskCommandImpl implements GetDisplayTaxesCmd
This is the default implementation of theGetDisplayTaxesCmd
Task Command. It can be called by any commands and databeans to set the different categories of tax amounts (for exampleGST
,PST
and so forth) for the input catalog entry. It usesCalculationCodes
with calculationUsage of Taxation to calculate the tax amounts for each of the tax categories that have been marked for display.If the command is successful, it will populate two hashtables:
iCategorizedTaxAmount
: contains the tax categories' Ids/names and tax amounts.ihshTaxDescriptionHash
: contains the tax categories' Ids/names and descriptions.
If unsuccessful, the two hashtables will be empty.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
-
Fields inherited from interface com.ibm.commerce.taxation.commands.GetDisplayTaxesCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description GetDisplayTaxesCmdImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.Hashtable
getCategorizedTaxAmount()
Returns the monetary amounts of all tax categories and their names.java.util.Hashtable
getTaxDescriptionHash()
Gets the descriptions of all tax categories.java.util.HashMap
getTaxRateHash()
Gets the rates of all tax categories.void
performExecute()
Executes main business logic of the command.void
reset()
Resets the command properties.void
setAddressId(java.lang.Long aAddressId)
Sets the id of the input ship-to address (Optional).void
setCatEntryId(java.lang.Long aCatEntryId)
Sets the id of the input catalog entry.void
setCurrency(java.lang.String aCurrency)
Sets the currency of the input price amount.void
setDisplayOnly(boolean abDisplayOnly)
Sets the flag to indicate if the taxes are calculated for display purpose (Optional).void
setFulfillmentCenterId(java.lang.Integer aFulfillmentCenterId)
Sets the id of the fulfillment center (Optional).void
setPrice(java.math.BigDecimal aPrice)
Sets the product price for calculating the taxes.void
setQuantity(java.lang.Double aQuantity)
Sets the product quantity for calculating the taxes.void
setShippingCharge(java.math.BigDecimal aShippingCharge)
Sets the shipping charge for the shipping the product.void
setUOM(java.lang.String astrUOM)
Sets the unit of measure for the product.void
validateParameters()
Checks mandatory parameters.-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
public void reset()
Resets the command properties. Prepares the command for re-execution.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
getCategorizedTaxAmount
public java.util.Hashtable getCategorizedTaxAmount()
Returns the monetary amounts of all tax categories and their names.- Specified by:
getCategorizedTaxAmount
in interfaceGetDisplayTaxesCmd
- Returns:
- The monetary amounts of all tax categories and their corresponding category names/ids.
-
getTaxDescriptionHash
public java.util.Hashtable getTaxDescriptionHash()
Gets the descriptions of all tax categories.- Specified by:
getTaxDescriptionHash
in interfaceGetDisplayTaxesCmd
- Returns:
- The descriptions, names or ids of all tax categories.
-
getTaxRateHash
public java.util.HashMap getTaxRateHash()
Gets the rates of all tax categories.- Specified by:
getTaxRateHash
in interfaceGetDisplayTaxesCmd
- Returns:
- The rates of all tax categories.
-
performExecute
public void performExecute() throws ECException
Executes main business logic of the command.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
setAddressId
public void setAddressId(java.lang.Long aAddressId)
Sets the id of the input ship-to address (Optional).- Specified by:
setAddressId
in interfaceGetDisplayTaxesCmd
- Parameters:
aAddressId
- The reference number of the ship-to address.
-
setCatEntryId
public void setCatEntryId(java.lang.Long aCatEntryId)
Sets the id of the input catalog entry.- Specified by:
setCatEntryId
in interfaceGetDisplayTaxesCmd
- Parameters:
aCatEntryId
- The reference number of the catalog entry.
-
setCurrency
public void setCurrency(java.lang.String aCurrency)
Sets the currency of the input price amount.- Specified by:
setCurrency
in interfaceGetDisplayTaxesCmd
- Parameters:
aCurrency
- The currency of the input price amount.
-
setDisplayOnly
public void setDisplayOnly(boolean abDisplayOnly)
Sets the flag to indicate if the taxes are calculated for display purpose (Optional).- Specified by:
setDisplayOnly
in interfaceGetDisplayTaxesCmd
- Parameters:
abDisplayOnly
- To indicate if it is for display use only. A true value (default) means for display. A false value means not for display.
-
setFulfillmentCenterId
public void setFulfillmentCenterId(java.lang.Integer aFulfillmentCenterId)
Sets the id of the fulfillment center (Optional).- Specified by:
setFulfillmentCenterId
in interfaceGetDisplayTaxesCmd
- Parameters:
aFulfillmentCenterId
- The reference number of the fulfillment center.
-
setPrice
public void setPrice(java.math.BigDecimal aPrice)
Sets the product price for calculating the taxes.- Specified by:
setPrice
in interfaceGetDisplayTaxesCmd
- Parameters:
aPrice
- The product price for calculating the taxes.
-
setQuantity
public void setQuantity(java.lang.Double aQuantity)
Sets the product quantity for calculating the taxes.- Specified by:
setQuantity
in interfaceGetDisplayTaxesCmd
- Parameters:
aQuantity
- The product quantity for calculating the taxes.
-
setShippingCharge
public void setShippingCharge(java.math.BigDecimal aShippingCharge)
Sets the shipping charge for the shipping the product.- Specified by:
setShippingCharge
in interfaceGetDisplayTaxesCmd
- Parameters:
aShippingCharge
- The product shipping charge.
-
setUOM
public void setUOM(java.lang.String astrUOM)
Sets the unit of measure for the product.- Specified by:
setUOM
in interfaceGetDisplayTaxesCmd
- Parameters:
astrUOM
- The unit of measure for the product.
-
validateParameters
public void validateParameters() throws ECException
Checks mandatory parameters.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
-
-