com.ibm.commerce.inventory.commands
Class CreateReceiptCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.inventory.commands.CreateReceiptCmdImpl
All Implemented Interfaces:
CreateReceiptCmd, ECCommand, ECTargetableCommand, TaskCommand

public class CreateReceiptCmdImpl
extends TaskCommandImpl
implements CreateReceiptCmd

Default implementation of the CreateReceiptCmd interface. Creates a receipt of an item at a fulfillment center.

This command first determines the type of receipt to be created. If the expected inventory record detail identifier is provided, an expected inventory receipt will be created and the receipt type will be set to 'EIR'. If the disposition record identifier of returned item is provided, a return receipt will be created and the receipt type will be set to 'RTN'. Otherwise, an ad hoc receipt will be created and the receipt type will be set to 'ADHC'.

If this is an expected inventory receipt, the quantity received and quantity remaining of the corresponding expected inventory record detail will be updated.

If the receipt is created successfully, the receipt identifier will be returned and the receipt will be made available to the distribution arrangement by calling MakeReceiptAvailableCmd task command.

This command requires to have the store id set in the command context. Required parameters are listed in the validateParameters method.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.inventory.commands. CreateReceiptCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CreateReceiptCmdImpl()
           
 
Method Summary
 java.lang.String getComment1()
          Gets the comment specified on the new receipt.
 java.lang.String getComment2()
          Gets the comment specified regarding the quality of the item received.
 java.math.BigDecimal getCost()
          Gets the unit cost of the item.
 java.lang.Long getDistArrangId()
          Gets the identifier of the distribution arrangement that has access to this received inventory.
 java.lang.Integer getFfmcenterId()
          Gets the identifier of the fulfillment center where the inventory was received.
 java.lang.Long getItemspcId()
          Gets the identifier of the item specified for receipt.
 java.lang.Long getMemberId()
          Gets the identifier of the owner of the received item.
 java.lang.String getPartNumber()
          Gets the part number of the received item.
 java.lang.Integer getQtyReceived()
          Gets the number of items received.
 java.lang.Long getRaDetailId()
          Gets the expected inventory record detail identifier for the expected inventory receipt.
 java.lang.Long getRcptAvailId()
          Gets the available receipt identifier.
 java.sql.Timestamp getReceiptDate()
          Gets the date the inventory was received.
 java.lang.Long getReceiptId()
          Gets the identifier of the new receipt.
 java.lang.String getReceiptType()
          Gets the type of receipt which indicates how this receipt was created.
 java.lang.Long getRtnRcptDspId()
          Gets the disposition record identifier of the item returned for receipt.
 java.lang.String getSetCCurr()
          Gets the currency of the cost field.
 java.lang.Long getVendorId()
          Gets the identifier of the vendor that supplied the inventory.
 java.lang.Long getVersionSpcId()
          Gets the product version identifier of the item returned for receipt.
 boolean isReadyToCallExecute()
          Ready to be executed.
 void performExecute()
          Performs the execution of creating a receipt.
 void reset()
          Resets the command local variable.
 void setComment1(java.lang.String newComment1)
          Sets the comment on the new receipt.
 void setComment2(java.lang.String newComment2)
          Sets the comment regarding the quality of the item received.
 void setCost(java.math.BigDecimal newCost)
          Sets the unit cost of the item being received.
 void setDistArrangId(java.lang.Long newDistArrangId)
          Sets the identifier of the distribution arrangement that has access to this received inventory.
 void setFfmcenterId(java.lang.Integer newFfmcenterId)
          Sets the fulfillment center identifier.
 void setItemspcId(java.lang.Long newItemspcId)
          Sets the identifier of the item specified for receipt.
 void setMemberId(java.lang.Long newMemberId)
          Sets the identifier of the owner of the item specified for receipt.
 void setPartNumber(java.lang.String newPartNumber)
          Sets the part number of the items being received.
 void setQtyReceived(java.lang.Integer newQtyReceived)
          Sets the number of items being received.
 void setRaDetailId(java.lang.Long newRaDetailId)
          Sets the identifier of the record detail of the expected inventory.
 void setRcptAvailId(java.lang.Long newRcptAvailId)
          Sets the identifier of the available receipt.
 void setReceiptDate(java.sql.Timestamp newReceiptDate)
          Sets the date the inventory was received.
 void setReceiptId(java.lang.Long newReceiptId)
          Sets identifier of the new receipt.
 void setReceiptType(java.lang.String newReceiptType)
          Sets the type of receipt which indicates how this receipt was created.
 void setRequestProperties( TypedProperty newRequestProperties)
          Gets the information of receipt to be created and sets the information into the command local variable.
 void setRtnRcptDspId(java.lang.Long newRtnRcptDspId)
          Sets the disposition record identifier of the returned item.
 void setSetCCurr(java.lang.String newSetCCurr)
          Sets the currency of the cost field.
 void setVendorId(java.lang.Long newVendorId)
          Sets the identifier of the vendor that supplied the inventory.
 void setVersionSpcId(java.lang.Long newVersionSpcId)
          Sets the product version identifier of the item specified for receipt.
 void validateParameters()
          Checks the information of the receipt to be created.
 
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, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
The internal copyright field.
See Also:
Constant Field Values
Constructor Detail

