Tax information flow

The following list describes tax information flow:

  1. A customer access online store, browses the store catalog, views products, and adds items to the shopping cart.
  2. When the customer goes to the order summary page, the OrderPrepareCmd command is called to prepare the order for viewing.
  3. The OrderPrepare command uses the Calculation framework to calculate the tax amounts of the order and its order items.
  4. The Calculation Framework calls the ApplyCalculationUsage calculation method for tax. With the tax integration feature enabled, its implementation would be ApplyCalculationUsageTIKCmdImpl, which does the following things:
    • Calls the CalculationCodeCombineCmd calculation method for tax to group the order items by the tax Calculation codes associated with each order item.
    • For each calculation code to be applied to the items in the order, it creates a TaxIntegrationOrderCmd task command, which instantiates the configured implementation, which is based on entries in the CMDREG table. There is no default implementation.
    • For every order item in the shopping cart, it creates a TaxIntegrationOrderItemCmd task command, which instantiates the configured implementation, which is based on entries in the CMDREG table. There is no default implementation. The TaxIntegrationOrderCmd.addOrderItem method adds each TaxIntegrationOrderItemCmd command to the TaxIntegrationOrderCmd command. During this process, the audit flag for each order item is set to off, by default.
    • Calls the TaxIntegrationOrderCmd.execute()' method to calculate the tax.
    • Updates the ORDERITEMS table with the tax, with the OrderItemAccessBean. The tax might be displayed on the shopping cart page to the customer.
    • Passes tax amounts to OrderPrepareCmd command to update the order tax total and subtotal.
    Note: There is no correlation between order items in an order and taxintegrationorderitems in a taxintegrationorder. By default, each orderitem to taxintegrationorder is composed in sequence. The returned taxintegrationorderitem are in the same sequence. By using this process, it is clear which order item corresponds to the taxintegrationitem's value. Alternately, you might extend the interfaces to add corresponding fields to record the correlation.
  5. If the customer submits the items in the shopping cart for purchase, another request is sent to the Web server. This request calls the OrderProcess task command.
  6. The OrderProcess task command calls the TaxCalculationUsageTIKCmd task command for setting the audit flag. Its default implementation class, CalculationCmdImpl, is overridden by the TaxCalculationUsageTIKCmdImpl implementation class (part of the tax integration interface). The TaxCalculationUsageTIKCmd implementation class performs the same functions as ApplyCalculationUsageTIKCmdImpl; however, the audit flag is set to on for every order item.