use Koha::Biblioitems;
use Koha::Items;
use Koha::ItemTypes;
+use Koha::Patrons;
use C4::Biblio qw( GetMarcFromKohaField );
{
}
}
+{
+ my $patrons = Koha::Patrons->search( {}, { order_by => [ 'categorycode', 'borrowernumber' ] } );
+ my @invalid_patrons;
+ while ( my $patron = $patrons->next ) {
+ push @invalid_patrons, $patron unless $patron->is_valid_age;
+ }
+ if (@invalid_patrons) {
+ new_section("Patrons with invalid age for category");
+ foreach my $patron (@invalid_patrons) {
+ new_item( sprintf "Patron borrowernumber=%s in category '%s' has invalid age '%s'",
+ $patron->borrowernumber, $patron->category->categorycode, $patron->get_age );
+ }
+ new_hint("You may change patron's category automatically with misc/cronjobs/update_patrons_category.pl");
+ }
+}
+
sub new_section {
my ( $name ) = @_;
say "\n== $name ==";