Lines 259-300
if ($barcode) {
Link Here
|
259 |
$barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter'); |
259 |
$barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter'); |
260 |
my $item = Koha::Items->find({ barcode => $barcode }); |
260 |
my $item = Koha::Items->find({ barcode => $barcode }); |
261 |
|
261 |
|
262 |
# Check if we should display a checkin message, based on the the item |
262 |
if ( $item ) { |
263 |
# type of the checked in item |
263 |
# Check if we should display a checkin message, based on the the item |
264 |
my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype ); |
264 |
# type of the checked in item |
265 |
if ( $itemtype && $itemtype->checkinmsg ) { |
265 |
my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype ); |
266 |
$template->param( |
266 |
if ( $itemtype && $itemtype->checkinmsg ) { |
267 |
checkinmsg => $itemtype->checkinmsg, |
267 |
$template->param( |
268 |
checkinmsgtype => $itemtype->checkinmsgtype, |
268 |
checkinmsg => $itemtype->checkinmsg, |
269 |
); |
269 |
checkinmsgtype => $itemtype->checkinmsgtype, |
270 |
} |
270 |
); |
|
|
271 |
} |
271 |
|
272 |
|
272 |
# make sure return branch respects home branch circulation rules, default to homebranch |
273 |
# make sure return branch respects home branch circulation rules, default to homebranch |
273 |
my $hbr = GetBranchItemRule($item->homebranch, $itemtype ? $itemtype->itemtype : undef )->{'returnbranch'} || "homebranch"; |
274 |
my $hbr = GetBranchItemRule($item->homebranch, $itemtype ? $itemtype->itemtype : undef )->{'returnbranch'} || "homebranch"; |
274 |
$returnbranch = $item->$hbr; |
275 |
$returnbranch = $item->$hbr; |
275 |
|
276 |
|
276 |
my $materials = $item->materials; |
277 |
my $materials = $item->materials; |
277 |
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials }); |
278 |
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials }); |
278 |
$materials = $descriptions->{lib} // $materials; |
279 |
$materials = $descriptions->{lib} // $materials; |
279 |
|
280 |
|
280 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
281 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ); |
281 |
|
282 |
|
282 |
my $biblio = $item->biblio; |
283 |
my $biblio = $item->biblio; |
283 |
$template->param( |
284 |
$template->param( |
284 |
title => $biblio->title, |
285 |
title => $biblio->title, |
285 |
homebranch => $item->homebranch, |
286 |
homebranch => $item->homebranch, |
286 |
holdingbranch => $item->holdingbranch, |
287 |
holdingbranch => $item->holdingbranch, |
287 |
returnbranch => $returnbranch, |
288 |
returnbranch => $returnbranch, |
288 |
author => $biblio->author, |
289 |
author => $biblio->author, |
289 |
itembarcode => $item->barcode, |
290 |
itembarcode => $item->barcode, |
290 |
itemtype => $item->effective_itemtype, |
291 |
itemtype => $item->effective_itemtype, |
291 |
ccode => $item->ccode, |
292 |
ccode => $item->ccode, |
292 |
itembiblionumber => $biblio->biblionumber, |
293 |
itembiblionumber => $biblio->biblionumber, |
293 |
biblionumber => $biblio->biblionumber, |
294 |
biblionumber => $biblio->biblionumber, |
294 |
borrower => $borrower, |
295 |
borrower => $borrower, |
295 |
additional_materials => $materials, |
296 |
additional_materials => $materials, |
296 |
issue => $issue, |
297 |
issue => $issue, |
297 |
); |
298 |
); |
|
|
299 |
} # FIXME else we should not call AddReturn but set BadBarcode directly instead |
298 |
|
300 |
|
299 |
my %input = ( |
301 |
my %input = ( |
300 |
counter => 0, |
302 |
counter => 0, |
Lines 302-307
if ($barcode) {
Link Here
|
302 |
barcode => $barcode, |
304 |
barcode => $barcode, |
303 |
); |
305 |
); |
304 |
|
306 |
|
|
|
307 |
|
305 |
# do the return |
308 |
# do the return |
306 |
( $returned, $messages, $issueinformation, $borrower ) = |
309 |
( $returned, $messages, $issueinformation, $borrower ) = |
307 |
AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate ); |
310 |
AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate ); |
308 |
- |
|
|