[open-ils-commits] [GIT] Evergreen ILS branch master updated. 8f745ed83f0f76cb4da8260420765147f4558d7a

Evergreen Git git at git.evergreen-ils.org
Mon Jul 29 12:52:28 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  8f745ed83f0f76cb4da8260420765147f4558d7a (commit)
      from  0033c26e92acb7e6577d490e4b7be357c21c6d14 (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 8f745ed83f0f76cb4da8260420765147f4558d7a
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Jul 8 11:13:23 2013 -0400

    LP1195150 batch update funds alters debits
    
    When a fund is updated via the ACQ batch update bar (along the top of
    the PO interface), ensure that any existing fund debits are updated to
    use the new fund.  If the selected fund exceeds the balance block
    percent, the operation will fail and the  user will be notified.
    
    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/Lineitem/BatchUpdate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem/BatchUpdate.pm
index 0a8b9a3..a12052c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem/BatchUpdate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem/BatchUpdate.pm
@@ -282,6 +282,7 @@ sub lineitem_batch_update_impl {
     # Now, going through all our lineitem details, make the updates
     # called for in $changes, other than the 'item_count' field (handled above).
 
+    my %fund_cache;
     my @fields = qw/owning_lib fund location collection_code circ_modifier/;
     foreach my $jub (@$lineitems) {
         # We use the counting style of loop below because we need to know our
@@ -300,6 +301,7 @@ sub lineitem_batch_update_impl {
             }
 
             # Handle existing and new copies.
+            my $fund_changed = 0;
             foreach my $field (@fields) {
                 # Calling pick_winning_change() in list context gets us an
                 # empty list for "no change to make", (undef) for "clear the
@@ -315,6 +317,12 @@ sub lineitem_batch_update_impl {
                         my $meth = "clear_$field";
                         $lid->$meth;
                     } else {
+
+                        $fund_changed = 1 if 
+                            !$lid->isnew and 
+                            $field eq 'fund' and 
+                            $lid->$field ne $change;
+
                         $lid->$field($change);
                     }
                 }
@@ -323,7 +331,18 @@ sub lineitem_batch_update_impl {
             my $method = ($lid->isnew ? "create" : "update") .
                 "_acq_lineitem_detail";
 
-            $e->$method($lid) or return $e->die_event;
+            if ($fund_changed) {
+                # handle_changed_lid updates any existing fund debits
+                # linked to the LID to use the new fund.  If the fund
+                # balance reaches a stop/warn percent (or error), 
+                # processing exits early and returns an event.
+                my $evt = 
+                    OpenILS::Application::Acq::Order::handle_changed_lid(
+                        $e, $lid, 0, \%fund_cache);
+                return $evt if $evt;
+            } else {
+                $e->$method($lid) or return $e->die_event;
+            }
         }
 
         if (defined $starting_use_count and

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

Summary of changes:
 .../Application/Acq/Lineitem/BatchUpdate.pm        |   21 +++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list