Bugzilla – Attachment 92774 Details for
Bug 7376
Transfer limits should be checked at check-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug 7376 Transfer limits should be checked at check-in
0001-Bug-7376-Transfer-limits-should-be-checked-at-check-.patch (text/plain), 2.00 KB, created by
Koha Team University Lyon 3
on 2019-09-13 08:55:37 UTC
(
hide
)
Description:
Bug 7376 Transfer limits should be checked at check-in
Filename:
MIME Type:
Creator:
Koha Team University Lyon 3
Created:
2019-09-13 08:55:37 UTC
Size:
2.00 KB
patch
obsolete
>From 077a409b6a9f7ee19c864b566ae04ec30756e2a7 Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Fri, 13 Sep 2019 10:51:38 +0200 >Subject: [PATCH] Bug 7376 Transfer limits should be checked at check-in > >--- > C4/Circulation.pm | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e346e2d..ad42213 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1158,7 +1158,7 @@ sub CanBookBeReturned { > $message = $item->{'homebranch'}; # FIXME: choice of homebranch is arbitrary > } > >- return ($allowed, $message); >+ return ($allowed, $message, $allowreturntobranch); > } > > =head2 CheckHighHolds >@@ -1924,7 +1924,28 @@ sub AddReturn { > } > > # check if the return is allowed at this branch >- my ($returnallowed, $message) = CanBookBeReturned($item_unblessed, $branch); >+ my ($returnallowed, $message, $allowedbranch) = CanBookBeReturned($item_unblessed, $branch); >+ if ($allowedbranch eq 'anywhere') { >+ # if we try a checkin that would result in a forbidden branchtransfer, refuse the return as well >+ # first, find branchtransferlimit value for this item >+ my $branchtransferlimitvalue = $itemtype; >+ $branchtransferlimitvalue = $item_unblessed->{ccode} >+ if C4::Context->preference("item-level_itypes") >+ && C4::Context->preference("BranchTransferLimitsType") eq 'ccode'; >+ >+ if ( $item_unblessed->{'homebranch'} ne $branch >+ && ( >+ C4::Context->preference("IndependentBranches") >+ or ( C4::Context->preference("UseBranchTransferLimits") >+ and not IsBranchTransferAllowed($item_unblessed->{'homebranch'}, $branch, $branchtransferlimitvalue ) ) >+ ) >+ ) { >+ $returnallowed = 0; >+ $message = $item_unblessed->{'homebranch'}; >+ } >+ >+ } >+ > unless ($returnallowed){ > $messages->{'Wrongbranch'} = { > Wrongbranch => $branch, >-- >2.1.4 >
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 Raw
Actions:
View
Attachments on
bug 7376
:
6954
|
21715
|
21805
|
22016
|
22017
|
22323
|
22357
|
22696
|
23168
|
76559
|
76866
|
76876
|
92740
|
92774
|
93190
|
93191
|
93192
|
93193
|
93194
|
93195
|
93196
|
107077
|
107078
|
107079
|
115369
|
115370
|
116493
|
116494
|
116927
|
116928
|
116937
|
116938
|
120897
|
120898
|
120899
|
120900
|
120901
|
120902
|
120903
|
144435
|
144436
|
144437
|
144438
|
144439
|
144440
|
144441
|
175690
|
175691
|
175692
|
175693
|
175694
|
175695
|
175696
|
175697