@@ -, +, @@
---
C4/Items.pm | 12 +++++++--
.../prog/en/modules/tools/inventory.tt | 29 ++++++++++++++++++++++
t/db_dependent/Items/GetItemsForInventory.t | 7 +++++-
tools/inventory.pl | 12 ++++++++-
4 files changed, 56 insertions(+), 4 deletions(-)
--- a/C4/Items.pm
+++ a/C4/Items.pm
@@ -477,7 +477,6 @@ lists of authorized values for certain item fields.
minlocation => $minlocation,
maxlocation => $maxlocation,
location => $location,
- itemtype => $itemtype,
ignoreissued => $ignoreissued,
datelastseen => $datelastseen,
branchcode => $branchcode,
@@ -485,6 +484,7 @@ lists of authorized values for certain item fields.
offset => $offset,
size => $size,
statushash => $statushash,
+ itemtypes => @itemsarray,
} );
Retrieve a list of title/authors/barcode/callnumber, for biblio inventory.
@@ -517,6 +517,7 @@ sub GetItemsForInventory {
my $size = $parameters->{'size'} // '';
my $statushash = $parameters->{'statushash'} // '';
my $ignore_waiting_holds = $parameters->{'ignore_waiting_holds'} // '';
+ my $items = $parameters->{'itemtypes'} // '';
my $dbh = C4::Context->dbh;
my ( @bind_params, @where_strings );
@@ -576,7 +577,6 @@ sub GetItemsForInventory {
push @where_strings, 'biblioitems.itemtype = ?';
push @bind_params, $itemtype;
}
-
if ( $ignoreissued) {
$query .= "LEFT JOIN issues ON items.itemnumber = issues.itemnumber ";
push @where_strings, 'issues.date_due IS NULL';
@@ -587,6 +587,14 @@ sub GetItemsForInventory {
push( @where_strings, q{(reserves.found != 'W' OR reserves.found IS NULL)} );
}
+ if ( $items and @{$items} > 0 ){
+ my $joinedvals;
+ for my $itemtype (@{$items}){
+ $joinedvals = join(',', @{$items});
+ }
+ push @where_strings, "( biblioitems.itemtype IN (" . $joinedvals . ") OR items.itype IN (" . $joinedvals . ") )";
+ }
+
if ( @where_strings ) {
$query .= 'WHERE ';
$query .= join ' AND ', @where_strings;
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
@@ -157,7 +157,27 @@
+
+
+
+
Select all | Clear all
+
+ [% FOREACH itemtype IN itemtypes %]
+
+
+
+
+ [% IF loop.count() % 4 == 0 && !loop.last() %]
+
+
+ [% END %]
+ [% END %]
+
+
+
+
+