Lines 1046-1057
sub CanBookBeIssued {
Link Here
|
1046 |
# issued to someone else |
1046 |
# issued to someone else |
1047 |
my $currborinfo = C4::Members::GetMember( borrowernumber => $issue->{borrowernumber} ); |
1047 |
my $currborinfo = C4::Members::GetMember( borrowernumber => $issue->{borrowernumber} ); |
1048 |
|
1048 |
|
1049 |
# warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})"; |
1049 |
|
1050 |
$needsconfirmation{ISSUED_TO_ANOTHER} = 1; |
1050 |
my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
1051 |
$needsconfirmation{issued_firstname} = $currborinfo->{'firstname'}; |
1051 |
|
1052 |
$needsconfirmation{issued_surname} = $currborinfo->{'surname'}; |
1052 |
unless ( $can_be_returned ) { |
1053 |
$needsconfirmation{issued_cardnumber} = $currborinfo->{'cardnumber'}; |
1053 |
$issuingimpossible{RETURN_IMPOSSIBLE} = 1; |
1054 |
$needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'}; |
1054 |
$issuingimpossible{branch_to_return} = $message; |
|
|
1055 |
} else { |
1056 |
$needsconfirmation{ISSUED_TO_ANOTHER} = 1; |
1057 |
$needsconfirmation{issued_firstname} = $currborinfo->{'firstname'}; |
1058 |
$needsconfirmation{issued_surname} = $currborinfo->{'surname'}; |
1059 |
$needsconfirmation{issued_cardnumber} = $currborinfo->{'cardnumber'}; |
1060 |
$needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'}; |
1061 |
} |
1055 |
} |
1062 |
} |
1056 |
|
1063 |
|
1057 |
unless ( $ignore_reserves ) { |
1064 |
unless ( $ignore_reserves ) { |
Lines 1379-1384
sub AddIssue {
Link Here
|
1379 |
if ( $actualissue->{borrowernumber}) { |
1386 |
if ( $actualissue->{borrowernumber}) { |
1380 |
# This book is currently on loan, but not to the person |
1387 |
# This book is currently on loan, but not to the person |
1381 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
1388 |
# who wants to borrow it now. mark it returned before issuing to the new borrower |
|
|
1389 |
my ( $allowed, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); |
1390 |
return unless $allowed; |
1382 |
AddReturn( |
1391 |
AddReturn( |
1383 |
$item->{'barcode'}, |
1392 |
$item->{'barcode'}, |
1384 |
C4::Context->userenv->{'branch'} |
1393 |
C4::Context->userenv->{'branch'} |