Test plan:
[1] Run the script with -doit and -cat [some_category] and verify that
the printed total is correct.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
$sql .= " AND categorycode = ?" if $category;
my $sth = $dbh->prepare($sql);
$sth->execute($since, $category || () );
+ my $cnt = 0;
while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) {
print "$borrowernumber: $categorycode\n";
next unless $doit;
borrowernumber => $borrowernumber,
categorycode => $categorycode,
} );
+ $cnt++;
}
$dbh->commit();
+ print "Total borrowers updated: $cnt\n" if $doit;
}