LP#1198465 Allow fine generator to respect a stop_fines filter
authorMike Rylander <miker@esilibrary.com>
Thu, 25 Sep 2014 16:58:45 +0000 (12:58 -0400)
committerDan Wells <dbw2@calvin.edu>
Tue, 11 Nov 2014 19:44:43 +0000 (14:44 -0500)
In order to support situations where billings should be generated on
specific circs, even when stop_fines is set, we allow a filter to
be passed.  The default of not passing a filter is the same as requiring
that stop_fines be NULL, which is the pre-commit behavior.

We also remove a never-used parameter.

Signed-off-by: Mike Rylander <miker@esilibrary.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>

Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm

index 0452676..62713bd 100644 (file)
@@ -1042,14 +1042,14 @@ sub generate_fines {
     my $self = shift;
     my $client = shift;
     my $circ = shift;
-    my $overbill = shift;
+    my $stop_fines_reasons = shift;
 
     local $OpenILS::Application::Storage::WRITE = 1;
 
     my @circs;
     if ($circ) {
         push @circs,
-            action::circulation->search_where( { id => $circ, stop_fines => undef } ),
+            action::circulation->search_where( { id => $circ, stop_fines => $stop_fines_reasons } ),
             booking::reservation->search_where( { id => $circ, return_time => undef, cancel_time => undef } );
     } else {
         push @circs, overdue_circs();
@@ -1132,10 +1132,6 @@ sub generate_fines {
 
             my $f_idx = 0;
             my $fine = $fines[$f_idx] if (@fines);
-            if ($overbill) {
-                $fine = $fines[++$f_idx] while ($fine and $fine->voided);
-            }
-
             my $current_fine_total = 0;
             $current_fine_total += int($_->amount * 100) for (grep { $_ and !$_->voided } @fines);