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 227-232 use C4::Biblio qw( GetMarcFromKohaField ); Link Here
227
    }
228
    }
228
}
229
}
229
230
231
{
232
    my $patrons = Koha::Patrons->search( {}, { order_by => [ 'categorycode', 'borrowernumber' ] } );
233
    my @invalid_patrons;
234
    while ( my $patron = $patrons->next ) {
235
        push @invalid_patrons, $patron unless $patron->is_valid_age;
236
    }
237
    if (@invalid_patrons) {
238
        new_section("Patrons with invalid age for category");
239
        foreach my $patron (@invalid_patrons) {
240
            new_item( sprintf "Patron borrowernumber=%s in category '%s' has invalid age '%s'",
241
                $patron->borrowernumber, $patron->category->categorycode, $patron->get_age );
242
        }
243
        new_hint("You may change patron's category automatically with misc/cronjobs/update_patrons_category.pl");
244
    }
245
}
246
230
sub new_section {
247
sub new_section {
231
    my ( $name ) = @_;
248
    my ( $name ) = @_;
232
    say "\n== $name ==";
249
    say "\n== $name ==";
233
- 

Return to bug 26311