Bugzilla – Attachment 54565 Details for
Bug 17140
Incorrect rounding in total fines calculations, part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17140: Fix rounding in total fines calculations, part 2
Bug-17140-Fix-rounding-in-total-fines-calculations.patch (text/plain), 1.24 KB, created by
Lari Taskula
on 2016-08-18 12:28:08 UTC
(
hide
)
Description:
Bug 17140: Fix rounding in total fines calculations, part 2
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2016-08-18 12:28:08 UTC
Size:
1.24 KB
patch
obsolete
>From 31e260ca2595e0895267c823704c9c357584a490 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <larit@student.uef.fi> >Date: Thu, 18 Aug 2016 15:17:58 +0300 >Subject: [PATCH] Bug 17140: Fix rounding in total fines calculations, part 2 > >This patch fixes still occuring issue with total fines calculations. > >To test: >1. Go to patron's fines tab, make sure there are no outstanding payments. >2. Via "Create manual invoice" tab, create one fine of 1.14 >3. Go to Pay fines tab >4. Click "Pay amount" and confirm. >5. Observe error message "You must pay a value less than or equal to 1.14." >6. Run t/db_dependent/Members.t >7. Observe failure in a test case >8. Apply patch. >7. Repeat step 3 and 4 >8. Observe that payment goes through >9. Run t/db_dependent/Members.t >10. Observe test passing >--- > C4/Members.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 061172f..8596e4d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1026,6 +1026,7 @@ sub GetMemberAccountRecords { > $total += sprintf "%.0f", 1000*$data->{amountoutstanding}; # convert float to integer to avoid round-off errors > } > $total /= 1000; >+ $total = 0 + sprintf "%.6f", $total; # fix rounding error > return ( $total, \@acctlines,$numlines); > } > >-- >1.9.1
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 17140
:
54542
|
54565
|
54566
|
54611
|
54642
|
54643
|
82375
|
83467
|
86044
|
86051
|
93553
|
93554
|
93678
|
93715
|
93716
|
93717