ePages 7.38.0 - DE_EPAGES/TaxUSSystemDB/API/Zip2TaxUS.pm

Package DE_EPAGES::TaxUSSystemDB::API::Zip2TaxUS

Functions for the zip2taxus database table

@EXPORT_OK
UpdateZip2TaxUSMetaTable
UpdateZip2TaxUSTable
ImportZip2TaxUSTable
GetInfoZip2TaxUSByZipCodeCityState
GetTaxRateOrRangeByZipCodeCityState
GetInfoZip2TaxUSsByZipCodePart
LoadSystemDBTable

Functions

GetInfoZip2TaxUSByZipCodeCityState
GetInfoZip2TaxUSsByZipCodePart
GetTaxRateOrRangeByZipCodeCityState
ImportZip2TaxUSTable
LoadSystemDBTable
UpdateZip2TaxUSMetaTable
UpdateZip2TaxUSTable

GetInfoZip2TaxUSByZipCodeCityState

Gets Info for primary keys ZipCode, City, State. Will be run on store 'System' automatically.

Syntax
GetInfoZip2TaxUSByZipCodeCityState($hParams);
Input
$hParams (reference to hash)
with following keys:
  • ZipCode - (part of primary key)- varchar(50)
  • City - (part of primary key)- varchar(50)
  • State - (part of primary key)- varchar(50)
Return
$hZip2TaxUS (reference to hash)
with following keys:
  • z2t_ID - (optional)- int
  • ZipCode - (part of primary key)- varchar(50)
  • SalesTaxRate - (optional)- float
  • RateState - (optional)- float
  • ReportingCodeState - (optional)- varchar(50)
  • RateCounty - (optional)- float
  • ReportingCodeCounty - (optional)- varchar(50)
  • RateCity - (optional)- float
  • ReportingCodeCity - (optional)- varchar(50)
  • RateSpecialDistrict - (optional)- float
  • ReportingCodeSpecialDistrict - (optional)- varchar(50)
  • City - (part of primary key)- varchar(50)
  • PostOffice - (optional)- varchar(50)
  • State - (part of primary key)- varchar(50)
  • County - (optional)- varchar(50)
  • ShippingTaxable - (optional)- bit
  • PrimaryRecord - (optional)- bit
  • Version - (part of primary key)- char(7)

GetInfoZip2TaxUSsByZipCodePart

Returns objects of Zip2TaxUS by alternate key ZipCode. Will be run on store 'System' automatically.

Syntax
$ahZip2TaxUSs = GetInfoZip2TaxUSsByZipCodePart($ZipCode);
Input
$ZipCode (varchar(50))
Return
$ahZip2TaxUSs (reference to array of hashes)
with following keys:
  • z2t_ID - (optional)- int
  • ZipCode - (part of primary key)- varchar(50)
  • SalesTaxRate - (optional)- float
  • RateState - (optional)- float
  • ReportingCodeState - (optional)- varchar(50)
  • RateCounty - (optional)- float
  • ReportingCodeCounty - (optional)- varchar(50)
  • RateCity - (optional)- float
  • ReportingCodeCity - (optional)- varchar(50)
  • RateSpecialDistrict - (optional)- float
  • ReportingCodeSpecialDistrict - (optional)- varchar(50)
  • City - (part of primary key)- varchar(50)
  • PostOffice - (optional)- varchar(50)
  • State - (part of primary key)- varchar(50)
  • County - (optional)- varchar(50)
  • ShippingTaxable - (optional)- bit
  • PrimaryRecord - (optional)- bit

GetTaxRateOrRangeByZipCodeCityState

Gets the SalesTaxRate for primary keys ZipCode, City, State. if the state is origin based. Gets the SalesTaxRate range for the State ZipCode, City, State. if the state is destimation based. Will be run on store 'System' automatically.

Syntax
GetTaxRateOrRangeByZipCodeCityState($hParams);
Input
$hParams (reference to hash)
with following keys:
  • ZipCode - (part of primary key)- varchar(50)
  • City - (part of primary key)- varchar(50)
  • State - (part of primary key)- varchar(50)
Return
$InfoZip2Tax (reference to array of hashes)
with following keys:
  • SalesTaxRateMin - float
  • SalesTaxRateMax - float
  • OriginBased - bit

ImportZip2TaxUSTable

Imports a zip2tax-formatted csv file to the zip2taxus table. Existing entries won't be updated. Will be run on store 'System' automatically.

Syntax
ImportZip2TaxUSTable($FileName, $Version);
Input
$FileName (string)
file path of the csv file
$Version (string)
version, defaults to current version

LoadSystemDBTable

Loads $CsvFile (or ftp://ftp.epages.com/pub/epages/data/SystemDBDump/$TableName.csv) into table systemdb.$TableName using RunOnStore($StoreName) (default: Backup). Columns in CSV file must be tab separated and lines must be '\n' separated.

Syntax
my $Result = LoadSystemDBTable($TableName, $StoreName, $CsvFile);
Input
$TableName (string (req.))
name of table to load, e.g. zip2taxus
$StoreName (string (optional))
use this connection to load data
$CsvFile (string (optional))
path to CSV file
Return
$Result (boolean)
0 - failure, 1 - success

UpdateZip2TaxUSMetaTable

Initializes the zip2taxusmeta table with the given zip2taxus version and update URL. Will be run on store 'System' automatically.

Syntax
UpdateZip2TaxUSMetaTable();
Input
$Version (string)
zip2taxus version
$UpdateURL (string)
provider update URL

UpdateZip2TaxUSTable

Updates the zip2taxus table with the fresh fetched version from the provider. Can be executed without downtime. Will be run on store 'System' automatically.

Syntax
UpdateZip2TaxUSTable();
Return
$Message (string)
returns a message if the current version equals the next
version (update already done in a given month), otherwise undef