From: miker Date: Mon, 24 Aug 2009 15:23:49 +0000 (+0000) Subject: fire the fine generator at checkin time to assess required fines without a "missing... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3fad258da1a98507f5070f04f9d3bc98c3c28268;p=evergreen%2Fmasslnc.git fire the fine generator at checkin time to assess required fines without a "missing fine" window git-svn-id: svn://svn.open-ils.org/ILS/trunk@13923 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 7fed4dff24..2cb9a9ed3b 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -1676,6 +1676,9 @@ sub do_checkin { " open circs for copy " .$self->copy->id."!!") if @$circs > 1; } + # run the fine generator against this circ, if this circ is there + $self->generate_fines if ($self->circ); + # if the circ is marked as 'claims returned', add the event to the list $self->push_events(OpenILS::Event->new('CIRC_CLAIMS_RETURNED')) if ($self->circ and $self->circ->stop_fines @@ -2152,6 +2155,27 @@ sub process_received_transit { } +sub generate_fines { + my $self = shift; + my $evt; + my $obt; + + my $st = OpenSRF::AppSession->connect( + 'open-ils.storage' + )->request( + 'open-ils.storage.action.circulation.overdue.generate_fines', + undef, + $self->circ->id + )->wait_complete; + + $st->disconnect; + + # refresh the circ in case the fine generator set the stop_fines field + $self->circ($self->editor->retrieve_action_circulation($self->circ->id)); + + return undef; +} + sub checkin_handle_circ { my $self = shift; my $circ = $self->circ;