com.konakartadmin.bl
Class AdminTaxMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminTaxMgr
All Implemented Interfaces:
AdminTaxMgrIf

public class AdminTaxMgr
extends AdminBaseMgr
implements AdminTaxMgrIf

The AdminTaxMgr - for Managing Tax Objects for the Admin Application


Nested Class Summary
protected  class AdminTaxMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String mutex
          Mutex for this manager
protected static java.util.Map<java.lang.String,AdminTaxMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminTaxMgr(KKAdminIf eng)
          Constructor
 
Method Summary
protected  void addCountryOrderBy(com.konakart.bl.KKCriteria c, AdminCountrySearch search)
           
protected  int addCountrySearchCriteria(com.konakart.bl.KKCriteria c, AdminCountrySearch search)
           
protected  void addGeoZoneOrderBy(com.konakart.bl.KKCriteria c, AdminGeoZoneSearch search)
           
protected  int addGeoZoneSearchCriteria(com.konakart.bl.KKCriteria c, AdminGeoZoneSearch search)
           
protected  void addSubZoneOrderBy(com.konakart.bl.KKCriteria c, AdminSubZoneSearch search)
           
protected  int addSubZoneSearchCriteria(com.konakart.bl.KKCriteria c, AdminSubZoneSearch search)
           
protected  void addTaxClassOrderBy(com.konakart.bl.KKCriteria c, AdminTaxClassSearch search)
           
protected  int addTaxClassSearchCriteria(com.konakart.bl.KKCriteria c, AdminTaxClassSearch search)
           
protected  void addTaxRateOrderBy(com.konakart.bl.KKCriteria c, AdminTaxRateSearch search)
           
protected  int addTaxRateSearchCriteria(com.konakart.bl.KKCriteria c, AdminTaxRateSearch search)
           
protected  void addZoneOrderBy(com.konakart.bl.KKCriteria c, AdminZoneSearch search)
           
protected  int addZoneSearchCriteria(com.konakart.bl.KKCriteria c, AdminZoneSearch search)
           
 int deleteCountry(int id)
          Delete a Country
 int deleteGeoZone(int id)
          Delete a Tax Area - and all it's mappings
 int deleteSubZone(int id)
          Delete a Zone
 int deleteTaxClass(int id)
          Delete a TaxClass
 int deleteTaxRate(int id)
          Delete a TaxRate
 int deleteZone(int id)
          Delete a Zone
 boolean doesCountryExist(int id)
          Checks to see whether a country already exists with this id
 boolean doesGeoZoneExist(int id)
          Return true if the zone exists.
 boolean doesSubZoneExist(int id)
          Return true if the zone exists.
 boolean doesTaxClassExist(int taxClassId)
          Return true if the tax class exists.
 boolean doesTaxRateExist(int id)
          Return true if the zone exists.
 boolean doesZoneExist(int id)
          Return true if the zone exists.
 AdminCountry[] getAllCountriesFull()
          Returns an array of fully populated countries.
 AdminGeoZone[] getAllGeoZones()
          Get an array of AdminGeoZones from the DB.
 AdminTaxClass[] getAllTaxClassesFull()
          Returns an array of all tax class objects.
 AdminTaxRateSearchResult getAllTaxRates()
          This returns an AdminTaxRateSearchResult object.
 int getAllTaxRatesCount()
          Returns a count of the number of TaxRates
 AdminCountrySearchResult getCountries(AdminCountrySearch search, int offset, int size)
          This returns an AdminCountrySearchResult object.
 int getCountriesCount(AdminCountrySearch search)
          Returns a count of the number of Countries
 AdminCountry getCountryById(int countryId)
          Returns the country object for the country id, or Null if the country doesn't exist in the DB.
 AdminCountry getCountryByName(java.lang.String countryName)
          Returns the country object for the country name, or Null if the country doesn't exist in the DB.
 AdminGeoZoneSearchResult getGeoZones(AdminGeoZoneSearch search, int offset, int size)
          This returns an AdminGeoZoneSearchResult object.
 int getGeoZonesCount(AdminGeoZoneSearch search)
          Returns a count of the number of Zones with the specified search criteria
 AdminSubZoneSearchResult getSubZones(AdminSubZoneSearch search, int offset, int size)
          This returns an AdminSubZoneSearchResult object.
 int getSubZonesCount(AdminSubZoneSearch search)
          Returns a count of the number of Zones with the specified search criteria
 AdminTaxClassSearchResult getTaxClasses(AdminTaxClassSearch search)
          This returns an AdminTaxClassSearchResult object.
 int getTaxQuantityRule()
          Returns the rule used to calculate tax for products with multiple quantities.
 AdminTaxRateSearchResult getTaxRates(AdminTaxRateSearch search, int offset, int size)
          This returns an AdminTaxRateSearchResult object.
 int getTaxRatesCount(AdminTaxRateSearch search)
          Returns a count of the number of TaxRates with the specified search criteria
 int getTaxScale()
          Returns the precision use for calculating tax that matches the ADMIN_CURRENCY_DECIMAL_PLACES configuration variable.
 AdminZone getZonePerCountryAndCode(int countryId, java.lang.String zoneDesc)
          The zone name and zone code is compared with the zoneDesc parameter in order to determine whether a zone exists in the DB matching zoneDesc for the country defined by countryId.
 AdminZone getZonePerId(int zoneId)
          Returns the zone if it exists, otherwise null
 AdminZoneSearchResult getZones(AdminZoneSearch search, int offset, int size)
          This returns an AdminZoneSearchResult object.
 AdminZone[] getZonesById(int countryId)
          Returns an array of AdminZones in the specified country - fully-populated
 int getZonesCount(AdminZoneSearch search)
          Returns a count of the number of Zones with the specified search criteria
 int insertCountry(AdminCountry country)
          Insert an AdminCountry object
 int insertGeoZone(AdminGeoZone insertObj)
          Insert an AdminGeoZone object
 int insertSubZone(AdminSubZone insertObj)
          Insert an AdminSubZone object
 int insertTaxClass(AdminTaxClass taxClass)
          Insert an AdminTaxClass object
 int insertTaxRate(AdminTaxRate insertObj)
          Insert an AdminTaxRate object
 int insertZone(AdminZone insertObj)
          Insert an AdminZone object
 void refreshConfigs()
          Refresh the configuration of the Admin Currency Manager
