Invoice total error

Beth Leonard beth at oasis.slimy.com
Sat Apr 9 15:51:42 EDT 2005


On Fri, Apr 08, 2005 at 08:06:11PM -0500, David Blomquist wrote:
> Description Quantity Unit Price Taxable Subtotal Tax
> 
> Item one    1.00      43.29             43.29     0.00
> Item two    1.00      60.00     X       60.00     4.95
> Item three   .50      90.00	X	45.00	  3.71
> Item four    .25      90.00	X	22.50     1.86
> Item five    .25      90.00	X	22.50     1.86
> 
> Total:$205.66  Subtotal:$193.29   Tax:$12.38
> 
> I have added the columns of the Subtotal and Tax columns and found that
> they are correct but the Total of 205.66 is incorrect; it should be
> 205.67.

I can verify that the bug is there on my system.  I typed in your
invoice and got the same total.  Because the total tax works out
to exactly half a penny, it looks like gnucash's listed
total is worked out using a "round to even" protocol, instead of "round
up" for an exact half penny the way the tax is figured.  It looks
like different parts of the program use different methods of
calculating that number.

Changing the first item to either 43.28 or 43.30 demonstrates the
round-to-even behavior.  Changing it by two pennies to 43.31 reveals
the error again.

Looks like a bug to me.

To further characterize the bug, changing the unit price to "60.01"
again hides the bug.  The tax is no longer exactly half a penny.

I think that the correct behavior for gnucash should be to figure
the tax on the entire invoice, round it, and use that number plus
the subtotal to equal the total for the invoice (the way a shopkeeper
would.)  This method would have the potential for an incorrect
hand-addition of the per-item tax (are those usually called out
separately on invoices?).

I am not an accountant so I do not know the "correct" way to figure
it, but clearly the current way is wrong.  Subtotal plus total tax
should always equal total bill.  It occurs to me that the "correct"
way may even differ from state to state or country to country.

--Beth 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                             Beth Leonard                          +
+       O say, does that star-spangled banner yet wave              +
+       O'er the land of the free and the home of the brave?        +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


More information about the gnucash-user mailing list