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.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);