java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.returns.commands.CalculateReturnItemAdjustmentPolicyCmdImpl
Calculate the adjustment for a return mechandise authorization (RMA) item. This is an abstract implementation which supplies some common infrastructure for concrete implementations.
Behaviour
Field Summary |
---|
Fields inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
policyId,
requestProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.returns.commands. CalculateReturnItemAdjustmentPolicyCmd |
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 | |
---|---|
CalculateReturnItemAdjustmentPolicyCmdImpl() ReturnItemCreditCalculateCmdImpl constructor comment. |
Method Summary | |
---|---|
protected
abstract java.math.BigDecimal |
calcAdjustment() Calculate the RMA item adjustment (charge). |
protected
java.sql.Timestamp |
calcTimestampShipped() Calculate the timestamp when the item was shipped. |
protected
void |
createCharge(java.lang.String aChargeType,
java.math.BigDecimal anAmount) Create a charge against the rma item. |
protected
int |
findBestDays(int aDaysSinceShipped, int[] theDays) Find the smallest days value that is >= number of days since the item was shipped. |
java.math.BigDecimal |
getAdjustment() Get the automatically calculated adjustment for the returned/refunded item. |
protected
int |
getDaysSince(java.sql.Timestamp aTimestamp) Get the number of days since a particluar timestamp value. |
protected
OrderItemAccessBean |
getOrderItemAB() Get the order item access bean. |
protected
RMAItemAccessBean |
getRMAItemAB() Get the RMA item access bean. |
protected
java.math.BigDecimal |
getTotalToAdjust() Get the amount to be used to calculate the adjustment. |
void |
performExecute() Execute the command. |
protected
void |
removeExistingCharges() Remove existing charges. |
void |
reset() reset the command. |
void |
setOrderItemAB(
OrderItemAccessBean anOrderItemAB) (Optional) Set the orderItem being returned/refunded. |
void |
setRequestProperties(
TypedProperty requestProperties) Set the request properties for the policy. |
void |
setRMAItemAB(
RMAItemAccessBean anRMAItemAB) Set the RMA Item access bean which will have its adjustment updated. |
void |
validateParameters() Check mandatory parameters. |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId |
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 |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId |
Constructor Detail |
---|
public CalculateReturnItemAdjustmentPolicyCmdImpl()
Method Detail |
---|
protected abstract java.math.BigDecimal calcAdjustment() throws ECException
ECException
protected java.sql.Timestamp calcTimestampShipped() throws FinderException, java.rmi.RemoteException, javax.naming.NamingException, CreateException, ECException
FinderException
java.rmi.RemoteException
javax.naming.NamingException
CreateException
ECException
protected void createCharge(java.lang.String aChargeType, java.math.BigDecimal anAmount) throws ECSystemException
aChargeType
- charge type codeanAmount
- charge amount
ECSystemException
protected int findBestDays(int aDaysSinceShipped, int[] theDays)
aDaysSinceShipped
- days since the item was shipped.theDays
- the days array.public java.math.BigDecimal getAdjustment()
getAdjustment
in interface
CalculateReturnItemAdjustmentPolicyCmd
protected int getDaysSince(java.sql.Timestamp aTimestamp)
aTimestamp
- the timestamp to calculate the number of days
since.protected OrderItemAccessBean getOrderItemAB()
protected RMAItemAccessBean getRMAItemAB()
protected java.math.BigDecimal getTotalToAdjust() throws ECSystemException
ECSystemException
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
protected void removeExistingCharges() throws ECSystemException
ECSystemException
public void reset()
reset
in class
AbstractECTargetableCommand
public void setOrderItemAB(OrderItemAccessBean anOrderItemAB)
setOrderItemAB
in interface
CalculateReturnItemAdjustmentPolicyCmd
anOrderItemAB
- the orderItem access bean.public void setRequestProperties(TypedProperty requestProperties)
setRequestProperties
in interface
BusinessPolicyCommand
setRequestProperties
in class
BusinessPolicyCommandImpl
requestProperties
- The request propertiespublic void setRMAItemAB(RMAItemAccessBean anRMAItemAB)
setRMAItemAB
in interface
CalculateReturnItemAdjustmentPolicyCmd
anRMAItemAB
- RMA item access bean.public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException