Bug 15741: Fix rounding in total fines calculations
commit430dc045033ea3f70684068da3d37f0b769b60f9
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 Mar 2016 11:58:24 +0000 (8 11:58 +0000)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 14:18:22 +0000 (27 16:18 +0200)
tree7e91628e6d1e562aec3232f8bef77f80962819d2
parent0f5ef2cc8a31b7d520390e52d6b5a250071cde3c
Bug 15741: Fix rounding in total fines calculations

C4::Members::GetMemberAccountRecords wrongly casts float to integer
It's common to use sprintf in Perl to do this job.

% perl -e 'print int(1000*64.60)."\n"';
64599
% perl -e 'print sprintf("%.0f", 1000*64.60)."\n"';
64600

Test plan:
1) Create manual invoice for 64.60 (or 1.14, 1.36, ...)
2) Try to pay it using "Pay amount" or "Pay selected" buttons

Signed-off-by: Sally Healey <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 92fbb1f3d0f2bdb070a1b647c96edbce5b28a377)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit 40507ce1529a237ec5c51837805100e89e96db9c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
C4/Members.pm