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)
committerGalen Charlton <galen.charlton@liblime.com>
Thu, 12 Feb 2009 20:31:52 +0000 (14:31 -0600)
commit05864978c5ca3495db386c3ea6527b11d96ef25e
tree36340c56a2d77ccd6d0435c020bcc64fafde8f06
parent871f0f27e3075de8e5798652af19f3c72c9b7854
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.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Members.pm