[open-ils-commits] r13923 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 24 11:23:52 EDT 2009


Author: miker
Date: 2009-08-24 11:23:49 -0400 (Mon, 24 Aug 2009)
New Revision: 13923

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
fire the fine generator at checkin time to assess required fines without a "missing fine" window

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2009-08-24 15:07:46 UTC (rev 13922)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm	2009-08-24 15:23:49 UTC (rev 13923)
@@ -1676,6 +1676,9 @@
             " 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 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;



More information about the open-ils-commits mailing list