java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentCreditCmdImpl
Default implementation of the
CalculateReturnItemAdjustmentCreditCmd
interface. Calculate the
adjustment credit for a return mechandise authorization (RMA) item. Entries in
the RMAIADJCRD table are first removed then re-calculated for the rma item
based on the adjustments of the order item. Each order item adjustment is
pro-rated based on the RMA quantity. This command also sets the total
adjustment credit which the calling command can retrieve.
Utilizes these access beans
StoreAccessBean
RMAItemAccessBean
OrderItemAccessBean
OrderItemAdjustmentAccessBean
RMAItemAdjustmentCreditAccessBean
Field Summary |
---|
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.returns.commands. CalculateReturnItemAdjustmentCreditCmd |
COPYRIGHT,
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand |
COPYRIGHT |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
CalculateReturnItemAdjustmentCreditCmdImpl() CalculateReturnItemAdjustmentCreditCmdImpl constructor. |
Method Summary | |
---|---|
protected
java.math.BigDecimal |
calcSpecificAdjustmentCredit(
OrderItemAccessBean anOrderItemAB,
OrderItemAdjustmentAccessBean anOrderItemAdjAB) Calculate the adjustment credit for a specific order item adjustment. |
java.math.BigDecimal |
getAdjustmentCredit() Get the total calculated adjustment credit for the returned/refunded item. |
protected
java.math.BigDecimal |
getLimitAmount(
OrderItemAdjustmentAccessBean anOrderItemAdjAB) Return an amount that the adjustment credit will be limited to. |
protected
OrderItemAccessBean |
getOrderItemAB() Get the access bean of the order item being returned. |
protected
RMAItemAccessBean |
getRMAItemAB() Get the RMA item access bean for which the adjustment credit is being calculated. |
void |
performExecute() Execute the command. |
protected
void |
removeOldAdjustmentCredits() Remove existing adjustment credits for the rma item being processed. |
void |
reset() Reset the command. |
protected
void |
setAdjustmentCredit(java.math.BigDecimal newAdjustmentCredit) Set the total adjustment credit for the rma item. |
void |
setOrderItemAB(
OrderItemAccessBean anOrderItemAB) Set the orderItem being returned/refunded. |
void |
setQuantity(java.lang.Double aQuantity) Set the quantity to be credited. |
void |
setRMAItemAB(
RMAItemAccessBean anRMAItemAB) Set the RMA Item access bean which will have its adjustment credit updated. |
void |
validateParameters() Check mandatory parameters. |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
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 |
Constructor Detail |
---|
public CalculateReturnItemAdjustmentCreditCmdImpl()
Method Detail |
---|
protected java.math.BigDecimal calcSpecificAdjustmentCredit(OrderItemAccessBean anOrderItemAB, OrderItemAdjustmentAccessBean anOrderItemAdjAB) throws ECException
anOrderItemAB
- The access bean of the order item being
examined.anOrderItemAdjAB
- The access bean of the order item
adjustment being examined.ECException
public java.math.BigDecimal getAdjustmentCredit()
getAdjustmentCredit
in interface
CalculateReturnItemAdjustmentCreditCmd
protected java.math.BigDecimal getLimitAmount(OrderItemAdjustmentAccessBean anOrderItemAdjAB) throws ECException
anOrderItemAdjAB
- The access bean of the order item
adjustment being examined.ECException
protected OrderItemAccessBean getOrderItemAB()
protected RMAItemAccessBean getRMAItemAB()
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
protected void removeOldAdjustmentCredits() throws ECSystemException
ECSystemException
public void reset()
reset
in class
AbstractECTargetableCommand
protected void setAdjustmentCredit(java.math.BigDecimal newAdjustmentCredit)
newAdjustmentCredit
- The total adjustment credit
amount.public void setOrderItemAB(OrderItemAccessBean anOrderItemAB)
setOrderItemAB
in interface
CalculateReturnItemAdjustmentCreditCmd
anOrderItemAB
- The orderItem access bean.public void setQuantity(java.lang.Double aQuantity)
setQuantity
in interface
CalculateReturnItemAdjustmentCreditCmd
aQuantity
- The quantity to be credited.public void setRMAItemAB(RMAItemAccessBean anRMAItemAB)
setRMAItemAB
in interface
CalculateReturnItemAdjustmentCreditCmd
anRMAItemAB
- The RMA item access bean.public void validateParameters() throws ECException
Parameters
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECApplicationException
- If there is no StoreAccessBean or there is
no RMAItemAccessBean or there is no OrderItemAccessBean or a quantity has not
be specified , throws com.ibm.commerce.exception.ECApplicationException with
ECMessage._ERR_BAD_MISSING_CMD_PARAMETERECException