Where in the world are you calling from?

R

Roedy Green

I wrote a pair of Applets to compute sales tax. I did some looking at
web hit stats and discovered the Canadian Tax calculator is my most
popular piece of software. It would be nice if it could
automatically default configure itself to the province/state of the
user.

I can get the country from Locale.getDefault().getCountry(), but not
the state/province.

It does not have to be 100% accurate.

It might be done with some rough IP table ranges, ideally something in
pure Java. Any ideas?

I know there are commercial IP categorising services and tables, but I
have no budget. This, like all my software is free.

I suppose I might do a cookie or Preference to record the last choice,
but that would require signing the Applet, which scares people off.
 
G

GArlington

I wrote a pair of Applets to compute sales tax. I did some looking at
web hit stats and discovered the Canadian Tax calculator is my most
popular piece of software. It would be nice if it could
automatically default configure itself to the province/state of the
user.

I can get the country from Locale.getDefault().getCountry(), but not
the state/province.

It does not have to be 100% accurate.

It might be done with some rough IP table ranges, ideally something in
pure Java. Any ideas?

I know there are commercial IP categorising services and tables, but I
have no budget. This, like all my software is free.

I suppose I might do a cookie or Preference to record the last choice,
but that would require signing the Applet, which scares people off.

How about "Geolocation by IP Address" on google?
 
G

GArlington

I wrote a pair of Applets to compute sales tax. I did some looking at
web hit stats and discovered the Canadian Tax calculator is my most
popular piece of software. It would be nice if it could
automatically default configure itself to the province/state of the
user.

I can get the country from Locale.getDefault().getCountry(), but not
the state/province.

It does not have to be 100% accurate.

It might be done with some rough IP table ranges, ideally something in
pure Java. Any ideas?

I know there are commercial IP categorising services and tables, but I
have no budget. This, like all my software is free.

I suppose I might do a cookie or Preference to record the last choice,
but that would require signing the Applet, which scares people off.

http://netgeo.caida.org/perl/netgeo.cgi?target=156.251.0.15
 
T

Tom Anderson

For the US, which I assume you are considering covering because of the
mention of "state", knowing the state is not sufficient. A city can have
its own sales tax rate.

No, i think by 'state' he means LAW_ABIDING_CITIZEN or TAX_EVADER. :)

Or REGISTERED_CHARITY, i guess. Don't know if that matters in Canada.

tom
 
D

Dave Miller

Roedy said:
I wrote a pair of Applets to compute sales tax. I did some looking at
web hit stats and discovered the Canadian Tax calculator is my most
popular piece of software. It would be nice if it could
automatically default configure itself to the province/state of the
user.

I can get the country from Locale.getDefault().getCountry(), but not
the state/province.

It does not have to be 100% accurate.

It might be done with some rough IP table ranges, ideally something in
pure Java. Any ideas?

I know there are commercial IP categorising services and tables, but I
have no budget. This, like all my software is free.

I suppose I might do a cookie or Preference to record the last choice,
but that would require signing the Applet, which scares people off.
There is a free GeoIP database, available as a csv file, at:

http://www.maxmind.com/app/geolitecity
 
T

Tom Anderson

It might be done with some rough IP table ranges, ideally something in
pure Java. Any ideas?

Aside from the suggestions others have made, how about asking people for
their location, but then sending it back to your server, so you yourself
can build up some IP-to-location data? Might take a long time to build up
enough, though. Plus, there might be data protection law issues; no idea
how that works outside the EU.
I suppose I might do a cookie or Preference to record the last choice,
but that would require signing the Applet, which scares people off.

Could you do something with HTML and/or javascript to do the cookie bit
without having to use a signed applet?

tom
 
D

Dave Miller

Eric said:
GArlington said:
[...]
I know there are commercial IP categorising services and tables, but I
have no budget. This, like all my software is free.
[...]

http://netgeo.caida.org/perl/netgeo.cgi?target=156.251.0.15

