From b6d4f96caa22923f84124e825427407489e821a0 Mon Sep 17 00:00:00 2001 From: Dan Wells Date: Fri, 20 Feb 2015 17:19:42 -0500 Subject: [PATCH] LP 1198465: Rename internal functions for clarity These methods will now be the splitting point for void vs. adjustment, so let's give them broader names. Signed-off-by: Dan Wells Signed-off-by: Kathy Lussier Signed-off-by: Ben Shum --- .../perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm | 6 +++--- .../perlmods/lib/OpenILS/Application/Circ/CircCommon.pm | 8 ++++---- .../perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index 07357ea70f..0de7fd7e98 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -745,7 +745,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; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index adf6af2cc9..1aca1de6b6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -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; } @@ -604,7 +604,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 @@ -1331,7 +1331,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; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm index 8496e3f35a..9a005136cd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm @@ -20,12 +20,12 @@ my $parser = DateTime::Format::ISO8601->new; # ----------------------------------------------------------------- -# 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 = { @@ -102,14 +102,14 @@ sub void_lost { } # ------------------------------------------------------------------ -# 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. diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index 93c288e86c..19f313405e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -2634,7 +2634,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; @@ -3799,7 +3799,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); } -- 2.43.2