protected  void setZoneCriteriaWithStandardAttributes(org.apache.torque.util.Criteria c)
          Sets the criteria with the standard attributes so as not to have to repeat this code many times.
 int updateCountry(AdminCountry country)
          Update an AdminCountry object
 int updateGeoZone(AdminGeoZone updateObj)
          Update an AdminGeoZone object
 int updateSubZone(AdminSubZone updateObj)
          Update an AdminSubZone object
 int updateTaxClass(AdminTaxClass taxClass)
          Update an AdminTaxClass object
 int updateTaxRate(AdminTaxRate updateObj)
          Update an AdminTaxRate object
 int updateZone(AdminZone updateObj)
          Update an AdminZone object
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


mutex

protected static java.lang.String mutex
Mutex for this manager


staticDataHM

protected static java.util.Map<java.lang.String,AdminTaxMgr.StaticData> staticDataHM
Hash Map that contains the static data

Constructor Detail

AdminTaxMgr

public AdminTaxMgr(KKAdminIf eng)
            throws java.lang.Exception
Constructor

Parameters:
eng - the Admin Engine
Throws:
java.lang.Exception
Method Detail

getAllCountriesFull

public AdminCountry[] getAllCountriesFull()
                                   throws com.workingdogs.village.DataSetException,
                                          org.apache.torque.TorqueException,
                                          KKAdminException
Description copied from interface: AdminTaxMgrIf
Returns an array of fully populated countries.

Specified by:
getAllCountriesFull in interface AdminTaxMgrIf
Returns:
Returns an array of countries - fully-populated
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getCountryByName

public AdminCountry getCountryByName(java.lang.String countryName)
                              throws KKAdminException,
                                     org.apache.torque.TorqueException,
                                     com.workingdogs.village.DataSetException
Returns the country object for the country name, or Null if the country doesn't exist in the DB. If there is more than one country with the same name, we return the first one that we find.

Specified by:
getCountryByName in interface AdminTaxMgrIf
Parameters:
countryName -
Returns:
Returns a country object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getCountryById

public AdminCountry getCountryById(int countryId)
                            throws KKAdminException,
                                   org.apache.torque.TorqueException,
                                   com.workingdogs.village.DataSetException
Returns the country object for the country id, or Null if the country doesn't exist in the DB.

Specified by:
getCountryById in interface AdminTaxMgrIf
Parameters:
countryId -
Returns:
Returns a country object
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getAllTaxClassesFull

