com.ibm.commerce.returns.commands
Class CalculateReturnItemAdjustmentCreditCmdImpl
- 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.returns.commands.CalculateReturnItemAdjustmentCreditCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CalculateReturnItemAdjustmentCreditCmd, 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
public class CalculateReturnItemAdjustmentCreditCmdImpl extends TaskCommandImpl implements CalculateReturnItemAdjustmentCreditCmd
Default implementation of theCalculateReturnItemAdjustmentCreditCmd
interface. Calculate the adjustment credit for a return merchandise authorization (RMA) item. Entries in the RMAIADJCRD table are first removed then re-calculated for the RMA item based on the adjustments of the order item. Each order item adjustment is pro-rated based on the RMA quantity. This command also sets the total adjustment credit which the calling command can retrieve.Utilizes these access beans
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentCreditCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description CalculateReturnItemAdjustmentCreditCmdImpl()
CalculateReturnItemAdjustmentCreditCmdImpl constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.math.BigDecimal
getAdjustmentCredit()
Get the total calculated adjustment credit for the returned/refunded item.void
performExecute()
Execute the command.void
reset()
Reset the command.void
setOrderItemAB(OrderItemAccessBean anOrderItemAB)
Set the orderItem being returned/refunded.void
setQuantity(java.lang.Double aQuantity)
Set the quantity to be credited.void
setRMAItemAB(RMAItemAccessBean anRMAItemAB)
Set the RMA Item access bean which will have its adjustment credit updated.void
validateParameters()
Check 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
-
-
-
-
Constructor Detail
-
CalculateReturnItemAdjustmentCreditCmdImpl
public CalculateReturnItemAdjustmentCreditCmdImpl()
CalculateReturnItemAdjustmentCreditCmdImpl constructor.
-
-
Method Detail
-
getAdjustmentCredit
public java.math.BigDecimal getAdjustmentCredit()
Get the total calculated adjustment credit for the returned/refunded item.- Specified by:
getAdjustmentCredit
in interfaceCalculateReturnItemAdjustmentCreditCmd
- Returns:
- The total amount of the credit (in the same currency of the orderItem).
-
performExecute
public void performExecute() throws ECException
Execute the command.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
reset
public void reset()
Reset the command.- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
setOrderItemAB
public void setOrderItemAB(OrderItemAccessBean anOrderItemAB)
Set the orderItem being returned/refunded.- Specified by:
setOrderItemAB
in interfaceCalculateReturnItemAdjustmentCreditCmd
- Parameters:
anOrderItemAB
- The orderItem access bean.
-
setQuantity
public void setQuantity(java.lang.Double aQuantity)
Set the quantity to be credited.- Specified by:
setQuantity
in interfaceCalculateReturnItemAdjustmentCreditCmd
- Parameters:
aQuantity
- The quantity to be credited.
-
setRMAItemAB
public void setRMAItemAB(RMAItemAccessBean anRMAItemAB)
Set the RMA Item access bean which will have its adjustment credit updated.- Specified by:
setRMAItemAB
in interfaceCalculateReturnItemAdjustmentCreditCmd
- Parameters:
anRMAItemAB
- The RMA item access bean.
-
validateParameters
public void validateParameters() throws ECException
Check mandatory parameters. Checks the following parameters:Parameters
- StoreAccessBean
- StoreAccessBean passed in the command context
- RMAItemAB
- RMAItemAccessBean of the RMA item
- OrderItemAB
- OrderitemAccesBean of the Order item
- Quantity
- quantity of items to return
- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECApplicationException
- If there is no StoreAccessBean or there is no RMAItemAccessBean or there is no OrderItemAccessBean or a quantity has not be specified , throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETERECException
- StoreAccessBean
-
-