Bugzilla – Attachment 54611 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.34 KB, created by
Lari Taskula
on 2016-08-19 10:37:41 UTC
(
hide
)
Description:
Bug 17140: Fix rounding in total fines calculations, part 2
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2016-08-19 10:37:41 UTC
Size:
1.34 KB
patch
obsolete
>From 23ac984823301a9026059247d6e1adc45eccc145 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 rounding 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. >9. Repeat step 3 and 4 >10. Observe that payment goes through >11. Run t/db_dependent/Members.t >12. Observe test passing >--- > C4/Members.pm | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 061172f..51a857d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1023,9 +1023,8 @@ sub GetMemberAccountRecords { > } > $acctlines[$numlines] = $data; > $numlines++; >- $total += sprintf "%.0f", 1000*$data->{amountoutstanding}; # convert float to integer to avoid round-off errors >+ $total += sprintf '%.2f', $data->{amountoutstanding}; > } >- $total /= 1000; > 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