com.ibm.commerce.payment.commands

Class UpdateTASpendingForLimitCheckCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, UpdateTASpendingCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class UpdateTASpendingForLimitCheckCmdImpl
    extends TaskCommandImpl
    implements UpdateTASpendingCmd
    This is the default implementation of the UpdateTASpendingCmd task command.

    Behaviour:

    • 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.

    This command uses the following AccessBeans:

    Task commands called:

    None
    See Also:
    Serialized Form
    • Constructor Detail

      • UpdateTASpendingForLimitCheckCmdImpl

        public UpdateTASpendingForLimitCheckCmdImpl()
    • Method Detail

      • reset

        public void reset()
        This method resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters. Then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

        This is useful if the command instance is to be called multiple times with different command parameters.

        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setErrorViewName

        public 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.
        Specified by:
        setErrorViewName in interface UpdateTASpendingCmd
        Parameters:
        sEVN - A String that specifies the Error View name.
        See Also:
        UpdateTASpendingCmd.ERRTASK_NAME
      • setOrder

        public void setOrder(OrderAccessBean ab)
        This method sets the order property of the command.
        Specified by:
        setOrder in interface UpdateTASpendingCmd
        Parameters:
        ab - The OrderAccessBean of the Order.
      • setOrderItems

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

        public void setTotalAmount(java.math.BigDecimal nTA)
        This method sets the totalAmount property of the command.
        Specified by:
        setTotalAmount in interface UpdateTASpendingCmd
        Parameters:
        nTA - A BigDecimal that specifies the total amount for the Trading Agreement spending limit record update.