bug 2126: reduce round-off errors in fine balance
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 12 Feb 2009 20:20:43 +0000 (14:20 -0600)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 4 Mar 2009 11:46:58 +0000 (12:46 +0100)
commit877dc53206468a62c83a8f57d8932e7943f70ab3
tree24ec2615233670a62c9e3f3ff6ec9d994b8607b1
parent484f0479e023337b78bf2d4c03ccfa91cadf4dc2
bug 2126: reduce round-off errors in fine balance

If a patron has a number of fine transactions, the
total could be wrong.  This is particularly noticeable
when a patron has a zero balance, as summing a group
of floating point values derived from decimal(6,2) columns
can result a scalar value that is not zero.

Koha really should be using integral arithmetic
or appropriate accounting modules to do fine and
acquisitions calculations.  Using floating point scalars
for monetary amounts is always a mistake.

This patch also prevents an account maintenance
fee from being applied when renewing a patron if the
amount would be 0.
C4/Members.pm