@@ -, +, @@ Koha::Clubs::get_enrollable --- Koha/Clubs.pm | 2 +- t/db_dependent/Clubs.t | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) --- a/Koha/Clubs.pm +++ a/Koha/Clubs.pm @@ -58,7 +58,7 @@ sub get_enrollable { # Only clubs with no end date or an end date in the future can be enrolled in $params->{'-and'} = [ - -or => [ date_end => { '>=' => \'CURRENT_DATE()' }, date_end => undef], + -or => [ date_end => { '>=' => \'CAST(now() AS date)' }, date_end => undef], -or => [ 'me.branchcode' => $borrower->branchcode, 'me.branchcode' => undef ] ]; --- a/t/db_dependent/Clubs.t +++ a/t/db_dependent/Clubs.t @@ -124,6 +124,16 @@ is( $club_template->club_template_enrollment_fields->count, 2, 'Club template has two enrollment fields' ); ## Create a club based on this template +Koha::Club->new( + { + club_template_id => $club_template->id, + name => "Test Expired Club", + branchcode => $branchcode, + date_start => '1900-01-01', + date_end => '1900-01-02', + } +)->store(); + my $club = Koha::Club->new( { club_template_id => $club_template->id, --