Interesting! I tried it with my own IP address, and it
pinpointed my location right away, with an error of only
3128 miles!
GeoIp location is definitely a work in progress. Most are using a
combination of trace routing and user reporting to build range tables.

The below server is in Lenexa, KS. The datacenter is owned by a German
company and the table has it in Amsterdam. There's not a young man in
Lenexa that doesn't wish the table correct.

http://netgeo.caida.org/perl/netgeo.cgi?target=217.160.252.47
 
T

Tim Slattery

Patricia Shanahan said:
For the US, which I assume you are considering covering because of the
mention of "state", knowing the state is not sufficient. A city can have
its own sales tax rate.

As can counties and special tax districts that straddle county and
city boundaries. And many systems try to use postal ZIP codes to
determine which jurisdiction a customer is in, but that doesn't work
either. For example, my home has an Alexandria, VA mailing address
and zip code, but I live next door in Fairfax County. Different
jurisdiction, potentially different rates. The USPS set up the ZIP
system to help it deliver mail, ZIPs don't correspond to political
boundaries (except state boundaries, I think).
 
A

Arne Vajhøj

Patricia said:
For the US, which I assume you are considering covering because of the
mention of "state", knowing the state is not sufficient. A city can have
its own sales tax rate.

Maybe he just wrote states to explain to those south of the border
that are not aware of what a province is ...

Arne
 
R

Roedy Green

For the US, which I assume you are considering covering because of the
mention of "state", knowing the state is not sufficient. A city can have
its own sales tax rate.

I don't have all the districts coded. I was hoping for was to get at
least the state. In states where I don't have district info, I just
compute state tax.
 
R

Roedy Green

Actually, in the US, not even a city or zip code is sufficient to get the
correct value. The system is so complex that most of the time sales tax
returns are just estimates of the true value.

I think the current scheme is nuts. One massive simplification would
be to use a single sales tax per vendor, rather than having the vendor
compute the tax based on the district the vendor lives. How can you
possibly remit sanely?

The government services are to the vendor, not the buyer.

It is too complex. It necessitates tax evasion.
 
T

Tom Anderson

I think the current scheme is nuts. One massive simplification would be
to use a single sales tax per vendor, rather than having the vendor
compute the tax based on the district the vendor lives. How can you
possibly remit sanely?

The government services are to the vendor, not the buyer.

Are you saying the government provides no services to people who buy
things?

I agree with your conclusion, but not your reason for it!
It is too complex. It necessitates tax evasion.

Sales taxes are also highly regressive - the poorer you are, the more of
your income you spend on things which attract sales tax, ie almost
everything except a mortgage.

tom
 
R

Roedy Green

I think the current scheme is nuts. One massive simplification would
be to use a single sales tax per vendor, rather than having the vendor
compute the tax based on the district the vendor lives. How can you
possibly remit sanely?

whoops. I meant to say:

I think the current scheme is nuts. One massive simplification would
be to use a single sales tax per vendor, rather than having the vendor
compute the tax based on the district the buyer lives. How can you
possibly remit sanely?

If the government wants to work it that way, it behooves them to
provide a service to find the rate given the ip/address/zip of a
buyer. Every vendor in the country can't expected to collect and
maintain such information.

If the federal government provides it, the vendor can't be liable for
errors.
 
R

Roedy Green

Are you saying the government provides no services to people who buy
things?

no, but the services associated with the goods sold were provided by
vendor's district, not the buyer's.

For example, the vendor's district provided police, water, roads,
bridges, business climate ...

What did the buyer's district contribute?

When the buyer and vendor reside in the same district, it does not
matter whom you imagine controls the rate. There the services to
provide the goods are provided by that district.

I think it should depend on the vendor's district, rather than the
buyer's district for the following reasons:

1. easier to compute. Just one rate.

2. vendor can't very well lie about his district. The buyer can.

3. easier to remit. All money goes to the local district.

4. easier to enforce. A district only has to monitor local business.

5. You collect sale tax on foreign sales. Why should a district
subsidise foreigners?

