com.ibm.commerce.returns.commands

Class ReturnItemToInventoryCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ReturnItemToInventoryCmd, 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 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
    • Constructor Detail

      • ReturnItemToInventoryCmdImpl

        public ReturnItemToInventoryCmdImpl()
        ReturnItemToInventoryCmdImpl constructor.
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        Execute the command.

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

        • 1.) Item is currently Not Tracked Do not create a new receipt at all
        • 2.) Order Item was Not Tracked at Allocation but is now. Don't try to look up old precedence, create new receipt with cost of 0.00, vendor of ??
        • 3.) Order Item was Tracked at Allocation and is still Tracked Look up old receipt(s) and create new one with same cost and vendor
        • 4.) Item is now tracked, receipt allocation is not determinable.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • reset

        public void reset()
        Description copied from class: AbstractECTargetableCommand
        This method is called after a command has been executed. It is used to reset its states variables. After the call to reset, the command should be able to be executed again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setDispositionDate

        public void setDispositionDate(java.sql.Timestamp DispositionDate)
        This method sets 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)
        This method sets 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)
        This method sets 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)
        This method sets the quantity to returned to inventory.
        Specified by:
        setQuantity in interface ReturnItemToInventoryCmd
        Parameters:
        quantity - Inventory Quantity
      • setRtnRcptDspId

        public void setRtnRcptDspId(java.lang.Long rtnRcptDspId)
        This method sets the Return Receipt Disposition id.
        Specified by:
        setRtnRcptDspId in interface ReturnItemToInventoryCmd
        Parameters:
        rtnRcptDspId - Return Receipt Disposition ID
      • setVersionSpecId

        public void setVersionSpecId(java.lang.Long versionSpecId)
        This method sets the version specification id.
        Specified by:
        setVersionSpecId in interface ReturnItemToInventoryCmd
        Parameters:
        versionSpecId - The version specification identifier.
      • getDispositionDate

        public java.sql.Timestamp getDispositionDate()
        This method gets the disposition date on which a part of a return receipt was disposed.
        Returns:
        The disposition date
      • getFulfillmentCenter

        public java.lang.Integer getFulfillmentCenter()
        This method gets the fulfillment center id to which inventory is being returned.
        Returns:
        The fulfillment center identifier
      • getOrderItemsId

        public java.lang.Long getOrderItemsId()
        This method gets the order item id from which the merchandise in question came.
        Returns:
        The order item identifier
      • getQuantity

        public java.lang.Integer getQuantity()
        This method gets the quantity to be returned to inventory.
        Returns:
        The inventory quantity
      • getRtnRcptDspId

        public java.lang.Long getRtnRcptDspId()
        This method gets the return receipt disposition id.
        Returns:
        The return receipt disposition id
      • getVersionSpecId

        public java.lang.Long getVersionSpecId()
        This method gets the version specification id.
        Returns:
        The version specification id
      • setRMAItemComponentAccessBean

        public void setRMAItemComponentAccessBean(RMAItemComponentAccessBean rmaItemCmpAB)
        This method sets the RMA item component access bean.
        Parameters:
        rmaItemCmpAB - The RMA item component access bean.
      • getRMAItemComponentAccessBean

        public RMAItemComponentAccessBean getRMAItemComponentAccessBean()
        This method gets the RMA item component access bean.
        Returns:
        The RMA item component access bean.
      • validateParameters

        public void validateParameters()
                                throws ECException
        Check parameters.

        • orderItemsId (required)
        • versionSpecIdId (required if ordefrItemsId not specified)
        • quantity (required)
        • ffmCenterId (required)
        • dateDisposed (required)

        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
      • 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 fulfillment center when a receipt is created.
        Parameters:
        itemspcId - item specified id
        Throws:
        ECException