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

(-)a/misc/maintenance/search_for_data_inconsistencies.pl (-1 / +17 lines)
Lines 25-30 use Koha::BiblioFrameworks; Link Here
25
use Koha::Biblioitems;
25
use Koha::Biblioitems;
26
use Koha::Items;
26
use Koha::Items;
27
use Koha::ItemTypes;
27
use Koha::ItemTypes;
28
use Koha::Patrons;
28
use C4::Biblio;
29
use C4::Biblio;
29
30
30
{
31
{
Lines 209-214 use C4::Biblio; Link Here
209
    }
210
    }
210
}
211
}
211
212
213
{
214
    my $patrons = Koha::Patrons->search( {}, { order_by => [ 'categorycode', 'borrowernumber' ] } );
215
    my @invalid_patrons;
216
    while ( my $patron = $patrons->next ) {
217
        push @invalid_patrons, $patron unless $patron->is_valid_age;
218
    }
219
    if (@invalid_patrons) {
220
        new_section("Patrons with invalid age for category");
221
        foreach my $patron (@invalid_patrons) {
222
            new_item( sprintf "Patron borrowernumber=%s in category '%s' has invalid age '%s'",
223
                $patron->borrowernumber, $patron->category->categorycode, $patron->get_age );
224
        }
225
        new_hint("You may change patron's category automatically with misc/cronjobs/update_patrons_category.pl");
226
    }
227
}
228
212
sub new_section {
229
sub new_section {
213
    my ( $name ) = @_;
230
    my ( $name ) = @_;
214
    say "\n== $name ==";
231
    say "\n== $name ==";
215
- 

Return to bug 26311