package Koha::Cron;
use strict;
use warnings;
use utf8;
use feature ':5.10';
use C4::Context;
C4::Context->_new_userenv(1);
C4::Context->set_userenv(
'-1', '-1', undef, 'CRON', 'CRON', undef,
undef, undef, undef, undef, undef
);
1;
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use C4::Biblio;
use C4::Letters;
unless ($confirm) {
pod2usage(1);
cronlogaction();
# The fields that will be substituted into <<items.content>>
use Pod::Usage;
use JSON;
use C4::Items;
use Getopt::Long;
use C4::Circulation;
use C4::Log;
) || pod2usage(1);
pod2usage(0) if $help;
my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 });
use Koha::Patrons;
use Date::Calc qw(
use C4::Koha;
use C4::Items qw/ CartToShelf /;
use Modern::Perl;
use AnyEvent;
use LWP::UserAgent;
use HTTP::Request;
use C4::Search;
use C4::Search::History;
use YAML::Syck;
exit;
usage() if $help || !$conf;
use DBI;
use English qw(-no_match_vars);
pod2usage(1) if $help;
pod2usage( -verbose => 2 ) if $man;
my %wanted_borrowers_columns = map { $_ => 1 } qw/borrowernumber cardnumber surname firstname address city phone dateofbirth/;
my %wanted_issues_columns = map { $_ => 1 } qw/borrowernumber date_due itemcallnumber title itemtype/;
eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
my $help;
#! /usr/bin/perl
use C4::Members;
use Koha::DateUtils;
use Koha::Database;
# can be run as frequently as required
# log messages are appended to logdir/editrace.log
use Log::Log4perl qw(:easy);
use 5.010;
use C4::Overdues;
use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy
use C4::Debug;
# cancel all expired hold requests
use C4::Reserves;
use C4::HoldsQueue qw(CreateQueue);
use Koha::Holds;
use C4::ImportBatch;
my ($help, $framework);
use C4::Circulation qw/LostItem MarkIssueReturned/;
use Time::HiRes qw(gettimeofday);
use C4::AuthoritiesMarc;
use Koha::Authority::MergeRequests;
$|=1; # flushes output
if( $params->{batch} ) {
if ( $params->{batch} ) {
handle_batch( $params );
handle_batch($params);
} else {
use C4::Budgets qw( GetBudget );
use C4::Suggestions qw( GetUnprocessedSuggestions );
use Koha::Libraries;
use DateTime;
use DateTime::Duration;
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter);
) or pod2usage(2);
cronlogaction() unless $test_mode;
if ( defined $csvfilename && $csvfilename =~ /^-/ ) {
use C4::Suggestions;
use Koha::Account::Lines;
my @patron_ids = map { $_->borrowernumber } Koha::Account::Lines->search(
# this script will remove those older than 5 days
use Template;
use Time::Local;
use POSIX;
use C4::Reports::Guided; # 0.12
use Koha::Reports;
use C4::Serials;
use C4::UsageStats;
use Koha::Sitemapper;
#!/usr/bin/perl
use C4::SocialData;
my $results = C4::SocialData::get_report;
use Date::Calc qw/Date_to_Days/;
use Getopt::Long qw/HelpMessage :config gnu_getopt/;
use Koha::StockRotationRotas;
sub usage {
-