[Koha-bugs] [Bug 27945] Limit the number of active article requests per patron category
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Oct 1 10:21:00 CEST 2021
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27945
--- Comment #87 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
I am not convinced by the COMPLETED, updated_on code:
965 Returns true if the patron can request articles. As limits apply for the
patron
966 on on the same day, those completed the same day are considered as
current.
976 my $dtf = Koha::Database->new->schema->storage->datetime_parser;
977 my $compdate = dt_from_string->add( days => -1 );
978 my $count = Koha::ArticleRequests->search([
979 { borrowernumber => $self->borrowernumber, status =>
['REQUESTED','PENDING','PROCESSING'] },
980 { borrowernumber => $self->borrowernumber, status => 'COMPLETED',
updated_on => { '>', $dtf->format_date($compdate) }},
if today is Oct 1st, $dtf->format_date($compdate) will be Sept 30th and
updated_on > 2021-09-30 will return the rows updated yesterday as well.
There is no test coverage for that.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list