no_negative_tax — disallow tax calculations to apply negative value
When the pragma is enabled and the tax calculation yields a negative number, the tax amount applied will be reset to zero.
Interchange 5.7.0 (2/2 contexts shown):
Source: lib/Vend/Interpolate.pm (rev. 2.308 from Mon Sep 22 00:01:19 2008)
Line 5637 (context shows lines 5627-5641 in salestax():5594)
}
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 (rev. 2.308 from Mon Sep 22 00:01:19 2008)
Line 5694 (context shows lines 5684-5698 in salestax():5594)
{ 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);