@@ -, +, @@ --- C4/Items.pm | 61 +++++++++++-------- .../prog/en/modules/tools/inventory.tt | 5 ++ tools/inventory.pl | 65 +++++++++++--------- 3 files changed, 76 insertions(+), 55 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1024,20 +1024,23 @@ sub GetLostItems { =head2 GetItemsForInventory -($itemlist, $iTotalRecords) = GetItemsForInventory( { - minlocation => $minlocation, - maxlocation => $maxlocation, - location => $location, - itemtype => $itemtype, - ignoreissued => $ignoreissued, - datelastseen => $datelastseen, - branchcode => $branchcode, - branch => $branch, - offset => $offset, - size => $size, - stautshash => $statushash - interface => $interface, -} ); +( $itemlist, $iTotalRecords ) = GetItemsForInventory( + { + minlocation => $minlocation, + maxlocation => $maxlocation, + location => $location, + itemtype => $itemtype, + ignoreissued => $ignoreissued, + datelastseen => $datelastseen, + branchcode => $branchcode, + branch => $branch, + offset => $offset, + size => $size, + stautshash => $statushash, + interface => $interface, + ignore_holds_waiting => $ignore_holds_waiting, + } +); Retrieve a list of title/authors/barcode/callnumber, for biblio inventory. @@ -1056,18 +1059,19 @@ $iTotalRecords is the number of rows that would have been returned without the $ sub GetItemsForInventory { my ( $parameters ) = @_; - my $minlocation = $parameters->{'minlocation'} // ''; - my $maxlocation = $parameters->{'maxlocation'} // ''; - my $location = $parameters->{'location'} // ''; - my $itemtype = $parameters->{'itemtype'} // ''; - my $ignoreissued = $parameters->{'ignoreissued'} // ''; - my $datelastseen = $parameters->{'datelastseen'} // ''; - my $branchcode = $parameters->{'branchcode'} // ''; - my $branch = $parameters->{'branch'} // ''; - my $offset = $parameters->{'offset'} // ''; - my $size = $parameters->{'size'} // ''; - my $statushash = $parameters->{'statushash'} // ''; - my $interface = $parameters->{'interface'} // ''; + my $minlocation = $parameters->{minlocation} // ''; + my $maxlocation = $parameters->{maxlocation} // ''; + my $location = $parameters->{location} // ''; + my $itemtype = $parameters->{itemtype} // ''; + my $ignoreissued = $parameters->{ignoreissued} // ''; + my $datelastseen = $parameters->{datelastseen} // ''; + my $branchcode = $parameters->{branchcode} // ''; + my $branch = $parameters->{branch} // ''; + my $offset = $parameters->{offset} // ''; + my $size = $parameters->{size} // ''; + my $statushash = $parameters->{statushash} // ''; + my $interface = $parameters->{interface} // ''; + my $ignore_holds_waiting = $parameters->{ignore_holds_waiting} // ''; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); @@ -1130,6 +1134,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 %]