View | Details | Raw Unified | Return to bug 7376
Collapse All | Expand All

(-)a/C4/Circulation.pm (-6 / +16 lines)
Lines 1406-1420 sub CanBookBeReturned { Link Here
1406
        $message = $to_branch = $item->homebranch;    # FIXME: choice of homebranch is arbitrary
1406
        $message = $to_branch = $item->homebranch;    # FIXME: choice of homebranch is arbitrary
1407
    }
1407
    }
1408
1408
1409
    return ( $allowed, $message ) unless $allowed;
1410
1409
    # Make sure there are no branch transfer limits between item's current
1411
    # Make sure there are no branch transfer limits between item's current
1410
    # branch (holdinbranch) and the return branch
1412
    # branch (holdinbranch) and the return branch
1411
    my $to_library = Koha::Libraries->find($to_branch);
1413
    my $return_library = Koha::Libraries->find($to_branch);
1412
    if ( !$item->can_be_transferred( { to => $to_library } ) ) {
1414
    if ( !$item->can_be_transferred( { to => $return_library } ) ) {
1413
        $allowed = 0;
1415
        return ( 0, $item->homebranch );
1414
        $message = $item->homebranch;
1416
    }
1417
1418
    # Make sure there are no branch transfer limits between
1419
    # either homebranch and holdinbranch and the return branch
1420
    my $home_library    = Koha::Libraries->find( $item->homebranch );
1421
    my $holding_library = Koha::Libraries->find( $item->holdingbranch );
1422
    if (   $item->can_be_transferred( { from => $return_library, to => $holding_library } )
1423
        or $item->can_be_transferred( { from => $return_library, to => $home_library } ) )
1424
    {
1425
        return ( 1, undef );
1415
    }
1426
    }
1416
1427
1417
    return ( $allowed, $message );
1428
    return ( 0, $item->homebranch );
1418
}
1429
}
1419
1430
1420
=head2 CheckHighHolds
1431
=head2 CheckHighHolds
1421
- 

Return to bug 7376