Interface CheckTASpendingLimitCmd

  • All Superinterfaces:,,,, ECCommand,,, TaskCommand
    All Known Implementing Classes:

    public interface CheckTASpendingLimitCmd
    extends TaskCommand
    Check Trading Agreement's Spending Limit of the specified by given order.

    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 checked. This amount is in the Currency of the Order.
    errorViewName String Optional error view name passed in by the Caller.

    • An order may include orderItems that are purchased under different TradingAgreement and different TradingAgreement may have different Spending limits.
    • Checks if Spending Limit of the TradingAgreement would be exceeded with this purchase if the TradingAgreement includes a RightToBuyTC by Amount.
    • Records for the Purchase Amount and Refund Amount for purchases and refunds. Those against a Trading Agreement with RightToBuyTC by Amount are kept in the same currency specified for the RightToBuyTCByAmount. These records are kept in separate Tables, TRDPURAMT and TRDREFAMT respectively. Note that the currency of this RightToBuy TC must not change once the Trading Agreement has been activated. And purchases have been made against the Trading Agreement.
    • Purchases can be made using a currency that is different from the currency specified for the RightToBuyTC by Amount. For each unique Trading Agreement specified in the OrderItems that includes a RightToBuy TC by Amount. This default implementation converts the sum of the purchase amounts of the OrderItems to the currency specified for the RightToBuy TC. If the resulting amount and 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, the Task Command throws an ECApplicationException.
    • The purchase amount of an OrderItem is the sum of the ORDERITEMS.TOTALPRODUCT + ORDERITEMS.TAXAMOUNT + ORDERITEMS.SHIPCHARGE + ORDERITEMS.SHIPTAXAMOUNT minus ORDERITEMS.TOTALADJUSTMENT. (Similarly, the purchase amount for the whole Order consists of the sum of ORDERS.TOTALPRODUCT + ORDERS.TOTALTAX + ORDERS.TOTALSHIPPING + ORDERS.TOTALTAXSHIPPING minus ORDERS.TOTALADJUSTMENT. This is the same as the totalAmount passed by the caller.)
    Note that CheckTASpendingLimit may be called several times by various commands during Order Flow. (for example, from Order Capture commands, the OrderProcess command, and so on.). The actual update of the Trading Agreement Spending Amount is made during ReleaseToFulfillment by the CheckPaymentAcceptCmdImpl Task Command Implementation class when bReleaseToFulfillment is set to true.

    Default Error View Name:
    • CheckTASpendingLimitErrorView (This is the default ErrorViewName if none is passed into the command.)
    • Field Detail


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

        static final java.lang.String defaultCommandClassName
        The default implementation class.
        See Also:
        Constant Field Values

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

      • setErrorViewName

        void setErrorViewName(java.lang.String sEVN)
        Sets the error view to be used to report error.
        sEVN - the Error View name
      • setOrder

        void setOrder(OrderAccessBean abOrder)
        Sets the order property of the command.
        abOrder - the OrderAccessBean of the Order
      • setOrderItems

        void setOrderItems(OrderItemAccessBean[] aOrderItems)
        Sets the aOrderItems property of the command.
        aOrderItems - the Array of the OrderItemAccessBean of the Order
      • setTotalAmount

        void setTotalAmount(java.math.BigDecimal nTotalAmount)
        Sets the totalAmount property of the command.
        nTotalAmount - the amount to be checked