public AdminTaxClass[] getAllTaxClassesFull()
                                     throws com.workingdogs.village.DataSetException,
                                            org.apache.torque.TorqueException,
                                            KKAdminException
Description copied from interface: AdminTaxMgrIf
Returns an array of all tax class objects.

Specified by:
getAllTaxClassesFull in interface AdminTaxMgrIf
Returns:
Returns an array of TaxClasses
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getTaxClasses

public AdminTaxClassSearchResult getTaxClasses(AdminTaxClassSearch search)
                                        throws KKAdminException
This returns an AdminTaxClassSearchResult object.

Specified by:
getTaxClasses in interface AdminTaxMgrIf
Parameters:
search -
Returns:
Returns an AdminTaxClassSearchResult object
Throws:
KKAdminException

deleteTaxClass

public int deleteTaxClass(int id)
                   throws KKAdminException
Delete a TaxClass

Specified by:
deleteTaxClass in interface AdminTaxMgrIf
Parameters:
id - A TaxClass id
Returns:
returns the id of the deleted TaxClass
Throws:
KKAdminException

insertTaxClass

public int insertTaxClass(AdminTaxClass taxClass)
                   throws KKAdminException
Insert an AdminTaxClass object

Specified by:
insertTaxClass in interface AdminTaxMgrIf
Parameters:
taxClass - An AdminTaxClass object
Returns:
returns the id of the inserted AdminTaxClass object
Throws:
KKAdminException

updateTaxClass

public int updateTaxClass(AdminTaxClass taxClass)
                   throws KKAdminException
Update an AdminTaxClass object

Specified by:
updateTaxClass in interface AdminTaxMgrIf
Parameters:
taxClass - An AdminTaxClass object
Returns:
returns the id of the updated AdminTaxClass object
Throws:
KKAdminException

addTaxClassOrderBy

protected void addTaxClassOrderBy(com.konakart.bl.KKCriteria c,
                                  AdminTaxClassSearch search)

addTaxClassSearchCriteria

protected int addTaxClassSearchCriteria(com.konakart.bl.KKCriteria c,
                                        AdminTaxClassSearch search)

doesTaxClassExist

public boolean doesTaxClassExist(int taxClassId)
                          throws org.apache.torque.TorqueException,
                                 KKAdminException
Return true if the tax class exists.

Specified by:
doesTaxClassExist in interface AdminTaxMgrIf
Parameters:
taxClassId -
Returns:
True if the category exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getZonesById

public AdminZone[] getZonesById(int countryId)
                         throws com.workingdogs.village.DataSetException,
                                org.apache.torque.TorqueException,
                                KKAdminException
Description copied from interface: AdminTaxMgrIf
Returns an array of AdminZones in the specified country - fully-populated

Specified by:
getZonesById in interface AdminTaxMgrIf
Parameters:
countryId -
Returns:
Returns an array of AdminZones in the specified country - fully-populated
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getZonePerCountryAndCode

public AdminZone getZonePerCountryAndCode(int countryId,
                                          java.lang.String zoneDesc)
                                   throws org.apache.torque.TorqueException,
                                          com.workingdogs.village.DataSetException,
                                          KKAdminException
The zone name and zone code is compared with the zoneDesc parameter in order to determine whether a zone exists in the DB matching zoneDesc for the country defined by countryId. An example of this would be to compare the state of an address with FL or Florida.

Specified by:
getZonePerCountryAndCode in interface AdminTaxMgrIf
Parameters:
countryId -
zoneDesc -
Returns:
the zoneif it exists, otherwise null
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getZonePerId

public AdminZone getZonePerId(int zoneId)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException,
                              KKAdminException
Description copied from interface: AdminTaxMgrIf
Returns the zone if it exists, otherwise null

Specified by:
getZonePerId in interface AdminTaxMgrIf
Parameters:
zoneId -
Returns:
the zone if it exists, otherwise null
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getZones

public AdminZoneSearchResult getZones(AdminZoneSearch search,
                                      int offset,
                                      int size)
                               throws KKAdminException
This returns an AdminZoneSearchResult object.

Specified by:
getZones in interface AdminTaxMgrIf
Parameters:
search - the definition of the search - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminZoneSearchResult object
Throws:
KKAdminException

deleteZone

public int deleteZone(int id)
               throws KKAdminException
Delete a Zone