If you want some sort of equalisation payments, to shift money between
districts, let that be negotiated by the districts and handles with a
single yearly cheque. There is no need to involve every interdistrict
financial transaction.
 
R

Roedy Green

In the U.S. the sales tax is not based on the location of the vendor but on
the location of the buyer.

Agreed. I scrambled my sentence. I argue it should be the reverse.
Quoting from
http://mindprod.com/products1.html#AMERICANTAX


Call for Sales Tax Reform
*************************

I think the current US sales tax scheme is nuts. One
massive simplification would be to use a single sales tax
per vendor, rather than having the vendor compute the tax
based on the district the buyer lives. How can the vendor
possibly remit to every possible district?

The scheme is too complex. It necessitates tax evasion.

The services associated with the goods sold were provided by
vendor's district, not the buyer's. For example, the
vendor's district provided police, water, roads, bridges,
business climate ...

What did the buyer's district contribute? nothing!

When the buyer and vendor reside in the same district, it
does not matter whom you imagine controls the rate. There
the services to provide the goods are provided by that
district.

I think the tax rate should depend on the vendor's
district, rather than the buyer's district for the following
reasons:

1. Easier to compute. Just one rate.

2. The vendor can't very well lie about his district. The
buyer can.

3. Easier to remit. All money goes to the local district.

4. Easier to enforce. A district only has to monitor local business.

5. You collect sale tax on foreign sales. Why should a
district subsidise foreigners?

If you want some sort of equalisation payments, to shift
money between districts, let that be negotiated by the
districts, state or federal government and handled with a
single yearly cheque to provide the aggregate adjustment.
There is no need to involve every interdistrict financial
transaction, every vendor and every buyer.
 
R

Roedy Green

Maybe he just wrote states to explain to those south of the border
that are not aware of what a province is ...

There are two applets, one for Canadian Sales tax. Anyone outside
Canada is treated identically.

The other is for US Sales tax. Anyone outside the USA is treated
identically.

US sales tax is much more complicated since it depends on the buyer's
district, not just his state.

I have worked out district tables for some of the states, but I could
not find them for all states. For some states, I compute only the
state level tax.

I can't see how the American system functions at all when it is so
difficult to find sales tax info, the info is not in machine friendly
form. It would take a person dedicated to maintaining tables.

Further, how the hell do you know where a buyer REALLY is.
The districts are not defined in any way an outsider could possibly
make sense of.

To see what I have done, see
http://mindprod.com/applet/canadiantax.html
http://mindprod.com/applet/americantax.html
 
T

Tim Slattery

Roedy Green said:
If the federal government provides it, the vendor can't be liable for
errors.

It's not the federal government's business, they aren't collecting
these taxes. It's the various states, counties, cities, special
districts.

You're right, it would be nice to have some kind of central directory
of this stuff so that a vendor could look up a customer's street
address (maybe) and see who is supposed to get how much. With so many
different entities forming, dissolving, changing boundaries, changing
rates, charging and removing surcharges, etc, etc, it would be a
nightmare.
 
T

Tom Anderson

no, but the services associated with the goods sold were provided by
vendor's district, not the buyer's.

That's based on the assumption that the purpose of sales taxes is to pay
for the services which enabled the good to be sold. My understanding is
that governments basically treat sales taxes as just another way of
raising money.
For example, the vendor's district provided police, water, roads,
bridges, business climate ...

What did the buyer's district contribute?

The same things. If they hadn't, the buyer probably wouldn't have been in
a position to make the purchase!
I think it should depend on the vendor's district, rather than the
buyer's district for the following reasons:

1. easier to compute. Just one rate.
2. vendor can't very well lie about his district. The buyer can.
3. easier to remit. All money goes to the local district.
4. easier to enforce. A district only has to monitor local business.

These are excellent reasons, and i agree entirely.
5. You collect sale tax on foreign sales. Why should a district
subsidise foreigners?

Because the foreign country probably isn't charging sales tax on things
you buy from them, and you don't really want to encourage them to start.
Particularly if, like the US, you're running a trade deficit.

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top