@@ -, +, @@ returned - Set AllowReturnToBranch to anywhere - Check an item (homebranch Library 1, holding branch Library 1) out from Library 1 - Check the item out from Library 2 - Set AllowReturnToBranch to holdinbranch ("only the library the item was checked out from"). - Check an item (homebranch Library 1, holding branch Library 1) out from Library 1 - Check the item out from Library 2 --- C4/Circulation.pm | 19 +++++++++++++------ .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ 2 files changed, 17 insertions(+), 6 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1046,12 +1046,19 @@ sub CanBookBeIssued { # issued to someone else my $currborinfo = C4::Members::GetMember( borrowernumber => $issue->{borrowernumber} ); -# warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})"; - $needsconfirmation{ISSUED_TO_ANOTHER} = 1; - $needsconfirmation{issued_firstname} = $currborinfo->{'firstname'}; - $needsconfirmation{issued_surname} = $currborinfo->{'surname'}; - $needsconfirmation{issued_cardnumber} = $currborinfo->{'cardnumber'}; - $needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'}; + + my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); + + unless ( $can_be_returned ) { + $issuingimpossible{RETURN_IMPOSSIBLE} = 1; + $issuingimpossible{branch_to_return} = $message; + } else { + $needsconfirmation{ISSUED_TO_ANOTHER} = 1; + $needsconfirmation{issued_firstname} = $currborinfo->{'firstname'}; + $needsconfirmation{issued_surname} = $currborinfo->{'surname'}; + $needsconfirmation{issued_cardnumber} = $currborinfo->{'cardnumber'}; + $needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'}; + } } unless ( $ignore_reserves ) { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -535,6 +535,10 @@ $(document).ready(function() {
  • This item belongs to [% Branches.GetName( itemhomebranch ) %] and cannot be checked out from this location.
  • [% END %] + [% IF RETURN_IMPOSSIBLE %] +
  • This item must be return to [% Branches.GetName( branch_to_return ) %].
  • + [% END %] + [% IF ( USERBLOCKEDWITHENDDATE ) %]
  • Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].
  • [% END %] --