From: miker Date: Thu, 10 Mar 2011 15:43:55 +0000 (+0000) Subject: Skip fine generation when the fine interval is day-granular, meaning fines are handle... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0635a13bff4c33c447774c37c8cdc693617736b6;p=working%2FEvergreen.git Skip fine generation when the fine interval is day-granular, meaning fines are handled by the nightly cron script git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@19679 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 07f67518dc..ccf2b3b5a3 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2926,14 +2926,17 @@ sub generate_fines_start { my $self = shift; my $reservation = shift; - my $id = $reservation ? $self->reservation->id : $self->circ->id; + my $obj = $reservation ? $self->reservation: $self->circ; + + # Don't generate fines on circs with a fine interval that's not day-granular + return undef if (OpenSRF::Utils->interval_to_seconds($obj->fine_interval) % 86400 == 0); if (!exists($self->{_gen_fines_req})) { $self->{_gen_fines_req} = OpenSRF::AppSession->create('open-ils.storage') ->request( 'open-ils.storage.action.circulation.overdue.generate_fines', undef, - $id + $obj->id ); } @@ -2944,6 +2947,8 @@ sub generate_fines_finish { my $self = shift; my $reservation = shift; + $self->{_gen_fines_req}->wait_complete if ($self->{_gen_fines_req}); + my $id = $reservation ? $self->reservation->id : $self->circ->id; $self->{_gen_fines_req}->wait_complete;