No idea as to your exact problem, BUT

In the UK and in Europe, you normally do not have any choice in how you 
calculate tax. The rounding rules etc etc are prescribed by the legislation so 
the way your programmer did it MAY be illegal, or it MAY be the way the 
legislation told him to do it!

For example, if I calculate VAT over here (Sales Tax to you Americans), 
applying our 17.5% tax rate to goods worth #1, I get a sticker price of #1.17. 
Anybody notice anything odd? That is the correct calculation as specified by 
law.

(By "sticker price", I mean the price quoted on the goods. In Europe, the price 
you see on the goods or shelf is the price you pay - if they charge you any 
more and get caught the fines are HEFTY! Saying to customers "oh there's 6% 
sales tax on top of the displayed price" would probably get management thrown 
in jail!)

Cheers,
Wol

-----Original Message-----
From: Brenda Price [mailto:[EMAIL PROTECTED] 
Sent: 18 May 2007 15:48
To: u2-users@listserver.u2ug.org
Subject: [U2] Reverse calculating taxes

We have a program that got into an endless loop yesterday because of the
way the programmer wrote the code.  Since that program is kicked off by
automated processes behind the scenes nothing we tried would let us get
a hold of it and get it out of the loop, we had to kill it. Not fun and
we are still dealing with the aftermath today.



I've been looking at the code and the existing calculation does not look
like it is correct.



The program takes the tax amt multiples it by the tax rate for each tax
federal, state, county, city. It then adds or subtracts a penny on the
amount from the highest tax rate until adding that amount to all the
other tax amounts equals the tax amt passed in.



What happened yesterday was that the calculation could never match
because it was 29.63 and the calculation was 2.00025, which was round to
2.0003, so once it got to 29.6303, it just keep adding and subtracting a
penny to try and make it match. In this instance the tax was a straight
6.75% state tax.



I checked records updated in the past to see what the calculation did to
those records when there were multiple taxes to break out.  I found a
record with 0 fed tax, 5.5% state tax, 1% county, and 1% city tax.  The
amount of the tax was $11.72 with the breakdown of $0 Fed, $11.48 state,
$.12 county, $.12 city.



Yes, 12 cents is 1 percent of the tax amount but is it 1 percent of the
amount the tax was calculated on which is not available to us.  To me
that is questionable.



To me, I should be able to get the original amount used to calculate the
tax, the calculate the taxes for each rate, add them up, make sure the
total amount matches what the tax amount is.  I just can't think of a
way of doing this at the moment, drawing blanks for sure.



Any idea's!  Does anyone think the current calculation is ok.



Brenda
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to