Lines 22-27
use Modern::Perl;
Link Here
|
22 |
use Carp; |
22 |
use Carp; |
23 |
|
23 |
|
24 |
use Koha::Database; |
24 |
use Koha::Database; |
|
|
25 |
use Koha::DateUtils qw( dt_from_string ); |
25 |
|
26 |
|
26 |
use Koha::Club; |
27 |
use Koha::Club; |
27 |
|
28 |
|
Lines 56-65
sub get_enrollable {
Link Here
|
56 |
} |
57 |
} |
57 |
} |
58 |
} |
58 |
|
59 |
|
|
|
60 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
61 |
|
59 |
# Only clubs with no end date or an end date in the future can be enrolled in |
62 |
# Only clubs with no end date or an end date in the future can be enrolled in |
60 |
$params->{'-and'} = [ |
63 |
$params->{'-and'} = [ |
61 |
-or => [ date_end => { '>=' => \'CAST(now() AS date)' }, date_end => undef], |
64 |
-or => [ |
62 |
-or => [ 'me.branchcode' => $borrower->branchcode, 'me.branchcode' => undef ] |
65 |
date_end => { '>=' => $dtf->format_datetime( dt_from_string() ) }, |
|
|
66 |
date_end => undef, |
67 |
], |
68 |
-or => [ |
69 |
'me.branchcode' => $borrower->branchcode, |
70 |
'me.branchcode' => undef, |
71 |
] |
63 |
]; |
72 |
]; |
64 |
|
73 |
|
65 |
my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } ); |
74 |
my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } ); |
66 |
- |
|
|