[interchange-docs] xmldocs - docelic modified refs/SalesTaxFunction

docs at icdevgroup.org docs at icdevgroup.org
Sat Apr 26 17:15:30 UTC 2008

User:      docelic
Date:      2008-04-26 17:15:30 GMT
Added:     refs     SalesTaxFunction
* SalesTaxFunction docs added

Revision  Changes    Path
1.1                  xmldocs/refs/SalesTaxFunction

rev 1.1, prev_rev 1.0
Index: SalesTaxFunction
__NAME__ purpose
specify custom tax calculation function

__NAME__ see also

__NAME__ synopsis
<arg choice='plain'><replaceable>subroutine_name</replaceable></arg>

__NAME__ description
The directive specifies custom sales &glos-tax; function.
The function return value has to be a &PERL; hash, just like
other &IC; tax calculation methods would return. 
<emphasis role='bold'>Make sure the "DEFAULT" value is returned, or
the tax will unconditionally yield zero</emphasis>.

__NAME__ notes

__NAME__ 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;

__NAME__ example: Calculate tax
SalesTaxFunction  <<EOR
return {
  DEFAULT => 0.0,
  IL => 0.075,
  OH => 0.065,

__NAME__ example: Specify tax subroutine defined elsewhere
SalesTaxFunction  custom_tax_routine

More information about the docs mailing list