com.ibm.commerce.returns.commands

Class ReturnPrepareCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, ReturnPrepareCmd, 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 ReturnPrepareCmdImpl
    extends ReturnBaseCmdImpl
    implements ReturnPrepareCmd

    Adds terms and conditions to a return merchandise authorization (RMA) prior to agreement. Terms include taxes, warehouse to which customer must return required merchandise, and payment vehicle to be used for any agreed upon credit.

    Parameters

    RMAId (mandatory)
    The Id of the RMA for which to create final terms.
    RMAComment (optional)
    The textual additions to the RMA.
    URL (mandatory)
    The URL to which to redirect.

    Behaviour

    • Checks to see if the RMA exists. If not, ECApplicationException is thrown with the message _ERR_RMA_IN_INVALID_STATE_FOR_COMMAND.
    • Checks to see if a trading id is specified in the RMA. If not, ECApplicationException is thrown with message _ERR_BAD_MISSING_CMD_PARAMETER.
    • Calls the RefreshExpiredRMAItemsCmd task command to determine if the RMAGOODFOR time frame has expired for each RMA item. The credit calculation and automatic approval are called again for those items that have exceeded the 'good for' time.
    • Calls CalculateReturnAdjustmentPolicyCmd task command to calculate RMA level charges or credits specified by policy.
    • Calls the CalculateReturnTaxCmd task command to calculate taxes.
    • Calculates all totals; that is, the total credit in the RMA and the total credit in the return.
    • If the total credit for the RMA is greater than zero, then calls the DetermineReturnCreditVehicleCmd task command to determine how to credit the customer. And sets the value in the Return. If the task command does not resolve a credit method, then ECSystemException is thrown with message _ERR_CANNOT_DETERMINE_CREDIT_VEHICLE.
    • If any RMA item components are marked to be received, calls the ResolveReturnFulfillmentCenterCmd task command to determine a return fulfillment center for the Return. And sets the value in the Return. Otherwise, sets RMA.Ffmctr_id to null. If the task command does not resolve a return fulfillment center, ECSystemException is thrown with message _ERR_CANNOT_DETERMINE_RETURN_FFMCENTER.
    • Marks the RMA as prepared (RMA.prepared='Y').
    • Calls the ExtendReturnPrepareCmd task command.
    • On successful completion, call the specified URL.

    Utilizes these access beans

    See Also:
    Serialized Form