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
TaxCalculatorImpl
public TaxCalculatorImpl()
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 calculationlines
- 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 calculationtotal
- 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
Copyright © 2001 BEA Systems, Inc. All Rights Reserved