Bugzilla – Attachment 107333 Details for
Bug 25663
Koha::RefundLostItemFeeRules should be merged into Koha::CirculationRules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25663: Add get_lostreturn_policy method to CirculationRules
Bug-25663-Add-getlostreturnpolicy-method-to-Circul.patch (text/plain), 1.77 KB, created by
Martin Renvoize (ashimema)
on 2020-07-24 12:14:45 UTC
(
hide
)
Description:
Bug 25663: Add get_lostreturn_policy method to CirculationRules
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-07-24 12:14:45 UTC
Size:
1.77 KB
patch
obsolete
>From d846e9e671ab720e3a46a2ec7facc775921ec0f0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 3 Jun 2020 12:59:21 +0100 >Subject: [PATCH] Bug 25663: Add get_lostreturn_policy method to > CirculationRules > >This patch adds a new get_lostreturn_policy method to >Koha::CirculationRules which returns a boolean to the caller which >denotes whether a refund should be applied or not on the return of >a lost item. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/CirculationRules.pm | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 790f30498d..9bf1ab860e 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -426,6 +426,36 @@ sub get_onshelfholds_policy { > return $rule ? $rule->rule_value : 0; > } > >+=head3 get_lostreturn_policy >+ >+ my $refund = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } ); >+ >+=cut >+ >+sub get_lostreturn_policy { >+ my ( $class, $params ) = @_; >+ >+ my $item = $params->{item}; >+ >+ my $behaviour = C4::Context->preference( 'RefundLostOnReturnControl' ) // 'CheckinLibrary'; >+ my $behaviour_mapping = { >+ CheckinLibrary => $params->{'return_branch'}, >+ ItemHomeBranch => $item->homebranch, >+ ItemHoldingBranch => $item->holdingbranch >+ }; >+ >+ my $branch = $behaviour_mapping->{ $behaviour }; >+ >+ my $rule = Koha::CirculationRules->get_effective_rule( >+ { >+ branchcode => $branch, >+ rule_name => 'refund', >+ } >+ ); >+ >+ return $rule ? $rule->rule_value : 1; >+} >+ > =head3 article_requestable_rules > > Return rules that allow article requests, optionally filtered by >-- >2.20.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 25663
:
105524
|
105525
|
105526
|
105527
|
106105
|
106106
|
106107
|
106108
|
106823
|
106824
|
106825
|
107332
|
107333
|
107334
|
108069
|
108070
|
108071
|
111309