mergesort
mergesort

Reputation: 5197

How can I charge sales tax depending on merchant?

I have a table of all zip codes (and states) and sales tax rates and a table of merchants. I am trying to store which merchants charge sales taxes in which states. I was planning on adding a table which maps merchants to states they charge taxes in. However, there are a bunch of exemptions for different categories. For example, New York doesn't charge sales tax on clothes if the total is under $110, and Vermont doesn't charge sales tax on clothes at all.

Can I store something like that in a database in a clean way, or should I create a messy helper file that includes these rules?

Upvotes: 0

Views: 67

Answers (2)

Jay
Jay

Reputation: 27492

Is your intent that you will use this database to calculate sales tax, or that it is purely for reference/information?

If you're using it to calculate the tax, then a "messy helper file" would be, well, very messy.

If you're trying to deal with sales taxes from many states, then as Buddy says, this is a huge job. I had a little business in Ohio for a while and I was only selling one product and only had to deal with Ohio taxes, and it was still a complicated mess because of all the different taxing entities and different rates. Worst was the sales tax to support mass transit in Cleveland, as the places where this tax was imposed did not follow any simple geographical boundaries, that is, you couldn't just say "county X, yes or no" or anything like that. The only practical way to tell was to submit an address to their web site and they'd tell you if it was within their boundary. If you have to deal with all 50 states I'd be terrified at all the special cases that are likely to come up. So if you can find some third party software to do this, I'd seriously consider it. Somebody who has the resources to study the tax laws of every state and figure them all out and keep current on them.

Failing that ... I'd say you'd have to go through every state's laws and figure out all the cases that you have to deal with. Many states exempt some categories of products, like food and clothes. Some have different rates for different products, like surtaxes on luxury goods. I hadn't heard of an exemption up to a certain amount before, but apparently that's something else to consider. I'd say you have to find out what all the rules are, what data you need to support each, and build a monster table of all these rules. Presumably the table would include columns for applicable taxing entity, product category, rate for this category (possibly zero), and dollar threshold at which the rate applies. Maybe you'll discover other things.

Upvotes: 0

user2191247
user2191247

Reputation:

You're in for a world of hurt if you try to roll out your own billing from scratch. There are also city, county, special purpose district, and transit authority taxes with various exemptions rules depending on where you are buying from.

Recommend using third party billing — for a lot of reasons, mostly outside of the scope of SO. With third party billing, you just need to concentrate on classifying the items correctly.

Upvotes: 1

Related Questions