Java Forum / General / May 2008
Where in the world are you calling from?
Roedy Green - 15 May 2008 12:11 GMT 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.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
GArlington - 15 May 2008 13:57 GMT On May 15, 12:11 pm, Roedy Green <see_webs...@mindprod.com.invalid> wrote:
> 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 [quoted text clipped - 19 lines] > Roedy Green Canadian Mind Products > The Java Glossaryhttp://mindprod.com How about "Geolocation by IP Address" on google?
GArlington - 15 May 2008 13:58 GMT On May 15, 12:11 pm, Roedy Green <see_webs...@mindprod.com.invalid> wrote:
> 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 [quoted text clipped - 19 lines] > Roedy Green Canadian Mind Products > The Java Glossaryhttp://mindprod.com http://netgeo.caida.org/perl/netgeo.cgi?target=156.251.0.15
Eric Sosman - 15 May 2008 15:43 GMT > On May 15, 12:11 pm, Roedy Green <see_webs...@mindprod.com.invalid> > wrote: [quoted text clipped - 4 lines] > > 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!
 Signature Eric.Sosman@sun.com
Dave Miller - 15 May 2008 15:55 GMT >> On May 15, 12:11 pm, Roedy Green <see_webs...@mindprod.com.invalid> >> wrote: [quoted text clipped - 8 lines] > 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
 Signature Dave Miller Java Web Hosting at: http://www.cheap-jsp-hosting.com/
Kenneth P. Turvey - 15 May 2008 19:17 GMT >> 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! Only off by 2,612 miles here.
 Signature Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Arne Vajhøj - 15 May 2008 23:09 GMT >>> 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! > > Only off by 2,612 miles here. Thousands of miles wrong here too.
That service is not good.
There are plenty of better services.
http://www.maxmind.com/app/locate_my_ip
seems a lot more reliable.
Arne
Dave Miller - 15 May 2008 23:21 GMT >>>> http://netgeo.caida.org/perl/netgeo.cgi?target=156.251.0.15 >>> Interesting! I tried it with my own IP address, and it [quoted text clipped - 13 lines] > > Arne Maxmind is better - they have our Kansas server in Georgia (at least it's the right continent & country) and the server below they have spot on in Vancouver, BC.
 Signature Dave Miller Java Web Hosting at: http://www.cheap-jsp-hosting.com/
Eric Sosman - 16 May 2008 02:44 GMT >> On May 15, 12:11 pm, Roedy Green <see_webs...@mindprod.com.invalid> >> wrote: [quoted text clipped - 8 lines] > pinpointed my location right away, with an error of only > 3128 miles! ... about half the 6225-mile mean error of just picking a completely random point on Earth's surface. Most such random points would be underwater, unlikely to be the locations of clients or servers. Assuming I'm on dry land somewhere and that the service designates another randomly-chosen dry-land location as "where I am," calculating the mean error is beyond my mathematical powers.
 Signature Eric Sosman esosman@ieee-dot-org.invalid
Patricia Shanahan - 15 May 2008 14:22 GMT > 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. 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.
Patricia
Tom Anderson - 15 May 2008 15:17 GMT >> 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 [quoted text clipped - 4 lines] > 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
 Signature ... but when you spin it it looks like a dancing foetus!
Kenneth P. Turvey - 15 May 2008 15:40 GMT > 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. 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.
It is a mess.
 Signature Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Roedy Green - 15 May 2008 23:38 GMT On 15 May 2008 14:40:05 GMT, "Kenneth P. Turvey" <kt-usenet@squeakydolphin.com> wrote, quoted or indirectly quoted someone who said :
>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.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tom Anderson - 16 May 2008 01:43 GMT > On 15 May 2008 14:40:05 GMT, "Kenneth P. Turvey" > <kt-usenet@squeakydolphin.com> wrote, quoted or indirectly quoted [quoted text clipped - 10 lines] > > 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
 Signature roger and kay payne, symmetry, piercing, archaeology, position, in ,,
