[open-ils-commits] [GIT] Evergreen ILS branch rel_2_11 updated. e2d669c6044c5e99ac5fc07f4aff09d2e3b134dd

Evergreen Git git at git.evergreen-ils.org
Thu Jul 20 18:14:39 EDT 2017


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_2_11 has been updated
       via  e2d669c6044c5e99ac5fc07f4aff09d2e3b134dd (commit)
       via  cf50371f21d776bb9d5295e0567627b589adb121 (commit)
      from  f9e6c48d1b9db43b21216d31b3a565c8ec27bb8e (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 e2d669c6044c5e99ac5fc07f4aff09d2e3b134dd
Author: Jeff Davis <jdavis at sitka.bclibraries.ca>
Date:   Tue May 9 14:17:29 2017 -0700

    LP#1689656: Adjust to zero on negative balance
    
    Adjust to zero was not actually adjusting to zero on negative balances
    in at least some cases.  This patch corrects that behavior.
    
    Test plan:
    
    [1] Generate multiple overdue billings on an overdue circ.
    [2] Apply a payment (cash or forgive) to resolve the overdue billings.
    [3] Checkin the item using backdated checkin or amnesty mode, such that
        the overdue billings are automatically voided, resulting in a
        negative balance.
    [4] Adjust to zero.  A single new manual adjustment billing is created,
        reinstating one overdue billing, and then the adjust-to-zero process
        exits.  The negative balance has been reduced by the amount of one
        overdue billing, rather than being fully adjusted to zero.
    [5] Apply the patch and restart services.
    [6] Repeat steps 1-3 with a new circulation.
    [7] Adjust to zero.  This time, the balance should be correctly adjusted
        to zero, instead of exiting prematurely with an outstanding
        negative balance.
    
    Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

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 22d37a9..c434b15 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -981,7 +981,7 @@ sub _rebill_xact {
         $rebill_amount += $billing->amount;
 
         # if we have a postive (or zero) balance now, stop
-        last if $rebill_amount >= $xact_balance;
+        last if ($xact_balance + $rebill_amount >= 0);
     }
 }
 

commit cf50371f21d776bb9d5295e0567627b589adb121
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Thu Jul 20 18:10:15 2017 -0400

    LP#1689656 Add test for manual adjustment of negative balance
    
    Without the fix in LP#1689656, this test fails.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/live_t/09-lp1198465_neg_balances.t b/Open-ILS/src/perlmods/live_t/09-lp1198465_neg_balances.t
index 33b4023..318f52c 100644
--- a/Open-ILS/src/perlmods/live_t/09-lp1198465_neg_balances.t
+++ b/Open-ILS/src/perlmods/live_t/09-lp1198465_neg_balances.t
@@ -1,6 +1,6 @@
 #!perl
 
-use Test::More tests => 132;
+use Test::More tests => 133;
 
 diag("Test features of Conditional Negative Balances code.");
 
@@ -477,6 +477,23 @@ is(
 );
 
 
+### adjust to zero, manually
+$apputils->simplereq(
+    'open-ils.circ',
+    'open-ils.circ.money.billable_xact.adjust_to_zero',
+    $script->authtoken,
+    [$xact_id]
+);
+
+### verify 2nd ending state
+$summary = fetch_billable_xact_summary($xact_id);
+is(
+    $summary->balance_owed,
+    '0.00',
+    'Case 13 (bonus): Patron has a balance of 0.00 (after manual adjustment of negative balance)'
+);
+
+
 ##############################
 # 14. RERUN of Case 1. No Prohibit Negative Balance Settings Are Enabled, Payment Made
 # SETTINGS: Prohibit negative balances on bills for overdue materials

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Money.pm |    2 +-
 .../perlmods/live_t/09-lp1198465_neg_balances.t    |   19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list