com.ibm.commerce.returns.commands
Class ReturnItemToInventoryCmdImpl

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

public class ReturnItemToInventoryCmdImpl
extends TaskCommandImpl
implements ReturnItemToInventoryCmd

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.


Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.returns.commands.ReturnItemToInventoryCmd
COPYRIGHT, defaultCommandClassName, NAME
 
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 common 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 is 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()
          Performs server side parameter checking.
protected  boolean wasItemTrackableAtAllocation()
          Was inventory for item trackable at the time of allocation.
 
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

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 common command for creating a receipt
Parameters:
quantity - inventory quantity
vendorID - vendor id
cost - unit cost
ccurr - currency
rtnRcptDspId - return receipt disposition id

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.

formulateNewReceipt

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

isItemTrackable

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

lookupOriginalReceipt

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

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()
Description copied from class: AbstractECCommand
This method is 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 AbstractECCommand

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:
orderItemsId - 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
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -  

wasItemTrackableAtAllocation

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