Specified by:
deleteZone in interface AdminTaxMgrIf
Parameters:
id - A Zone id
Returns:
returns the id of the deleted Zone
Throws:
KKAdminException

insertZone

public int insertZone(AdminZone insertObj)
               throws KKAdminException
Insert an AdminZone object

Specified by:
insertZone in interface AdminTaxMgrIf
Parameters:
insertObj - An AdminZone object
Returns:
returns the id of the inserted AdminZone object
Throws:
KKAdminException

updateZone

public int updateZone(AdminZone updateObj)
               throws KKAdminException
Update an AdminZone object

Specified by:
updateZone in interface AdminTaxMgrIf
Parameters:
updateObj - An AdminZone object
Returns:
returns the id of the updated AdminZone object
Throws:
KKAdminException

doesZoneExist

public boolean doesZoneExist(int id)
                      throws org.apache.torque.TorqueException,
                             KKAdminException
Return true if the zone exists.

Specified by:
doesZoneExist in interface AdminTaxMgrIf
Parameters:
id - zone id
Returns:
True if the zone exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getZonesCount

public int getZonesCount(AdminZoneSearch search)
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException,
                         KKAdminException
Returns a count of the number of Zones with the specified search criteria

Specified by:
getZonesCount in interface AdminTaxMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of Zones with the specified search criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addZoneOrderBy

protected void addZoneOrderBy(com.konakart.bl.KKCriteria c,
                              AdminZoneSearch search)

addZoneSearchCriteria

protected int addZoneSearchCriteria(com.konakart.bl.KKCriteria c,
                                    AdminZoneSearch search)

getAllGeoZones

public AdminGeoZone[] getAllGeoZones()
                              throws java.lang.Exception
Get an array of AdminGeoZones from the DB. Always append the "--none--" geo zone as the first element in the array.

Specified by:
getAllGeoZones in interface AdminTaxMgrIf
Returns:
Returns an array of AdminGeoZones - fully-populated
Throws:
java.lang.Exception

getGeoZones

public AdminGeoZoneSearchResult getGeoZones(AdminGeoZoneSearch search,
                                            int offset,
                                            int size)
                                     throws KKAdminException
This returns an AdminGeoZoneSearchResult object.

Specified by:
getGeoZones in interface AdminTaxMgrIf
Parameters:
search - the definition of the search - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminGeoZoneSearchResult object
Throws:
KKAdminException

deleteGeoZone

public int deleteGeoZone(int id)
                  throws KKAdminException
Delete a Tax Area - and all it's mappings

Specified by:
deleteGeoZone in interface AdminTaxMgrIf
Parameters:
id - A Tax Area id
Returns:
returns the id of the deleted Tax Area
Throws:
KKAdminException

insertGeoZone

public int insertGeoZone(AdminGeoZone insertObj)
                  throws KKAdminException
Insert an AdminGeoZone object

Specified by:
insertGeoZone in interface AdminTaxMgrIf
Parameters:
insertObj - An AdminGeoZone object
Returns:
returns the id of the inserted AdminGeoZone object
Throws:
KKAdminException

updateGeoZone

public int updateGeoZone(AdminGeoZone updateObj)
                  throws KKAdminException
Update an AdminGeoZone object

Specified by:
updateGeoZone in interface AdminTaxMgrIf
Parameters:
updateObj - An AdminGeoZone object
Returns:
returns the id of the updated AdminGeoZone object
Throws:
KKAdminException

doesGeoZoneExist

public boolean doesGeoZoneExist(int id)
                         throws org.apache.torque.TorqueException,
                                KKAdminException
Return true if the zone exists.

Specified by:
doesGeoZoneExist in interface AdminTaxMgrIf
Parameters:
id - zone id
Returns:
True if the zone exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getGeoZonesCount

public int getGeoZonesCount(AdminGeoZoneSearch search)
                     throws org.apache.torque.TorqueException,
                            com.workingdogs.village.DataSetException,
                            KKAdminException
Returns a count of the number of Zones with the specified search criteria

Specified by:
getGeoZonesCount in interface AdminTaxMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of Zones with the specified search criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addGeoZoneOrderBy

protected void addGeoZoneOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminGeoZoneSearch search)

addGeoZoneSearchCriteria

protected int addGeoZoneSearchCriteria(com.konakart.bl.KKCriteria c,
                                       AdminGeoZoneSearch search)

getSubZones

