Bugzilla – Attachment 49907 Details for
Bug 16202
Rental fees can be generated for fractions of a penny/cent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-16202-GetIssuingCharges-should-return-a-collecta.patch (text/plain), 1.66 KB, created by
Colin Campbell
on 2016-04-05 12:23:51 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2016-04-05 12:23:51 UTC
Size:
1.66 KB
patch
obsolete
>From 57d5f52d070bb73c9fc3a6e5357c03b3a3ecc61d Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 5 Apr 2016 12:56:24 +0100 >Subject: [PATCH] Bug 16202: GetIssuingCharges should return a collectable > amount > >Charges should not include elements less than a penny/cent >they are not displayed but can be saved to the database >causing "odd" behaviour down the line > >Make the routine round the resultant charge to nearest cent, >so consistent values are returned. >Removed the one case where it was rounded post call. >Although the main danger is values generated by the discount >calculation apply the rounding to all returned charges in case >the item charge is defined using the 3rd or 4th decimal >places. >--- > C4/Circulation.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 70ae3fd..5df5527 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -981,7 +981,6 @@ sub CanBookBeIssued { > if ( $rentalConfirmation ){ > my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} ); > if ( $rentalCharge > 0 ){ >- $rentalCharge = sprintf("%.02f", $rentalCharge); > $needsconfirmation{RENTALCHARGE} = $rentalCharge; > } > } >@@ -3210,6 +3209,9 @@ sub GetIssuingCharges { > my $discount = _get_discount_from_rule($discount_rules, $branch, $item_type); > $charge = ( $charge * ( 100 - $discount ) ) / 100; > } >+ if ($charge) { >+ $charge = sprintf '%.2f', $charge; # ensure no fractions of a penny returned >+ } > } > > return ( $charge, $item_type ); >-- >2.5.5 >
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 16202
:
49907
|
59741
|
60639