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

(-)a/C4/SIP/ILS/Patron.pm (-5 / +10 lines)
Lines 22-30 use C4::Context; Link Here
22
use C4::Koha;
22
use C4::Koha;
23
use C4::Members;
23
use C4::Members;
24
use C4::Reserves;
24
use C4::Reserves;
25
use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio);
25
use C4::Items qw( GetItemnumbersForBiblio);
26
use C4::Auth qw(checkpw);
26
use C4::Auth qw(checkpw);
27
27
28
use Koha::Items;
28
use Koha::Libraries;
29
use Koha::Libraries;
29
use Koha::Patrons;
30
use Koha::Patrons;
30
31
Lines 315-321 sub hold_items { Link Here
315
    my $self = shift;
316
    my $self = shift;
316
    my $item_arr = $self->x_items('hold_items', @_);
317
    my $item_arr = $self->x_items('hold_items', @_);
317
    foreach my $item (@{$item_arr}) {
318
    foreach my $item (@{$item_arr}) {
318
        $item->{barcode} = GetBarcodeFromItemnumber($item->{itemnumber});
319
        my $item_obj = Koha::Items->find($item->{itemnumber});
320
        $item_arr->{barcode} = $item_obj ? $item_obj->barcode : undef;
319
    }
321
    }
320
    return $item_arr;
322
    return $item_arr;
321
}
323
}
Lines 483-497 sub _get_outstanding_holds { Link Here
483
    while ( my $hold = $holds->next ) {
485
    while ( my $hold = $holds->next ) {
484
        my $item;
486
        my $item;
485
        if ($hold->itemnumber) {
487
        if ($hold->itemnumber) {
486
            $item = $hold->itemnumber;
488
            $item = $hold->item;
487
        }
489
        }
488
        else {
490
        else {
489
            # We need to return a barcode for the biblio so the client
491
            # We need to return a barcode for the biblio so the client
490
            # can request the biblio info
492
            # can request the biblio info
491
            $item = ( GetItemnumbersForBiblio($hold->biblionumber) )->[0];
493
            my $items = $hold->biblio->items;
494
            $item = $items->count ? $item->next : undef;
492
        }
495
        }
493
        my $unblessed_hold = $hold->unblessed;
496
        my $unblessed_hold = $hold->unblessed;
494
        $unblessed_hold->{barcode} = GetBarcodeFromItemnumber($item);
497
498
        $unblessed_hold->{barcode} = $item ? $item->barcode : undef;
499
495
        push @holds, $unblessed_hold;
500
        push @holds, $unblessed_hold;
496
    }
501
    }
497
    return \@holds;
502
    return \@holds;
(-)a/cataloguing/additem.pl (-1 / +3 lines)
Lines 903-908 foreach my $tag ( keys %{$tagslib}){ Link Here
903
}
903
}
904
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
904
@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
905
905
906
my $item = Koha::Items->find($itemnumber); # We certainly want to fetch it earlier
907
906
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
908
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
907
$template->param(
909
$template->param(
908
    biblionumber => $biblionumber,
910
    biblionumber => $biblionumber,
Lines 912-918 $template->param( Link Here
912
    item_header_loop => \@header_value_loop,
914
    item_header_loop => \@header_value_loop,
913
    item             => \@loop_data,
915
    item             => \@loop_data,
914
    itemnumber       => $itemnumber,
916
    itemnumber       => $itemnumber,
915
    barcode          => GetBarcodeFromItemnumber($itemnumber),
917
    barcode          => $item ? $item->barcode : undef,
916
    itemtagfield     => $itemtagfield,
918
    itemtagfield     => $itemtagfield,
917
    itemtagsubfield  => $itemtagsubfield,
919
    itemtagsubfield  => $itemtagsubfield,
918
    op      => $nextop,
920
    op      => $nextop,
(-)a/svc/checkin (-3 / +5 lines)
Lines 24-33 use CGI; Link Here
24
use JSON qw(to_json);
24
use JSON qw(to_json);
25
25
26
use C4::Circulation;
26
use C4::Circulation;
27
use C4::Items qw(GetBarcodeFromItemnumber GetItem ModItem);
27
use C4::Items qw(GetItem ModItem);
28
use C4::Context;
28
use C4::Context;
29
use C4::Auth qw(check_cookie_auth);
29
use C4::Auth qw(check_cookie_auth);
30
use Koha::Checkouts;
30
use Koha::Checkouts;
31
use Koha::Items;
31
32
32
my $input = new CGI;
33
my $input = new CGI;
33
34
Lines 53-59 my $branchcode = $input->param('branchcode') Link Here
53
$override_limit = $override_limit ? $override_limit eq 'true' : undef;
54
$override_limit = $override_limit ? $override_limit eq 'true' : undef;
54
$exempt_fine    = $exempt_fine    ? $exempt_fine eq 'true'    : undef;
55
$exempt_fine    = $exempt_fine    ? $exempt_fine eq 'true'    : undef;
55
56
56
my $barcode = GetBarcodeFromItemnumber($itemnumber);
57
my $item = Koha::Items->find($itemnumber);
58
59
my $barcode = $item ? $item->barcode : undef; # We certainly will want to return an error code
57
60
58
my $data;
61
my $data;
59
$data->{itemnumber}     = $itemnumber;
62
$data->{itemnumber}     = $itemnumber;
60
- 

Return to bug 21184