Tax information flow
The following describes the flow of tax information:
- The customer uses a browser to access the merchant's online store, browse the store catalog, view products on the product display pages, and add items to the shopping cart.
- When the customer navigates to the order summary page, the
OrderPrepareCmd command is called to prepare the order for viewing.- The OrderPrepare command uses the Calculation Framework to calculate the tax amounts of the order and its orderitems, among other things.
- 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:
- It will first call the CalculationCodeCombine calculation method for tax to group the orderitems by the tax calculation code associated with each orderitem.
- For each calculation code to be applied to the items in the order, it creates a TaxOrderCmd task command, which will instantiate the configured implementation, based on entries in the WebSphere Commerce
CMDREG table. There is no default implementation.- For every order item in the shopping cart, it creates a TaxOrderItemCmd task command, which will instantiate the configured implementation, based on entries in the WebSphere Commerce
CMDREG table. There is no default implementation. The TaxOrderCmd addOrderItem method adds each TaxOrderItemCmd command to the TaxOrderCmd command. During this process, the audit flag for each order item is set to off, by default.- Calls the TaxOrderCmd calculateTaxes method to calculate the tax.
- Updates the
ORDERITEMS table in WebSphere Commerce with the tax, using WebSphere Commerce's OrderItemAccessBean. The tax may be displayed on the shopping cart page to the customer.- Passes tax amounts to OrderPrepareCmd command to update the order tax total and subtotal.
- If the customer submits the items in the shopping cart for purchase, another request is sent to the Web server, but this time, to call the OrderProcess task command.
- 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 except that for every order item, the audit flag is set to on.
(C) Copyright IBM Corporation 1996, 2006. All Rights Reserved.