Name

SalesTaxFunction — specify custom tax calculation function

SYNOPSIS

subroutine_name

DESCRIPTION

The directive specifies custom sales tax function.

The function return value has to be a Perl hash, just like other Interchange tax calculation methods would return. Make sure the "DEFAULT" value is returned, or the tax will unconditionally yield zero.

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Calculate tax amount based on vendor

SalesTaxFunction  <<EOR
my $vendor_id = $Session->{source};

my $tax_hash = $TextSearch->hash( {
  se => $vendor_id,
  fi => 'salestax.asc',
  sf => 'vendor_code',
  ml => 1000,
  } );

$tax_hash = {} if ! $tax_hash;
$tax_hash->{DEFAULT} = 0;

return $tax_hash;
EOR

Example: Calculate tax

SalesTaxFunction  <<EOR
return {
  DEFAULT => 0.0,
  IL => 0.075,
  OH => 0.065,
};
EOR

Example: Specify tax subroutine defined elsewhere

SalesTaxFunction  custom_tax_routine

NOTES

AVAILABILITY

SalesTaxFunction is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 683

['SalesTaxFunction', undef,            ''],

AUTHORS

Interchange Development Group

SEE ALSO

tax

DocBook! Interchange!