package Main;
$Main::VERSION = '0.068';
# PODNAME: koha-overdue
# ABSTRACT: Claim overdues each day, grouping same overdues

use Modern::Perl;
use Koha::Contrib::Tamil::Overdue;
use Pod::Usage;
use Getopt::Long;

binmode(STDOUT, ':encoding(utf8)');

my ($verbose, $help, $doit) = (0, 0, 0);
    'verbose' => \$verbose,
    'help'    => \$help,
    'doit'    => \$doit,

sub usage {
    pod2usage( -verbose => 2 );

usage()  if @ARGV == 0 || $help;

my $overdue = Koha::Contrib::Tamil::Overdue->new( doit => $doit, verbose => $verbose );

no strict "refs";
for (@ARGV) {
    usage()  unless /process|clear|email|print/;



=encoding UTF-8

=head1 NAME

koha-overdue - Claim overdues each day, grouping same overdues

=head1 VERSION

version 0.068


Process Koha overdues.

The script requires to operate a configuration file (config.yaml) located in
Koha etc/overdue directory. 

=head1 USAGE


=item koha-overdue [--verbose|--help|--doit] process|clear|email|print 




=item B<--doit>

Do effectively the required action. Otherwise show what the action would do.

=item B<--verbose|-v>

Enable script verbose mode. 

=item B<--help|-h>

Print this help page.


=head1 ACTIONS


=item B<process>

Process all overdues.

=item B<clear>

Delete from message_queue table all messages that have been added the last
hours, that are 'email' or 'print' message with 'pending' status.

=item B<email>

Send by email all 'email' messages that are pending.


=item B<print>

Print all 'print' messages that are pending.


=head1 AUTHOR

Frédéric Demians <f.demians@tamil.fr>


This software is Copyright (c) 2022 by Fréderic Démians.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007