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

Evergreen Git git at git.evergreen-ils.org
Thu Jul 11 15:17:56 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  1ac7a24188fe435586da0d373ce461dab9ef1af8 (commit)
       via  94313130f81553691967bcd8c50c17b361a8e301 (commit)
       via  bc9b805468865055184eb1f2232855a21e224124 (commit)
      from  357b6ca85f240b249f393cc24c44dbbccba75acd (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 1ac7a24188fe435586da0d373ce461dab9ef1af8
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Jul 11 13:14:04 2013 -0400

    LP833820 repair ACQ options passing thinko
    
    Ensure zero_copy_activate option is passed down to
    create_lineitem_debits with new no-asset-activation code.  Thanks to Dan
    Wells for spotting this.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

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 194fdb5..e813cd9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
@@ -803,8 +803,9 @@ sub set_lineitem_attr {
 # Lineitem Debits
 # ----------------------------------------------------------------------------
 sub create_lineitem_debits {
-    my ($mgr, $li, $dry_run, $options) = @_; 
+    my ($mgr, $li, $options) = @_;
     $options ||= {};
+    my $dry_run = $options->{dry_run};
 
     unless($li->estimated_unit_price) {
         $mgr->editor->event(OpenILS::Event->new('ACQ_LINEITEM_NO_PRICE', payload => $li->id));
@@ -2664,7 +2665,7 @@ sub activate_purchase_order_impl {
         $li->state('on-order');
         $li->claim_policy($provider->default_claim_policy)
             if $provider->default_claim_policy and !$li->claim_policy;
-        create_lineitem_debits($mgr, $li, $dry_run) or return $e->die_event;
+        create_lineitem_debits($mgr, $li, $options) or return $e->die_event;
         update_lineitem($mgr, $li) or return $e->die_event;
         $mgr->post_process( sub { create_lineitem_status_events($mgr, $li->id, 'aur.ordered'); });
         $mgr->respond;

commit 94313130f81553691967bcd8c50c17b361a8e301
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Wed Jul 10 21:49:16 2013 -0400

    Release notes entry for PO activation without loading items.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/docs/RELEASE_NOTES_NEXT/Acquisitions/acq-po-activation-sans-assets.txt b/docs/RELEASE_NOTES_NEXT/Acquisitions/acq-po-activation-sans-assets.txt
new file mode 100644
index 0000000..b5c4638
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Acquisitions/acq-po-activation-sans-assets.txt
@@ -0,0 +1,5 @@
+Support PO activation without requiring items
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A new _Activate PO Without Loading Items_ option in the PO allows staff to
+activate the PO without loading copies into the catalog.

commit bc9b805468865055184eb1f2232855a21e224124
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Nov 27 15:26:48 2012 -0500

    Support PO activation w/o loading items
    
    Allow for the activation of purchase orders without requiring that bibs
    and items be loaded.  (Currently, if bibs and items are not manually
    loaded, they are loaded during PO activation).
    
    Adds a new link next to the existing PO Activate link for "Activate
    Withoug Loading Items".  Apart from the fact that there are no
    underlying bibs/copies, such a PO behaves the same as any other PO.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    
    Conflicts:
    	Open-ILS/src/templates/acq/po/view.tt2
    	Open-ILS/web/js/ui/default/acq/po/view_po.js
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

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 9661f92..194fdb5 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
@@ -2599,21 +2599,24 @@ __PACKAGE__->register_method(
 sub activate_purchase_order {
     my($self, $conn, $auth, $po_id, $vandelay, $options) = @_;
     $options ||= {};
+    $$options{dry_run} = ($self->api_name =~ /\.dry_run/) ? 1 : 0;
 
-    my $dry_run = ($self->api_name =~ /\.dry_run/) ? 1 : 0;
     my $e = new_editor(authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
     my $mgr = OpenILS::Application::Acq::BatchManager->new(editor => $e, conn => $conn);
-    my $die_event = activate_purchase_order_impl($mgr, $po_id, $vandelay, $dry_run, $options);
+    my $die_event = activate_purchase_order_impl($mgr, $po_id, $vandelay, $options);
     return $e->die_event if $die_event;
     $conn->respond_complete(1);
-    $mgr->run_post_response_hooks unless $dry_run;
+    $mgr->run_post_response_hooks unless $$options{dry_run};
     return undef;
 }
 
 # xacts managed within
 sub activate_purchase_order_impl {
-    my ($mgr, $po_id, $vandelay, $dry_run, $options) = @_;
+    my ($mgr, $po_id, $vandelay, $options) = @_;
+    $options ||= {};
+    my $dry_run = $$options{dry_run};
+    my $no_assets = $$options{no_assets};
 
     # read-only until lineitem asset creation
     my $e = $mgr->editor;
@@ -2636,9 +2639,11 @@ sub activate_purchase_order_impl {
 
     my $li_ids = $e->search_acq_lineitem($query, {idlist => 1});
 
-    my $vl_resp; # imported li's and the queue the managing queue
-    if (!$dry_run) {
+    my $vl_resp; # imported li's and the managing queue
+    unless ($dry_run or $no_assets) {
         $e->rollback; # read-only thus far
+
+        # list_assets manages its own transactions
         $vl_resp = create_lineitem_list_assets($mgr, $li_ids, $vandelay)
             or return OpenILS::Event->new('ACQ_LI_IMPORT_FAILED');
         $e->xact_begin;
@@ -2649,7 +2654,7 @@ sub activate_purchase_order_impl {
     for my $li_id (@$li_ids) {
         my $li = $e->retrieve_acq_lineitem($li_id);
         
-        if (!$li->eg_bib_id and !$dry_run) {
+        unless ($li->eg_bib_id or $dry_run or $no_assets) {
             # we encountered a lineitem that was not successfully imported.
             # we cannot continue.  rollback and report.
             $e->rollback;
@@ -2659,7 +2664,7 @@ sub activate_purchase_order_impl {
         $li->state('on-order');
         $li->claim_policy($provider->default_claim_policy)
             if $provider->default_claim_policy and !$li->claim_policy;
-        create_lineitem_debits($mgr, $li, $dry_run, $options) or return $e->die_event;
+        create_lineitem_debits($mgr, $li, $dry_run) or return $e->die_event;
         update_lineitem($mgr, $li) or return $e->die_event;
         $mgr->post_process( sub { create_lineitem_status_events($mgr, $li->id, 'aur.ordered'); });
         $mgr->respond;
diff --git a/Open-ILS/src/templates/acq/po/view.tt2 b/Open-ILS/src/templates/acq/po/view.tt2
index 143a9d2..ab1ba88 100644
--- a/Open-ILS/src/templates/acq/po/view.tt2
+++ b/Open-ILS/src/templates/acq/po/view.tt2
@@ -21,7 +21,15 @@
                     <th>[% l('Activatable?') %]</th>
                     <td>
                         <span id="acq-po-activate-checking"></span>
-                        <span class="hidden" id="acq-po-activate-link"><span dojoType="dijit.form.Button" onClick="activatePo()" jsId="activatePoButton">[% l('Activate Order') %]</span></span>
+                        <span class="hidden" id="acq-po-activate-links" style='padding: 5px'>
+                            <span dojoType="dijit.form.Button" onClick="activatePo()" jsId="activatePoButton">
+                                [% l('Activate Order') %]
+                            </span>
+                            <span style='padding: 5px;'> / </span>
+                            <span dojoType="dijit.form.Button" onClick="activatePo(true)" jsId="activatePoNoAssetsButton">
+                                [% l('Activate Without Loading Items') %]
+                            </span>
+                        </span>
                     </td>
                 </tr>
                 <tr>
diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
index d95fc4f..dd7e854 100644
--- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
+++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
@@ -57,6 +57,7 @@
     "PO_COULD_ACTIVATE" : "Yes.",
     "PO_WARNING_NO_BLOCK_ACTIVATION" : "Yes; fund ${0} (${1}) would be encumbered beyond its warning level.",
     "PO_STOP_BLOCKS_ACTIVATION" : "No; fund ${0} (${1}) would be encumbered beyond its stop level.",
+    "PO_ALREADY_ACTIVATED" : "Activated",
     "PO_FUND_WARNING_CONFIRM" : "Are you sure? Did you see the warning about over-encumbering a fund?",
     "CONFIRM_FUNDS_AT_STOP" : "One or more of the selected funds has a balance below its stop level.\nYou may not be able to activate purchase orders incorporating these copies.\nContinue?",
     "CONFIRM_FUNDS_AT_WARNING" : "One or more of the selected funds has a balance below its warning level.\nContinue?",
diff --git a/Open-ILS/web/js/ui/default/acq/po/view_po.js b/Open-ILS/web/js/ui/default/acq/po/view_po.js
index 0159b5b..f1ef20c 100644
--- a/Open-ILS/web/js/ui/default/acq/po/view_po.js
+++ b/Open-ILS/web/js/ui/default/acq/po/view_po.js
@@ -366,7 +366,11 @@ function renderPo() {
         if (PO.lineitem_count() > 1)
             openils.Util.show("acq-po-split");
     } else {
-        dojo.byId("acq-po-activate-checking").innerHTML = localeStrings.NO;
+        if (PO.order_date()) {
+            dojo.byId("acq-po-activate-checking").innerHTML = localeStrings.PO_ALREADY_ACTIVATED;
+        } else {
+            dojo.byId("acq-po-activate-checking").innerHTML = localeStrings.NO;
+        }
     }
 
     // XXX we probably don't *always* need to do this...
@@ -493,7 +497,7 @@ function init2() {
 
 function checkCouldActivatePo() {
     var d = dojo.byId("acq-po-activate-checking");
-    var a = dojo.byId("acq-po-activate-link");  /* <span> not <a> now, but no diff */
+    var a = dojo.byId("acq-po-activate-links");  /* <span> not <a> now, but no diff */
     d.innerHTML = localeStrings.PO_CHECKING;
     var warnings = [];
     var stops = [];
@@ -579,8 +583,9 @@ function checkCouldActivatePo() {
     );
 }
 
-function activatePo() {
+function activatePo(noAssets) {
     activatePoButton.attr("disabled", true);
+    activatePoNoAssetsButton.attr("disabled", true);
 
     if (openils.Util.isTrue(PO.prepayment_required())) {
         if (!confirm(localeStrings.PREPAYMENT_REQUIRED_REMINDER)) {
@@ -596,10 +601,15 @@ function activatePo() {
         }
     }
 
-    liTable.showAssetCreator(activatePoStage2);
+    if (noAssets) {
+        // no need for AssetCreator when assets are not desired
+        activatePoStage2(true);
+    } else {
+        liTable.showAssetCreator(activatePoStage2);
+    }
 }
 
-function activatePoStage2() {
+function activatePoStage2(noAssets) {
 
     var want_refresh = false;
     progressDialog.show(true);
@@ -610,7 +620,10 @@ function activatePoStage2() {
                 openils.User.authtoken,
                 PO.id(),
                 null,  // vandelay options
-                {zero_copy_activate : dojo.byId('acq-po-activate-zero-copies').checked}
+                {
+                    no_assets : noAssets, // no bibs/volumes/copies required
+                    zero_copy_activate : dojo.byId('acq-po-activate-zero-copies').checked
+                }
             ],
             "onresponse": function(r) {
                 progressDialog.hide();

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Acq/Order.pm  |   24 ++++++++++++-------
 Open-ILS/src/templates/acq/po/view.tt2             |   10 +++++++-
 Open-ILS/web/js/dojo/openils/acq/nls/acq.js        |    1 +
 Open-ILS/web/js/ui/default/acq/po/view_po.js       |   25 +++++++++++++++----
 .../Acquisitions/acq-po-activation-sans-assets.txt |    5 ++++
 5 files changed, 49 insertions(+), 16 deletions(-)
 create mode 100644 docs/RELEASE_NOTES_NEXT/Acquisitions/acq-po-activation-sans-assets.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list