Roedy Green - 16 May 2008 15:56 GMT On Fri, 16 May 2008 01:43:28 +0100, Tom Anderson <twic@urchin.earth.li> wrote, quoted or indirectly quoted someone who said :
>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.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tom Anderson - 16 May 2008 18:36 GMT > On Fri, 16 May 2008 01:43:28 +0100, Tom Anderson > <twic@urchin.earth.li> wrote, quoted or indirectly quoted someone who [quoted text clipped - 5 lines] > 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: [quoted text clipped - 3 lines] > 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
 Signature It's the 21st century, man - we rue _minutes_. -- Benjamin Rosenbaum
Roedy Green - 18 May 2008 15:42 GMT On Fri, 16 May 2008 18:36:49 +0100, Tom Anderson <twic@urchin.earth.li> wrote, quoted or indirectly quoted someone who said :
>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. Yes obviously.
Consider this scenario. Let's say you ordered 20 tonnes of recycled toilet paper. Why should your district get the tax money when the other district had to do all the work of providing the infrastructure to help manufacture it, e.g. water, roads etc.?
Local taxes are supposed be be for supporting local government expenditures.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
RedGrittyBrick - 18 May 2008 18:16 GMT > On Fri, 16 May 2008 18:36:49 +0100, Tom Anderson > <twic@urchin.earth.li> wrote, quoted or indirectly quoted someone who [quoted text clipped - 11 lines] > other district had to do all the work of providing the infrastructure > to help manufacture it, e.g. water, roads etc.? * Because they need the money to supply the raw materials ordered by the second hand toilet paper factory? (Symmetry)
* Because it costs money to process used recycled toilet paper when it arrives in the local sewerage system?
* Because they don't care what the tax relates to, only that they need money for local schools etc?
> Local taxes are supposed be be for supporting local government > expenditures. Even areas that use recycled toilet paper have local services that need paying for somehow.
I obviously don't understand this discussion since it seems very circular to me.
If my local district thought they could raise money by taxing farts in Timbuktu I'm sure they would consider it. There's no need for the thing being taxed to be related in any way to the uses made of the tax money. Where I live, windows used to be taxed and income tax was a temporary measure to fund a war with a nearby empire-builder. There is rarely much correlation between source and usage of tax revenues, as far as I can see.
 Signature RGB
Tom Anderson - 18 May 2008 18:58 GMT > On Fri, 16 May 2008 18:36:49 +0100, Tom Anderson > <twic@urchin.earth.li> wrote, quoted or indirectly quoted someone who [quoted text clipped - 11 lines] > district had to do all the work of providing the infrastructure to help > manufacture it, e.g. water, roads etc.? Well, my district is going to provide the drains which are going to take it all away again, for one.
> Local taxes are supposed be be for supporting local government > expenditures. Absolutely. But a sales tax could be local to the buyer rather than the seller. Although then you should probably call it a purchase tax.
tom
 Signature These spoiled youths forget that when they are shaven they look like boiled potatoes. -- Tara Singh
Lew - 20 May 2008 02:45 GMT > Absolutely. But a sales tax could be local to the buyer rather than the > seller. Although then you should probably call it a purchase tax. The term I've heard in the U.S. is "use tax". If I purchase an item by mail order from some other state, or even another country AFAIK, I am by law required to remit the use tax on that purchase to my state and local governments. The use tax rate is the same as the sales tax rate, and applies to the same items as sales tax, the only difference being that use tax is assessed where the vendor does not have a sales tax agreement with the jurisdiction where I make the purchase.
 Signature Lew
Lew - 16 May 2008 02:55 GMT > 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? In the U.S. the sales tax is not based on the location of the vendor but on the location of the buyer.
 Signature Lew
