[Koha-bugs] [Bug 17140] Incorrect rounding in total fines calculations, part 2

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 19 15:40:55 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17140

--- Comment #7 from Marc Véron <veron at veron.ch> ---
In table accountlines, definition of amount is decimal 28,6
http://schema.koha-community.org/tables/accountlines.html

I am able to enter a manual invoice like 0.008 (displays as 0.01) or 0.004
(displays as 0.00)

The table then contains:
mysql> select amount from accountlines where borrowernumber = 13;
+----------+
| amount   |
+----------+
| 0.008000 |
| 0.004000 |
+----------+

The 'Pay fines' tab shows an amount of 0.01 and an amount of 0.00

I payed the first one (0.01), it asked 0.01

mysql> select amount from accountlines where borrowernumber = 13;
+-----------+
| amount    |
+-----------+
|  0.008000 |
|  0.004000 |
| -0.010000 |
+-----------+

The 'Pay fines tab then shows an amount of 0.00
If I want to pay using 'Pay' on the line, it asks for 0.00, but obviously it is
not possible to pay the amount.

Same with 'Pay amount'

Now I add manual invoices, let's say 3 times 0.003

mysql> select amount from accountlines where borrowernumber = 13;
+-----------+
| amount    |
+-----------+
|  0.008000 |
|  0.004000 |
| -0.010000 |
|  0.003000 |
|  0.003000 |
|  0.003000 |
+-----------+

The Account tab shows all 0.00 in 'Outstanding' column, but a 'Total due' of
0.01

A similar situation occurs with Rental discounts in Circulation and fines rules
(smart-rules.pl), e.g. values like 2.961000

That will lead to confusion... 

What to do? Maybe the following:

 - Define a systemwide decimal precision for data entry of amounts?
 - Maybe depending on the decimal places in syspref CurrencyFormat?
 - Make Rental discounts round to that precision?
 - Allow 'Price' plug-in to override if more precision is necessary, e.g. for
calculating / displaying taxes in acquisition? (Koha/Number/Price.pm)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list