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

(-)a/C4/Circulation.pm (-6 / +16 lines)
Lines 1423-1437 sub CanBookBeReturned { Link Here
1423
        $message = $to_branch = $item->homebranch;    # FIXME: choice of homebranch is arbitrary
1423
        $message = $to_branch = $item->homebranch;    # FIXME: choice of homebranch is arbitrary
1424
    }
1424
    }
1425
1425
1426
    return ( $allowed, $message ) unless $allowed;
1427
1426
    # Make sure there are no branch transfer limits between item's current
1428
    # Make sure there are no branch transfer limits between item's current
1427
    # branch (holdinbranch) and the return branch
1429
    # branch (holdinbranch) and the return branch
1428
    my $to_library = Koha::Libraries->find($to_branch);
1430
    my $return_library = Koha::Libraries->find($to_branch);
1429
    if ( !$item->can_be_transferred( { to => $to_library } ) ) {
1431
    if ( !$item->can_be_transferred( { to => $return_library } ) ) {
1430
        $allowed = 0;
1432
        return ( 0, $item->homebranch );
1431
        $message = $item->homebranch;
1433
    }
1434
1435
    # Make sure there are no branch transfer limits between
1436
    # either homebranch and holdinbranch and the return branch
1437
    my $home_library    = Koha::Libraries->find( $item->homebranch );
1438
    my $holding_library = Koha::Libraries->find( $item->holdingbranch );
1439
    if (   $item->can_be_transferred( { from => $return_library, to => $holding_library } )
1440
        or $item->can_be_transferred( { from => $return_library, to => $home_library } ) )
1441
    {
1442
        return ( 1, undef );
1432
    }
1443
    }
1433
1444
1434
    return ( $allowed, $message );
1445
    return ( 0, $item->homebranch );
1435
}
1446
}
1436
1447
1437
=head2 CheckHighHolds
1448
=head2 CheckHighHolds
1438
- 

Return to bug 7376