SalesTaxFunction — specify custom tax calculation function
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.
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