Eric Sosman - 16 May 2008 15:37 GMT >> 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 [quoted text clipped - 3 lines] > In the U.S. the sales tax is not based on the location of the vendor but > on the location of the buyer. IANAL, and I Expecially ANA Tax L, but isn't sales tax determined by the location of the transaction? A difficult thing to pin down, since the exchange of money for ownership or license rights or whatnot is something of an abstraction whose latitude and longitude are a bit fuzzy ...
Still: Here in Massachusetts USA, I pay "sales tax" on things I buy in the state, but I pay a "use tax" on things I buy elsewhere and bring into the state. It happens that the amount of the use tax is equal to the sales tax I would have paid had the purchase been made in-state, but the Revenue people are very careful to distinguish between them anyhow. I imagine this is because the state's authority to levy "sales tax" and "use tax" derive from different legal underpinnings, but I don't have any actual knowledge to back my imagination.
A practical difference: Sales tax (in Massachusetts, at any rate) is collected by the vendor at the point of sale, while use tax is reported by the buyer, usually as an additional line on the annual income tax return. Wink, wink, and see Amazon's lawsuit against the state of New York.
 Signature Eric.Sosman@sun.com
Travis James - 17 May 2008 00:52 GMT >>> 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 [quoted text clipped - 9 lines] > or license rights or whatnot is something of an abstraction > whose latitude and longitude are a bit fuzzy ... I think conceptually that's true but there must be some regulation on how those lines are drawn. In California, if I go to a lower-tax county and buy a plasma, I pay their tax rate. I suppose, like buying on Amazon, I should true up with the tax man at filing, but who does that.
However, when I was a boat salesman (which is practically the same as car sales), I had to get the buyer's zip code where it would be registered because we collected tax according to the underlying county of the buyer.
Sales tax is obviously a PITA, and most intelligent people could probably come up with a simplification to cover 90% of the cases. The problem is that each of our 10% cases will probably not be the same. So you end up with such craziness as the marshmallow tax (big ones are food and not taxable, little ones are taxed or something like that).
The city/county/district level taxes are what lets the politicians raise money for their favorite program with "just a little tax." We pay .1% (.001) towards our zoo, for example.
Lew - 17 May 2008 02:14 GMT Eric Sosman wrote:
>> IANAL, and I Expecially ANA Tax L, but isn't sales tax >> determined by the location of the transaction? A difficult >> thing to pin down, since the exchange of money for ownership >> or license rights or whatnot is something of an abstraction >> whose latitude and longitude are a bit fuzzy ...
> I think conceptually that's true but there must be some regulation on > how those lines are drawn. In California, if I go to a lower-tax county [quoted text clipped - 5 lines] > registered because we collected tax according to the underlying county > of the buyer. The location of the buyer is defined differently at law for the type of transaction. You walk into a store, you transact at the store, and the buyer is at the store for the transaction. The intimate involvement of cars and boats with law and registration and licensing must have something to do with the determination of the location to be at the home address. When a buyer purchases over the 'net, the location is the client seat.
Grey areas abound, no doubt.
 Signature Lew
Roedy Green - 18 May 2008 15:50 GMT >The location of the buyer is defined differently at law for the type of >transaction. You walk into a store, you transact at the store, and the buyer >is at the store for the transaction. The intimate involvement of cars and >boats with law and registration and licensing must have something to do with >the determination of the location to be at the home address. When a buyer >purchases over the 'net, the location is the client seat. All my life I have lobbied politicians for simplification of the income tax. I would say "I don't mind paying the tax, but I burns me up to be forced to compute it, especially when it is deliberately and obviously obfuscated (adding numbers in, then taking them away later, standard deductions). You could compute the exact same taxes much more simply, and further they don't have to be nearly so complex."
It is perhaps not so painful now with QuickTax, but I figured circa 1982 the government should provide a canonical QuickTax free to anyone to compute tax more easily.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Slattery - 19 May 2008 15:03 GMT >All my life I have lobbied politicians for simplification of the >income tax. I have completely given up hope that any kind of rationalization will *ever* come to income taxes. Every time the subject is raised, every lobbyist in the world descends on the legislature, looking for special breaks for their clients. Rational policies are impossible in that environment, it just ain't gonna happen.
 Signature Tim Slattery Slattery_T@bls.gov http://members.cox.net/slatteryt
