From d3f30c637323f2750fd4e0f78420192a268a5f41 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 1 Apr 2011 19:29:46 +0000 Subject: [PATCH] Patch from Thomas Berezansky to address unneccessary fine generation and avoid unchecked division by zero; details and DCO at https://bugs.launchpad.net/evergreen/+bug/747533 git-svn-id: svn://svn.open-ils.org/ILS/trunk@19927 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index cd0cdb84a9..5ded5bd7a2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -839,6 +839,12 @@ sub generate_fines { $fine_interval =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o; $fine_interval = interval_to_seconds( $fine_interval ); + if ( $fine_interval == 0 || int($c->$recurring_fine_method * 100) == 0 || int($c->max_fine * 100) == 0 ) { + $client->respond( "Fine Generator skipping circ due to 0 fine interval, 0 fine rate, or 0 max fine.\n" ); + $log->info( "Fine Generator skipping circ " . $c->id . " due to 0 fine interval, 0 fine rate, or 0 max fine." ); + next; + } + if ( $is_reservation and $fine_interval >= interval_to_seconds('1d') ) { my $tz_offset_s = 0; if ($due_dt->strftime('%z') =~ /(-|\+)(\d{2}):?(\d{2})/) { -- 2.11.0