Bug 2094: fixing two bugs in lost items report
authorAndrew Moore <andrew.moore@liblime.com>
Fri, 9 May 2008 20:06:26 +0000 (15:06 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 11 May 2008 11:48:51 +0000 (06:48 -0500)
* I guess the limit by item type was never working. I made it look for the right database column
* I fixed the error that was returned with no items were returned.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Items.pm
reports/itemslost.pl

index fb285db..fa31f52 100644 (file)
@@ -904,7 +904,7 @@ sub GetLostItems {
 
     my $sth = $dbh->prepare($query);
     $sth->execute( @query_parameters );
-    my $items;
+    my $items = [];
     while ( my $row = $sth->fetchrow_hashref ){
         push @$items, $row;
     }
index 9d46f22..c0482ab 100755 (executable)
@@ -56,7 +56,7 @@ if ( $get_items ) {
     my %where;
     $where{'homebranch'}       = $branchfilter    if defined $branchfilter;
     $where{'barcode'}          = $barcodefilter   if defined $barcodefilter;
-    $where{'itemtype'}         = $itemtypesfilter if defined $itemtypesfilter;
+    $where{'itype'}            = $itemtypesfilter if defined $itemtypesfilter;
     $where{'authorised_value'} = $loststatusfilter if defined $loststatusfilter;
 
     my $items = GetLostItems( \%where, $orderbyfilter );