Enable / Disable Tax on Shipping


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

By jcosmo - Thu 14 Jan 2016
Shipping as far as I know is never taxed in the U.S. - I've never worked on a site where shipping has been taxed. But Kartris is set up so that if tax is applied, it is always applied to shipping fees as well.

I found this forum post about how to remove tax from shipping: http://forum.kartris.com/Topic3232.aspx. But this post permanently removes it. I think this is something that should be configurable as part of the Kartris code base.

I created a configuration variable for it with the following SQL:
INSERT INTO tblKartrisConfig (CFG_Name, CFG_Value, CFG_DataType, CFG_DisplayType, CFG_DisplayInfo, CFG_Description, CFG_VersionAdded, CFG_DefaultValue, CFG_Important)
VALUES ('general.tax.chargeonshipping', 'y', 's', 'b', 'y|n', 'Whether to charge tax on shipping', '2.8004', 'y', 0)
GO

I then modified BasketBLL.vb at Line 1737 to be:
If GetKartConfig("general.tax.chargeonshipping") = "y" Then
ShippingPrice.TaxRate = IIf(ApplyTax, .ComputedTaxRate, 0)

Else
ShippingPrice.TaxRate = 0
End If

I then modified KartrisClasses.vb at Line 356 to be:
If GetKartConfig("general.tax.chargeonshipping") = "y" Then
If blnUStaxEnabled Or blnSimpletaxEnabled Then

numShippingTaxRate = ShippingCountry.ComputedTaxRate
Else
blnNormalShippingTax = True
End If
Else
numShippingTaxRate = 0
End If

And finally modified KartrisClasses.vb at Line 439 to be:
If GetKartConfig("general.tax.chargeonshipping") = "y" Then
If blnUStaxEnabled Or blnSimpletaxEnabled Then
numShippingTaxRate = ShippingCountry.ComputedTaxRate
Else
blnNormalShippingTax = True
End If
Else
numShippingTaxRate = 0
End If

This allows whether or not the shipping is taxed to be configured in the admin. It would be great to see this included in the code base in a future release.







By Paul - Sat 6 Feb 2016
We have an update for this but we've approached it in a different way. It's based on something we did have in the past but was removed and simplified.

In EU tax regimes, the rate of tax is selectable in a dropdown at version level, and for each shipping method. When in US tax regime mode, the dropdown becomes a checkbox for versions (simply whether items have tax or not). But this was hidden for shipping methods.

So we have made that visible and also hooked up the code to decide if the box should be checked or not, and also to save the correct details depending on if the box is checked or not.

We use the same principle as for versions; for 'no tax' we find the first tax rate record (taxrates table in db) that has a value of 0 (i.e. 0 percent tax in EU mode). For 'with tax' we find the ID of the first tax rate record that has a value above zero (e.g. 20 or whatever for EU tax mode).

The calculations at checkout are already there, so no change was needed. We just needed a small change in KartrisClasses.vb to apply the calculation logic to shipping methods.

This is the changeset:

https://kartris.codeplex.com/SourceControl/changeset/43851

The advantage of this route is that you can choose whether to apply tax for different shipping methods. So it's a little more flexible. It may be that you need all without tax, but just in case there is some special method that is taxable, this will support that.