public AdminSubZoneSearchResult getSubZones(AdminSubZoneSearch search,
                                            int offset,
                                            int size)
                                     throws KKAdminException
This returns an AdminSubZoneSearchResult object.

Specified by:
getSubZones in interface AdminTaxMgrIf
Parameters:
search - the definition of the search - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminSubZoneSearchResult object
Throws:
KKAdminException

deleteSubZone

public int deleteSubZone(int id)
                  throws KKAdminException
Delete a Zone

Specified by:
deleteSubZone in interface AdminTaxMgrIf
Parameters:
id - A Zone id
Returns:
returns the id of the deleted Zone
Throws:
KKAdminException

insertSubZone

public int insertSubZone(AdminSubZone insertObj)
                  throws KKAdminException
Insert an AdminSubZone object

Specified by:
insertSubZone in interface AdminTaxMgrIf
Parameters:
insertObj - An AdminSubZone object
Returns:
returns the id of the inserted AdminSubZone object
Throws:
KKAdminException

updateSubZone

public int updateSubZone(AdminSubZone updateObj)
                  throws KKAdminException
Update an AdminSubZone object

Specified by:
updateSubZone in interface AdminTaxMgrIf
Parameters:
updateObj - An AdminSubZone object
Returns:
returns the id of the updated AdminSubZone object
Throws:
KKAdminException

doesSubZoneExist

public boolean doesSubZoneExist(int id)
                         throws org.apache.torque.TorqueException,
                                KKAdminException
Return true if the zone exists.

Specified by:
doesSubZoneExist in interface AdminTaxMgrIf
Parameters:
id - zone id
Returns:
True if the zone exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getSubZonesCount

public int getSubZonesCount(AdminSubZoneSearch search)
                     throws org.apache.torque.TorqueException,
                            com.workingdogs.village.DataSetException,
                            KKAdminException
Returns a count of the number of Zones with the specified search criteria

Specified by:
getSubZonesCount in interface AdminTaxMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of Zones with the specified search criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addSubZoneOrderBy

protected void addSubZoneOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminSubZoneSearch search)

addSubZoneSearchCriteria

protected int addSubZoneSearchCriteria(com.konakart.bl.KKCriteria c,
                                       AdminSubZoneSearch search)

getCountriesCount

public int getCountriesCount(AdminCountrySearch search)
                      throws org.apache.torque.TorqueException,
                             com.workingdogs.village.DataSetException,
                             KKAdminException
Returns a count of the number of Countries

Specified by:
getCountriesCount in interface AdminTaxMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of Countries
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getCountries

public AdminCountrySearchResult getCountries(AdminCountrySearch search,
                                             int offset,
                                             int size)
                                      throws KKAdminException
This returns an AdminCountrySearchResult object.

Specified by:
getCountries in interface AdminTaxMgrIf
Parameters:
search -
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminCountrySearchResult object
Throws:
KKAdminException

deleteCountry

public int deleteCountry(int id)
                  throws KKAdminException
Delete a Country

Specified by:
deleteCountry in interface AdminTaxMgrIf
Parameters:
id - A Country id
Returns:
returns the id of the deleted Country
Throws:
KKAdminException

insertCountry

public int insertCountry(AdminCountry country)
                  throws KKAdminException
Insert an AdminCountry object

Specified by:
insertCountry in interface AdminTaxMgrIf
Parameters:
country - An AdminCountry object
Returns:
returns the id of the inserted AdminCountry object
Throws:
KKAdminException

updateCountry

public int updateCountry(AdminCountry country)
                  throws KKAdminException
Update an AdminCountry object

Specified by:
updateCountry in interface AdminTaxMgrIf
Parameters:
country - An AdminCountry object
Returns:
returns the id of the updated AdminCountry object
Throws:
KKAdminException

addCountryOrderBy

protected void addCountryOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminCountrySearch search)

addCountrySearchCriteria

protected int addCountrySearchCriteria(com.konakart.bl.KKCriteria c,
                                       AdminCountrySearch search)

doesCountryExist

public boolean doesCountryExist(int id)
                         throws org.apache.torque.TorqueException,
                                KKAdminException
Checks to see whether a country already exists with this id

Specified by:
doesCountryExist in interface AdminTaxMgrIf
Parameters:
id - the country Id
Returns:
Returns true if the country already exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getAllTaxRates

public AdminTaxRateSearchResult getAllTaxRates()
                                        throws KKAdminException
