Bugzilla – Attachment 178432 Details for
Bug 19336
Add option to fines.pl to apply maximal fine amount after delay
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19336: (QA follow-up) Tidy fines.pl
Bug-19336-QA-follow-up-Tidy-finespl.patch (text/plain), 3.36 KB, created by
William Lavoie
on 2025-02-20 16:05:54 UTC
(
hide
)
Description:
Bug 19336: (QA follow-up) Tidy fines.pl
Filename:
MIME Type:
Creator:
William Lavoie
Created:
2025-02-20 16:05:54 UTC
Size:
3.36 KB
patch
obsolete
>From a52ccb24770a50bdd62624d5ac6ee26b3e066bc1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 18 Oct 2024 15:17:29 +0000 >Subject: [PATCH] Bug 19336: (QA follow-up) Tidy fines.pl > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/fines.pl | 41 ++++++++++++++++++++++++----------------- > 1 file changed, 24 insertions(+), 17 deletions(-) > >diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl >index 77d8e2cfd0..8e43b53ec2 100755 >--- a/misc/cronjobs/fines.pl >+++ b/misc/cronjobs/fines.pl >@@ -56,12 +56,12 @@ my $command_line_options = join( " ", @ARGV ); > cronlogaction( { info => $command_line_options } ); > > GetOptions( >- 'h|help' => \$help, >- 'v|verbose' => \$verbose, >- 'l|log' => \$log, >- 'o|out:s' => \$output_dir, >- 'm|maxdays:i' => \$maxdays, >- 'i|verifyissue' => \$verify_issue, >+ 'h|help' => \$help, >+ 'v|verbose' => \$verbose, >+ 'l|log' => \$log, >+ 'o|out:s' => \$output_dir, >+ 'm|maxdays:i' => \$maxdays, >+ 'i|verifyissue' => \$verify_issue, > 'maxfinesdays=i' => \$maxfinesdays > ); > my $usage = << 'ENDUSAGE'; >@@ -100,6 +100,8 @@ try { > exit; > }; > >+cronlogaction( { info => $command_line_options } ); >+ > my @borrower_fields = qw(cardnumber categorycode surname firstname email phone address citystate); > my @item_fields = qw(itemnumber barcode date_due); > my @other_fields = qw(days_overdue fine); >@@ -151,23 +153,28 @@ for my $overdue ( @{$overdues} ) { > } > ++$counted; > >- my ( $amount, $unitcounttotal, $unitcount); >- if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { >+ my ( $amount, $unitcounttotal, $unitcount ); >+ if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days($today)->in_units('days') ) { > my $itype = $overdue->{itemtype} || $overdue->{itype}; >- my $data = Koha::CirculationRules->get_effective_rule( { rule_name => 'overduefinescap', categorycode => $patron->categorycode, itemtype => $itype, branchcode => $branchcode } ); >- if ( defined($data->rule_value) ) { >- $amount = $data->rule_value; >+ my $data = Koha::CirculationRules->get_effective_rule( >+ { >+ rule_name => 'overduefinescap', categorycode => $patron->categorycode, itemtype => $itype, >+ branchcode => $branchcode >+ } >+ ); >+ if ( defined( $data->rule_value ) ) { >+ $amount = $data->rule_value; > $unitcount = 'n/a'; >- } >- else { >- print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $patron->categorycode}\n"; >+ } else { >+ print >+ "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $patron->categorycode}\n"; > } > } >- if (!$amount) { >- ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue, $today ); >+ if ( !$amount ) { >+ ( $amount, $unitcounttotal, $unitcount ) = >+ CalcFine( $overdue, $patron->categorycode, $branchcode, $datedue, $today ); > } > >- > # Don't update the fine if today is a holiday. > # This ensures that dropbox mode will remove the correct amount of fine. > if ( >-- >2.43.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 19336
:
67191
|
68318
|
68335
|
68336
|
75379
|
75380
|
75381
|
85914
|
85915
|
85916
|
85917
|
85918
|
85919
|
85920
|
85921
|
85922
|
85923
|
124197
|
124198
|
124199
|
124200
|
124201
|
153504
|
153505
|
153506
|
153507
|
153508
|
168517
|
168518
|
168519
|
168520
|
168521
|
172982
|
172983
|
172984
|
172985
|
172986
|
172987
|
176915
|
176916
|
176917
|
176918
|
176919
|
176920
|
178427
|
178428
|
178429
|
178430
|
178431
| 178432