+my @all_items= GetItemsInfo($biblionumber);
+my @items;
+for my $itm (@all_items) {
+ push @items, $itm unless ( $itm->{itemlost} &&
+ GetHideLostItemsPreference($loggedinuser) &&
+ !$showallitems &&
+ ($itemnumber != $itm->{itemnumber}));
+}
+
+my $totalcount=@all_items;
+my $showncount=@items;
+my $hiddencount = $totalcount - $showncount;
+$data->{'count'}=$totalcount;
+$data->{'showncount'}=$showncount;
+$data->{'hiddencount'}=$hiddencount; # can be zero