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

(-)a/serials/routing-preview.pl (-5 / +7 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 );
64
66
    my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
65
    my $biblio = Koha::Biblios->find( $biblionumber );
66
    my $items = $biblio->items->search_ordered;
67
    my $branch =
68
        $items->count
69
      ? $items->next->holding_branch->branchcode
70
      : $subs->{branchcode};
67
    $library = Koha::Libraries->find($branch);
71
    $library = Koha::Libraries->find($branch);
68
72
69
	if (C4::Context->preference('RoutingListAddReserves')){
73
	if (C4::Context->preference('RoutingListAddReserves')){
70
		# get existing reserves .....
74
		# get existing reserves .....
71
75
72
        my $biblio = Koha::Biblios->find( $biblionumber );
73
        my $holds = $biblio->current_holds;
76
        my $holds = $biblio->current_holds;
74
        my $count = $holds->count;
77
        my $count = $holds->count;
75
        while ( my $hold = $holds->next ) {
78
        while ( my $hold = $holds->next ) {
76
- 

Return to bug 31318