@@ -, +, @@ --- Koha/Illrequest.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/Koha/Illrequest.pm +++ a/Koha/Illrequest.pm @@ -728,18 +728,21 @@ sub _limit_counter { my ( $self, $method, $target ) = @_; # Establish parameters of counts - my $where; + my $resultset; if ($method && $method eq 'annual') { - $where = \"YEAR(placement_date) = YEAR(NOW())"; + $resultset = Koha::Illrequests->search({ + -and => [ + %{$target}, + \"YEAR(placed) = YEAR(NOW())" + ] + }); } else { # assume 'active' # FIXME: This status list is ugly. There should be a method in config # to return these. $where = { status => { -not_in => [ 'QUEUED', 'COMP' ] } }; + $resultset = Koha::Illrequests->search({ %{$target}, %{$where} }); } - # Create resultset - my $resultset = Koha::Illrequests->search({ %{$target}, %{$where} }); - # Fetch counts return $resultset->count; } --