Bugzilla – Attachment 157983 Details for
Bug 35074
Add --patron_category to writeoff_debts.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35074: Add support for category_code to writeoff_debts
Bug-35074-Add-support-for-categorycode-to-writeoff.patch (text/plain), 2.54 KB, created by
Martin Renvoize (ashimema)
on 2023-10-27 13:07:08 UTC
(
hide
)
Description:
Bug 35074: Add support for category_code to writeoff_debts
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-10-27 13:07:08 UTC
Size:
2.54 KB
patch
obsolete
>From 064486d96e0e7632c90faf160a0d2cacc3fffdf8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 17 Oct 2023 12:39:44 +0100 >Subject: [PATCH] Bug 35074: Add support for category_code to writeoff_debts > >This patch adds support for passing category_code as a limiter for the >writeoff_debts script. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > misc/cronjobs/writeoff_debts.pl | 28 ++++++++++++++++++++-------- > 1 file changed, 20 insertions(+), 8 deletions(-) > >diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl >index 1fc7ce18e38..dad36ffaf9e 100755 >--- a/misc/cronjobs/writeoff_debts.pl >+++ b/misc/cronjobs/writeoff_debts.pl >@@ -11,15 +11,16 @@ use Koha::DateUtils qw( dt_from_string ); > > use Koha::Script -cron; > >-my ( $help, $verbose, @type, $before, $after, $file, $confirm ); >+my ( $help, $verbose, @type, $before, $after, @category_code, $file, $confirm ); > GetOptions( >- 'h|help' => \$help, >- 'v|verbose+' => \$verbose, >- 't|type:s' => \@type, >- 'ab|added_before|added-before:s' => \$before, >- 'aa|added_after|added-after:s' => \$after, >- 'f|file:s' => \$file, >- 'c|confirm' => \$confirm, >+ 'h|help' => \$help, >+ 'v|verbose+' => \$verbose, >+ 't|type:s' => \@type, >+ 'ab|added_before|added-before:s' => \$before, >+ 'aa|added_after|added-after:s' => \$after, >+ 'cc|category_code|category-code:s' => \@category_code, >+ 'f|file:s' => \$file, >+ 'c|confirm' => \$confirm, > ); > @type = split( /,/, join( ',', @type ) ); > >@@ -59,6 +60,11 @@ if ($after) { > $where->{date}->{'>'} = $dtf->format_datetime($added_after); > } > >+if (@category_code) { >+ $where->{'patron.categorycode'}->{'-in'} = \@category_code; >+ push @{ $attr->{'join'} }, 'patron'; >+} >+ > my $lines = Koha::Account::Lines->search( $where, $attr ); > if ( $verbose ) { > print "Attempting to write off " . $lines->count . " debts"; >@@ -168,6 +174,12 @@ Writeoff debts added after the date passed. > Dates should be in ISO format, e.g., 2013-07-19, and can be generated > with `date -d '-3 month' --iso-8601`. > >+=item B<--category-code> >+ >+Writeoff debts for patrons belonging to the passed categories. >+ >+Can be used multiple times for additional category codes. >+ > =item B<--type> > > Writeoff debts of the passed type. Accepts a list of CREDIT_TYPE_CODEs. >-- >2.41.0
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 35074
:
157227
|
157228
|
157860
|
157861
|
157981
|
157982
|
157983
|
158057
|
158058
|
158059