org.broadleafcommerce.core.pricing.service.module
Class SimpleTaxModule

java.lang.Object
  extended by org.broadleafcommerce.core.pricing.service.module.SimpleTaxModule
All Implemented Interfaces:
TaxModule

Deprecated.

@Deprecated
public class SimpleTaxModule
extends Object
implements TaxModule

Simple factor-based tax module that can be configured by adding rates for specific postalCodes, city, state, or country. Through configuration, this module can be used to set a specific tax rate for items and shipping for a given postal code, city, state, or country. Utilizes the fulfillment group's address to determine the tax location. Useful for those with very simple tax needs.

Author:
jfischer, brian polster

Field Summary
protected  Double defaultFulfillmentGroupTaxRate
          Deprecated.  
protected  Double defaultItemTaxRate
          Deprecated.  
protected  Map<String,Double> fulfillmentGroupCityTaxRateMap
          Deprecated.  
protected  Map<String,Double> fulfillmentGroupCountryTaxRateMap
          Deprecated.  
protected  Map<String,Double> fulfillmentGroupPostalCodeTaxRateMap
          Deprecated.  
protected  Map<String,Double> fulfillmentGroupStateTaxRateMap
          Deprecated.  
protected  Map<String,Double> itemCityTaxRateMap
          Deprecated.  
protected  Map<String,Double> itemCountryTaxRateMap
          Deprecated.  
protected  Map<String,Double> itemPostalCodeTaxRateMap
          Deprecated.  
protected  Map<String,Double> itemStateTaxRateMap
          Deprecated.  
static String MODULENAME
          Deprecated.  
protected  String name
          Deprecated.  
protected  boolean taxFees
          Deprecated.  
 
Constructor Summary
SimpleTaxModule()
          Deprecated.  
 
Method Summary
 Order calculateTaxForOrder(Order order)
          Deprecated.  
 Double determineItemTaxRate(Address address)
          Deprecated. Uses the passed in address to determine if the item is taxable.
 Double determineTaxRateForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
          Deprecated. Uses the passed in address to determine if the item is taxable.
 Double getDefaultFulfillmentGroupTaxRate()
          Deprecated.  
 Double getDefaultItemTaxRate()
          Deprecated.  
 Double getFactor()
          Deprecated.  
 Map<String,Double> getFulfillmentGroupCityTaxRateMap()
          Deprecated.  
 Map<String,Double> getFulfillmentGroupCountryTaxRateMap()
          Deprecated.  
 Map<String,Double> getFulfillmentGroupPostalCodeTaxRateMap()
          Deprecated.  
 Map<String,Double> getFulfillmentGroupStateTaxRateMap()
          Deprecated.  
 Map<String,Double> getItemCityTaxRateMap()
          Deprecated.  
 Map<String,Double> getItemCountryTaxRateMap()
          Deprecated.  
 Map<String,Double> getItemPostalCodeTaxRateMap()
          Deprecated.  
 Map<String,Double> getItemStateTaxRateMap()
          Deprecated.  
 String getName()
          Deprecated.  
protected  boolean isFeeTaxable(FulfillmentGroupFee fee)
          Deprecated.  
