© 2001 BEA Systems, Inc.

com.beasys.commerce.ebusiness.tax
Class TaxCalculatorImpl

com.beasys.commerce.ebusiness.tax.TaxCalculatorImpl

public class TaxCalculatorImpl

A generic Tax Calculator. Implementations for different tax packages should subclass off of this class, and provide the same API.

See Also:
TaxCalculator, TaxCalculatorHome

Constructor Summary
TaxCalculatorImpl()
           
 
Method Summary
 void afterBegin()
           
 void afterCompletion(boolean committed)
           
 void beforeCompletion()
           
 TaxResult calculateTax(TaxParameters params, TaxLineList lines)
          Calculate tax based on the parameters given.
 Price calculateTotalTax(TaxParameters params, Price total)
          This essentially creates an itemLine with no taxcode, 1 unit, and calls calculateTax with the line and parameters.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbPostCreate()
           
 void ejbRemove()
           
 Address[] getAlternateAddresses(Address address)
          Given an address (with the stipulation that the Zipcode/postalcode is correct) return a set of addresses that may be the correct address (city, county combinations) Only works for Canadian and USA addresses.
 void setSessionContext(com.beasys.commerce.ebusiness.tax.SessionContext ctx)
           
 

Constructor Detail

TaxCalculatorImpl

public TaxCalculatorImpl()
Method Detail

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException

setSessionContext

public void setSessionContext(com.beasys.commerce.ebusiness.tax.SessionContext ctx)
                       throws javax.ejb.EJBException

calculateTax

public TaxResult calculateTax(TaxParameters params,
                              TaxLineList lines)
                       throws SystemException,
                              TaxException
Calculate tax based on the parameters given. The basic TaxCalculator requires an override percentage. If one of the additional modules are used, then additional functionality will be provided. Addresses should go through getAlternateAddresses() before being passed in. Otherwise accurate tax calculation may not be performed.
Parameters:
params - TaxParameters provided for tax calculation
lines - TaxLineList provided for tax calculation
Throws:
SystemException -  
TaxException -  

getAlternateAddresses

public Address[] getAlternateAddresses(Address address)
                                throws SystemException,
                                       TaxException
Given an address (with the stipulation that the Zipcode/postalcode is correct) return a set of addresses that may be the correct address (city, county combinations) Only works for Canadian and USA addresses. Non US/Canadian addresses are returned as is.
Parameters:
address - Address which needs to be checked
Throws:
SystemException -  

calculateTotalTax

public Price calculateTotalTax(TaxParameters params,
                               Price total)
                        throws SystemException,
                               TaxException
This essentially creates an itemLine with no taxcode, 1 unit, and calls calculateTax with the line and parameters.
Parameters:
params - TaxParameters provided for tax calculation
total - Total amount on which tax is to be calculated
Throws:
TaxException -  

afterBegin

public void afterBegin()
                throws java.rmi.RemoteException

beforeCompletion

public void beforeCompletion()
                      throws java.rmi.RemoteException

afterCompletion

public void afterCompletion(boolean committed)
                     throws java.rmi.RemoteException

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved