@@ -, +, @@ --- C4/Items.pm | 9 +++++++-- .../prog/en/modules/tools/inventory.tt | 5 +++++ tools/inventory.pl | 4 +++- 3 files changed, 15 insertions(+), 3 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1011,7 +1011,7 @@ sub GetLostItems { =head2 GetItemsForInventory -($itemlist, $iTotalRecords) = GetItemsForInventory($minlocation, $maxlocation, $location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $offset, $size, $statushash); +($itemlist, $iTotalRecords) = GetItemsForInventory($minlocation, $maxlocation, $location, $itemtype, $ignoreissued, $ignore_holds_waiting, $datelastseen, $branchcode, $offset, $size, $statushash); Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. @@ -1029,7 +1029,7 @@ $iTotalRecords is the number of rows that would have been returned without the $ =cut sub GetItemsForInventory { - my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_; + my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $ignore_holds_waiting, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); @@ -1091,6 +1091,11 @@ sub GetItemsForInventory { push @where_strings, 'issues.date_due IS NULL'; } + if ( $ignore_holds_waiting ) { + $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 @@ -207,6 +207,11 @@ $(document).ready(function(){ [% END %]
  • +
  • + + +
  • +
  • --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -46,6 +46,7 @@ $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); my $location=$input->param('location') || ''; my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this my $ignoreissued=$input->param('ignoreissued'); +my $ignore_holds_waiting = $input->param('ignore_holds_waiting'); my $datelastseen = $input->param('datelastseen'); my $markseen = $input->param('markseen'); my $branchcode = $input->param('branchcode') || ''; @@ -135,6 +136,7 @@ $template->param( maxlocation => $maxlocation, location => $location, ignoreissued => $ignoreissued, + ignore_holds_waiting => $ignore_holds_waiting, branchcode => $branchcode, branch => $branch, datelastseen => $datelastseen, @@ -231,7 +233,7 @@ my @items_with_problems; if ( $markseen or $op ) { # retrieve all items in this range. my $totalrecords; - ($inventorylist, $totalrecords) = GetItemsForInventory($minlocation, $maxlocation, $location, $itemtype, $ignoreissued, '', $branchcode, $branch, 0, undef , $staton); + ($inventorylist, $totalrecords) = GetItemsForInventory($minlocation, $maxlocation, $location, $itemtype, $ignoreissued, $ignore_holds_waiting, '', $branchcode, $branch, 0, undef , $staton); } # If "compare barcodes list to results" has been checked, we want to alert for missing items --