CreateReceiptCmdImpl

public CreateReceiptCmdImpl()
Method Detail

getComment1

public java.lang.String getComment1()
Description copied from interface: CreateReceiptCmd
Gets the comment specified on the new receipt.
Specified by:
getComment1 in interface CreateReceiptCmd
Returns:
Comment specified on the new receipt.
See Also:
CreateReceiptCmd.getComment1(), setComment1(java.lang.String)

getComment2

public java.lang.String getComment2()
Description copied from interface: CreateReceiptCmd
Gets the comment specified regarding the quality of the item received.
Specified by:
getComment2 in interface CreateReceiptCmd
Returns:
Quality comment on the recieved item.
See Also:
CreateReceiptCmd.getComment2(), setComment2(java.lang.String)

getCost

public java.math.BigDecimal getCost()
Description copied from interface: CreateReceiptCmd
Gets the unit cost of the item.
Specified by:
getCost in interface CreateReceiptCmd
Returns:
Cost of the item.
See Also:
CreateReceiptCmd.getCost(), setCost(java.math.BigDecimal)

getDistArrangId

public java.lang.Long getDistArrangId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the distribution arrangement that has access to this received inventory.
Specified by:
getDistArrangId in interface CreateReceiptCmd
Returns:
Distribution arrangement identifier.
See Also:
CreateReceiptCmd.getDistArrangId(), setDistArrangId(java.lang.Long)

getFfmcenterId

public java.lang.Integer getFfmcenterId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the fulfillment center where the inventory was received.
Specified by:
getFfmcenterId in interface CreateReceiptCmd
Returns:
Fulfillment center identifier.
See Also:
CreateReceiptCmd.getFfmcenterId(), setFfmcenterId(java.lang.Integer)

getItemspcId

public java.lang.Long getItemspcId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the item specified for receipt.
Specified by:
getItemspcId in interface CreateReceiptCmd
Returns:
Item identifier.
See Also:
CreateReceiptCmd.getItemspcId(), setItemspcId(java.lang.Long)

getMemberId

public java.lang.Long getMemberId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the owner of the received item.
Specified by:
getMemberId in interface CreateReceiptCmd
Returns:
Member identifier.
See Also:
CreateReceiptCmd.getMemberId(), setMemberId(java.lang.Long)

getPartNumber

public java.lang.String getPartNumber()
Description copied from interface: CreateReceiptCmd
Gets the part number of the received item. Can be used to uniquely identify an item for the owner identified by memberId.
Specified by:
getPartNumber in interface CreateReceiptCmd
Returns:
Part number.
See Also:
CreateReceiptCmd.getPartNumber(), setPartNumber(java.lang.String)

getQtyReceived

public java.lang.Integer getQtyReceived()
Description copied from interface: CreateReceiptCmd
Gets the number of items received.
Specified by:
getQtyReceived in interface CreateReceiptCmd
Returns:
Quantity received.
See Also:
CreateReceiptCmd.getQtyReceived(), setQtyReceived(java.lang.Integer)

getRaDetailId

public java.lang.Long getRaDetailId()
Description copied from interface: CreateReceiptCmd
Gets the expected inventory record detail identifier for the expected inventory receipt.
Specified by:
getRaDetailId in interface CreateReceiptCmd
Returns:
Record detail identifier.
See Also:
CreateReceiptCmd.getRaDetailId(), setRaDetailId(java.lang.Long)

