From 4fd404c7231df633d2f87667619b0cb82b2e595f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 1 Aug 2022 09:11:17 +0200 Subject: [PATCH] Bug 27272: Fix library display on routing slip - to squash --- serials/routing-preview.pl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 0e62a68c81f..462ad307bc5 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -61,16 +61,18 @@ my $library; if($ok){ # get biblio information.... my $biblionumber = $subs->{'bibnum'}; + + my $biblio = Koha::Biblios->find( $biblionumber ); + my $items = $biblio->items->search_ordered; + my $branch = + $items->count + ? $items->next->holding_branch->branchcode + : $subs->{branchcode}; + $library = Koha::Libraries->find($branch); + if (C4::Context->preference('RoutingListAddReserves')){ # get existing reserves ..... - my $biblio = Koha::Biblios->find( $biblionumber ); - my $items = $biblio->items->search_ordered; - my $branch = - $items->count - ? $items->next->holding_branch->branchcode - : $subs->{branchcode}; - $library = Koha::Libraries->find($branch); my $holds = $biblio->current_holds; my $count = $holds->count; while ( my $hold = $holds->next ) { -- 2.25.1