Bug 19899: Restore Item floats feature - do not crash
[koha.git] / circ / bookcount.pl
index d4d3e54..2976a05 100755 (executable)
@@ -29,7 +29,6 @@ use C4::Circulation;
 use C4::Output;
 use C4::Koha;
 use C4::Auth;
-use C4::Branch; # GetBranches
 use C4::Biblio; # GetBiblioItemData
 use Koha::DateUtils;
 use Koha::Libraries;
@@ -38,14 +37,10 @@ my $input        = new CGI;
 my $itm          = $input->param('itm');
 my $bi           = $input->param('bi');
 my $biblionumber = $input->param('biblionumber');
-my $branches     = GetBranches;
 
 my $idata = itemdatanum($itm);
 my $data  = GetBiblioItemData($bi);
 
-my $homebranch    = $branches->{ $idata->{'homebranch'}    }->{'branchname'};
-my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'};
-
 my $lastmove = lastmove($itm);
 
 my $lastdate;
@@ -83,8 +78,8 @@ $template->param(
     author                  => $data->{'author'},
     barcode                 => $idata->{'barcode'},
     biblioitemnumber        => $bi,
-    homebranch              => $homebranch,
-    holdingbranch           => $holdingbranch,
+    homebranch              => $idata->{homebranch},
+    holdingbranch           => $idata->{holdingbranch},
     lastdate                => $lastdate ? $lastdate : 0,
     count                   => $count,
     libraries               => $libraries,