Bugzilla – Attachment 131961 Details for
Bug 18855
Fines cronjob can cause duplicate fines if run during active circulation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18855: Move the condition at the top of the iteration
Bug-18855-Move-the-condition-at-the-top-of-the-ite.patch (text/plain), 2.00 KB, created by
Jonathan Druart
on 2022-03-21 11:36:07 UTC
(
hide
)
Description:
Bug 18855: Move the condition at the top of the iteration
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-21 11:36:07 UTC
Size:
2.00 KB
patch
obsolete
>From 9c57ca4a82548b7891379d8129218bf2cbd8678f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 21 Mar 2022 12:33:31 +0100 >Subject: [PATCH] Bug 18855: Move the condition at the top of the iteration > >- skip the CalcFine call >- use Koha::Checkout->is_overdue >--- > misc/cronjobs/fines.pl | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl >index 5a472f8db70..0fe90d112ad 100755 >--- a/misc/cronjobs/fines.pl >+++ b/misc/cronjobs/fines.pl >@@ -127,6 +127,14 @@ for my $overdue ( @{$overdues} ) { > "ERROR in Getoverdues : issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n"; > next; > } >+ >+ # if the issue changed before the script got to it, then pass on it. >+ my $issue = Koha::Checkouts->find({ issue_id => $overdue->{issue_id} }); >+ next if ( ! $issue or $issue->date_due ne $overdue->{date_due} ); >+ >+ my $datedue = dt_from_string( $overdue->{date_due} ); >+ next unless $issue->is_overdue( $datedue ); >+ > my $patron = Koha::Patrons->find( $overdue->{borrowernumber} ); > my $branchcode = > ( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch} >@@ -138,10 +146,6 @@ for my $overdue ( @{$overdues} ) { > $is_holiday{$branchcode} = set_holiday( $branchcode, $today ); > } > >- my $datedue = dt_from_string( $overdue->{date_due} ); >- if ( DateTime->compare( $datedue, $today ) == 1 ) { >- next; # not overdue >- } > ++$counted; > > my ( $amount, $unitcounttotal, $unitcount ) = >@@ -157,9 +161,6 @@ for my $overdue ( @{$overdues} ) { > && ( $amount && $amount > 0 ) > ) > { >- # if the issue changed before the script got to it, then pass on it. >- my $issue = Koha::Checkouts->find({ issue_id => $overdue->{issue_id} }); >- next if ( ! $issue or $issue->date_due ne $overdue->{date_due} ); > UpdateFine( > { > issue_id => $overdue->{issue_id}, >-- >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 18855
:
127816
|
127851
|
127852
|
128187
|
131304
|
131961
|
144083
|
144084
|
145496
|
151647
|
152907
|
152987
|
152991
|
153012