Bug 5708

Summary: Incorrect Discount applied to rental charge at checkout
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: CirculationAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, gmcharlt
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch

Description Colin Campbell 2011-02-07 17:22:00 UTC
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
Comment 1 Colin Campbell 2011-02-07 17:46:39 UTC
Created attachment 3086 [details] [review]
Proposed patch
Comment 2 MJ Ray (software.coop) 2011-03-04 10:26:51 UTC
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
Comment 3 Owen Leonard 2011-03-29 14:00:34 UTC
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.
Comment 4 Chris Cormack 2011-03-30 07:02:57 UTC
Patch pushed, please test
Comment 5 Colin Campbell 2011-03-30 10:38:36 UTC
Tested in Production