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

Evergreen Git git at git.evergreen-ils.org
Thu Jul 28 14:40:47 EDT 2011


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  f799217b4f72cd75686a1424184158a1b0ce3b96 (commit)
      from  ab28c7b8def4b015b92bf954dec5bbb5dd8143d9 (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 f799217b4f72cd75686a1424184158a1b0ce3b96
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Thu Jul 28 14:17:44 2011 -0400

    Make users confirm they really want to delete lineitems from POs...
    
    ... when they've already been ordered. There's really no reason to ever
    make such a deletion this that I can think of, but I use a confirm()
    instead of stricter measures in case I'm missing something.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

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 040bec3..2d89f12 100644
--- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
+++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
@@ -77,5 +77,6 @@
     "NUM_CLAIMS_EXISTING" : "Claims (${0} existing)",
     "LOAD_TERMS_FIRST" : "You can't retrieve records until you've loaded a CSV file\nwith bibliographic IDs in the first column.",
     "SELECT_SEARCH_FIELD": "Select Search Field",
-    "LIBRARY_INITIATED": "Library Initiated"
+    "LIBRARY_INITIATED": "Library Initiated",
+    "DEL_LI_FROM_PO": "That item has already been ordered!  Deleting it now will not revoke or modify any order that has been placed with a vendor.  Deleting the item may put the system's idea of your purchase order in a state that is inconsistent with reality.  Are you sure you mean to do this?"
 }
diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js
index bc0c0a8..0b9b642 100644
--- a/Open-ILS/web/js/ui/default/acq/common/li_table.js
+++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js
@@ -2319,7 +2319,34 @@ function AcqLiTable() {
     this._deleteLiList = function(list, idx) {
         if(idx == null) idx = 0;
         if(idx >= list.length) return;
-        var liId = list[idx].id();
+
+        var li = list[idx];
+        var liId = li.id();
+
+        if (this.isPO && (li.state() == "on-order" || li.state() == "received")) {
+            /* It makes little sense to delete a lineitem from a PO that has
+             * already been marked 'on-order'.  Especially if EDI is in use,
+             * such a purchase order will probably have already been shipped
+             * off to a vendor, and mucking with it at this point could leave
+             * your data in a bad state that doesn't jive with reality.
+             *
+             * I could see making this restriction even firmer.
+             *
+             * I could also see adjusting the li state comparisons, extending
+             * the comparison to the PO's state, and/or providing functions
+             * that house the logic for comparing states in a single location.
+             *
+             * Yes, this will be really annoying if you have selected a lot
+             * of lineitems to cancel that have been ordered. You'll get a
+             * confirm dialog for each one.
+             */
+
+            if (!confirm(localeStrings.DEL_LI_FROM_PO)) {
+                self._deleteLiList(list, ++idx); /* move on to next in list */
+                return;
+            }
+        }
+
         fieldmapper.standardRequest(
             ['open-ils.acq',
              this.isPO ? 'open-ils.acq.purchase_order.lineitem.delete' : 'open-ils.acq.picklist.lineitem.delete'],

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

Summary of changes:
 Open-ILS/web/js/dojo/openils/acq/nls/acq.js       |    3 +-
 Open-ILS/web/js/ui/default/acq/common/li_table.js |   29 ++++++++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list