DIBS-Payment-Services/Zen-Cart — pull request #14 by syntaxerror (2014-11-27 07:08:35+00:00)
Title: Fix for negative tax on free shipping coupon

Today when a coupon with free shipping is used, the shipping rate is sent to DPW as a negative value because of the tax being subtracted from zero.

With this fix the tax is only subtracted from shipping rate if it's grater than the tax value.

Note! It might need to be added more checking and calculation to avoid any other issues, but I really don't see how that would be any real issues - unless the carts config is very wrong. Normally it should be enough to do the subtraction of tax if shipping rate is greater than zero, I just used greater than tax value to ensure it's not getting negative...