Lines 48-54
sub do_checkout {
Link Here
|
48 |
my $patron = Koha::Patrons->find($self->{patron}->{borrowernumber}); |
48 |
my $patron = Koha::Patrons->find($self->{patron}->{borrowernumber}); |
49 |
my $overridden_duedate; # usually passed as undef to AddIssue |
49 |
my $overridden_duedate; # usually passed as undef to AddIssue |
50 |
my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; |
50 |
my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; |
51 |
my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); |
51 |
my ($issuingimpossible, $needsconfirmation, $messages) = _can_we_issue($patron, $barcode, 0); |
52 |
|
52 |
|
53 |
if ( $no_block_due_date ) { |
53 |
if ( $no_block_due_date ) { |
54 |
my $year = substr($no_block_due_date,0,4); |
54 |
my $year = substr($no_block_due_date,0,4); |
Lines 108-113
sub do_checkout {
Link Here
|
108 |
$self->screen_msg('Item must be checked out at a circulation desk'); |
108 |
$self->screen_msg('Item must be checked out at a circulation desk'); |
109 |
$noerror = 0; |
109 |
$noerror = 0; |
110 |
last; |
110 |
last; |
|
|
111 |
} elsif ( $confirmation eq 'RECALLED' ) { |
112 |
$self->screen_msg('Item has been recalled for another patron'); |
113 |
$noerror = 0; |
114 |
last; |
111 |
} else { |
115 |
} else { |
112 |
# We've been returned a case other than those above |
116 |
# We've been returned a case other than those above |
113 |
$self->screen_msg("Item cannot be issued: $confirmation"); |
117 |
$self->screen_msg("Item cannot be issued: $confirmation"); |
Lines 141-148
sub do_checkout {
Link Here
|
141 |
}); |
145 |
}); |
142 |
} else { |
146 |
} else { |
143 |
# can issue |
147 |
# can issue |
144 |
my $issue = AddIssue( $patron, $barcode, $overridden_duedate, 0 ); |
148 |
my $recall_id; |
145 |
$self->{due} = $self->duedatefromissue($issue, $itemnumber); |
149 |
foreach ( keys %{$messages} ) { |
|
|
150 |
if ( $_ eq "RECALLED" ) { |
151 |
$recall_id = $messages->{RECALLED}; |
152 |
} |
153 |
} |
154 |
my $issue = AddIssue( $patron, $barcode, $overridden_duedate, 0, undef, undef, { recall_id => $recall_id } ); |
155 |
$self->{due} = $self->duedatefromissue( $issue, $itemnumber ); |
146 |
} |
156 |
} |
147 |
|
157 |
|
148 |
$self->ok(1); |
158 |
$self->ok(1); |
Lines 152-158
sub do_checkout {
Link Here
|
152 |
sub _can_we_issue { |
162 |
sub _can_we_issue { |
153 |
my ( $patron, $barcode, $pref ) = @_; |
163 |
my ( $patron, $barcode, $pref ) = @_; |
154 |
|
164 |
|
155 |
my ( $issuingimpossible, $needsconfirmation, $alerts ) = |
165 |
my ( $issuingimpossible, $needsconfirmation, $alerts, $messages ) = |
156 |
CanBookBeIssued( $patron, $barcode, undef, 0, $pref ); |
166 |
CanBookBeIssued( $patron, $barcode, undef, 0, $pref ); |
157 |
for my $href ( $issuingimpossible, $needsconfirmation ) { |
167 |
for my $href ( $issuingimpossible, $needsconfirmation ) { |
158 |
|
168 |
|
Lines 163-169
sub _can_we_issue {
Link Here
|
163 |
} |
173 |
} |
164 |
} |
174 |
} |
165 |
} |
175 |
} |
166 |
return ( $issuingimpossible, $needsconfirmation ); |
176 |
return ( $issuingimpossible, $needsconfirmation, $messages ); |
167 |
} |
177 |
} |
168 |
|
178 |
|
169 |
1; |
179 |
1; |
170 |
- |
|
|