Roedy Green - 18 May 2008 15:45 GMT On Fri, 16 May 2008 16:52:26 -0700, Travis James <travis.james@gmail.com> wrote, quoted or indirectly quoted someone who said :
>So >you end up with such craziness as the marshmallow tax (big ones are food >and not taxable, little ones are taxed or something like that). We have a strange tax dodge here in Canada. If you buy less than 6 bakery items, they are taxed. 6 or more and they are not. What is this for? To encourage gluttony. To discriminate against old age pensioners living alone? It is just something the bakery lobby got installed to encourage sales?
You'd think a tax would be designed to be ignored for trivial items and engaged for ones big enough to be worth the bother.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Smith - 20 May 2008 01:50 GMT > We have a strange tax dodge here in Canada. If you buy less than 6 > bakery items, they are taxed. 6 or more and they are not. What is > this for? To encourage gluttony. To discriminate against old age > pensioners living alone? It is just something the bakery lobby got > installed to encourage sales? I don't know how Canadian sales taxes work, but if they are like those in the US, then they probably distinguish between sales to consumers and sales to businesses. Perhaps they are using a heuristic: less than 6 is probably a sale to the consumer (taxed), whereas 6 or more is probably a sale to a restaurant or caterer or other reseller (not taxed).
Also in the US, many states treat food differently depending on whether it is sold for immediate consumption or sold to take home for later use. Whether a given item is taxed or not depends on the item, not what the customer actually says they are going to do with it. Soda is taxed, even though it is unlikely that a person who buys a 2 liter bottle at the grocery store as part of buying a bunch of groceries is going to do anything other than take it home, but it in the fridge, and consume it over several days.
Anyway, if Canada does something similar, then maybe they figure that 5 or less indicates something likely to be consumer soon, whereas 6 or more is probably a purchase that will be taken home for later use?
 Signature --Tim Smith
Roedy Green - 21 May 2008 03:28 GMT On Mon, 19 May 2008 17:50:59 -0700, Tim Smith <reply_in_group@mouse-potato.com> wrote, quoted or indirectly quoted someone who said :
>I don't know how Canadian sales taxes work, but if they are like those >in the US, then they probably distinguish between sales to consumers and >sales to businesses. Perhaps they are using a heuristic: less than 6 is >probably a sale to the consumer (taxed), whereas 6 or more is probably a >sale to a restaurant or caterer or other reseller (not taxed). The GST (federal sales tax) is quite clever. Everybody pays the GST. Businesses collect the GST. businesses total up their GST expenditures for the month.
They subtract the their expenditures from the GST collected. They remit that.
Its a clever system because everybody's records cross check everyone else's.
In my years in business I never encountered anyone cheating on it, or asking me to cheat.
The PST (Provincial Sales Tax) works differently. If you are a business, you show your PST number and the vendor does not change PST. However, it is such a hassle you would not bother except for large purchases. Because it would be so easy to cheat, vendors presume you are.
there are no county or city sales taxes. They get a cut of the other two taxes.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 21 May 2008 19:44 GMT On Wed, 21 May 2008 02:28:04 GMT, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>The GST (federal sales tax) is quite clever. Everybody pays the GST. >Businesses collect the GST. businesses total up their GST expenditures >for the month. I found a commercial service that for a mere $900 a year will tell me the sales tax rate given the zip code. Good lord, that same program for Canada could be written in 30 minutes including collecting all the data.
Surely there is some principle that says you should be able to comply with the law without expending $900 a year.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Slattery - 21 May 2008 21:17 GMT > I found a commercial service that for a mere $900 a year will tell me >the sales tax rate given the zip code. For the reasons I stated earlier in this thread, I very much doubt that this program can be 100% accurate. You simply *cannot* determine sales tax rates and districts from a USPS ZIP code.
 Signature Tim Slattery Slattery_T@bls.gov http://members.cox.net/slatteryt
RedGrittyBrick - 18 May 2008 18:34 GMT > Sales tax is obviously a PITA, and most intelligent people could > probably come up with a simplification to cover 90% of the cases. The > problem is that each of our 10% cases will probably not be the same. So > you end up with such craziness as the marshmallow tax (big ones are food > and not taxable, little ones are taxed or something like that). To the delight of lawyers
http://www.educationet.org/messageboard/posts/38833.html http://en.wikipedia.org/wiki/Jaffa_cake
I like the final summary in the trial transcript.
 Signature RGB
