Lines 1333-1347
sub CanBookBeReturned {
Link Here
|
1333 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1333 |
$message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1334 |
} |
1334 |
} |
1335 |
|
1335 |
|
|
|
1336 |
return ($allowed, $message) unless $allowed; |
1337 |
|
1336 |
# Make sure there are no branch transfer limits between item's current |
1338 |
# Make sure there are no branch transfer limits between item's current |
1337 |
# branch (holdinbranch) and the return branch |
1339 |
# branch (holdinbranch) and the return branch |
1338 |
my $to_library = Koha::Libraries->find($to_branch); |
1340 |
my $return_library = Koha::Libraries->find($to_branch); |
1339 |
if (!$item->can_be_transferred({ to => $to_library })) { |
1341 |
if (!$item->can_be_transferred({ to => $return_library })) { |
1340 |
$allowed = 0; |
1342 |
return (0, $item->homebranch); |
1341 |
$message = $item->homebranch; |
1343 |
} |
|
|
1344 |
|
1345 |
# Make sure there are no branch transfer limits between |
1346 |
# either homebranch and holdinbranch and the return branch |
1347 |
my $home_library = Koha::Libraries->find($item->homebranch); |
1348 |
my $holding_library = Koha::Libraries->find($item->holdingbranch); |
1349 |
if ($item->can_be_transferred({ from => $return_library , to => $holding_library }) or |
1350 |
$item->can_be_transferred({ from => $return_library , to => $home_library })) { |
1351 |
return (1, undef); |
1342 |
} |
1352 |
} |
1343 |
|
1353 |
|
1344 |
return ($allowed, $message); |
1354 |
return (0, $item->homebranch); |
1345 |
} |
1355 |
} |
1346 |
|
1356 |
|
1347 |
=head2 CheckHighHolds |
1357 |
=head2 CheckHighHolds |
1348 |
- |
|
|