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

(-)a/Koha/Patron.pm (-5 / +5 lines)
Lines 24-29 use Carp; Link Here
24
use List::MoreUtils qw( any uniq );
24
use List::MoreUtils qw( any uniq );
25
use JSON qw( to_json );
25
use JSON qw( to_json );
26
use Unicode::Normalize;
26
use Unicode::Normalize;
27
use bigint;
27
28
28
use C4::Context;
29
use C4::Context;
29
use C4::Log;
30
use C4::Log;
Lines 113-122 sub fixup_cardnumber { Link Here
113
    my $max = Koha::Patrons->search({
114
    my $max = Koha::Patrons->search({
114
        cardnumber => {-regexp => '^-?[0-9]+$'}
115
        cardnumber => {-regexp => '^-?[0-9]+$'}
115
    }, {
116
    }, {
116
        select => \'CAST(cardnumber AS SIGNED)',
117
        order_by => \'(cardnumber+0) DESC',
117
        as => ['cast_cardnumber']
118
        })->next;
118
    })->_resultset->get_column('cast_cardnumber')->max;
119
        return unless $max;
119
    $self->cardnumber(($max || 0) +1);
120
    $self->cardnumber(($max->cardnumber || 0) +1);
120
}
121
}
121
122
122
=head3 trim_whitespace
123
=head3 trim_whitespace
123
- 

Return to bug 26035