Lines 1276-1290
sub CanBookBeReturned {
Link Here
|
1276 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1276 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1277 |
} |
1277 |
} |
1278 |
|
1278 |
|
|
|
1279 |
return ($allowed, $message) unless $allowed; |
1280 |
|
1279 |
# Make sure there are no branch transfer limits between item's current |
1281 |
# Make sure there are no branch transfer limits between item's current |
1280 |
# branch (holdinbranch) and the return branch |
1282 |
# branch (holdinbranch) and the return branch |
1281 |
my $to_library = Koha::Libraries->find($to_branch); |
1283 |
my $return_library = Koha::Libraries->find($to_branch); |
1282 |
if (!$item->can_be_transferred({ to => $to_library })) { |
1284 |
if (!$item->can_be_transferred({ to => $return_library })) { |
1283 |
$allowed = 0; |
1285 |
return (0, $item->homebranch); |
1284 |
$message = $item->homebranch; |
1286 |
} |
|
|
1287 |
|
1288 |
# Make sure there are no branch transfer limits between |
1289 |
# either homebranch and holdinbranch and the return branch |
1290 |
my $home_library = Koha::Libraries->find($item->homebranch); |
1291 |
my $holding_library = Koha::Libraries->find($item->holdingbranch); |
1292 |
if ($item->can_be_transferred({ from => $return_library , to => $holding_library }) or |
1293 |
$item->can_be_transferred({ from => $return_library , to => $home_library })) { |
1294 |
return (1, undef); |
1285 |
} |
1295 |
} |
1286 |
|
1296 |
|
1287 |
return ($allowed, $message); |
1297 |
return (0, $item->homebranch); |
1288 |
} |
1298 |
} |
1289 |
|
1299 |
|
1290 |
=head2 CheckHighHolds |
1300 |
=head2 CheckHighHolds |
1291 |
- |
|
|