[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 15:31:23 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27945

--- Comment #92 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #87)
> 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.

So this is the main blocker for this dev. I will add tests:
Marcel: what is the right behavior? 24 hours timespan? same day? I feel like
'same day' is the right thing. But will implement it as you want, so: how?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list