SalesTaxFunction
Define a Perl subroutine that will return a hash reference with sales
tax settings.
Synopsis
|
SalesTaxFunction Perl code
|
Scope
This directive is only available for use in the local
(catalog.cfg) configuration file.
It will not affect any other website in any way.
This directive will not work in the global
(interchange.cfg) configuration file.
Description
This directives is used to define a Perl subroutine that will return a
hash reference with the sales tax settings.
|
Warning
The returned hash reference must contain a "DEFAULT" key.
All other values are optional.
|
See the Interchange sales tax calculations page for more
information on how Interchange uses the provided values to calculate
sales tax.
Examples
Query a table, or a text file in this case, tax rates used by a particular vendor
SalesTaxFunction <<EOS
my $vendor_code = $Session->{source};
my $tax = $TextSearch->hash({
fi => 'salestax.asc',
sf => 'vendor_code',
se => $vendor_code,
ml => 1000,
});
$tax ||= {};
$tax->{DEFAULT} = 0.00;
return $tax;
EOS
|
Simply define and return a Perl hash reference
SalesTaxFunction <<EOS
return {
DEFAULT => 0.000,
IL => 0.075,
OH => 0.065,
};
EOS
|
See Also