Add option to inventory tool to ignore copies on loan
authorMichael Hafen <mdhafen@tech.washk12.org>
Tue, 24 Feb 2009 19:05:50 +0000 (12:05 -0700)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:18:46 +0000 (23:18 +0200)
This adds an option to the inventory tool causing it to ignore copies
currently on loan.  This is good if you want to do inventory, but don't
want to update the date-last-seen on items currently on loan.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
C4/Items.pm

index c9818a0..b843ca5 100644 (file)
@@ -1071,6 +1071,11 @@ END_SQL
         push @where_strings, 'issues.date_due IS NULL';
     }
 
+    if ( $ignoreissued) {
+        $query .= "LEFT JOIN issues ON items.itemnumber = issues.itemnumber ";
+        push @where_strings, 'issues.date_due IS NULL';
+    }
+
     if ( @where_strings ) {
         $query .= 'WHERE ';
         $query .= join ' AND ', @where_strings;