com.ibm.commerce.returns.commands

Class ReturnItemUpdateCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnItemAddCmd, ReturnItemUpdateCmd, Protectable, 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 ReturnItemUpdateCmdImpl
    extends ReturnItemBaseCmdImpl
    implements ReturnItemUpdateCmd
    This is the default implementation of the controller command ReturnItemUpdateCmd interface. It updates the return merchandise authorization (RMA) item. It updates information about a returned item. This command can be called for multiple RMA items.

    Input parameters:

    Name Description
    forUser The logon ID of the user on whose behalf the command will be run. Only a person with the authority to process orders can specify this parameter.
    forUserId The logon ID of the user on whose behalf the command will be run. Only a person with a security role of Customer Service Representative can specify this parameter.
    creditAdjustment_i The amount by which to adjust the product credit amount.
    receive_i Specifies whether or not the return item components should be received by the store.
    RMAItemId_i (Required) The RMAItem identifier.
    quantity_i The quantity being returned.
    UOM_i The unit of measure for quantity_i.
    comment_i A comment about the item being returned.
    reason_i The reason for the return, as provided by the purchaser.
    URL (Required) The URL to be called when the command completes successfully.
    outRMAName The name to use for the name-value pair which will be passed to the redirected URL.

    Behaviour:

    If the RMA item has been manually approved, the approval will be removed and auto approval will be re-run on the item.

    Each item will be processed in the following way:

    • Check to see if RMA exists. If not, return an error.
    • Check that purchaser owns the RMA that the rmaItem belongs to. If not, return an authorization error.
    • Check that RMA item has not been received against nor credited.
    • Check that the RMA is in the correct state.
    • if (quantity changed) then if (returned item is based on an orderItem) then Call task command CalculateReturnItemCreditCmd to calculate default credit amount. Set credit amount on RMA item.
    • if the quantity has changed and the returned item is based on catEntry) Call task command CalculateReturnItemCreditForCatEntryCmd
    • Update the RMA item
    • Call task command AutoApproveReturnItemCmd to see if item is automatically approved. Mark rmaItem as either "system-approved" or "approval pending" depending on result from task command.

    Task commands called:

    See Also:
    Serialized Form
    • Field Detail

      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
    • Constructor Detail

      • ReturnItemUpdateCmdImpl

        public ReturnItemUpdateCmdImpl()
        ReturnItemUpdateCmdImpl constructor.
    • Method Detail

      • validateParameters

        public void validateParameters()
                                throws ECException
        This method first calls super.validateParameters. Then it checks whether updating the item causes the requested quantity to exceed the defined business threshold. If the check fails, it throws an ECApplicationException. Then it calls super.validateParameters to do additional checks.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class ReturnItemBaseCmdImpl
        Throws:
        ECException - If a parameter was invalid, or there was an error retrieving data to do the validation.