[Koha-bugs] [Bug 27945] Limit the number of article requests per day per patron category

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 18 15:31:02 CEST 2021


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

--- Comment #25 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Side note
Currently we use the following custom check to limit numbers:

my $compdate = dt_from_string->add( days => -1 );
my $count = Koha::ArticleRequests->search([
    { borrowernumber => $borrowernumber, status => ['PENDING','PROCESSING'] },
    { borrowernumber => $borrowernumber, status => 'COMPLETED', updated_on => {
'>',
Koha::Database->new->schema->storage->datetime_parser->format_date($compdate)
}},
])->count;

This does not take into consideration the new/requested and pending status. So
pending is still new here.
But it looks at the number of requests in the pipeline for the user PLUS the
completed ones within the last 24 hours. Advantage illustrated by the example
below:

Proposed check:
Say that the limit is 5.
User submits 5 requests on Friday night, Saturday, Sunday and Monday morning.
This makes that we need to process 20 requests coming in on Monday.

"Custom" check:
User may only submit 5 requests on Friday night if we did not complete requests
during that day. He is not allowed any more requests during the weekend. Only
when we complete say 1 request on Monday, he is allowed to submit another one
on Tuesday (24 hours later).

What do you think?

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


More information about the Koha-bugs mailing list