From a61fc8da614b8df149a4205a2c28bb5cb730dc56 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 5 Feb 2024 16:50:32 +0000 Subject: [PATCH] Bug 35996: Make it clear that --category-code can not be used alone This patch adds a clarification to writeoff_debts.pl to make it clear that --category-code can't be used as the only filter when running the script. If this is the case, the script just displays the help menu as it is expecting one of the other filters Test plan: 1) Run perl misc/cronjobs/writeoff_debts.pl --category-code TEST --confirm 2) Observe that the help menu is displayed instead of running the script 3) Check the help menu for the text added in this patch WNC amended patch - added same warning in the option section Signed-off-by: David Nind --- misc/cronjobs/writeoff_debts.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index 8d808185391..e06b9124ab2 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/misc/cronjobs/writeoff_debts.pl @@ -150,7 +150,9 @@ example, supplying both --added_before and --type specifies that the accountline must meet both conditions to be selected for writeoff. You must pass at least one of the filtering options for the script to run. -This is to prevent an accidental 'writeoff all' operation. +This is to prevent an accidental 'writeoff all' operation. Please note that +--category-code must be accompanied by another filter - the script will not +run if this is the only filter provided. =head1 OPTIONS @@ -180,6 +182,8 @@ Writeoff debts for patrons belonging to the passed categories. Can be used multiple times for additional category codes. +This option cannot be used alone, it must be combined with another filter. + =item B<--type> Writeoff debts of the passed type. Accepts a list of debit type codes. -- 2.39.2