[open-ils-commits] r19679 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 10 10:43:57 EST 2011
Author: miker
Date: 2011-03-10 10:43:55 -0500 (Thu, 10 Mar 2011)
New Revision: 19679
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
Skip fine generation when the fine interval is day-granular, meaning fines are handled by the nightly cron script
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2011-03-10 14:25:04 UTC (rev 19678)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2011-03-10 15:43:55 UTC (rev 19679)
@@ -2926,14 +2926,17 @@
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 @@
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;
More information about the open-ils-commits
mailing list