my $verbose = 0;
my $nomail = 0;
my $MAX = 90;
+my $test_mode = 0;
my @branchcodes; # Branch(es) passed as parameter
my @emails_to_use; # Emails to use for messaging
my @emails; # Emails given in command-line parameters
'itemscontent=s' => \$itemscontent,
'list-all' => \$listall,
't|triggered' => \$triggered,
+ 'test' => \$test_mode,
'date=s' => \$date_input,
'borcat=s' => \@myborcat,
'borcatout=s' => \@myborcatout,
pod2usage(1) if $help;
pod2usage( -verbose => 2 ) if $man;
-cronlogaction();
+cronlogaction() unless $test_mode;
if ( defined $csvfilename && $csvfilename =~ /^-/ ) {
warn qq(using "$csvfilename" as filename, that seems odd);
type => 'OVERDUES',
comment => "OVERDUES_PROCESS " . output_pref( dt_from_string() ),
}
- );
+ ) unless $test_mode;
$verbose and warn "debarring $borr\n";
}
my @params = ($borrowernumber);
from_address => $admin_email_address,
to_address => join(',', @emails_to_use),
}
- );
+ ) unless $test_mode;
# A print notice should be sent only once per overdue level.
# Without this check, a print could be sent twice or more if the library checks sms and email and print and the patron has no email or sms number.
$print_sent = 1 if $effective_mtt eq 'print';