Lines 728-745
sub _limit_counter {
Link Here
|
728 |
my ( $self, $method, $target ) = @_; |
728 |
my ( $self, $method, $target ) = @_; |
729 |
|
729 |
|
730 |
# Establish parameters of counts |
730 |
# Establish parameters of counts |
731 |
my $where; |
731 |
my $resultset; |
732 |
if ($method && $method eq 'annual') { |
732 |
if ($method && $method eq 'annual') { |
733 |
$where = \"YEAR(placement_date) = YEAR(NOW())"; |
733 |
$resultset = Koha::Illrequests->search({ |
|
|
734 |
-and => [ |
735 |
%{$target}, |
736 |
\"YEAR(placed) = YEAR(NOW())" |
737 |
] |
738 |
}); |
734 |
} else { # assume 'active' |
739 |
} else { # assume 'active' |
735 |
# FIXME: This status list is ugly. There should be a method in config |
740 |
# FIXME: This status list is ugly. There should be a method in config |
736 |
# to return these. |
741 |
# to return these. |
737 |
$where = { status => { -not_in => [ 'QUEUED', 'COMP' ] } }; |
742 |
$where = { status => { -not_in => [ 'QUEUED', 'COMP' ] } }; |
|
|
743 |
$resultset = Koha::Illrequests->search({ %{$target}, %{$where} }); |
738 |
} |
744 |
} |
739 |
|
745 |
|
740 |
# Create resultset |
|
|
741 |
my $resultset = Koha::Illrequests->search({ %{$target}, %{$where} }); |
742 |
|
743 |
# Fetch counts |
746 |
# Fetch counts |
744 |
return $resultset->count; |
747 |
return $resultset->count; |
745 |
} |
748 |
} |
746 |
- |
|
|