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 qw( GetMarcFromKohaField );
29
use C4::Biblio qw( GetMarcFromKohaField );
29
30
30
{
31
{
Lines 276-281 use C4::Biblio qw( GetMarcFromKohaField ); Link Here
276
    }
277
    }
277
}
278
}
278
279
280
{
281
    my $patrons = Koha::Patrons->search( {}, { order_by => [ 'categorycode', 'borrowernumber' ] } );
282
    my @invalid_patrons;
283
    while ( my $patron = $patrons->next ) {
284
        push @invalid_patrons, $patron unless $patron->is_valid_age;
285
    }
286
    if (@invalid_patrons) {
287
        new_section("Patrons with invalid age for category");
288
        foreach my $patron (@invalid_patrons) {
289
            new_item( sprintf "Patron borrowernumber=%s in category '%s' has invalid age '%s'",
290
                $patron->borrowernumber, $patron->category->categorycode, $patron->get_age );
291
        }
292
        new_hint("You may change patron's category automatically with misc/cronjobs/update_patrons_category.pl");
293
    }
294
}
295
279
sub new_section {
296
sub new_section {
280
    my ( $name ) = @_;
297
    my ( $name ) = @_;
281
    say "\n== $name ==";
298
    say "\n== $name ==";
282
- 

Return to bug 26311