com.ibm.commerce.inventory.commands
Class CreateReceiptCmdImpl

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

public class CreateReceiptCmdImpl
extends TaskCommandImpl
implements CreateReceiptCmd

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


Field Summary
static java.lang.String COPYRIGHT
          The internal copyright field.
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.inventory.commands.CreateReceiptCmd
defaultCommandClassName, NAME
 
Constructor Summary
CreateReceiptCmdImpl()
           
 
Method Summary
 java.lang.String getComment1()
          Return comment1 (receipt comment).
 java.lang.String getComment2()
          Return comment2 (quality comment).
 java.math.BigDecimal getCost()
          Return unit cost.
 java.lang.Long getDistArrangId()
          Return distribution arrangement identifier.
 java.lang.Integer getFfmcenterId()
          Return fulfillment center identifier.
 java.lang.Long getItemspcId()
          Return item identifier.
 java.lang.Long getMemberId()
          Return member identifier.
 java.lang.String getPartNumber()
          Return part number.
 java.lang.Integer getQtyReceived()
          Return the quantity received.
 java.lang.Long getRaDetailId()
          Return expected inventory record detail identifier.
 java.lang.Long getRcptAvailId()
          Return available receipt identifier.
 java.sql.Timestamp getReceiptDate()
          Return the date the inventory was received.
 java.lang.Long getReceiptId()
          Return the receipt identifier.
 java.lang.String getReceiptType()
          Return type of receipt which indicates how this receipt was created.
 java.lang.Long getRtnRcptDspId()
          Return the disposition record identifier of returned item.
 java.lang.String getSetCCurr()
          Return currency of the COST field.
 java.lang.Long getVendorId()
          Return the identifier of the vendor that supplied the inventory.
 java.lang.Long getVersionSpcId()
          Return the product version identifier of the item.
 boolean isReadyToCallExecute()
          This command is ready to be executed.
 void performExecute()
          This method performs the execution of creating a receipt.
 void reset()
          This method resets the command local variable.
 void setComment1(java.lang.String newComment1)
          Set comment1 (receipt comment).
 void setComment2(java.lang.String newComment2)
          Set comment2 (quality comment).
 void setCost(java.math.BigDecimal newCost)
          Set unit cost.
 void setDistArrangId(java.lang.Long newDistArrangId)
          Set distribution arrangement identifier.
 void setFfmcenterId(java.lang.Integer newFfmcenterId)
          Set fulfillment center identifier.
 void setItemspcId(java.lang.Long newItemspcId)
          Set item identifier.
 void setMemberId(java.lang.Long newMemberId)
          Set member identifier.
 void setPartNumber(java.lang.String newPartNumber)
          Set part number.
 void setQtyReceived(java.lang.Integer newQtyReceived)
          Set the quantity received.
 void setRaDetailId(java.lang.Long newRaDetailId)
          Set expected inventory record detail identifier.
 void setRcptAvailId(java.lang.Long newRcptAvailId)
          Set available receipt identifier.
 void setReceiptDate(java.sql.Timestamp newReceiptDate)
          Set the date the inventory was received.
 void setReceiptId(java.lang.Long newReceiptId)
          Set the receipt identifier.
 void setReceiptType(java.lang.String newReceiptType)
          Set type of receipt which indicates how this receipt was created.
 void setRequestProperties(TypedProperty newRequestProperties)
          Set request properties.
 void setRtnRcptDspId(java.lang.Long newRtnRcptDspId)
          Set the disposition record identifier of returned item.
 void setSetCCurr(java.lang.String newSetCCurr)
          Set currency of the COST field.
 void setVendorId(java.lang.Long newVendorId)
          Set the identifier of the vendor that supplied the inventory.
 void setVersionSpcId(java.lang.Long newVersionSpcId)
          Set the product version identifier of the item.
 void validateParameters()
          This method checks the information of receipt to be created.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, 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
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
The internal copyright field.
Constructor Detail

CreateReceiptCmdImpl

public CreateReceiptCmdImpl()
Method Detail

getComment1

public java.lang.String getComment1()
Return comment1 (receipt comment).
Specified by:
getComment1 in interface CreateReceiptCmd
Returns:
java.lang.String

