use Modern::Perl;
use Koha::Script -cron;
-use C4::Reports::Guided; # 0.12
+use C4::Reports::Guided qw( store_results execute_query );
use Koha::Reports;
use C4::Context;
-use C4::Log;
+use C4::Log qw( cronlogaction );
use Koha::Email;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use Koha::SMTP::Servers;
-use Getopt::Long qw(:config auto_help auto_version);
-use Pod::Usage;
+use Getopt::Long qw( GetOptions );
+use Pod::Usage qw( pod2usage );
use Text::CSV::Encoded;
use CGI qw ( -utf8 );
-use Carp;
-use Encode;
+use Carp qw( carp );
+use Encode qw( decode );
use JSON qw( to_json );
-use Try::Tiny;
+use Try::Tiny qw( catch try );
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
- use FindBin;
+ use FindBin ();
eval { require "$FindBin::Bin/../kohalib.pl" };
}
$message .= $csv->string() . "\n";
push @rows_to_store, [@$line] if $store_results;
}
+ $message = Encode::decode_utf8($message);
}
if ( $store_results ) {
my $json = to_json( \@rows_to_store );
}
$email->attach(
- encode( 'utf8', $message ),
+ Encode::encode_utf8($message),
content_type => "text/$format",
name => "report$report_id-$date.$format",
disposition => 'attachment',