From 3968c315dcb4f9c36a04cca8d32f8544c4f2698c 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 0e62a68c81..462ad307bc 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.37.1