]> git.koha-community.org Git - koha.git/commit
Bug 27079: Floating point comparison correction
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 25 Nov 2020 12:58:56 +0000 (12:58 +0000)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Wed, 16 Dec 2020 21:53:10 +0000 (22:53 +0100)
commitf8b7a36a08d697c8c341c429763fcc401006ccc0
tree50872350d270c7e2d619b569aa39333a93a7afbe
parentfb5bd1de683d74ac898a3f0c94de2eba7d0a2206
Bug 27079: Floating point comparison correction

We cannot compare calculated values directly as those calculations may
have introduced floating point differences.  We have the
Koha::Number::Price->round function to consistently round the floating
point number to a decimal with 2 points precission for comparison.

Test plan
1/ Set a circ rule to have a .15 per day fine and enable finesMode
syspref.
2/ Issue an item of this type to a borrower (making it 12 days overdue
   by setting the due date to 12 days in the past)
3/ Run the fines job:
4/ Pay the fine for the patron
5/ Check in the item
6/ Note that the patron does not have an 'Overpayment refund' of $0.00

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Bug 27079: (QA follow-up) Round both sides for clarity

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f99a22f276e429863d4168f7f92c60e66deeb82d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 198c3be9f0036b5b828d14941b3eae1898526b6a)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
C4/Overdues.pm