Bugzilla – Attachment 179156 Details for
Bug 37920
writeoff_debts.pl should be logged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37920: Add cronjob loggging to writeoff_debts.pl
Bug-37920-Add-cronjob-loggging-to-writeoffdebtspl.patch (text/plain), 1.60 KB, created by
Martin Renvoize (ashimema)
on 2025-03-11 11:05:40 UTC
(
hide
)
Description:
Bug 37920: Add cronjob loggging to writeoff_debts.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-11 11:05:40 UTC
Size:
1.60 KB
patch
obsolete
>From e0039b450fb9a7fdd514d0d37b3143454319e896 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >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 > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Tested on top of bug 39236. Works as advertised. >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37920
:
178917
|
179144
| 179156