This returns an AdminTaxRateSearchResult object.

Specified by:
getAllTaxRates in interface AdminTaxMgrIf
Returns:
Returns an AdminTaxRateSearchResult object
Throws:
KKAdminException

getTaxRates

public AdminTaxRateSearchResult getTaxRates(AdminTaxRateSearch search,
                                            int offset,
                                            int size)
                                     throws KKAdminException
This returns an AdminTaxRateSearchResult object.

Specified by:
getTaxRates in interface AdminTaxMgrIf
Parameters:
search - the definition of the search - can be null
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminTaxRateSearchResult object
Throws:
KKAdminException

deleteTaxRate

public int deleteTaxRate(int id)
                  throws KKAdminException
Delete a TaxRate

Specified by:
deleteTaxRate in interface AdminTaxMgrIf
Parameters:
id - A TaxRate id
Returns:
returns the id of the deleted TaxRate
Throws:
KKAdminException

insertTaxRate

public int insertTaxRate(AdminTaxRate insertObj)
                  throws KKAdminException
Insert an AdminTaxRate object

Specified by:
insertTaxRate in interface AdminTaxMgrIf
Parameters:
insertObj - An AdminTaxRate object
Returns:
returns the id of the inserted AdminTaxRate object
Throws:
KKAdminException

updateTaxRate

public int updateTaxRate(AdminTaxRate updateObj)
                  throws KKAdminException
Update an AdminTaxRate object

Specified by:
updateTaxRate in interface AdminTaxMgrIf
Parameters:
updateObj - An AdminTaxRate object
Returns:
returns the id of the updated AdminTaxRate object
Throws:
KKAdminException

doesTaxRateExist

public boolean doesTaxRateExist(int id)
                         throws org.apache.torque.TorqueException,
                                KKAdminException
Return true if the zone exists.

Specified by:
doesTaxRateExist in interface AdminTaxMgrIf
Parameters:
id - zone id
Returns:
True if the zone exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getTaxRatesCount

public int getTaxRatesCount(AdminTaxRateSearch search)
                     throws org.apache.torque.TorqueException,
                            com.workingdogs.village.DataSetException,
                            KKAdminException
Returns a count of the number of TaxRates with the specified search criteria

Specified by:
getTaxRatesCount in interface AdminTaxMgrIf
Parameters:
search - Search criteria
Returns:
A count of the number of TaxRates with the specified search criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getAllTaxRatesCount

public int getAllTaxRatesCount()
                        throws org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException,
                               KKAdminException
Returns a count of the number of TaxRates

Specified by:
getAllTaxRatesCount in interface AdminTaxMgrIf
Returns:
A count of the number of TaxRates
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addTaxRateOrderBy

protected void addTaxRateOrderBy(com.konakart.bl.KKCriteria c,
                                 AdminTaxRateSearch search)

addTaxRateSearchCriteria

protected int addTaxRateSearchCriteria(com.konakart.bl.KKCriteria c,
                                       AdminTaxRateSearch search)

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Refresh the configuration of the Admin Currency Manager

Specified by:
refreshConfigs in interface AdminTaxMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
java.lang.Exception

getTaxQuantityRule

public int getTaxQuantityRule()
                       throws KKAdminException
Returns the rule used to calculate tax for products with multiple quantities. The supported rules are:
    • TaxUtils.TAX_PER_ITEM : The tax is calculated for a single item, to the number of decimal places defined by scale. Then this value is multiplied by the quantity.
      TaxUtils.TAX_ON_TOTAL : The tax is calculated for the total amount (single item cost x quantity).
  • Specified by:
    getTaxQuantityRule in interface AdminTaxMgrIf
    Returns:
    the taxQuantityRule
    Throws:
    KKAdminException

    getTaxScale

    public int getTaxScale()
                    throws KKAdminException
    Returns the precision use for calculating tax that matches the ADMIN_CURRENCY_DECIMAL_PLACES configuration variable.

    Specified by:
    getTaxScale in interface AdminTaxMgrIf
    Returns:
    the taxScale
    Throws:
    KKAdminException

    setZoneCriteriaWithStandardAttributes

    protected void setZoneCriteriaWithStandardAttributes(org.apache.torque.util.Criteria c)
    Sets the criteria with the standard attributes so as not to have to repeat this code many times.

    Parameters:
    c -


    Copyright © 2011 DS Data Systems UK Ltd.