[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 4b472cb269ddd85fc395a3e0d62583a9c1da9401

Evergreen Git git at git.evergreen-ils.org
Mon Sep 16 12:17:31 EDT 2013


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  4b472cb269ddd85fc395a3e0d62583a9c1da9401 (commit)
      from  081880142353b99a4e90d7fbb9e9407dabffb9a8 (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 4b472cb269ddd85fc395a3e0d62583a9c1da9401
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Aug 20 09:33:49 2013 -0400

    LP#1206649 un-cancel received lineitems / copies
    
    Clear the cancel reason when a canceled lineitem is marked as received.
    With items, clear the cancel reason and re-generate fund debits if they
    were removed during cancelation (because the keep_debits flag in the
    cancel reason was set to false).
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
index c8ca798..eac934b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
@@ -601,6 +601,8 @@ sub receive_lineitem {
 
     return 0 unless $li->state eq 'on-order' or $li->state eq 'cancelled'; # sic
 
+    $li->clear_cancel_reason; # un-cancel on receive
+
     my $lid_ids = $mgr->editor->search_acq_lineitem_detail(
         {lineitem => $li_id, recv_time => undef}, {idlist => 1});
 
@@ -728,6 +730,19 @@ sub receive_lineitem_detail {
 
     return 1 if $lid->recv_time;
 
+    # if the LID is marked as canceled, remove the cancel reason,
+    # and reinstate fund debits where deleted by cancelation.
+    if ($lid->cancel_reason) {
+        my $cr = $e->retrieve_acq_cancel_reason($lid->cancel_reason);
+
+        if (!$U->is_true($cr->keep_debits)) {
+            # debits were removed during cancelation.
+            create_lineitem_detail_debit(
+                $mgr, $lid->lineitem, $lid) or return 0;
+        }
+        $lid->clear_cancel_reason;
+    }
+
     $lid->receiver($e->requestor->id);
     $lid->recv_time('now');
     $e->update_acq_lineitem_detail($lid) or return 0;

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Acq/Order.pm  |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list