com.ibm.commerce.taxation.commands
Class GetReturnTaxesCmdImpl
java.lang.Object
|
+--com.ibm.commerce.command.AbstractECCommand
|
+--com.ibm.commerce.command.TaskCommandImpl
|
+--com.ibm.commerce.taxation.commands.GetReturnTaxesCmdImpl
- All Implemented Interfaces:
- ECCommand, GetReturnTaxesCmd, TaskCommand
- public class GetReturnTaxesCmdImpl
- extends TaskCommandImpl
- implements GetReturnTaxesCmd
This GetReturnTaxesCmd
Task Command Implementation calculates the tax amounts
of the original order items net those to be returned in a RMA.
If the command is successful in calculating the taxes, it will return
the tax amounts for the net items.
Behaviour
recalculates taxes on the original order items net the items to be returned.
Field Summary |
static java.lang.String |
COPYRIGHT
|
Methods inherited from class com.ibm.commerce.command.AbstractECCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, 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.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
COPYRIGHT
public static final java.lang.String COPYRIGHT
GetReturnTaxesCmdImpl
public GetReturnTaxesCmdImpl()
getNetAdjByCategoryForReturn
protected java.math.BigDecimal getNetAdjByCategoryForReturn(java.util.Hashtable aRMAItemAdjs,
java.util.Hashtable aOrderItemAdjs,
java.lang.Integer aTaxCategoryId)
throws ECException
- Returns the net adjustment amounts for a particular tax category.
- Parameters:
aRMAItemAdjs
- the adjustment credits in a RMA.aOrderItemAdjs
- the adjustment amounts in a RMA.aTaxCategoryId
- the tax category.
- Returns:
- The net adjust amounts for a particular tax category.
getOrderItemABs
public OrderItemAccessBean[] getOrderItemABs()
- Returns the orderitem access beans.
- Specified by:
getOrderItemABs
in interface GetReturnTaxesCmd
- Following copied from interface:
com.ibm.commerce.taxation.commands.GetReturnTaxesCmd
- Returns:
- The access beans of the orderitems.
getOrderItemAdjustments
public java.util.Hashtable getOrderItemAdjustments(java.lang.Long aOrderItemId)
throws ECException
- Obtains the original adjustment amounts for the orderitem to be returned.
- Parameters:
aOrderItemId
- The id of the orderitem.
- Returns:
- The original adjustment amounts.
getRMAItemAdjustmentCredits
protected java.util.Hashtable getRMAItemAdjustmentCredits(java.lang.Long aRMAItemId)
throws ECException
- Obtains the adjustment credit amounts for the orderitem to be returned.
- Parameters:
aRMAItemId
- The id of the RMA orderitem.
- Returns:
- The adjustment credit amounts.
performExecute
public void performExecute()
throws ECException
- Executes main business logic of the command.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
com.ibm.commerce.command.CommandException
- The superclass for all ECExceptions.
setRMAItemABs
public void setRMAItemABs(RMAItemAccessBean[] aRMAItemABs)
- Sets the RMAItem for which the new tax amounts are to be calculated.
- Specified by:
setRMAItemABs
in interface GetReturnTaxesCmd
- Following copied from interface:
com.ibm.commerce.taxation.commands.GetReturnTaxesCmd
- Parameters:
aRMAItemABs
- the access beans of the orderItem to be returned.
validateParameters
public void validateParameters()
throws ECException
- Checks mandatory parameters.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
ECException.
-
validateTaxableNetPrice
protected java.math.BigDecimal validateTaxableNetPrice(OrderItemAccessBean aOrderItemAB,
RMAItemAccessBean aRMAItemAB)
throws ECException
- Returns the net adjustment amounts for a particular tax category.
The default implmemtation takes into account of returned credit and
credit adjustment and CSR adjustment when calculating the refunded
amount. The refunded amount is subtracted from the original total
price and the new price total will be input to perform the tax
calculation.
- Parameters:
aRMAItemAdjs
- the adjustment credits in a RMA.aOrderItemAdjs
- the adjustment amounts in a RMA.aTaxCategoryId
- the tax category.
- Returns:
- The net adjust amounts for a particular tax category.