Bugzilla – Attachment 114404 Details for
Bug 27180
Fines cronjob does not update fines on holidays when finesCalendar is set to ignore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27180: Update fines on holidays
Bug-27180-Update-fines-on-holidays.patch (text/plain), 2.52 KB, created by
Martin Renvoize (ashimema)
on 2020-12-15 08:43:59 UTC
(
hide
)
Description:
Bug 27180: Update fines on holidays
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-12-15 08:43:59 UTC
Size:
2.52 KB
patch
obsolete
>From 0a2c63ecaebd8b8097ff56647cc2ea8596bf0161 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 9 Dec 2020 15:39:09 +0000 >Subject: [PATCH] Bug 27180: Update fines on holidays > >This patch removes code that prevents fines from being update on holidays. >The fines are already being calculated, and that takes the calendar into account if >needed, so fines won't be assessed on holidays if they shouldn't. > >To test: > 1 - set finesCalendar to 'ignore' > 2 - Checkout an item due yesterday > 3 - Ensure circ rules have a fine amount set > 4 - Make today a holiday > 5 - run fines.pl > 6 - No fine assessed > 7 - Apply patch > 8 - run fines.pl > 9 - Fine assessed! >10 - set finesCalendar to 'use' >11 - checkout an item, due yesterday >12 - run fines.pl >13 - no fine assessed > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/cronjobs/fines.pl | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > >diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl >index 9f61c0f598..198ecdcde3 100755 >--- a/misc/cronjobs/fines.pl >+++ b/misc/cronjobs/fines.pl >@@ -131,11 +131,7 @@ for my $overdue ( @{$overdues} ) { > ( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} > : ( $control eq 'PatronLibrary' ) ? $patron->branchcode > : $overdue->{branchcode}; >- >-# In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here). >- if ( !exists $is_holiday{$branchcode} ) { >- $is_holiday{$branchcode} = set_holiday( $branchcode, $today ); >- } >+ # In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here). > > my $datedue = dt_from_string( $overdue->{date_due} ); > if ( DateTime->compare( $datedue, $today ) == 1 ) { >@@ -147,9 +143,7 @@ for my $overdue ( @{$overdues} ) { > 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 ( $mode eq 'production' && !$is_holiday{$branchcode} ) { >+ if ( $mode eq 'production' ) { > if ( $amount && $amount > 0 ) { > UpdateFine( > { >@@ -193,13 +187,6 @@ Number of Overdue Items: > EOM > } > >-sub set_holiday { >- my ( $branch, $dt ) = @_; >- >- my $calendar = Koha::Calendar->new( branchcode => $branch ); >- return $calendar->is_holiday($dt); >-} >- > sub get_filename { > my $directory = shift; > if ( !$directory ) { >-- >2.20.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 27180
:
114287
|
114404
|
114706
|
115228
|
115229