Tom Anderson - 18 May 2008 22:01 GMT >> Sales tax is obviously a PITA, and most intelligent people could >> probably come up with a simplification to cover 90% of the cases. The [quoted text clipped - 8 lines] > > I like the final summary in the trial transcript. There was a similar battle over teacakes recently - the little things comprising a soft biscuit base, with a marshmallow dome on top, coated in chocolate. The revenue said they were chocolate-covered biscuits (taxable), and the supermarkets said they were caked (not). From 1973, when VAT (our sales tax) was brought in, the revenue insisted on their tax. In 1994, they changed their mind. They then owed the supermarkets 21 years of back tax. Cue another decade of legal battles.
There's a BBC article on it with a handy table of the tax status of various biscuit/cake products:
http://news.bbc.co.uk/1/hi/world/europe/7340101.stm
There are some striking oddities. For example, a biscuit coated in chocolate is taxable, but one filled with chocolate (like a bourbon or BN) is not. Shortbread topped with caramel and then chocolate, aka millionaire's shortbread, is not taxable, but shortbread topped with only chocolate is taxable.
tom
 Signature These spoiled youths forget that when they are shaven they look like boiled potatoes. -- Tara Singh
Roedy Green - 16 May 2008 16:07 GMT >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.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 16 May 2008 15:49 GMT On Thu, 15 May 2008 22:38:46 GMT, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>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.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Slattery - 16 May 2008 17:45 GMT >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.
 Signature Tim Slattery Slattery_T@bls.gov http://members.cox.net/slatteryt
Roedy Green - 18 May 2008 15:55 GMT >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. If it were in a common format, a common database a vendor's computer could look up to get the current rate, either there would have to be formed some multi-state body to operate it, similar to an industry association, or the federal government.
Perhaps somebody like ISO could define an international standard for tax rate inquiries, and bit by bit states could adopt it. Your vendor program would have to communicate with 50 different computers, but at least they would use the same protocol.
It offends me somebody putting a scheme into practice they know CAN'T possibly be managed. Even people desperately wanting to be in 100% compliance with the law CAN'T be. That sort of thing is how disrespect for law gets started.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Slattery - 19 May 2008 15:01 GMT >It offends me somebody putting a scheme into practice they know CAN'T >possibly be managed. Welcome to politics! What will offend few enough legislators (and constituencies) to get passed is not necessarily the best or even the most practicable solution.
> Even people desperately wanting to be in 100% >compliance with the law CAN'T be. That sort of thing is how >disrespect for law gets started. No argument here.
 Signature Tim Slattery Slattery_T@bls.gov http://members.cox.net/slatteryt
Martin Gregorie - 19 May 2008 23:08 GMT > Even people desperately wanting to be in 100% > compliance with the law CAN'T be. That sort of thing is how > disrespect for law gets started. Its also meat and drink to wannabe dictators and other pond-life governments. Government:1 You:0 - forever.
 Signature martin@ | Martin Gregorie gregorie. | org | Zappa fan & glider pilot
Tim Slattery - 15 May 2008 17:23 GMT >> 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 [quoted text clipped - 5 lines] >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).
 Signature Tim Slattery Slattery_T@bls.gov http://members.cox.net/slatteryt
Lew - 16 May 2008 02:56 GMT > As can counties and special tax districts that straddle county and > city boundaries. And many systems try to use postal ZIP codes to [quoted text clipped - 4 lines] > system to help it deliver mail, ZIPs don't correspond to political > boundaries (except state boundaries, I think). I live in a county that borders a city, but my address has the city's ZIP code. I used to live in that city, but at that time my address had the county's ZIP code.
 Signature Lew
