[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. bb594ad94f9292399595fa698e703d97e0a0197d
Evergreen Git
git at git.evergreen-ils.org
Wed Jul 11 17:09:37 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_3_0 has been updated
via bb594ad94f9292399595fa698e703d97e0a0197d (commit)
from 5fed92e899c457f5cdb0f0a2241c9d9d6b688cb3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bb594ad94f9292399595fa698e703d97e0a0197d
Author: Dan Wells <dbw2 at calvin.edu>
Date: Mon Apr 30 11:05:11 2018 -0400
LP#1749795 Close circ on adjustment when rebilled
When doing a re-bill, we were aborting too early when it rebilled to
exactly zero. Move the 'zero' check to the top of the loop, and
thereby make sure we check if the xact can be closed if we do any
adjustment, up or down.
To test:
- Run new billing test from previous commit, see it fail
- Apply patch
- Run tests again; all should pass
Signed-off-by: Dan Wells <dbw2 at calvin.edu>
Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>
Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
index 17c496b..7873802 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -1012,6 +1012,11 @@ sub adjust_bills_to_zero_manual {
{flesh => 1, flesh_fields => {mbts => ['usr']}}
]) or return $e->die_event;
+ if ($xact->balance_owed == 0) {
+ # zero already, all done
+ next;
+ }
+
return $e->die_event unless
$e->allowed('ADJUST_BILLS', $xact->usr->home_ou);
@@ -1026,22 +1031,20 @@ sub adjust_bills_to_zero_manual {
]) or return $e->die_event;
}
- my $billings = $e->search_money_billing([
- {
- xact => $xact_id,
- },
- {
- order_by => {mb => 'amount desc'},
- flesh => 1,
- flesh_fields => {mb => ['adjustments']},
- }
- ]);
-
- if ($xact->balance_owed == 0) {
- # if was zero, or we rebilled it to zero
- next;
- } else {
+ if ($xact->balance_owed > 0) {
# it's positive and needs to be adjusted
+ # (it either started positive, or we rebilled it positive)
+ my $billings = $e->search_money_billing([
+ {
+ xact => $xact_id,
+ },
+ {
+ order_by => {mb => 'amount desc'},
+ flesh => 1,
+ flesh_fields => {mb => ['adjustments']},
+ }
+ ]);
+
my @billings_to_zero = grep { !$U->is_true($_->voided) or !_is_fully_adjusted($_) } @$billings;
$CC->adjust_bills_to_zero($e, \@billings_to_zero, "System: MANUAL ADJUSTMENT");
}
-----------------------------------------------------------------------
Summary of changes:
.../perlmods/lib/OpenILS/Application/Circ/Money.pm | 33 +++++++++++---------
1 files changed, 18 insertions(+), 15 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list