Revert "LP#1198465 Allow fine generator to respect a stop_fines filter"
authorDan Wells <dbw2@calvin.edu>
Wed, 19 Nov 2014 23:08:31 +0000 (18:08 -0500)
committerDan Wells <dbw2@calvin.edu>
Wed, 19 Nov 2014 23:09:55 +0000 (18:09 -0500)
This reverts commit e1fdcd3a6885baac3f86402e330aef3d8b36c681.

The code failed in the case of restoring voided lost overdues together
with generating new lost overdues on checkin.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm

index 62713bd..0452676 100644 (file)
@@ -1042,14 +1042,14 @@ sub generate_fines {
     my $self = shift;
     my $client = shift;
     my $circ = shift;
-    my $stop_fines_reasons = shift;
+    my $overbill = shift;
 
     local $OpenILS::Application::Storage::WRITE = 1;
 
     my @circs;
     if ($circ) {
         push @circs,
-            action::circulation->search_where( { id => $circ, stop_fines => $stop_fines_reasons } ),
+            action::circulation->search_where( { id => $circ, stop_fines => undef } ),
             booking::reservation->search_where( { id => $circ, return_time => undef, cancel_time => undef } );
     } else {
         push @circs, overdue_circs();
@@ -1132,6 +1132,10 @@ 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);