Name

no_negative_tax — disallow tax calculations to apply negative value

VALUE

0 | 1

DEFAULT

0

DESCRIPTION

When the pragma is enabled and the tax calculation yields a negative number, the tax amount applied will be reset to zero.

EXAMPLES

Example: Enable no_negative_tax

Put the following in catalog.cfg:

Pragma no_negative_tax

NOTES

AVAILABILITY

no_negative_tax is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0 (2/2 contexts shown):

Source: lib/Vend/Interpolate.pm
Line 5728 (context shows lines 5718-5732 in salestax():5685)

}
else {
  $tax_hash = $Vend::Cfg->{SalesTaxTable};
#::logDebug("looking for tax function: " . uneval($tax_hash));
}

# if we have a cost from previous routines, return it
if(defined $cost) {
  $Vend::Items = $save if $save;
  switch_discount_space($oldspace) if defined $oldspace;
  if($cost < 0 and $::Pragma->{no_negative_tax}) {
    $cost = 0;
  }
  return Vend::Util::round_to_frac_digits($cost);
}

Source: lib/Vend/Interpolate.pm
Line 5785 (context shows lines 5775-5789 in salestax():5685)

        {  mv_price  => $amount, 
          code    => $code,
          quantity  => $amount, }, $tax);
  }
#::logDebug("salestax: final tax='$r' for code='$code'");
  last;
}

$Vend::Items = $save if defined $save;

if($r < 0 and ! $::Pragma->{no_negative_tax}) {
  $r = 0;
}

return Vend::Util::round_to_frac_digits($r);

AUTHORS

Interchange Development Group

SEE ALSO

tax

DocBook! Interchange!