use Koha::DateUtils;
my ( $help, $verbose, $not_borrowered_since, $expired_before, $category_code,
- $confirm );
+ $branchcode, $confirm );
GetOptions(
'h|help' => \$help,
'v|verbose' => \$verbose,
'not_borrowered_since:s' => \$not_borrowered_since,
'expired_before:s' => \$expired_before,
'category_code:s' => \$category_code,
+ 'branchcode:s' => \$branchcode,
'c|confirm' => \$confirm,
) || pod2usage(1);
$expired_before = dt_from_string( $expired_before, 'iso' )
if $expired_before;
-unless ( $not_borrowered_since or $expired_before or $category_code ) {
+unless ( $not_borrowered_since or $expired_before or $category_code or $branchcode ) {
pod2usage(q{At least one filter is mandatory});
exit;
}
not_borrowered_since => $not_borrowered_since,
expired_before => $expired_before,
category_code => $category_code,
+ branchcode => $branchcode,
}
);
=head1 SYNOPSIS
-delete_patrons.pl [-h -v -c] --not_borrowered_since=2013-07-21 --expired_before=2013-07-21 --category_code=CAT
+delete_patrons.pl [-h -v -c] --not_borrowered_since=2013-07-21 --expired_before=2013-07-21 --category_code=CAT --branchcode=CPL
dates can be generated with `date -d '-3 month' "+%Y-%m-%d"`
Delete patrons who have this category code.
+=item B<--branchcode>
+
+Delete patrons in this library.
+
=item B<-c|--confirm>
Without this flag set, this script will do nothing.