LP 1198465: Rename internal functions for clarity
authorDan Wells <dbw2@calvin.edu>
Wed, 26 Feb 2014 14:01:44 +0000 (09:01 -0500)
committerDan Wells <dbw2@calvin.edu>
Wed, 5 Mar 2014 22:21:21 +0000 (17:21 -0500)
These methods will now be the splitting point for void vs. adjustment,
so let's give them broader names.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 1cf8cc8..4629c1a 100644 (file)
@@ -741,7 +741,7 @@ sub set_item_lost_or_lod {
     # ---------------------------------------------------------------------
     # void all overdue fines on this circ if configured
     if( $void_overdue ) {
-        my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ);
+        my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ);
         return $evt if $evt;
     }
 
index c82a695..40c6a01 100644 (file)
@@ -461,7 +461,7 @@ sub set_circ_claims_returned {
 
         # make it look like the circ stopped at the cliams returned time
         $circ->stop_fines_time($backdate);
-        my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ, $backdate);
+        my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ, $backdate);
         return $evt if $evt;
     }
 
@@ -548,7 +548,7 @@ sub post_checkin_backdate_circ_impl {
     $e->update_action_circulation($circ) or return $e->die_event;
 
     # now void the overdues "erased" by the back-dating
-    my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ, $backdate);
+    my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ, $backdate);
     return $evt if $evt;
 
     # If the circ was closed before and the balance owned !=0, re-open the transaction
@@ -1263,7 +1263,7 @@ sub handle_mark_damaged {
         # the assumption is that you would not void the overdues unless you 
         # were also charging for the item and/or applying a processing fee
         if($void_overdue) {
-            my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ);
+            my $evt = OpenILS::Application::Circ::CircCommon->void_or_zero_overdues($e, $circ);
             return $evt if $evt;
         }
 
index 25bdc0d..7309e70 100644 (file)
@@ -18,12 +18,12 @@ my $U = "OpenILS::Application::AppUtils";
 
 
 # -----------------------------------------------------------------
-# Voids overdue fines on the given circ.  if a backdate is 
+# Voids (or zeros) overdue fines on the given circ.  if a backdate is 
 # provided, then we only void back to the backdate, unless the
 # backdate is to within the grace period, in which case we void all
 # overdue fines.
 # -----------------------------------------------------------------
-sub void_overdues {
+sub void_or_zero_overdues {
     my($class, $e, $circ, $backdate, $note) = @_;
 
     my $bill_search = { 
@@ -69,14 +69,14 @@ sub void_overdues {
 }
 
 # ------------------------------------------------------------------
-# Void all bills of a given type on a circulation.
+# Void (or zero) all bills of a given type on a circulation.
 #
 # Takes an editor, a circ object, the btype number for the bills you
 # want to void, and an optional note.
 #
 # Returns undef on success or the result from real_void_bills.
 # ------------------------------------------------------------------
-sub void_bills_of_type {
+sub void_or_zero_bills_of_type {
     my ($class, $e, $circ, $btype, $note) = @_;
 
     # Get a bill payment map.
index 7bb315e..f22223c 100644 (file)
@@ -2788,7 +2788,7 @@ sub finish_fines_and_voiding {
     # void overdues after fine generation to prevent concurrent DB access to overdue billings
     my $note = 'System: Amnesty Checkin' if $self->void_overdues;
 
-    my $evt = $CC->void_overdues(
+    my $evt = $CC->void_or_zero_overdues(
         $self->editor, $self->circ, $self->backdate, $note);
 
     return $self->bail_on_events($evt) if $evt;
@@ -3983,7 +3983,7 @@ sub checkin_handle_lost_or_lo_now_found {
     my $tag = $is_longoverdue ? "LONGOVERDUE" : "LOST";
 
     $logger->debug("voiding $tag item billings");
-    my $result = $CC->void_bills_of_type($self->editor, $self->circ, $bill_type, "System: VOIDED FOR $tag ITEM RETURNED");
+    my $result = $CC->void_or_zero_bills_of_type($self->editor, $self->circ, $bill_type, "System: VOIDED FOR $tag ITEM RETURNED");
     $self->bail_on_events($self->editor->event) if ($result);
 }