getRcptAvailId

public java.lang.Long getRcptAvailId()
Description copied from interface: CreateReceiptCmd
Gets the available receipt identifier.
Specified by:
getRcptAvailId in interface CreateReceiptCmd
Returns:
Available receipt identifier.
See Also:
CreateReceiptCmd.getRcptAvailId(), setRcptAvailId(java.lang.Long)

getReceiptDate

public java.sql.Timestamp getReceiptDate()
Description copied from interface: CreateReceiptCmd
Gets the date the inventory was received.
Specified by:
getReceiptDate in interface CreateReceiptCmd
Returns:
Inventory received date.
See Also:
CreateReceiptCmd.getReceiptDate(), setReceiptDate(java.sql.Timestamp)

getReceiptId

public java.lang.Long getReceiptId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the new receipt.
Specified by:
getReceiptId in interface CreateReceiptCmd
Returns:
New receipt identifier.
See Also:
CreateReceiptCmd.getReceiptId(), setReceiptId(java.lang.Long)

getReceiptType

public java.lang.String getReceiptType()
Description copied from interface: CreateReceiptCmd
Gets the type of receipt which indicates how this receipt was created. (ADHC: Ad hoc receipt, EIR: Expected Inventory Receipt, RTN: returned receipt.)
Specified by:
getReceiptType in interface CreateReceiptCmd
Returns:
Receipt type.
See Also:
CreateReceiptCmd.getReceiptType(), setReceiptType(java.lang.String)

getRtnRcptDspId

public java.lang.Long getRtnRcptDspId()
Description copied from interface: CreateReceiptCmd
Gets the disposition record identifier of the item returned for receipt.
Specified by:
getRtnRcptDspId in interface CreateReceiptCmd
Returns:
Disposition record identifier.
See Also:
CreateReceiptCmd.getRtnRcptDspId(), setRtnRcptDspId(java.lang.Long)

getSetCCurr

public java.lang.String getSetCCurr()
Description copied from interface: CreateReceiptCmd
Gets the currency of the cost field.
Specified by:
getSetCCurr in interface CreateReceiptCmd
Returns:
Currency of the cost field.
See Also:
CreateReceiptCmd.getSetCCurr(), setSetCCurr(java.lang.String)

getVendorId

public java.lang.Long getVendorId()
Description copied from interface: CreateReceiptCmd
Gets the identifier of the vendor that supplied the inventory.
Specified by:
getVendorId in interface CreateReceiptCmd
Returns:
Vendor identifier.
See Also:
CreateReceiptCmd.getVendorId(), setVendorId(java.lang.Long)

getVersionSpcId

public java.lang.Long getVersionSpcId()
Description copied from interface: CreateReceiptCmd
Gets the product version identifier of the item returned for receipt.
Specified by:
getVersionSpcId in interface CreateReceiptCmd
Returns:
Product version identifier.
See Also:
CreateReceiptCmd.getVersionSpcId(), setVersionSpcId(java.lang.Long)

setComment1

public void setComment1(java.lang.String newComment1)
Description copied from interface: CreateReceiptCmd
Sets the comment on the new receipt.
Specified by:
setComment1 in interface CreateReceiptCmd
Parameters:
newComment1 - generic comment, COMMENT1 property
See Also:
getComment1(), CreateReceiptCmd.setComment1(java.lang.String)

setComment2

public void setComment2(java.lang.String newComment2)
Description copied from interface: CreateReceiptCmd
Sets the comment regarding the quality of the item received.
Specified by:
setComment2 in interface CreateReceiptCmd
Parameters:
newComment2 - quality comment, COMMENT2 property
See Also:
getComment2(), CreateReceiptCmd.setComment2(java.lang.String)

setCost

public void setCost(java.math.BigDecimal newCost)
Description copied from interface: CreateReceiptCmd
Sets the unit cost of the item being received.
Specified by:
setCost in interface CreateReceiptCmd
Parameters:
newCost - cost of item, COST property
See Also:
getCost(), CreateReceiptCmd.setCost(java.math.BigDecimal)

setDistArrangId

