UPS Shipping and Tax


https://forum.kartris.com/Topic7004.aspx
Print Topic | Close Window

By Tiggywiggler - Wed 28 Feb 2018
Hello everyone,

I am experiencing a very odd problem. I can see what is happening but I cannot get 'in the head' of the original Kartris programmer to know why this module is behaving the way it is.

When you calculate shipping through the UPS shipping gateway, the Kartris shipping class in kartrisclasses.vb will call the method:

Public Sub New(ByVal ShippingCountry As Country, ByVal objShippingOption As Interfaces.objShippingOption, ByVal intTempID As Integer)

This method sets the variable numShippingTaxRate to -1 when it is instanciated. A value of -1 means that the tax is '-100%' or fully discounted in other words. This property is overwritten with a value of 0 only if the destination location is not a taxable location. This means that if you are shipping to a location that does not apply sales tax (most of the USA) then the tax rate on the shipping is set to 0% (or no discount and no additional charge).

The issue is that when shipping to New York, this has a sales tax of 8.875% which means that the condition

If Not ShippingCountry.D_Tax Then

is never hit. The result is that the value numShippingTaxRate = -1 is never overwritten. In fact, there isn't any logic in this module that would overwrite this rate in the situation that the destination applies tax.

Given that there is nowhere that the value could be overwritten I am completely stumped as to what the originally programmer of this module was trying to achieve.

Has anyone got a solution that they have found or does anyone know why this problem would exist?