Arne Vajhøj - 15 May 2008 23:05 GMT >> 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 [quoted text clipped - 5 lines] > 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
Roedy Green - 16 May 2008 16:13 GMT >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
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Lew - 17 May 2008 02:17 GMT > 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 [quoted text clipped - 3 lines] > The districts are not defined in any way an outsider could possibly > make sense of. It's actually not up to you to collect sales tax for those buyers whose locations you cannot determine, or with whose locations you don't have arrangements. At least for USA purchasers. It's up to the buyer to remit the appropriate use tax. You're off the hook.
You don't have to use IP location. Have the purchase order include an averral of location. You take their word for it.
 Signature Lew
Roedy Green - 18 May 2008 17:47 GMT >It's actually not up to you to collect sales tax for those buyers whose >locations you cannot determine, or with whose locations you don't have [quoted text clipped - 3 lines] >You don't have to use IP location. Have the purchase order include an averral >of location. You take their word for it. So when the buyer asks you the sales tax, what do you say? It sounds like you have to tell him two values, the amount he must remit to you and the amount he must pay himself, depending on your "business presence" in his state.
If you are a business, you don't have to collect sales taxes from people in other states unless you have a business presence in that state. In that case, you must collect just the state tax, not the local tax.
I have been collecting tax rate trivial for a revision of the American Tax program. In doing so I think I figured out why it is the way it is. It is the notion of taxation without representation. If a vendor's district can collect tax from a remote buyer, the buyer has no redress to complain about the tax. He can't vote the bounders out of office who jacked up the taxes.
I have been looking at Colorado. Some of the new districts jack their rate way above the average. American sale tax rates are exceedingly variable, even city by city.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 15 May 2008 23:35 GMT >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.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Dave Miller - 15 May 2008 15:19 GMT > 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 [quoted text clipped - 15 lines] > 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
 Signature Dave Miller Java Web Hosting at: http://www.cheap-jsp-hosting.com/
Tom Anderson - 15 May 2008 15:19 GMT > 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
 Signature ... but when you spin it it looks like a dancing foetus!
Tim Smith - 18 May 2008 06:50 GMT > 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 [quoted text clipped - 6 lines] > > It does not have to be 100% accurate. Here are a couple of ideas for you.
You are in BC, right? So, that's on the west side of Canada. And if we ignore the Yukon Territory, the Northwest Territories, and the other northern parts of Canada, then the remaining provinces have an interesting property. They are all in roughly a line. That is, as you go east, each province just borders one other province on the east. BC borders Alberta. Alberta borders Saskatchewan. And so on, through Ontario bordering Quebec. There it breaks down, as Quebec borders both Newfoundland and something that is too small on the little map I'm looking at to let me make out its name. :-)
Anyway, the geographic arrangements means that there would be a fairly good correlation between province and distance from you. And you can get a rough idea of distance from network latency (very rough). So, first approximation--have the applet measure latency between the user and a server in BC, and guess the province based on that.
You could improve the accuracy of this by tracing the route, and reporting the route data, along with the provinces the user selects in the applet, to your server. You could then analyze that data, and figure out correlations between having certain hosts on routes and province selections. This would let you come up with a system for predicting province selections based on routes between the applet and your server.
Another approach, still based on routes, would be to do a route trace from the applet to one or more outside locations. Look at the names of the intermediate hosts. ISPs often name routers geographically. The third hop on a trace from my home to mindprod.com, for example, is
ge-1-19-ur01.bremerton.wa.seattle.comcast.net
You can figure out just from the name that I'm in Washington state, probably near Seattle, and probably even nearer to Bremerton.
Also in the route from my home to your site are
gbr1.st6wa.ip.att.net
and
POS6-0.GW11.SEA1.ALTER.NET
I believe the st6wa in the first means Seattle, and Washington, and SEA1 in the second also means Seattle.
You could build up a table of the router naming conventions of various major ISPs and backbone providers, and so be able to tell from a route what cities or regions some of the routers are. Guess that the user is in the same province as the first router that you can place by naming convention, and I bet you'll be right a pretty good fraction of the time.
 Signature --Tim Smith
