+ # item lost, damaged loops
+ if ($row{'itemlost'}) {
+ my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'});
+ my $category = GetAuthValCode('items.itemlost',$fw);
+ my $lostdbh = C4::Context->dbh;
+ my $sth = $lostdbh->prepare("select lib from authorised_values where category=? and authorised_value =? ");
+ $sth->execute($category, $row{'itemlost'});
+ my $loststat = $sth->fetchrow;
+ if ($loststat) {
+ $row{'itemlost'} = $loststat;
+ }
+ }
+ if ($row{'damaged'}) {
+ my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'});
+ my $category = GetAuthValCode('items.damaged',$fw);
+ my $damageddbh = C4::Context->dbh;
+ my $sth = $damageddbh->prepare("select lib from authorised_values where category=? and authorised_value =? ");
+ $sth->execute($category, $row{'damaged'});
+ my $damagedstat = $sth->fetchrow;
+ if ($damagedstat) {
+ $row{'itemdamaged'} = $damagedstat;
+ }
+ }
+ # end lost, damaged