com.ibm.commerce.returns.commands
Class CalculateReturnItemProductCreditCmdImpl

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

public class CalculateReturnItemProductCreditCmdImpl
extends TaskCommandImpl
implements CalculateReturnItemProductCreditCmd

Calculate the amount of the original order item product price that this return mechandise authorization (RMA) item qualifies for. This implementation calculates:

If the limit amount is not null and the limit amount is < the product credit then the product credit is set equal to the limit amount. (This implementation has no limit).


Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands.CalculateReturnItemProductCreditCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
CalculateReturnItemProductCreditCmdImpl()
          CalculateReturnItemProductCreditCmdImpl constructor.
 
Method Summary
protected  java.math.BigDecimal getLimitAmount()
          Return an amount that the returned product credit will be limited to.
 java.math.BigDecimal getProductCredit()
          Get the automatically calculated product credit for the returned/refunded item.
 void performExecute()
          Execute the command.
 void reset()
          Reset the command.
 void setOrderItemAB(OrderItemAccessBean newOrderItemAB)
          Set the orderItem being returned/refunded.
 void setQuantity(java.lang.Double aQuantity)
          Set the quantity to be 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

CalculateReturnItemProductCreditCmdImpl

public CalculateReturnItemProductCreditCmdImpl()
CalculateReturnItemProductCreditCmdImpl constructor.
Method Detail

getLimitAmount

protected java.math.BigDecimal getLimitAmount()
                                       throws ECException
Return an amount that the returned product credit will be limited to. This amount should be in the same currency as the product credit. This implementation returns null.
Returns:
The limit amount. If there is no limit, null is returned.

getProductCredit

public java.math.BigDecimal getProductCredit()
Get the automatically calculated product credit for the returned/refunded item. This does not include any adjustment credit.
Specified by:
getProductCredit in interface CalculateReturnItemProductCreditCmd
Returns:
The amount of the credit (in the same currency of the orderItem).

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

setOrderItemAB

public void setOrderItemAB(OrderItemAccessBean newOrderItemAB)
Set the orderItem being returned/refunded.
Specified by:
setOrderItemAB in interface CalculateReturnItemProductCreditCmd
Parameters:
newOrderItemAB - The orderItem access bean.

setQuantity

public void setQuantity(java.lang.Double aQuantity)
Set the quantity to be credited.
Specified by:
setQuantity in interface CalculateReturnItemProductCreditCmd
Parameters:
aQuantity - The quantity to be credited.

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. -