com.ibm.commerce.payment.commands
Interface UpdateTASpendingCmd
- All Superinterfaces:
- ECCommand, TaskCommand
- All Known Implementing Classes:
- UpdateTASpendingForLimitCheckCmdImpl
- public interface UpdateTASpendingCmd
- extends TaskCommand
Update Trading Agreement's Spending information for the given order.
Parameter:
Parameter Name |
Type |
Descriptions |
order |
OrderAccessBean |
The Order Access Bean |
orderItems |
Vector of OrderItemAccess |
Vector of OrderItem Access Beans representing the OrderItems that make up the Order. |
totalAmount |
BigDecimal |
The Total Amount to be recorded. This amount is in the Currency of the Order. |
errorViewName |
String |
Optional error view name passed in by the Caller. |
Assumption:
- If a Trading Agreement has both RightToBuy by Amount TC and ObligationToBuy by
Amount TC the currency specified for the two TC's must be the same.
Behavior:
- An order may include orderItems that are purchased under the same Trading Agreement
or different TradingAgreements.
- If the OrderItems all specify the same Trading Agreement with the RightToBuy TC by
Amount or an ObligationToBuy TC by Amount or both, this default implementation inserts
a single row with the totalAmount converted to the currency of the TC into the TRDPURAMT
Table with the TRDPURAMT.ORDERITEMS_ID column set to null. If NOT all OrderItems have
the same Trading Agreement, this command inserts multiple rows into the TrdPurAmt table
for each OrderItem which has a Trading Agreement that includes a RightToBuy TC by Amount
or an ObligationToBuy TC by Amount or both, with purchase amount of the OrderItem converted
to the currency of the TC.
- For each unique Trading Agreement in the Order with a RightToBuy by Amount TC, this
command also checks if the total purchase amounts of the OrderItems converted to the
currency specified for the RightToBuy TC plus the sum of all Purchase Amounts for the
TradingAgreement in the TRDPURAMT Table exceeds the RightToBuy Amount in the TC plus
the sum of all Refund Amounts in the TRDREFAMT Table for the same Trading_id.
If it does, the Task Command throws an ECApplicationException and the insert does not happen.
- The purchase amount of an OrderItem is the sum of the
ORDERITEMS.TOTALPRODUCT + ORDERITEMS.TAXAMOUNT + ORDERITEMS.SHIPCHARGE + ORDERITEMS.SHIPTAXAMOUNT minus ORDERITEMS.TOTALADJUSTMENT.
- Since this Task Command may be called more than once, skip the insert if the row or
rows already exists.
Error View Name:
- UpdateTASpendingErrorView
ErrorCodes:
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
COPYRIGHT
public static final java.lang.String COPYRIGHT
defaultCommandClassName
public static final java.lang.String defaultCommandClassName
- The default implementation class.
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
- Name of the Error View for this command.
The constant value of this field is "UpdateTASpendingErrorView".
NAME
public static final java.lang.String NAME
setErrorViewName
public void setErrorViewName(java.lang.String sEVN)
- Optional error view name passed in by the Caller.
setOrder
public void setOrder(OrderAccessBean abOrder)
- Sets the order property of the command.
- Parameters:
abOrder
- the OrderAccessBean of the Order.
setOrderItems
public void setOrderItems(OrderItemAccessBean[] aOrderItems)
- Sets the aOrderItems property of the command.
- Parameters:
aOrderItems
- the Array of the OrderItemAccessBean of the Order
setTotalAmount
public void setTotalAmount(java.math.BigDecimal nTotalAmount)
- Sets the nTotalAmount property of the command.
- Parameters:
nTotalAmount
- the amount to be used for update.