From: miker Date: Wed, 15 Dec 2010 17:11:24 +0000 (+0000) Subject: Two bug fixes: 1) only allow one fine generator call per circulation during a given... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e4e869657884cf5c45649ff63a4a35e9702cc2db;p=evergreen%2Fbjwebb.git Two bug fixes: 1) only allow one fine generator call per circulation during a given transaction; 2) require that a circulation be open, based on the xact_finish field, in order to be the parent of a renewal (I suspect this used to depend on the open-circ view) git-svn-id: svn://svn.open-ils.org/ILS/trunk@18999 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 f5f2d53cc..e3a1afa53 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -2903,12 +2903,14 @@ sub generate_fines_start { my $id = $reservation ? $self->reservation->id : $self->circ->id; - $self->{_gen_fines_req} = OpenSRF::AppSession->create('open-ils.storage') - ->request( - 'open-ils.storage.action.circulation.overdue.generate_fines', - undef, - $id - ); + 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 + ); + } return undef; } @@ -2920,6 +2922,7 @@ sub generate_fines_finish { my $id = $reservation ? $self->reservation->id : $self->circ->id; $self->{_gen_fines_req}->wait_complete; + delete($self->{_gen_fines_req}); # refresh the circ in case the fine generator set the stop_fines field $self->reservation($self->editor->retrieve_booking_reservation($id)) if $reservation; @@ -3205,6 +3208,7 @@ sub do_renew { my $usrid = $self->patron->id if $self->patron; my $circ = $self->editor->search_action_circulation({ target_copy => $self->copy->id, + xact_finish => undef, ($usrid ? (usr => $usrid) : ()), '-or' => [ {stop_fines => undef},