Roedy Green - 18 May 2008 17:50 GMT On Sat, 17 May 2008 22:50:39 -0700, Tim Smith <reply_in_group@mouse-potato.com> wrote, quoted or indirectly quoted someone who said :
>Another approach, still based on routes, would be to do a route trace >from the applet to one or more outside locations. Look at the names of [quoted text clipped - 5 lines] >You can figure out just from the name that I'm in Washington state, >probably near Seattle, and probably even nearer to Bremerton. I had yet another idea how to tackle this. I just have the applet collect IP it has talked to recently. I then periodically look these up and build them into a table of IP->province. The idea being regular users suddenly notice the thing has developed persistent memory of their favoured setting. This however, still needs a server. I am trying to avoid having to sign the applet which would scare people off.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Smith - 18 May 2008 23:27 GMT > I had yet another idea how to tackle this. I just have the applet > collect IP it has talked to recently. I then periodically look these [quoted text clipped - 3 lines] > trying to avoid having to sign the applet which would scare people > off. Can't you just save their last settings in a cookie? It's been a long time since I looked at applets--but I thought they could save/read cookies, or communicate with Javascript code on the page which could do so for them. That way, when they come back, it picks up the last province/state they used, and you no longer care about their IP.
 Signature --Tim Smith
Roedy Green - 19 May 2008 00:12 GMT On Sun, 18 May 2008 15:27:17 -0700, Tim Smith <reply_in_group@mouse-potato.com> wrote, quoted or indirectly quoted someone who said :
>Can't you just save their last settings in a cookie? It's been a long >time since I looked at applets--but I thought they could save/read >cookies, or communicate with Javascript code on the page which could do >so for them. That way, when they come back, it picks up the last >province/state they used, and you no longer care about their IP. the last time I was experimenting with that, it looked as if you had to digitally sign the applet.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Tim Smith - 19 May 2008 08:06 GMT > >Can't you just save their last settings in a cookie? It's been a long > >time since I looked at applets--but I thought they could save/read [quoted text clipped - 4 lines] > the last time I was experimenting with that, it looked as if you had > to digitally sign the applet. That doesn't seem to be the case. There's a cookie demo applet here:
<http://www.cookiecentral.com/code/javacook2.htm>
If I set a persistent cookie in it, and then quit the browser and relaunch and go back to that site, the applet finds the cookie.
 Signature --Tim Smith
Roedy Green - 21 May 2008 03:30 GMT On Mon, 19 May 2008 00:06:32 -0700, Tim Smith <reply_in_group@mouse-potato.com> wrote, quoted or indirectly quoted someone who said :
>If I set a persistent cookie in it, and then quit the browser and >relaunch and go back to that site, the applet finds the cookie. that will do. I will simply persist the last choice of state/county.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 18 May 2008 15:57 GMT On Thu, 15 May 2008 11:11:42 GMT, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>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. One way to do this without signing, needing tables, or needing an IP lookup service would be to implement a simple database on the server to record preference by ip. Now if I could just persuade my ISP to let me run a Server. He needs one of those round TUITS.
 Signature
Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Mark Thornton - 18 May 2008 22:09 GMT > 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 [quoted text clipped - 15 lines] > 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. In WebStart it is possible to store small amounts of data on the client machine without needing to sign the application. As from Java 6u10 (beta) many features of WebStart become available to applets.
Mark Thornton
Andrew Thompson - 20 May 2008 03:57 GMT > In WebStart it is possible to store small amounts of data on the client > machine without needing to sign the application. As from Java 6u10 > (beta) many features of WebStart become available to applets. What about applications? It is so frustrating to have to redesign apps. from/to using the JNLP based classes over the standard classes.
-- Andrew T. PhySci.org
Mark Thornton - 20 May 2008 19:20 GMT >> In WebStart it is possible to store small amounts of data on the client >> machine without needing to sign the application. As from Java 6u10 [quoted text clipped - 3 lines] > have to redesign apps. from/to using the JNLP based > classes over the standard classes. This particular issue only applies to code run in a sandbox, which means unsigned applets and webstart applications. Regrettably, persistence in the sandbox is probably unavoidably different from the regular case. Security is a pain.
Mark Thornton
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|