Bugzilla – Attachment 102769 Details for
Bug 25115
Use get_effective_rule for getting rental discount
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25115: Use get_effective_rule for getting rental discount
Bug-25115-Use-geteffectiverule-for-getting-rental-.patch (text/plain), 1.81 KB, created by
Lari Taskula
on 2020-04-11 20:32:33 UTC
(
hide
)
Description:
Bug 25115: Use get_effective_rule for getting rental discount
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-04-11 20:32:33 UTC
Size:
1.81 KB
patch
obsolete
>From e56f02b9c6a7cec8b47789e2ae8ee631f52a071c Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Sat, 11 Apr 2020 20:31:44 +0000 >Subject: [PATCH] Bug 25115: Use get_effective_rule for getting rental discount > >--- > C4/Circulation.pm | 42 ++++++++---------------------------------- > 1 file changed, 8 insertions(+), 34 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 747d660ea6..f228f7c703 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3301,40 +3301,14 @@ sub GetIssuingCharges { > sub _get_discount_from_rule { > my ($categorycode, $branchcode, $itemtype) = @_; > >- # Set search precedences >- my @params = ( >- { >- branchcode => $branchcode, >- itemtype => $itemtype, >- categorycode => $categorycode, >- }, >- { >- branchcode => undef, >- categorycode => $categorycode, >- itemtype => $itemtype, >- }, >- { >- branchcode => $branchcode, >- categorycode => $categorycode, >- itemtype => undef, >- }, >- { >- branchcode => undef, >- categorycode => $categorycode, >- itemtype => undef, >- }, >- ); >- >- foreach my $params (@params) { >- my $rule = Koha::CirculationRules->search( >- { >- rule_name => 'rentaldiscount', >- %$params, >- } >- )->next(); >- >- return $rule->rule_value if $rule; >- } >+ my $rule = Koha::CirculationRules->get_effective_rule( { >+ branchcode => $branchcode, >+ itemtype => $itemtype, >+ categorycode => $categorycode, >+ rule_name => 'rentaldiscount', >+ } ); >+ >+ return $rule->rule_value if $rule; > > # none of the above > return 0; >-- >2.17.1
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 25115
: 102769