Bugzilla – Attachment 114019 Details for
Bug 27079
UpdateFine adds refunds for fines paid off before return
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27079: Floating point comparison correction
Bug-27079-Floating-point-comparison-correction.patch (text/plain), 1.44 KB, created by
Victor Grousset/tuxayo
on 2020-11-26 18:38:00 UTC
(
hide
)
Description:
Bug 27079: Floating point comparison correction
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2020-11-26 18:38:00 UTC
Size:
1.44 KB
patch
obsolete
>From 8f60b1c86262e0681c0485ca07e88eada0613053 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 25 Nov 2020 12:58:56 +0000 >Subject: [PATCH] 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> >--- > C4/Overdues.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index a9de67d1ee..607af71f5c 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -574,7 +574,7 @@ sub UpdateFine { > } > > if ( $accountline ) { >- if ( $accountline->amount != $amount ) { >+ if ( $accountline->amount != Koha::Number::Price->new($amount)->round ) { > $accountline->adjust( > { > amount => $amount, >-- >2.29.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27079
:
113981
|
113983
|
113984
|
113997
|
113999
|
114000
|
114001
|
114018
|
114019
|
114020
|
114029