]> git.koha-community.org Git - koha.git/commit
Bug 26593: Remove _get_discount_from_rule
authorNick Clemens <nick@bywatersolutions.com>
Thu, 19 Nov 2020 15:46:52 +0000 (15:46 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Wed, 20 Jan 2021 15:57:01 +0000 (15:57 +0000)
commit6fc8211e039362810fde18473aff16077d020300
treed620491b9d0aa316addf076d1c5c9eb0035f03e3
parentfd3002f33bfd240ca32c88a5f93078a620774dbb
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c055685ac4f59b2a83730c67792c6fb3c81d2123)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50ac537d92e4596451f1b673364b74df01ddc629)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation.t