[open-ils-commits] [GIT] Evergreen ILS branch master updated. 1f82890d2329c87a617cf4be685d765681fea8f6

Evergreen Git git at git.evergreen-ils.org
Thu Aug 27 11:48:29 EDT 2015


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, master has been updated
       via  1f82890d2329c87a617cf4be685d765681fea8f6 (commit)
       via  4357ab325959f2ed48b2001812b1039b6714dd9a (commit)
      from  9a0d5b4bd1a365b1911713f026780d0625734fcb (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 1f82890d2329c87a617cf4be685d765681fea8f6
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Thu Aug 27 16:02:57 2015 +0000

    LP#1484989: tweak test case
    
    This adjusts the test case so that it will
    report on the planned number of tests even if the
    test circ cannot be retrieved for some reason.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t b/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t
index 0a4aa56..e24888b 100644
--- a/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t
+++ b/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t
@@ -30,6 +30,8 @@ if (my $circ_resp = $circ_req->recv) {
             !$circ->xact_finish,
             'Circ with id = ' . $circ_id . ' is overdue with fines, so xact_finish isn\'t set'
         );
+    } else {
+        fail('unable to retrieve circ');
     }
 }
 

commit 4357ab325959f2ed48b2001812b1039b6714dd9a
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Aug 14 15:11:16 2015 -0400

    LP#1484989 Don't close xacts with checkin-generated fines
    
    If a transaction has checkin-generated fines, and previously had a
    balance of zero, the rearranged billing code was prematurely closing
    the transaction.  This commit separates the closing step to run after
    any possible fine generation.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

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 f92f5b8..d63cdc8 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2367,9 +2367,8 @@ sub do_checkin {
     }
 
     if( $self->circ ) {
-        $self->checkin_handle_circ;
+        $self->checkin_handle_circ_start;
         return if $self->bail_out;
-        $self->checkin_changed(1);
 
         if (!$dont_change_lost_zero) {
             # if this circ is LOST and we are configured to generate overdue
@@ -2392,6 +2391,11 @@ sub do_checkin {
             # handle fines for this circ, including overdue gen if needed
             $self->handle_fines;
         }
+
+        $self->checkin_handle_circ_finish;
+        return if $self->bail_out;
+        $self->checkin_changed(1);
+
     } elsif( $self->transit ) {
         my $hold_transit = $self->process_received_transit;
         $self->checkin_changed(1);
@@ -3224,7 +3228,7 @@ sub handle_fines {
    return undef;
 }
 
-sub checkin_handle_circ {
+sub checkin_handle_circ_start {
    my $self = shift;
    my $circ = $self->circ;
    my $copy = $self->copy;
@@ -3272,9 +3276,15 @@ sub checkin_handle_circ {
         $self->update_copy;
     }
 
+    return undef;
+}
+
+sub checkin_handle_circ_finish {
+    my $self = shift;
+    my $circ = $self->circ;
 
     # see if there are any fines owed on this circ.  if not, close it
-    ($obt) = $U->fetch_mbts($circ->id, $self->editor);
+    my ($obt) = $U->fetch_mbts($circ->id, $self->editor);
     $circ->xact_finish('now') if( $obt and $obt->balance_owed == 0 );
 
     $logger->debug("circulator: ".$obt->balance_owed." is owed on this circulation");
diff --git a/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t b/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t
new file mode 100644
index 0000000..0a4aa56
--- /dev/null
+++ b/Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t
@@ -0,0 +1,36 @@
+#!perl
+
+use Test::More tests => 2;
+
+diag("Make sure we don't close xacts with fines");
+
+use strict;
+use warnings;
+
+use OpenILS::Utils::TestUtils;
+my $script = OpenILS::Utils::TestUtils->new();
+#our $apputils   = "OpenILS::Application::AppUtils";
+my $storage_ses = $script->session('open-ils.storage');
+$script->authenticate({
+    username => 'admin',
+    password => 'demo123',
+    type => 'staff'});
+ok( $script->authtoken, 'Have an authtoken');
+
+my $barcode = 'CONC4000054';
+my $circ_id = 18;
+
+my $checkin_resp = $script->do_checkin_override({
+    barcode => $barcode});
+
+my $circ_req = $storage_ses->request('open-ils.storage.direct.action.circulation.retrieve', $circ_id);
+if (my $circ_resp = $circ_req->recv) {
+    if (my $circ = $circ_resp->content) {
+        ok(
+            !$circ->xact_finish,
+            'Circ with id = ' . $circ_id . ' is overdue with fines, so xact_finish isn\'t set'
+        );
+    }
+}
+
+$script->logout();

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

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   18 +++++++--
 .../live_t/10-lp1484989_dont_close_fined_xacts.t   |   38 ++++++++++++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/perlmods/live_t/10-lp1484989_dont_close_fined_xacts.t


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list