Lines 1247-1261
sub CanBookBeReturned {
Link Here
|
1247 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1247 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1248 |
} |
1248 |
} |
1249 |
|
1249 |
|
|
|
1250 |
return ($allowed, $message) unless $allowed; |
1251 |
|
1250 |
# Make sure there are no branch transfer limits between item's current |
1252 |
# Make sure there are no branch transfer limits between item's current |
1251 |
# branch (holdinbranch) and the return branch |
1253 |
# branch (holdinbranch) and the return branch |
1252 |
my $to_library = Koha::Libraries->find($to_branch); |
1254 |
my $return_library = Koha::Libraries->find($to_branch); |
1253 |
if (!$item->can_be_transferred({ to => $to_library })) { |
1255 |
if (!$item->can_be_transferred({ to => $return_library })) { |
1254 |
$allowed = 0; |
1256 |
return (0, $item->homebranch); |
1255 |
$message = $item->homebranch; |
1257 |
} |
|
|
1258 |
|
1259 |
# Make sure there are no branch transfer limits between |
1260 |
# either homebranch and holdinbranch and the return branch |
1261 |
my $home_library = Koha::Libraries->find($item->homebranch); |
1262 |
my $holding_library = Koha::Libraries->find($item->holdingbranch); |
1263 |
if ($item->can_be_transferred({ from => $return_library , to => $holding_library }) or |
1264 |
$item->can_be_transferred({ from => $return_library , to => $home_library })) { |
1265 |
return (1, undef); |
1256 |
} |
1266 |
} |
1257 |
|
1267 |
|
1258 |
return ($allowed, $message); |
1268 |
return (0, $item->homebranch); |
1259 |
} |
1269 |
} |
1260 |
|
1270 |
|
1261 |
=head2 CheckHighHolds |
1271 |
=head2 CheckHighHolds |
1262 |
- |
|
|