Summary: | Rental discounts are applied in wrong precedence order | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Fines and fees | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrew, caroline.cyr-la-rose, fridolin.somers, jonathan.druart, kyle, lari.taskula, martin.renvoize, tomascohen, victor |
Version: | Main | Keywords: | Academy |
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
21.05.00,20.11.02,20.05.08
|
Circulation function: | |
Attachments: |
Bug 26593: Remove _get_discount_from_rule
Bug 26593: Remove _get_discount_from_rule Bug 26593: Remove _get_discount_from_rule |
Description
Nick Clemens (kidclamp)
2020-10-01 11:14:39 UTC
Hmm, I'm wondering if there was a deliberate reason behind this or whether it's just a historical mistake. Created attachment 113823 [details] [review] Bug 26593: Remove _get_discount_from_rule This patch remove the private sub used in GetIssuingCharges in favor of get_effective_rule It corrects the wrong precedence for rules and adds tests to cover this subroutine NOTE: the 'branch' for the discount will be determined by the signed in branch, this is a bug to be fixed in the future To test: 1 - Define a rentalcharge for an itemtype 2 - Define a 10% discount for library A, category A, all itemtypes 3 - Define a 50% discount for all libraries, category A, same itemtype 4 - Attempt to checkout an item from library A of the matching itemtype 5 - The 50% discount is applied 6 - Apply patches 7 - Attempt to checkout an item from library A of the matching itemtype 8 - The 10% discount is applied prove -v t/db_dependent/Circulation.t Created attachment 114552 [details] [review] Bug 26593: Remove _get_discount_from_rule This patch remove the private sub used in GetIssuingCharges in favor of get_effective_rule It corrects the wrong precedence for rules and adds tests to cover this subroutine NOTE: the 'branch' for the discount will be determined by the signed in branch, this is a bug to be fixed in the future To test: 1 - Define a rentalcharge for an itemtype 2 - Define a 10% discount for library A, category A, all itemtypes 3 - Define a 50% discount for all libraries, category A, same itemtype 4 - Attempt to checkout an item from library A of the matching itemtype 5 - The 50% discount is applied 6 - Apply patches 7 - Attempt to checkout an item from library A of the matching itemtype 8 - The 10% discount is applied prove -v t/db_dependent/Circulation.t Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Created attachment 115013 [details] [review] Bug 26593: Remove _get_discount_from_rule This patch remove the private sub used in GetIssuingCharges in favor of get_effective_rule It corrects the wrong precedence for rules and adds tests to cover this subroutine NOTE: the 'branch' for the discount will be determined by the signed in branch, this is a bug to be fixed in the future To test: 1 - Define a rentalcharge for an itemtype 2 - Define a 10% discount for library A, category A, all itemtypes 3 - Define a 50% discount for all libraries, category A, same itemtype 4 - Attempt to checkout an item from library A of the matching itemtype 5 - The 50% discount is applied 6 - Apply patches 7 - Attempt to checkout an item from library A of the matching itemtype 8 - The 10% discount is applied prove -v t/db_dependent/Circulation.t Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> I could have sworn I'd already QA'd this a couple of months back! All works as expected.. Passing QA Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.02 Cannot replicate issue on 20.05. Discounts are being applied correctly based on library when following test plan without . Not backporting. Reverted a different patch and retested this one. Pushed to 20.05.x for 20.05.08 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. *** Bug 25115 has been marked as a duplicate of this bug. *** |