[open-ils-commits] [GIT] Evergreen ILS branch rel_2_12 updated. 3b6b6be7f55b8d4b464fe9fa79b190588d86e769

Evergreen Git git at git.evergreen-ils.org
Thu Jul 20 18:14:00 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_12 has been updated
       via  3b6b6be7f55b8d4b464fe9fa79b190588d86e769 (commit)
       via  1985b8e603eaf06f2f15a3fe0f937135a7a5c604 (commit)
      from  63e7aa2baecd28945103743c0c05e1387a92b364 (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 3b6b6be7f55b8d4b464fe9fa79b190588d86e769
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 1985b8e603eaf06f2f15a3fe0f937135a7a5c604
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