com.ibm.commerce.payment.commands

Interface UpdateTASpendingCmd

  • All Superinterfaces:
    com.ibm.websphere.command.CacheableCommand, com.ibm.commerce.command.CacheableECCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ECCommand, java.io.Serializable, com.ibm.websphere.command.TargetableCommand, TaskCommand
    All Known Implementing Classes:
    UpdateTASpendingForLimitCheckCmdImpl


    public interface UpdateTASpendingCmd
    extends TaskCommand
    This task command is used to update Trading Agreement's Spending information for the given order. The default implementation of this command is UpdateTASpendingForLimitCheckCmdImpl.

    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. And set the TRDPURAMT.ORDERITEMS_ID column 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:
    See Also:
    UpdateTASpendingForLimitCheckCmdImpl
    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
      • NAME

        static final java.lang.String NAME
        The full name of this command.
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        The default implementation of this command.
        See Also:
        Constant Field Values
      • ERRTASK_NAME

        static final java.lang.String ERRTASK_NAME
        The name of the default error view for this command. The constant value of this field is "UpdateTASpendingErrorView".
        See Also:
        Constant Field Values
    • Method Detail

      • setErrorViewName

        void setErrorViewName(java.lang.String sEVN)
        This method sets the error view to be used to report error. This overrides the default error view of the command.
        Parameters:
        sEVN - A String that specifies the Error View name.
      • setOrder

        void setOrder(OrderAccessBean abOrder)
        This method sets the order property of the command.
        Parameters:
        abOrder - The OrderAccessBean of the Order.
      • setOrderItems

        void setOrderItems(OrderItemAccessBean[] aOrderItems)
        This method sets the orderItems property of the command.
        Parameters:
        aOrderItems - An OrderItemAccessBean[] that represents the Array of OrderItemAccessBean of order items in the order.
      • setTotalAmount

        void setTotalAmount(java.math.BigDecimal nTotalAmount)
        This method sets the totalAmount property of the command.
        Parameters:
        nTotalAmount - A BigDecimal that specifies the total amount for the Trading Agreement spending limit record update.