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

(-)a/serials/routing-preview.pl (-6 / +6 lines)
Lines 25-31 use C4::Auth qw( get_template_and_user ); Link Here
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Reserves qw( AddReserve ModReserve );
26
use C4::Reserves qw( AddReserve ModReserve );
27
use C4::Context;
27
use C4::Context;
28
use C4::Items qw( GetItemsInfo );
29
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing );
28
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing );
30
use URI::Escape;
29
use URI::Escape;
31
30
Lines 62-75 my $library; Link Here
62
if($ok){
61
if($ok){
63
    # get biblio information....
62
    # get biblio information....
64
    my $biblionumber = $subs->{'bibnum'};
63
    my $biblionumber = $subs->{'bibnum'};
65
    my @itemresults = GetItemsInfo( $biblionumber );
66
    my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
67
    $library = Koha::Libraries->find($branch);
68
69
	if (C4::Context->preference('RoutingListAddReserves')){
64
	if (C4::Context->preference('RoutingListAddReserves')){
70
		# get existing reserves .....
65
		# get existing reserves .....
71
66
72
        my $biblio = Koha::Biblios->find( $biblionumber );
67
        my $biblio = Koha::Biblios->find( $biblionumber );
68
        my $items = $biblio->items;
69
        my $branch =
70
            $items->count
71
          ? $items->next->holding_branch->branchcode
72
          : $subs->{branchcode};
73
        $library = Koha::Libraries->find($branch);
73
        my $holds = $biblio->current_holds;
74
        my $holds = $biblio->current_holds;
74
        my $count = $holds->count;
75
        my $count = $holds->count;
75
        while ( my $hold = $holds->next ) {
76
        while ( my $hold = $holds->next ) {
76
- 

Return to bug 27272