From 57b9cf6b3cb6011ff84050da67ce6113b4d6d508 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 6 Feb 2024 12:14:28 +0000 Subject: [PATCH] Bug 34077: Only print verbose output when asked for This patch updates the logic such that we only trigger verbose when verbose is explicitly asked for. --- misc/cronjobs/writeoff_debts.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index 858c5a2324e..84543a8f6fd 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/misc/cronjobs/writeoff_debts.pl @@ -24,7 +24,7 @@ GetOptions( ); @type = split( /,/, join( ',', @type ) ); -pod2usage(1) if ( $help || !$file && !@type && !$before && !$after ); +pod2usage(1) if ( $help || !$file && !@type && !$before && !$after && !@category_code ); my $where = { 'amountoutstanding' => { '>' => 0 } }; my $attr = {}; @@ -67,7 +67,6 @@ if (@category_code) { my $lines = Koha::Account::Lines->search( $where, $attr ); -$verbose //= !$confirm; if ( $verbose ) { print "Attempting to write off " . $lines->count . " debts" if $confirm; print "With --confirm we would write off " . $lines->count . " debts" if !$confirm; @@ -202,8 +201,7 @@ This flag set the script to output logging for the actions it will perform. =item B<-c|--confirm> This flag must be provided in order for the script to actually -writeoff debts. If it is not supplied, the script will -only report on the accountline records it would have been written off. +writeoff debts. =back -- 2.43.0