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

(-)a/C4/Circulation.pm (-6 / +15 lines)
Lines 1382-1396 sub CanBookBeReturned { Link Here
1382
        $message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary
1382
        $message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary
1383
    }
1383
    }
1384
1384
1385
    return ($allowed, $message) unless $allowed;
1386
1385
    # Make sure there are no branch transfer limits between item's current
1387
    # Make sure there are no branch transfer limits between item's current
1386
    # branch (holdinbranch) and the return branch
1388
    # branch (holdinbranch) and the return branch
1387
    my $to_library = Koha::Libraries->find($to_branch);
1389
    my $return_library = Koha::Libraries->find($to_branch);
1388
    if (!$item->can_be_transferred({ to => $to_library })) {
1390
    if (!$item->can_be_transferred({ to => $return_library })) {
1389
        $allowed = 0;
1391
        return (0, $item->homebranch);
1390
        $message = $item->homebranch;
1392
    }
1393
1394
    # Make sure there are no branch transfer limits between
1395
    # either homebranch and holdinbranch and the return branch
1396
    my $home_library = Koha::Libraries->find($item->homebranch);
1397
    my $holding_library = Koha::Libraries->find($item->holdingbranch);
1398
    if ($item->can_be_transferred({ from => $return_library , to => $holding_library }) or
1399
        $item->can_be_transferred({ from => $return_library , to => $home_library })) {
1400
        return (1, undef);
1391
    }
1401
    }
1392
1402
1393
    return ($allowed, $message);
1403
    return (0, $item->homebranch);
1394
}
1404
}
1395
1405
1396
=head2 CheckHighHolds
1406
=head2 CheckHighHolds
1397
- 

Return to bug 7376