Lines 200-211
elsif ( $op eq "checkout" ) {
Link Here
|
200 |
} |
200 |
} |
201 |
} else { |
201 |
} else { |
202 |
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. |
202 |
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. |
203 |
my $hold_existed; |
203 |
my ( $hold_existed, $item ); |
204 |
if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) { |
204 |
if ( C4::Context->preference('HoldFeeMode') eq 'any_time_is_collected' ) { |
205 |
# There is no easy way to know if the patron has been charged for this item. |
205 |
# There is no easy way to know if the patron has been charged for this item. |
206 |
# So we check if a hold existed for this item before the check in |
206 |
# So we check if a hold existed for this item before the check in |
207 |
my $item = Koha::Items->find({ barcode => $barcode }); |
207 |
$item = Koha::Items->find({ barcode => $barcode }); |
208 |
$hold_existed = Koha::Holds->search({ -or => { 'biblionumber' => $item->biblionumber, 'itemnumber' => $item->itemnumber}})->count; |
208 |
$hold_existed = Koha::Holds->search( |
|
|
209 |
{ |
210 |
-and => { |
211 |
borrowernumber => $borrower->{borrowernumber}, |
212 |
-or => { |
213 |
biblionumber => $item->biblionumber, |
214 |
itemnumber => $item->itemnumber |
215 |
} |
216 |
} |
217 |
} |
218 |
)->count; |
209 |
} |
219 |
} |
210 |
AddIssue( $borrower, $barcode ); |
220 |
AddIssue( $borrower, $barcode ); |
211 |
|
221 |
|
Lines 214-220
elsif ( $op eq "checkout" ) {
Link Here
|
214 |
$template->param( |
224 |
$template->param( |
215 |
# If the hold existed before the check in, let's confirm that the charge line exists |
225 |
# If the hold existed before the check in, let's confirm that the charge line exists |
216 |
# Note that this should not be needed but since we do not have proper exception handling here we do it this way |
226 |
# Note that this should not be needed but since we do not have proper exception handling here we do it this way |
217 |
patron_has_hold_fee => Koha::Account::Lines->search({ borrowernumber => $borrower->{borrowernumber}, accounttype => 'Res', date => $dtf->format_date( dt_from_string ) })->count, |
227 |
patron_has_hold_fee => Koha::Account::Lines->search( |
|
|
228 |
{ |
229 |
borrowernumber => $borrower->{borrowernumber}, |
230 |
accounttype => 'Res', |
231 |
description => 'Reserve Charge - ' . $item->biblio->title, |
232 |
date => $dtf->format_date(dt_from_string) |
233 |
} |
234 |
)->count, |
218 |
); |
235 |
); |
219 |
} |
236 |
} |
220 |
} else { |
237 |
} else { |
221 |
- |
|
|