com.ibm.commerce.returns.commands
Class ReturnPrepareCmdImpl
java.lang.Object
|
+--CacheableCommandImpl
|
+--com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.returns.commands.ReturnPrepareCmdImpl
- All Implemented Interfaces:
-
AccCommand,
ControllerCommand,
ECCommand,
ECTargetableCommand,
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.
Utilizes these access beans
- See Also:
- Serialized
Form
Methods inherited from class
com.ibm.commerce.command.
ControllerCommandImpl |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setForUserId,
setGeneric,
setOwner,
setRequestProperties,
setResponseProperties,
setRetriable,
setViewInputProperties |
Methods inherited from class
com.ibm.commerce.command.
AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
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.
ControllerCommand |
checkPermission,
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,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
ReturnPrepareCmdImpl
public ReturnPrepareCmdImpl()
- ReturnPrepareCmdImpl constructor.
extendCommand
protected void extendCommand()
throws ECException
- Extend the command here. This implementation calls the task command
ExtendReturnPrepareCmd.
-
-
ECException
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
-
ECException
public void performExecute()
throws ECException
- Execute the command.
-
- Specified by:
-
performExecute
in interface
ECCommand
- Overrides:
-
performExecute
in class
AbstractECTargetableCommand
-
-
ECException
reset
public void reset()
- Reset the command.
-
- Overrides:
-
reset
in class
AbstractECTargetableCommand
validateParameters
public void validateParameters()
throws ECException
- Check mandatory parameters. Checks the following parameters:
Parameters
- RMA.status
- the status of the RMA must be in process or in edit state
- URL
- URL to redirect on completion of the command
- TradingId
- the trading id for the RMA
-
- Specified by:
-
validateParameters
in interface
ECCommand
- Overrides:
-
validateParameters
in class
AbstractECTargetableCommand
-
- Throws:
-
ECApplicationException
- If the RMA.status is not in the right
state, throws com.ibm.commerce.exception.ECApplicationException with
ECMessage.ECMessage._ERR_RMA_IN_INVALID_STATE_FOR_COMMAND
-
ECApplicationException
- If there is no TradingId or if the comment
is greater than 254 characters or if no URL has been specified, throws
com.ibm.commerce.exception.ECApplicationException with
ECMessage._ERR_BAD_MISSING_CMD_PARAMETER
-
ECException