View | Details | Raw Unified | Return to bug 18276
Collapse All | Expand All

(-)a/circ/circulation.pl (-7 / +7 lines)
Lines 331-340 if (@$barcodes) { Link Here
331
    $template_params->{messages} = $messages;
331
    $template_params->{messages} = $messages;
332
332
333
    my $item = Koha::Items->find({ barcode => $barcode });
333
    my $item = Koha::Items->find({ barcode => $barcode });
334
    my $biblio = $item->biblio;
334
    my ( $biblio, $mss );
335
335
336
    my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } });
336
    if ( $item ) {
337
    $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
337
        $biblio = $item->biblio;
338
        my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } });
339
        $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef;
340
    }
338
341
339
    # Fix for bug 7494: optional checkout-time fallback search for a book
342
    # Fix for bug 7494: optional checkout-time fallback search for a book
340
343
Lines 412-421 if (@$barcodes) { Link Here
412
        );
415
        );
413
    }
416
    }
414
417
415
    $template->param(
416
        itembiblionumber => $biblio->biblionumber
417
    );
418
419
418
420
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
419
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
421
    $patron = Koha::Patrons->find( $borrowernumber );
420
    $patron = Koha::Patrons->find( $borrowernumber );
Lines 424-429 if (@$barcodes) { Link Here
424
    if ( $item ) {
423
    if ( $item ) {
425
        $template_params->{item} = $item;
424
        $template_params->{item} = $item;
426
        $template_params->{biblio} = $biblio;
425
        $template_params->{biblio} = $biblio;
426
        $template_params->{itembiblionumber} = $biblio->biblionumber;
427
    }
427
    }
428
    push @$checkout_infos, $template_params;
428
    push @$checkout_infos, $template_params;
429
  }
429
  }
(-)a/circ/returns.pl (-33 / +35 lines)
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
- 

Return to bug 18276