@@ -, +, @@ --- C4/Items.pm | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt | 4 ++++ tools/inventory.pl | 4 ++++ 3 files changed, 14 insertions(+) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -823,6 +823,7 @@ sub GetItemsForInventory { my $offset = $parameters->{'offset'} // ''; my $size = $parameters->{'size'} // ''; my $statushash = $parameters->{'statushash'} // ''; + my $ignore_waiting_holds = $parameters->{'ignore_waiting_holds'} // ''; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); @@ -885,6 +886,11 @@ sub GetItemsForInventory { push @where_strings, 'issues.date_due IS NULL'; } + if ( $ignore_waiting_holds ) { + $query .= "LEFT JOIN reserves ON items.itemnumber = reserves.itemnumber "; + push( @where_strings, q{reserves.found != 'W' OR reserves.found IS NULL} ); + } + 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 @@ -129,6 +129,10 @@ [% END %] +
  • + + +
  • --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -46,6 +46,7 @@ my $maxlocation=$input->param('maxlocation'); $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); my $location=$input->param('location') || ''; my $ignoreissued=$input->param('ignoreissued'); +my $ignore_waiting_holds = $input->param('ignore_waiting_holds'); my $datelastseen = $input->param('datelastseen'); # last inventory date my $branchcode = $input->param('branchcode') || ''; my $branch = $input->param('branch'); @@ -127,6 +128,7 @@ $template->param( datelastseen => $datelastseen, compareinv2barcd => $compareinv2barcd, uploadedbarcodesflag => $uploadbarcodes ? 1 : 0, + ignore_waiting_holds => $ignore_waiting_holds, ); # Walk through uploaded barcodes, report errors, mark as seen, check in @@ -230,6 +232,7 @@ if ( $op && ( !$uploadbarcodes || $compareinv2barcd )) { branch => $branch, offset => 0, statushash => $staton, + ignore_waiting_holds => $ignore_waiting_holds, }); } # Build rightplacelist used to check if a scanned item is in the right place. @@ -244,6 +247,7 @@ if( @scanned_items ) { branch => $branch, offset => 0, statushash => undef, + ignore_waiting_holds => $ignore_waiting_holds, }); # Convert the structure to a hash on barcode $rightplacelist = { --