getComment2

public java.lang.String getComment2()
Return comment2 (quality comment).
Specified by:
getComment2 in interface CreateReceiptCmd
Returns:
java.lang.String

getCost

public java.math.BigDecimal getCost()
Return unit cost.
Specified by:
getCost in interface CreateReceiptCmd
Returns:
java.math.BigDecimal

getDistArrangId

public java.lang.Long getDistArrangId()
Return distribution arrangement identifier.
Specified by:
getDistArrangId in interface CreateReceiptCmd
Returns:
java.lang.Long

getFfmcenterId

public java.lang.Integer getFfmcenterId()
Return fulfillment center identifier.
Specified by:
getFfmcenterId in interface CreateReceiptCmd
Returns:
java.lang.Integer

getItemspcId

public java.lang.Long getItemspcId()
Return item identifier.
Specified by:
getItemspcId in interface CreateReceiptCmd
Returns:
java.lang.Long

getMemberId

public java.lang.Long getMemberId()
Return member identifier.
Specified by:
getMemberId in interface CreateReceiptCmd
Returns:
java.lang.Long

getPartNumber

public java.lang.String getPartNumber()
Return part number.
Specified by:
getPartNumber in interface CreateReceiptCmd
Returns:
java.lang.String

getQtyReceived

public java.lang.Integer getQtyReceived()
Return the quantity received.
Specified by:
getQtyReceived in interface CreateReceiptCmd
Returns:
java.lang.Integer

getRaDetailId

public java.lang.Long getRaDetailId()
Return expected inventory record detail identifier.
Specified by:
getRaDetailId in interface CreateReceiptCmd
Returns:
java.lang.Long

getRcptAvailId

public java.lang.Long getRcptAvailId()
Return available receipt identifier.
Specified by:
getRcptAvailId in interface CreateReceiptCmd
Returns:
java.lang.Long

getReceiptDate

public java.sql.Timestamp getReceiptDate()
Return the date the inventory was received.
Specified by:
getReceiptDate in interface CreateReceiptCmd
Returns:
java.sql.Timestamp

getReceiptId

public java.lang.Long getReceiptId()
Return the receipt identifier.
Specified by:
getReceiptId in interface CreateReceiptCmd
Returns:
java.lang.Long

getReceiptType

public java.lang.String getReceiptType()
Return type of receipt which indicates how this receipt was created.
Specified by:
getReceiptType in interface CreateReceiptCmd
Returns:
java.lang.String

getRtnRcptDspId

public java.lang.Long getRtnRcptDspId()
Return the disposition record identifier of returned item.
Specified by:
getRtnRcptDspId in interface CreateReceiptCmd
Returns:
java.lang.Long

getSetCCurr

public java.lang.String getSetCCurr()
Return currency of the COST field.
Specified by:
getSetCCurr in interface CreateReceiptCmd
Returns:
java.lang.String

getVendorId

public java.lang.Long getVendorId()
Return the identifier of the vendor that supplied the inventory.
Specified by:
getVendorId in interface CreateReceiptCmd
Returns:
java.lang.Long

getVersionSpcId

public java.lang.Long getVersionSpcId()
Return the product version identifier of the item.
Specified by:
getVersionSpcId in interface CreateReceiptCmd
Returns:
java.lang.Long

isReadyToCallExecute

public boolean isReadyToCallExecute()
This command is ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECCommand
Following copied from class: com.ibm.commerce.command.AbstractECCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECException
This method 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.

Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Throws:
ECException -  

reset

public void reset()
This method resets the command local variable.
Overrides:
reset in class AbstractECCommand

setComment1

public void setComment1(java.lang.String newComment1)
Set comment1 (receipt comment).
Specified by:
setComment1 in interface CreateReceiptCmd
Parameters:
newComment1 - java.lang.String

setComment2

public void setComment2(java.lang.String newComment2)
Set comment2 (quality comment).
Specified by:
setComment2 in interface CreateReceiptCmd
Parameters:
newComment2 - java.lang.String

setCost

public void setCost(java.math.BigDecimal newCost)
Set unit cost.
Specified by:
setCost in interface CreateReceiptCmd
Parameters:
newCost - java.math.BigDecimal