protected  boolean isItemTaxable(FulfillmentGroupItem item)
          Deprecated.  
 Double lookupCityRate(Map<String,Double> cityTaxRateMap, String city)
          Deprecated. Changes the city to upper case before checking the configuration.
 Double lookupCountryRate(Map<String,Double> countryTaxRateMap, Country country)
          Deprecated. Returns the taxAmount for the passed in country or null if no match is found.
 Double lookupPostalCodeRate(Map<String,Double> postalCodeTaxRateMap, String postalCode)
          Deprecated. Returns the taxAmount for the passed in postal code or null if no match is found.
 Double lookupStateRate(Map<String,Double> stateTaxRateMap, State state)
          Deprecated. Returns the taxAmount for the passed in state or null if no match is found.
 void setDefaultFulfillmentGroupTaxRate(Double defaultFulfillmentGroupTaxRate)
          Deprecated.  
 void setDefaultItemTaxRate(Double defaultItemTaxRate)
          Deprecated.  
 void setFactor(Double factor)
          Deprecated.  
 void setFulfillmentGroupCityTaxRateMap(Map<String,Double> fulfillmentGroupCityTaxRateMap)
          Deprecated.  
 void setFulfillmentGroupCountryTaxRateMap(Map<String,Double> fulfillmentGroupCountryTaxRateMap)
          Deprecated.  
 void setFulfillmentGroupPostalCodeTaxRateMap(Map<String,Double> fulfillmentGroupPostalCodeTaxRateMap)
          Deprecated.  
 void setFulfillmentGroupStateTaxRateMap(Map<String,Double> fulfillmentGroupStateTaxRateMap)
          Deprecated.  
 void setItemCityTaxRateMap(Map<String,Double> itemCityTaxRateMap)
          Deprecated.  
 void setItemCountryTaxRateMap(Map<String,Double> itemCountryTaxRateMap)
          Deprecated.  
 void setItemPostalCodeTaxRateMap(Map<String,Double> itemPostalCodeTaxRateMap)
          Deprecated.  
 void setItemStateTaxRateMap(Map<String,Double> itemStateTaxRateMap)
          Deprecated.  
 void setName(String name)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULENAME

public static final String MODULENAME
Deprecated. 
See Also:
Constant Field Values

name

protected String name
Deprecated. 

itemPostalCodeTaxRateMap

protected Map<String,Double> itemPostalCodeTaxRateMap
Deprecated. 

itemCityTaxRateMap

protected Map<String,Double> itemCityTaxRateMap
Deprecated. 

itemStateTaxRateMap

protected Map<String,Double> itemStateTaxRateMap
Deprecated. 

itemCountryTaxRateMap

protected Map<String,Double> itemCountryTaxRateMap
Deprecated. 

fulfillmentGroupPostalCodeTaxRateMap

protected Map<String,Double> fulfillmentGroupPostalCodeTaxRateMap
Deprecated. 

fulfillmentGroupCityTaxRateMap

protected Map<String,Double> fulfillmentGroupCityTaxRateMap
Deprecated. 

fulfillmentGroupStateTaxRateMap

protected Map<String,Double> fulfillmentGroupStateTaxRateMap
Deprecated. 

fulfillmentGroupCountryTaxRateMap

protected Map<String,Double> fulfillmentGroupCountryTaxRateMap
Deprecated. 

defaultItemTaxRate

protected Double defaultItemTaxRate
Deprecated. 

defaultFulfillmentGroupTaxRate

protected Double defaultFulfillmentGroupTaxRate
Deprecated. 

taxFees

protected boolean taxFees
Deprecated. 
Constructor Detail

SimpleTaxModule

public SimpleTaxModule()
Deprecated. 
Method Detail

calculateTaxForOrder

public Order calculateTaxForOrder(Order order)
                           throws TaxException
Deprecated. 
Specified by:
calculateTaxForOrder in interface TaxModule
Throws:
TaxException

getName

public String getName()
Deprecated. 
Specified by:
getName in interface TaxModule

setName

public void setName(String name)
Deprecated. 
Specified by:
setName in interface TaxModule

lookupPostalCodeRate

public Double lookupPostalCodeRate(Map<String,Double> postalCodeTaxRateMap,
                                   String postalCode)
Deprecated. 
Returns the taxAmount for the passed in postal code or null if no match is found.

Parameters:
postalCode -
Returns:

lookupCityRate

public Double lookupCityRate(Map<String,Double> cityTaxRateMap,
                             String city)
Deprecated. 
Changes the city to upper case before checking the configuration. Return null if no match is found.

Parameters:
cityTaxRateMap, - city
Returns:

lookupStateRate

public Double lookupStateRate(Map<String,Double> stateTaxRateMap,
                              State state)
Deprecated. 
Returns the taxAmount for the passed in state or null if no match is found. First checks the abbreviation (uppercase) followed by the name (uppercase).

Parameters:
stateTaxRateMap, - state
Returns:

lookupCountryRate

public Double lookupCountryRate(Map<String,Double> countryTaxRateMap,
                                Country country)
Deprecated. 
Returns the taxAmount for the passed in country or null if no match is found. First checks the abbreviation (uppercase) followed by the name (uppercase).

