View | Details | Raw Unified | Return to bug 27945
Collapse All | Expand All

(-)a/Koha/ArticleRequest.pm (-1 lines)
Lines 26-32 use Koha::Biblios; Link Here
26
use Koha::Items;
26
use Koha::Items;
27
use Koha::Libraries;
27
use Koha::Libraries;
28
use Koha::DateUtils qw( dt_from_string );
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::ArticleRequests;
30
use Koha::Exceptions::ArticleRequest;
29
use Koha::Exceptions::ArticleRequest;
31
30
32
use base qw(Koha::Object);
31
use base qw(Koha::Object);
(-)a/Koha/Patron.pm (-9 / +7 lines)
Lines 972-989 sub can_request_article { Link Here
972
972
973
    return 1 if !$limit;
973
    return 1 if !$limit;
974
974
975
    my $date = dt_from_string;
975
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
976
    my $count = Koha::ArticleRequests->search({
976
    my $compdate = dt_from_string->add( days => -1 );
977
            borrowernumber => $self->borrowernumber,
977
    my $count = Koha::ArticleRequests->search([
978
            status => {'!=' => 'CANCELED'},
978
        { borrowernumber => $self->borrowernumber, status => ['PENDING','PROCESSING'] },
979
            created_on => {
979
        { borrowernumber => $self->borrowernumber, status => 'COMPLETED', updated_on => { '>', $dtf->format_date($compdate) }},
980
                '>=' => $date->date.' 00:00:00',
980
    ])->count;
981
                '<=' => $date->date.' 23:59:59'
982
            }
983
        })->count;
984
    return $count < $limit ? 1 : 0;
981
    return $count < $limit ? 1 : 0;
985
}
982
}
986
983
984
987
=head3 article_requests
985
=head3 article_requests
988
986
989
my @requests = $borrower->article_requests();
987
my @requests = $borrower->article_requests();
(-)a/admin/categories.pl (-2 / +1 lines)
Lines 77-83 if ( $op eq 'add_validate' ) { Link Here
77
77
78
    my $is_a_modif = $input->param("is_a_modif");
78
    my $is_a_modif = $input->param("is_a_modif");
79
79
80
    if ($article_request_limit ne '' && $article_request_limit !~ /\d+/) {
80
    if ($article_request_limit ne '' && $article_request_limit !~ /^\d+$/) {
81
        push @messages, {type => 'error', code => 'article_request_numeric_limit' };
81
        push @messages, {type => 'error', code => 'article_request_numeric_limit' };
82
        $op = 'add_form';
82
        $op = 'add_form';
83
    } elsif ($article_request_limit ne '' && $article_request_limit < 0) {
83
    } elsif ($article_request_limit ne '' && $article_request_limit < 0) {
84
- 

Return to bug 27945