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/