From f76ae28927578fb2cf942c6cc3dc8ae1837f5c51 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 4 Mar 2025 14:01:45 +0000 Subject: [PATCH] Bug 37920: Add cronjob loggging to writeoff_debts.pl This patch adds the same logging as other cronjobs have To test: 1 - Enable system preference CronjobLog 2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 3 - Check the logs - no entries 4 - Apply patch 5 - Repeat 2 6 - Check the logs, two entries - one for the start and one for the end --- misc/cronjobs/writeoff_debts.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index 6ac740b765a..c88c30e9cb9 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/misc/cronjobs/writeoff_debts.pl @@ -6,11 +6,16 @@ use feature 'say'; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); +use C4::Log qw( cronlogaction ); + use Koha::Account::Lines; use Koha::DateUtils qw( dt_from_string ); use Koha::Script -cron; +my $command_line_options = join( " ", @ARGV ); +cronlogaction( { info => $command_line_options } ); + my ( $help, $verbose, @type, $before, $after, @category_code, $file, $confirm ); GetOptions( 'h|help' => \$help, @@ -137,6 +142,8 @@ while ( my $line = $lines->next ) { } } +cronlogaction( { action => 'End', info => "COMPLETED" } ); + exit(0); __END__ -- 2.39.5