[open-ils-commits] [GIT] Evergreen ILS branch master updated. 23ebae3bbcf09e4472e5bce1d15782c78484ace5

Evergreen Git git at git.evergreen-ils.org
Mon Feb 20 14:23:31 EST 2012


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  23ebae3bbcf09e4472e5bce1d15782c78484ace5 (commit)
      from  86e831e1ad85f6f5ed89ebf6bda4fe379808cd41 (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 23ebae3bbcf09e4472e5bce1d15782c78484ace5
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Wed Nov 2 12:23:47 2011 -0400

    Acq: minor usability improvements to receiving copies from invoice
    
    1) Show an "X out of Y copies received" message near the top of the
    display.
    
    2) Provide a button to return to the primary interface for invoice view.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/acq/invoice/receive.tt2 b/Open-ILS/src/templates/acq/invoice/receive.tt2
index 6a2abb9..f728a7b 100644
--- a/Open-ILS/src/templates/acq/invoice/receive.tt2
+++ b/Open-ILS/src/templates/acq/invoice/receive.tt2
@@ -21,7 +21,9 @@
 <div>
     <p><big>[% ctx.page_title %]</big></p>
     <p><strong id="inv-header"></strong></p>
+    <p id="inv-copy-count-info"></p>
     <div id="non-empty">
+        <p>The remaining are listed below.</p>
         <p>
             <span id="set-list-mode">[ <a id="set-list-mode-link" href="javascript:void(0);">Use List Mode</a> ]</span>
             <span id="set-number-mode">[ <a id="set-number-mode-link" href="javascript:void(0);">Use Numeric Mode</a> ]</span>
@@ -57,6 +59,9 @@
     <div class="hidden" id="empty">
         This invoice has no more copies to receive.
     </div>
+    <p>
+        <button onclick="copy_table.back_to_invoice();">Return to Invoice</button>
+    </p>
     <div class="hidden">
         <div dojoType="openils.widget.ProgressDialog" jsId="progress_dialog"></div>
     </div>
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 9e29f0f..7d4ce58 100644
--- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
+++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
@@ -85,5 +85,6 @@
     "ADD_LI_TO_PO_BAD_LI_STATE" : "The selected lineitem is not in a state that can be added to a purchase order",
     "INVOICE_NUMBER": "Invoice #${0}",
     "COPIES_TO_RECEIVE": "Number of copies to receive: ",
-    "CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider."
+    "CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider.",
+    "INVOICE_COPY_COUNT_INFO": "Copies received on this invoice: ${0} out of ${1}."
 }
diff --git a/Open-ILS/web/js/ui/default/acq/invoice/receive.js b/Open-ILS/web/js/ui/default/acq/invoice/receive.js
index 3930b52..d414676 100644
--- a/Open-ILS/web/js/ui/default/acq/invoice/receive.js
+++ b/Open-ILS/web/js/ui/default/acq/invoice/receive.js
@@ -118,6 +118,24 @@ function ReceivableCopyTable() {
 //        return n > 0 ? n : 0;
     };
 
+    this._render_copy_count_info = function() {
+        dojo.byId("inv-copy-count-info").innerHTML =
+            dojo.string.substitute(
+                localeStrings.INVOICE_COPY_COUNT_INFO,
+                [this.copy_number_received, this.copy_number_total]
+            );
+    };
+
+    this._increment_copy_count_info = function(li) {
+        var all_uncanceled = li.lineitem_details().filter(
+            function(lid) { return !lid.cancel_reason(); }
+        );
+        this.copy_number_total += all_uncanceled.length;
+        this.copy_number_received += all_uncanceled.filter(
+            function(lid) { return Boolean(lid.recv_time()); }
+        ).length;
+    };
+
     this._add_lineitem_number_mode = function(details, li, preselect_count) {
         var tr = dojo.create("tr", null, this.tbody);
         var td = dojo.create("td", {
@@ -181,6 +199,10 @@ function ReceivableCopyTable() {
      * that are still receivable, and preselect lineitem details up to the
      * number specified in ie.phys_item_count() */
     this.add_lineitem = function(ie, li, displayHTML) {
+        /* This call only affects the blurb about received vs. total copies
+         * on the invoice near the top of the display. */
+        this._increment_copy_count_info(li);
+
         var receivable_details = this._get_receivable_details(li);
         if (!receivable_details.length) return;
 
@@ -211,6 +233,8 @@ function ReceivableCopyTable() {
 
         this.user_has_acked = [];
         this.li_by_lid = {};
+        this.copy_number_received = 0;
+        this.copy_number_total = 0;
 
         if (this.spinners) {
             for (var key in this.spinners)
@@ -253,6 +277,8 @@ function ReceivableCopyTable() {
             }
         );
 
+        this._render_copy_count_info();
+
         if (openils.Util.objectProperties(this.li_by_lid).length) {
             openils.Util.show("non-empty");
             openils.Util.hide("empty");
@@ -345,6 +371,10 @@ function ReceivableCopyTable() {
         );
     };
 
+    this.back_to_invoice = function() {
+        location.href = oilsBasePath + "/acq/invoice/view/" + this.inv_id;
+    };
+
     this._init.apply(this, arguments);
 }
 

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

Summary of changes:
 Open-ILS/src/templates/acq/invoice/receive.tt2    |    5 +++
 Open-ILS/web/js/dojo/openils/acq/nls/acq.js       |    3 +-
 Open-ILS/web/js/ui/default/acq/invoice/receive.js |   30 +++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list