Bugzilla – Attachment 119400 Details for
Bug 27049
Add a script to bulk writeoff debts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27049: (QA follow-up) Add short params, replace warn with say
Bug-27049-QA-follow-up-Add-short-params-replace-wa.patch (text/plain), 2.39 KB, created by
Kyle M Hall (khall)
on 2021-04-09 15:45:47 UTC
(
hide
)
Description:
Bug 27049: (QA follow-up) Add short params, replace warn with say
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-04-09 15:45:47 UTC
Size:
2.39 KB
patch
obsolete
>From f1acf164b9a0aa0fb5168fb0820f4566873232ab Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 9 Apr 2021 11:45:03 -0400 >Subject: [PATCH] Bug 27049: (QA follow-up) Add short params, replace warn with > say > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/writeoff_debts.pl | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) > >diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl >index da64f010a4..ae2ee9c0de 100755 >--- a/misc/cronjobs/writeoff_debts.pl >+++ b/misc/cronjobs/writeoff_debts.pl >@@ -1,6 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >+use feature 'say'; > > use Getopt::Long; > use Pod::Usage; >@@ -12,12 +13,12 @@ use Koha::Script -cron; > > my ( $help, $verbose, @type, $added, $file, $confirm ); > GetOptions( >- 'h|help' => \$help, >- 'v|verbose' => \$verbose, >- 'type:s' => \@type, >- 'added_before:s' => \$added, >- 'f|file:s' => \$file, >- 'c|confirm' => \$confirm, >+ 'h|help' => \$help, >+ 'v|verbose+' => \$verbose, >+ 't|type:s' => \@type, >+ 'ab|added_before:s' => \$added, >+ 'f|file:s' => \$file, >+ 'c|confirm' => \$confirm, > ); > @type = split( /,/, join( ',', @type ) ); > >@@ -58,10 +59,10 @@ if ( $verbose ) { > } > > while ( my $line = $lines->next ) { >- warn "Skipping " . $line->accountlines_id . "; Not a debt" and next >- if $line->is_credit; >- warn "Skipping " . $line->accountlines_id . "; Is a PAYOUT" and next >- if $line->debit_type_code eq 'PAYOUT'; >+ say "Skipping " . $line->accountlines_id . "; Not a debt" and next >+ if $line->is_credit && $verbose > 1; >+ say "Skipping " . $line->accountlines_id . "; Is a PAYOUT" and next >+ if $line->debit_type_code eq 'PAYOUT' && $verbose > 1; > > if ($confirm) { > $line->_result->result_source->schema->txn_do( >@@ -107,10 +108,10 @@ while ( my $line = $lines->next ) { > > if ($verbose) { > if ($confirm) { >- print "Accountline " . $line->accountlines_id . " written off\n"; >+ say "Accountline " . $line->accountlines_id . " written off"; > } > else { >- print "Accountline " . $line->accountlines_id . " will be written off\n"; >+ say "Accountline " . $line->accountlines_id . " will be written off"; > } > } > } >-- >2.24.3 (Apple Git-128)
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 27049
:
113785
|
114812
|
115155
|
115186
|
115187
|
115188
|
115208
|
119399
| 119400