com.ibm.commerce.returns.commands
Class ReturnPrepareCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.returns.commands.ReturnPrepareCmdImpl
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ReturnPrepareCmd
- public class ReturnPrepareCmdImpl
- extends ControllerCommandImpl
- implements ReturnPrepareCmd
Adds terms and conditions to a return mechandise 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
is 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.
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setRequestProperties, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties |
ReturnPrepareCmdImpl
public ReturnPrepareCmdImpl()
- ReturnPrepareCmdImpl constructor.
extendCommand
protected void extendCommand()
throws ECException
- Extend the command here. This implementation calls the task command ExtendReturnPrepareCmd.
getResources
public AccessVector getResources()
throws ECException
- Gets the vector of resources accessed by this command.
- Specified by:
getResources
in interface ECCommand
- Overrides:
getResources
in class AbstractECTargetableCommand
- Returns:
- AccessVector - a vector of resource action pairs
performExecute
public void performExecute()
throws ECException
- Execute the command.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECTargetableCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
com.ibm.commerce.command.CommandException
- The superclass for all ECExceptions.
reset
public void reset()
- Reset the command.
- Overrides:
reset
in class AbstractECTargetableCommand
validateParameters
public void validateParameters()
throws ECException
- Check mandatory parameters.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECTargetableCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
ECException.
-