com.ibm.commerce.returns.commands
Class CreditReturnItemCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.returns.commands.CreditReturnItemCmdImpl
All Implemented Interfaces:
CreditReturnItemCmd, ECCommand, TaskCommand

public class CreditReturnItemCmdImpl
extends TaskCommandImpl
implements CreditReturnItemCmd

Activate the refund for a return mechandise authorization (RMA) and its items if there is one and it is approved.

Behaviour


Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands.CreditReturnItemCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CreditReturnItemCmdImpl()
          CreditReturnItemCmdImpl constructor.
 
Method Summary
protected  RMAAccessBean getRMAAB()
          Get the RMA access bean.
protected  java.util.Vector getRMAItemABs()
          Get the list of RMA item access beans.
protected  java.sql.Timestamp getTimestampNow()
          This will get the NOW timestamp.
protected  java.math.BigDecimal getTotalRefund()
          Get the total refund for the RMA.
protected  boolean isRefund(RMAAccessBean anRMAAB)
          Is there a refund? There is a refund if the total credit in the RMA is > 0.
protected  boolean isRefundApproved(RMAAccessBean anRMAAB, java.util.List theRMAItemABs)
          Is the refund approved? This calls the ApproveRefundPolicyCmd policy implementation.
 void performExecute()
          Execute the command.
 void reset()
          Reset the command.
 void setRMAAB(RMAAccessBean anRMAAB)
          Set the RMA being accessed.
 void setRMAItemABs(java.util.Vector anRMAItemABList)
          Set the RMA items being credited.
 void validateParameters()
          Check mandatory parameters.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Constructor Detail

CreditReturnItemCmdImpl

public CreditReturnItemCmdImpl()
CreditReturnItemCmdImpl constructor.
Method Detail

getRMAAB

protected RMAAccessBean getRMAAB()
Get the RMA access bean.
Returns:
The RMA access bean.

getRMAItemABs

protected java.util.Vector getRMAItemABs()
Get the list of RMA item access beans.
Returns:
The list of RMA item access beans.

getTimestampNow

protected java.sql.Timestamp getTimestampNow()
This will get the NOW timestamp. It only gets set on the first call.
Returns:
The NOW timestamp.

getTotalRefund

protected java.math.BigDecimal getTotalRefund()
                                       throws ECSystemException
Get the total refund for the RMA.
Returns:
The total refund amount.

isRefund

protected boolean isRefund(RMAAccessBean anRMAAB)
                    throws ECSystemException
Is there a refund? There is a refund if the total credit in the RMA is > 0.
Parameters:
anRMAAB - RMA access bean
Returns:
true if there is a refund; false otherwise.

isRefundApproved

protected boolean isRefundApproved(RMAAccessBean anRMAAB,
                                   java.util.List theRMAItemABs)
                            throws ECException
Is the refund approved? This calls the ApproveRefundPolicyCmd policy implementation.
Parameters:
anRMAAB - The RMA access bean.
theRMAItemABs - The list of RMA item access beans.
Returns:
true if the refund is approved; false otherwise.

performExecute

public void performExecute()
                    throws ECException
Execute the command.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

reset

public void reset()
Reset the command.
Overrides:
reset in class AbstractECCommand

setRMAAB

public void setRMAAB(RMAAccessBean anRMAAB)
Set the RMA being accessed.
Specified by:
setRMAAB in interface CreditReturnItemCmd
Parameters:
anRMAAB - The RMA access bean.

setRMAItemABs

public void setRMAItemABs(java.util.Vector anRMAItemABList)
Set the RMA items being credited.
Specified by:
setRMAItemABs in interface CreditReturnItemCmd
Parameters:
anRMAItemABList - The RMA item access bean vector.

validateParameters

public void validateParameters()
                        throws ECException
Check mandatory parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -