|
Lines 1150-1175
Returns:
Link Here
|
| 1150 |
=cut |
1150 |
=cut |
| 1151 |
|
1151 |
|
| 1152 |
sub CanBookBeReturned { |
1152 |
sub CanBookBeReturned { |
| 1153 |
my ($item, $branch) = @_; |
1153 |
my ($item, $branch) = @_; |
| 1154 |
my $allowreturntobranch = C4::Context->preference("AllowReturnToBranch") || 'anywhere'; |
1154 |
my $allowreturntobranch = C4::Context->preference("AllowReturnToBranch") || 'anywhere'; |
| 1155 |
|
1155 |
|
| 1156 |
# assume return is allowed to start |
1156 |
# assume return is allowed to start |
| 1157 |
my $allowed = 1; |
1157 |
my $allowed = 1; |
| 1158 |
my $message; |
1158 |
my $message; |
| 1159 |
|
1159 |
|
| 1160 |
# identify all cases where return is forbidden |
1160 |
# identify all cases where return is forbidden |
| 1161 |
if ($allowreturntobranch eq 'homebranch' && $branch ne $item->homebranch) { |
1161 |
if ($allowreturntobranch eq 'homebranch' && $branch ne $item->homebranch) { |
| 1162 |
$allowed = 0; |
1162 |
$allowed = 0; |
| 1163 |
$message = $item->homebranch; |
1163 |
$message = $item->homebranch; |
| 1164 |
} elsif ($allowreturntobranch eq 'holdingbranch' && $branch ne $item->holdingbranch) { |
1164 |
} elsif ($allowreturntobranch eq 'holdingbranch' && $branch ne $item->holdingbranch) { |
| 1165 |
$allowed = 0; |
1165 |
$allowed = 0; |
| 1166 |
$message = $item->holdingbranch; |
1166 |
$message = $item->holdingbranch; |
| 1167 |
} elsif ($allowreturntobranch eq 'homeorholdingbranch' && $branch ne $item->homebranch && $branch ne $item->holdingbranch) { |
1167 |
} elsif ($allowreturntobranch eq 'homeorholdingbranch' && $branch ne $item->homebranch && $branch ne $item->holdingbranch) { |
| 1168 |
$allowed = 0; |
1168 |
$allowed = 0; |
| 1169 |
$message = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
1169 |
$message = $item->homebranch; # FIXME: choice of homebranch is arbitrary |
| 1170 |
} |
1170 |
} |
| 1171 |
|
1171 |
|
| 1172 |
return ($allowed, $message); |
1172 |
return ($allowed, $message); |
| 1173 |
} |
1173 |
} |
| 1174 |
|
1174 |
|
| 1175 |
=head2 CheckHighHolds |
1175 |
=head2 CheckHighHolds |
| 1176 |
- |
|
|