com.ibm.commerce.payment.commands
Interface UpdateTASpendingCmd
- All Superinterfaces:
- TaskCommand
- All Known Implementing Classes:
- UpdateTASpendingForLimitCheckCmdImpl
- public interface UpdateTASpendingCmd
- extends TaskCommand
Update Trading Agreement's Spending information for the given order.
Parameters:
Parameter Name |
Type |
Descriptions |
order |
OrderAccessBean |
The OrderAccessBean of the order |
orderItems |
Vector of OrderItemAccess |
Vector of OrderItemAccessBeans representing the order items 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 Terms and Conditions must be the same.
Behavior:
- An order may include order items that are purchased under the same Trading Agreement or different Trading Agreements.
- If all the order items specify the same Trading Agreement with the RightToBuy by Amount TC or an ObligationToBuy by Amount TC or both, the 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 order items have the same Trading Agreement, the command inserts multiple rows into the TRDPURAMT table for each order item which has a Trading Agreement that includes a RightToBuy by Amount TC or an ObligationToBuy by Amount TC or both, with purchase amount of the order item converted to the currency of the TC.
- For each unique Trading Agreement in the order with a RightToBuy by Amount TC, the command also checks if the total purchase amounts of the order items converted to the currency specified for the RightToBuy TC plus the sum of all purchase amounts for the Trading Agreement 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 order item 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.
Default Error View Name:
- UpdateTASpendingErrorView
ErrorCodes:
Field Summary |
static java.lang.String |
COPYRIGHT
IBM copyright notice field. |
static java.lang.String |
defaultCommandClassName
The default implementation of this command. |
static java.lang.String |
ERRTASK_NAME
Name of the default error view for this command. |
static java.lang.String |
NAME
The name of this command. |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- IBM copyright notice field.
- See Also:
- Constant Field Values
NAME
public static final java.lang.String NAME
- The name of this command.
- See Also:
- Constant Field Values
defaultCommandClassName
public static final java.lang.String defaultCommandClassName
- The default implementation of this command.
- See Also:
- Constant Field Values
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
- Name of the default error view for this command. The constant value of this field is "UpdateTASpendingErrorView".
- See Also:
- Constant Field Values
setErrorViewName
public void setErrorViewName(java.lang.String sEVN)
- Sets the error view to be used to report error. This overrides the default error view of the command.
-
- Parameters:
- sEVN - the Error View name
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 orderItems property of the command.
-
- Parameters:
- aOrderItems - the Array of OrderItemAccessBean of order items in the order
setTotalAmount
public void setTotalAmount(java.math.BigDecimal nTotalAmount)
- Sets the totalAmount property of the command.
-
- Parameters:
- nTotalAmount - the total amount for the Trading Agreement spending limit record update
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.