-
-foreach my $item (@$items){
- $item->{itemlostloop}= GetAuthorisedValues('LOST',$item->{itemlost});
- $item->{itemdamagedloop}= GetAuthorisedValues('DAMAGED',$item->{damaged});
+($itemnumber) and @items = (grep {$_->{'itemnumber'} == $itemnumber} @items);
+foreach my $item (@items){
+ $item->{itemlostloop}= GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
+ $item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
+ $item->{'collection'} = $ccodes->{$item->{ccode}};
+ $item->{'itype'} = $itemtypes->{$item->{'itype'}}->{'description'};