com.ibm.commerce.returns.commands
Class ReturnItemToInventoryCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.returns.commands.ReturnItemToInventoryCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, ReturnItemToInventoryCmd, TaskCommand

public class ReturnItemToInventoryCmdImpl
extends TaskCommandImpl
implements ReturnItemToInventoryCmd

Default implementation of the task command ReturnItemToInventoryCmd interface. Command used to return merchandise to pool of inventory which can be used for new inventory allocations. If a new receipt must be created because of the trackable status of the item, it is done by calling CreateReceiptCmd. The values required by CreateReceiptCmd are calculated within this command.

Utilizes these access beans

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands. ReturnItemToInventoryCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand
COPYRIGHT
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
ReturnItemToInventoryCmdImpl()
          ReturnItemToInventoryCmdImpl constructor.
 
Method Summary
protected  void callCreateReceipt(java.lang.Integer quantity, java.lang.Long vendorID, java.math.BigDecimal cost, java.lang.String ccurr, java.lang.Long rtnRcptDspId)
          Calls CreateReceipt command for creating a receipt
 void createItemffmctr(java.lang.Long itemspcId)
          The createItemffmctr method is called to add a new row in itemffmctr for this item, store and fufillment center when a receipt is created.
protected  void formulateNewReceipt()
          Determine what values the new receipt should have
protected  boolean isItemTrackable()
          Whether the baseitem is marked trackable for inventory purposes.
protected  void lookupOriginalReceipt()
          Resolve required values not passed as arguments
 void performExecute()
          Execute the command.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
 void setDispositionDate(java.sql.Timestamp DispositionDate)
          Set the date the new inventory receipt(s) are for
 void setFulfillmentCenter(java.lang.Integer ffmCenterId)
          Set the fulfillment center to which inventory is being returned.
 void setOrderItemsId(java.lang.Long orderItemsId)
          Set the order item from which the merchandise in question came.
 void setQuantity(java.lang.Integer quantity)
          Set the quantity to returned to inventory.
 void setRtnRcptDspId(java.lang.Long rtnRcptDspId)
          Set the Return Receipt Dispositionthe new inventory receipt(s) are for
 void setVersionSpecId(java.lang.Long versionSpecId)
          Set the order item from which the merchandise in question came.
 void validateParameters()
          Check parameters.
protected  boolean wasItemTrackableAtAllocation()
          Was inventory for item trackable at the time of allocation.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReturnItemToInventoryCmdImpl

public ReturnItemToInventoryCmdImpl()
ReturnItemToInventoryCmdImpl constructor.
Method Detail

callCreateReceipt

protected void callCreateReceipt(java.lang.Integer quantity,
                                 java.lang.Long vendorID,
                                 java.math.BigDecimal cost,
                                 java.lang.String ccurr,
                                 java.lang.Long rtnRcptDspId)
                          throws ECException
Calls CreateReceipt command for creating a receipt
Parameters:
quantity - inventory quantity
vendorID - vendor id
cost - unit cost
ccurr - currency
rtnRcptDspId - return receipt disposition id
ECException

formulateNewReceipt

protected void formulateNewReceipt()
                            throws FinderException,
                                   java.rmi.RemoteException,
                                   javax.naming.NamingException,
                                   CreateException,
ECException
Determine what values the new receipt should have
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

isItemTrackable

protected boolean isItemTrackable()
                           throws FinderException,
                                  java.rmi.RemoteException,
                                  javax.naming.NamingException,
                                  CreateException,
ECException
Whether the baseitem is marked trackable for inventory purposes.
Returns:
true if item is currently trackable; false otherwise
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

lookupOriginalReceipt

protected void lookupOriginalReceipt()
                              throws FinderException,
                                     java.rmi.RemoteException,
                                     javax.naming.NamingException,
                                     CreateException,
ECException
Resolve required values not passed as arguments
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

performExecute

public void performExecute()
                    throws ECException
Execute the command.

There's 4 different scenarios that have to be covered and how we handle them

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
ECException

reset

public void reset()
Description copied from class: AbstractECTargetableCommand
This method should be called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class AbstractECTargetableCommand

setDispositionDate

public void setDispositionDate(java.sql.Timestamp DispositionDate)
Set the date the new inventory receipt(s) are for
Specified by:
setDispositionDate in interface ReturnItemToInventoryCmd
Parameters:
DispositionDate - Return Receipt Dispostion Date

setFulfillmentCenter

public void setFulfillmentCenter(java.lang.Integer ffmCenterId)
Set the fulfillment center to which inventory is being returned.
Specified by:
setFulfillmentCenter in interface ReturnItemToInventoryCmd
Parameters:
ffmCenterId - Fulfillment Center identifier

setOrderItemsId

public void setOrderItemsId(java.lang.Long orderItemsId)
Set the order item from which the merchandise in question came.
Specified by:
setOrderItemsId in interface ReturnItemToInventoryCmd
Parameters:
orderItemsId - Order Item identifier

setQuantity

public void setQuantity(java.lang.Integer quantity)
Set the quantity to returned to inventory.
Specified by:
setQuantity in interface ReturnItemToInventoryCmd
Parameters:
quantity - Inventory Quantity

setRtnRcptDspId

public void setRtnRcptDspId(java.lang.Long rtnRcptDspId)
Set the Return Receipt Dispositionthe new inventory receipt(s) are for
Specified by:
setRtnRcptDspId in interface ReturnItemToInventoryCmd
Parameters:
rtnRcptDspId - Return Receipt Dispostion ID

setVersionSpecId

public void setVersionSpecId(java.lang.Long versionSpecId)
Set the order item from which the merchandise in question came.
Specified by:
setVersionSpecId in interface ReturnItemToInventoryCmd
Parameters:
versionSpecId - Order Item identifier

validateParameters

public void validateParameters()
                        throws ECException
Check parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECApplicationException - If required parameters not specified or parameters are invalid, throws com.ibm.commerce.exception.ECApplicationException with ECMessage._ERR_BAD_MISSING_CMD_PARAMETER
ECException

wasItemTrackableAtAllocation

protected boolean wasItemTrackableAtAllocation()
                                        throws FinderException,
                                               java.rmi.RemoteException,
                                               javax.naming.NamingException,
                                               CreateException,
ECException
Was inventory for item trackable at the time of allocation.
Returns:
true if item was trackable at allocation; false otherwise
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException

createItemffmctr

public void createItemffmctr(java.lang.Long itemspcId)
                      throws ECException
The createItemffmctr method is called to add a new row in itemffmctr for this item, store and fufillment center when a receipt is created.
Parameters:
itemspcId - item specified id
ECException