Bugzilla – Attachment 124198 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: (follow-up) Correct DateTime and Koha calls
Bug-19336-follow-up-Correct-DateTime-and-Koha-call.patch (text/plain), 2.07 KB, created by
Alexis Ripetti
on 2021-08-27 21:00:16 UTC
(
hide
)
Description:
Bug 19336: (follow-up) Correct DateTime and Koha calls
Filename:
MIME Type:
Creator:
Alexis Ripetti
Created:
2021-08-27 21:00:16 UTC
Size:
2.07 KB
patch
obsolete
>From bd32b3aea8ce2c7373a643cf4bcac1f07090f095 Mon Sep 17 00:00:00 2001 >From: David Bourgault <dav.bour@gmail.com> >Date: Fri, 20 Oct 2017 09:11:47 -0400 >Subject: [PATCH] Bug 19336: (follow-up) Correct DateTime and Koha calls > >This fixes the 'DateTime does not overload' error. >It also fixes the next error, which was that C4::GetIssuingRules is deprecated. >Finally it now handles no overduefinescap being define (does nothing). > >Passes QA test tool > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > misc/cronjobs/fines.pl | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl >index 532c52433f..9af5a99209 100755 >--- a/misc/cronjobs/fines.pl >+++ b/misc/cronjobs/fines.pl >@@ -38,6 +38,7 @@ use Carp qw( carp croak ); > use File::Spec; > use Try::Tiny qw( catch try ); > >+use Koha::IssuingRules; > use Koha::Calendar; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Patrons; >@@ -148,10 +149,15 @@ for my $overdue ( @{$overdues} ) { > ++$counted; > > my ( $amount, $unitcounttotal, $unitcount); >- if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )) { >+ if ( defined($maxfinesdays) && $maxfinesdays <= $datedue->delta_days( $today )->in_units( 'days' ) ) { > my $itype = $overdue->{itemtype} || $overdue->{itype}; >- my $data = C4::Circulation::GetIssuingRule( $borrower->{categorycode}, $itype, $branchcode ); >- $amount = $data->{overduefinescap}; >+ my $data = Koha::IssuingRules->get_effective_issuing_rule( { categorycode => $borrower->{categorycode}, itemtype => $itype, branchcode => $branchcode } ); >+ if ( defined($data->overduefinescap) ) { >+ $amount = $data->overduefinescap; >+ } >+ else { >+ print "No overduefinescap defined for {branchcode = $branchcode, itemtype = $itype and categorycode = $borrower->{categorycode}}\n"; >+ } > } > if (!$amount) { > ( $amount, $unitcounttotal, $unitcount ) = CalcFine( $overdue, $borrower->{categorycode}, $branchcode, $datedue, $today ); >-- >2.25.1
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