An incorrect discount can be applied to the rental charge at checkout. Seems to be two causes 1 code does not take account of the branch where the transaction occurs. 2 code assumes that only a single value may be returned from the db which is not the case
Created attachment 3086 [details] [review] Proposed patch
This bug is mentioned in: Bug 5708 : Get Correct Discount when levying rentalcharge http://lists.koha-community.org/pipermail/koha-patches/2011-February/013776.html
Signing off based on this testing procedure: 1. Set up rental charges for item types, set up a discount for a patron category at a specific library. 2. Observed that before patching, the rental discount was applied to that patron category even when logged in to a different library. 3. Post-patch, rental discount was correctly applied for that patron category at the logged-in branch.
Patch pushed, please test
Tested in Production