Parameters:
countryTaxRateMap, - state
Returns:

isItemTaxable

protected boolean isItemTaxable(FulfillmentGroupItem item)
Deprecated. 

isFeeTaxable

protected boolean isFeeTaxable(FulfillmentGroupFee fee)
Deprecated. 

determineItemTaxRate

public Double determineItemTaxRate(Address address)
Deprecated. 
Uses the passed in address to determine if the item is taxable. Checks the configured maps in order - (postal code, city, state, country)

Parameters:
address -
Returns:

determineTaxRateForFulfillmentGroup

public Double determineTaxRateForFulfillmentGroup(FulfillmentGroup fulfillmentGroup)
Deprecated. 
Uses the passed in address to determine if the item is taxable. Checks the configured maps in order - (postal code, city, state, country)

Parameters:
fulfillmentGroup -
Returns:

getItemPostalCodeTaxRateMap

public Map<String,Double> getItemPostalCodeTaxRateMap()
Deprecated. 

setItemPostalCodeTaxRateMap

public void setItemPostalCodeTaxRateMap(Map<String,Double> itemPostalCodeTaxRateMap)
Deprecated. 

getItemCityTaxRateMap

public Map<String,Double> getItemCityTaxRateMap()
Deprecated. 

setItemCityTaxRateMap

public void setItemCityTaxRateMap(Map<String,Double> itemCityTaxRateMap)
Deprecated. 

getItemStateTaxRateMap

public Map<String,Double> getItemStateTaxRateMap()
Deprecated. 

setItemStateTaxRateMap

public void setItemStateTaxRateMap(Map<String,Double> itemStateTaxRateMap)
Deprecated. 

getItemCountryTaxRateMap

public Map<String,Double> getItemCountryTaxRateMap()
Deprecated. 

setItemCountryTaxRateMap

public void setItemCountryTaxRateMap(Map<String,Double> itemCountryTaxRateMap)
Deprecated. 

getFulfillmentGroupPostalCodeTaxRateMap

public Map<String,Double> getFulfillmentGroupPostalCodeTaxRateMap()
Deprecated. 

setFulfillmentGroupPostalCodeTaxRateMap

public void setFulfillmentGroupPostalCodeTaxRateMap(Map<String,Double> fulfillmentGroupPostalCodeTaxRateMap)
Deprecated. 

getFulfillmentGroupCityTaxRateMap

public Map<String,Double> getFulfillmentGroupCityTaxRateMap()
Deprecated. 

setFulfillmentGroupCityTaxRateMap

public void setFulfillmentGroupCityTaxRateMap(Map<String,Double> fulfillmentGroupCityTaxRateMap)
Deprecated. 

getFulfillmentGroupStateTaxRateMap

public Map<String,Double> getFulfillmentGroupStateTaxRateMap()
Deprecated. 

setFulfillmentGroupStateTaxRateMap

public void setFulfillmentGroupStateTaxRateMap(Map<String,Double> fulfillmentGroupStateTaxRateMap)
Deprecated. 

getFulfillmentGroupCountryTaxRateMap

public Map<String,Double> getFulfillmentGroupCountryTaxRateMap()
Deprecated. 

setFulfillmentGroupCountryTaxRateMap

public void setFulfillmentGroupCountryTaxRateMap(Map<String,Double> fulfillmentGroupCountryTaxRateMap)
Deprecated. 

getDefaultItemTaxRate

public Double getDefaultItemTaxRate()
Deprecated. 

setDefaultItemTaxRate

public void setDefaultItemTaxRate(Double defaultItemTaxRate)
Deprecated. 

getDefaultFulfillmentGroupTaxRate

public Double getDefaultFulfillmentGroupTaxRate()
Deprecated. 

setDefaultFulfillmentGroupTaxRate

public void setDefaultFulfillmentGroupTaxRate(Double defaultFulfillmentGroupTaxRate)
Deprecated. 

getFactor

@Deprecated
public Double getFactor()
Deprecated. 

Use getDefaultItemTaxRate instead.

Returns:

setFactor

@Deprecated
public void setFactor(Double factor)
Deprecated. 

Use setDefaultItemTaxRate instead.



Copyright © 2013. All Rights Reserved.