public void setDistArrangId(java.lang.Long newDistArrangId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the distribution arrangement that has access to this received inventory.
Specified by:
setDistArrangId in interface CreateReceiptCmd
Parameters:
newDistArrangId - distribution arrangement identifier, DISTARRANG_ID property
See Also:
getDistArrangId(), CreateReceiptCmd.setDistArrangId(java.lang.Long)

setFfmcenterId

public void setFfmcenterId(java.lang.Integer newFfmcenterId)
Description copied from interface: CreateReceiptCmd
Sets the fulfillment center identifier.
Specified by:
setFfmcenterId in interface CreateReceiptCmd
Parameters:
newFfmcenterId - fulfillment center identifier, FFMCENTER_ID property
See Also:
getFfmcenterId(), CreateReceiptCmd.setFfmcenterId(java.lang.Integer)

setItemspcId

public void setItemspcId(java.lang.Long newItemspcId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the item specified for receipt.
Specified by:
setItemspcId in interface CreateReceiptCmd
Parameters:
newItemspcId - item specified identifier, ITEMSPC_ID property
See Also:
getItemspcId(), CreateReceiptCmd.setItemspcId(java.lang.Long)

setMemberId

public void setMemberId(java.lang.Long newMemberId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the owner of the item specified for receipt.
Specified by:
setMemberId in interface CreateReceiptCmd
Parameters:
newMemberId - member identifier, MEMBER_ID property
See Also:
getMemberId(), CreateReceiptCmd.setMemberId(java.lang.Long)

setPartNumber

public void setPartNumber(java.lang.String newPartNumber)
Description copied from interface: CreateReceiptCmd
Sets the part number of the items being received.
Specified by:
setPartNumber in interface CreateReceiptCmd
Parameters:
newPartNumber - part number, PARTNUMBER property
See Also:
getPartNumber(), CreateReceiptCmd.setPartNumber(java.lang.String)

setQtyReceived

public void setQtyReceived(java.lang.Integer newQtyReceived)
Description copied from interface: CreateReceiptCmd
Sets the number of items being received.
Specified by:
setQtyReceived in interface CreateReceiptCmd
Parameters:
newQtyReceived - quantity of received items, QTYRECEIVED property
See Also:
getQtyReceived(), CreateReceiptCmd.setQtyReceived(java.lang.Integer)

setRaDetailId

public void setRaDetailId(java.lang.Long newRaDetailId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the record detail of the expected inventory.
Specified by:
setRaDetailId in interface CreateReceiptCmd
Parameters:
newRaDetailId - record detail identifier, RADETAIL_ID property
See Also:
getRaDetailId(), CreateReceiptCmd.setRaDetailId(java.lang.Long)

setRcptAvailId

public void setRcptAvailId(java.lang.Long newRcptAvailId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the available receipt.
Specified by:
setRcptAvailId in interface CreateReceiptCmd
Parameters:
newRcptAvailId - available receipt identifier
See Also:
getRcptAvailId(), CreateReceiptCmd.setRcptAvailId(java.lang.Long)

setReceiptDate

public void setReceiptDate(java.sql.Timestamp newReceiptDate)
Description copied from interface: CreateReceiptCmd
Sets the date the inventory was received.
Specified by:
setReceiptDate in interface CreateReceiptCmd
Parameters:
newReceiptDate - receipt date, RECEIPTDATE property
See Also:
getReceiptDate(), CreateReceiptCmd.setReceiptDate(java.sql.Timestamp)

setReceiptId

public void setReceiptId(java.lang.Long newReceiptId)
Description copied from interface: CreateReceiptCmd
Sets identifier of the new receipt. Called by the implementation.
Specified by:
setReceiptId in interface CreateReceiptCmd
Parameters:
newReceiptId - new receipt identifier.
See Also:
getReceiptId(), CreateReceiptCmd.setReceiptId(java.lang.Long)

setReceiptType

public void setReceiptType(java.lang.String newReceiptType)
Description copied from interface: CreateReceiptCmd
Sets the type of receipt which indicates how this receipt was created.
Specified by:
setReceiptType in interface CreateReceiptCmd
Parameters:
newReceiptType - new receipt type, RECEIPTTYPE property
See Also:
getReceiptType(), CreateReceiptCmd.setReceiptType(java.lang.String)

setRtnRcptDspId

public void setRtnRcptDspId(java.lang.Long newRtnRcptDspId)
Description copied from interface: CreateReceiptCmd
Sets the disposition record identifier of the returned item.
Specified by:
setRtnRcptDspId in interface CreateReceiptCmd
Parameters:
newRtnRcptDspId - disposition record identifier, RTNRCPTDSP_ID property
See Also:
getRtnRcptDspId(), CreateReceiptCmd.setRtnRcptDspId(java.lang.Long)

setSetCCurr

public void setSetCCurr(java.lang.String newSetCCurr)
Description copied from interface: CreateReceiptCmd
Sets the currency of the cost field.
Specified by:
setSetCCurr in interface CreateReceiptCmd
Parameters:
newSetCCurr - currency, SETCCURR property
See Also:
getSetCCurr(), CreateReceiptCmd.setSetCCurr(java.lang.String)

setVendorId

public void setVendorId(java.lang.Long newVendorId)
Description copied from interface: CreateReceiptCmd
Sets the identifier of the vendor that supplied the inventory.
Specified by:
setVendorId in interface CreateReceiptCmd
Parameters:
newVendorId - vendor identifier, VENDOR_ID property
See Also:
getVendorId(), CreateReceiptCmd.setVendorId(java.lang.Long)

setVersionSpcId

public void setVersionSpcId(java.lang.Long newVersionSpcId)
Description copied from interface: CreateReceiptCmd
Sets the product version identifier of the item specified for receipt.
Specified by:
setVersionSpcId in interface CreateReceiptCmd
Parameters:
newVersionSpcId - version identifier, VERSIONSPC_ID property
See Also:
getVersionSpcId(), CreateReceiptCmd.setVersionSpcId(java.lang.Long)

setRequestProperties

public void setRequestProperties(TypedProperty newRequestProperties)
                          throws ECApplicationException
Gets the information of receipt to be created and sets the information into the command local variable. Caller sets up the parms in the properties field then calls this method which calls the setters for each property.
Specified by:
setRequestProperties in interface CreateReceiptCmd
Parameters:
newRequestProperties - receipt properties All parameters are optional (null allowed) for this method, though may be required for the command.
  • COMMENT1 - generic comment
  • COMMENT2 - quality comment
  • COST
  • DISTARRANG_ID - distribution arrangement
  • FFMCENTER_ID - fulfillment center
  • ITEMSPC_ID - item specified for return
  • MEMBER_ID - owner id
  • PARTNUMBER
  • QTYRECEIVED - number of items received
  • RADETAIL_ID - record detail
  • RECEIPTDATE
  • RTNRCPTDSP_ID - return receipt disposition record
  • SETCCURR - currency
  • VENDOR_ID
  • VERSIONSPEC_ID - version
ECApplicationException
See Also:
validateParameters()

isReadyToCallExecute

public boolean isReadyToCallExecute()
Ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
Always true.

validateParameters

public void validateParameters()
                        throws ECException

Checks the information of the receipt to be created. Make sure all the required parameters were passed in, or collected from somewhere. Fields required to be set beforehand

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException - If mandatory parameters are not passed in, throw ECApplicationException specifying _ERR_BAD_MISSING_CMD_PARAMETER, _ERR_DIDNT_SET_MERCHANT

performExecute

public void performExecute()
                    throws ECException
Performs the execution of creating a receipt. If the expected inventory record detail identifier is provided, an expected inventory receipt will be created and the receipt type will be set to 'EIR'. If the disposition record identifier of returned item is provided, a return receipt will be created and the receipt type will be set to 'RTN'. Otherwise, an ad hoc receipt will be created and the receipt type will be set to 'ADHC'.

If this is an expected inventory receipt, the quantity received and quantity remaining of the corresponding expected inventory record detail will be updated.

If the receipt is created successfully, the receipt identifier will be returned and the receipt will be made available to the distribution arrangement by calling MakeReceiptAvailableCmd.

Utilizes the following beans

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException -
  • ECSystemException Create error, _ERR_CREATE_EXCEPTION
  • ECSystemException Finder error, _ERR_FINDER_EXCEPTION
  • ECSystemException Naming error, _ERR_NAMING_EXCEPTION
  • ECSystemException Remote error, _ERR_REMOTE_EXCEPTION

reset

public void reset()
Resets the command local variable.
Overrides:
reset in class AbstractECTargetableCommand