setDistArrangId

public void setDistArrangId(java.lang.Long newDistArrangId)
Set distribution arrangement identifier.
Specified by:
setDistArrangId in interface CreateReceiptCmd
Parameters:
newDistArrangId - java.lang.Long

setFfmcenterId

public void setFfmcenterId(java.lang.Integer newFfmcenterId)
Set fulfillment center identifier.
Specified by:
setFfmcenterId in interface CreateReceiptCmd
Parameters:
newFfmcenterId - java.lang.Integer

setItemspcId

public void setItemspcId(java.lang.Long newItemspcId)
Set item identifier.
Specified by:
setItemspcId in interface CreateReceiptCmd
Parameters:
newItemspcId - java.lang.Long

setMemberId

public void setMemberId(java.lang.Long newMemberId)
Set member identifier.
Specified by:
setMemberId in interface CreateReceiptCmd
Parameters:
newMemberId - java.lang.Long

setPartNumber

public void setPartNumber(java.lang.String newPartNumber)
Set part number.
Specified by:
setPartNumber in interface CreateReceiptCmd
Parameters:
newPartNumber - java.lang.String

setQtyReceived

public void setQtyReceived(java.lang.Integer newQtyReceived)
Set the quantity received.
Specified by:
setQtyReceived in interface CreateReceiptCmd
Parameters:
newQtyReceived - java.lang.Integer

setRaDetailId

public void setRaDetailId(java.lang.Long newRaDetailId)
Set expected inventory record detail identifier.
Specified by:
setRaDetailId in interface CreateReceiptCmd
Parameters:
newRaDetailId - java.lang.Long

setRcptAvailId

public void setRcptAvailId(java.lang.Long newRcptAvailId)
Set available receipt identifier.
Specified by:
setRcptAvailId in interface CreateReceiptCmd
Parameters:
newRcptAvailId - java.lang.Long

setReceiptDate

public void setReceiptDate(java.sql.Timestamp newReceiptDate)
Set the date the inventory was received.
Specified by:
setReceiptDate in interface CreateReceiptCmd
Parameters:
newReceiptDate - java.sql.Timestamp

setReceiptId

public void setReceiptId(java.lang.Long newReceiptId)
Set the receipt identifier.
Specified by:
setReceiptId in interface CreateReceiptCmd
Parameters:
newReceiptId - java.lang.Long

setReceiptType

public void setReceiptType(java.lang.String newReceiptType)
Set type of receipt which indicates how this receipt was created.
Specified by:
setReceiptType in interface CreateReceiptCmd
Parameters:
newReceiptType - java.lang.String

setRequestProperties

public void setRequestProperties(TypedProperty newRequestProperties)
                          throws ECApplicationException
Set request properties.
Specified by:
setRequestProperties in interface CreateReceiptCmd
Parameters:
reqParms - com.ibm.commerce.datatype.TypedProperty

setRtnRcptDspId

public void setRtnRcptDspId(java.lang.Long newRtnRcptDspId)
Set the disposition record identifier of returned item.
Specified by:
setRtnRcptDspId in interface CreateReceiptCmd
Parameters:
newRtnRcptDspId - java.lang.Long

setSetCCurr

public void setSetCCurr(java.lang.String newSetCCurr)
Set currency of the COST field.
Specified by:
setSetCCurr in interface CreateReceiptCmd
Parameters:
newSetCCurr - java.lang.String

setVendorId

public void setVendorId(java.lang.Long newVendorId)
Set the identifier of the vendor that supplied the inventory.
Specified by:
setVendorId in interface CreateReceiptCmd
Parameters:
newVendorId - java.lang.Long

setVersionSpcId

public void setVersionSpcId(java.lang.Long newVersionSpcId)
Set the product version identifier of the item.
Specified by:
setVersionSpcId in interface CreateReceiptCmd
Parameters:
newVersionSpcId - java.lang.Long

validateParameters

public void validateParameters()
                        throws ECException
This method checks the information of receipt to be created.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Throws:
com.ibm.commerce.exception.ECApplicationException. - If mandatory parameters are not passed in, throw ECApplicationException.