KMIG43 and KMIG250 - KMAIN117 and KMAIN12 - KCLSUPGRAD10 and KCLSUPGRAD15
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:05:40 +0000 (17:05 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: 85738f7

Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
Open-ILS/xul/staff_client/server/serial/batch_receive.js
Open-ILS/xul/staff_client/server/serial/common.js

index d41c688..8329d2f 100644 (file)
@@ -3779,13 +3779,13 @@ sub get_items_by {
             "from" => {
                 "sitem" => {
                     "siss" => {},
-                    "sstr" => {"join" => {"sdist" => {}}}
+                    "sstr" => {"join" => {"sdist" => {"join" => {"aou" => {}}}}}
                 }
             },
             "where" => {
                 %{$where{$by}}, $receivable ? ("date_received" => undef) : ()
             },
-            "order_by" => {"sitem" => ["id"]}
+            "order_by" => {"aou" => ["shortname"]}
         }
     ) or return $e->die_event;
 
index f29063b..7ee793f 100644 (file)
@@ -10,6 +10,7 @@ dojo.require("openils.PermaCrud");
 JSAN.use("util.error");
 var _error = new util.error();
 var batch_receiver;
+var tabindex_count = 0;
 
 function _generic_onmethoderror(r, stat, stat_text) {
     _error.standard_unexpected_error_alert(
@@ -453,11 +454,11 @@ function BatchReceiver() {
     this._get_autogen_potentials = function(item_id) {
         var hit_a_wall = false;
 
-        return [openils.Util.objectProperties(this.rows).sort(num_sort).filter(
+        return [openils.Util.objectProperties(this.rows).sort(no_sort).filter(
             function(id) {
                 if (hit_a_wall) {
                     return false;
-                } else if (id <= item_id || self._row_disabled(id)) {
+                } else if (id == item_id || self._row_disabled(id)) {
                     return false;
                 } else if (self._row_field_value(id, "barcode")) {
                     hit_a_wall = true;
@@ -973,7 +974,7 @@ function BatchReceiver() {
             dojo.create(
                 "textbox", {
                     "size": 15,
-                    "tabindex": 10000 + Number(item.id()), /* is this right? */
+                    "tabindex": 10000 + tabindex_count++,
                     "onchange": function() {
                         self.autogen_if_appropriate(this, item.id());
                     }
@@ -1125,6 +1126,7 @@ function BatchReceiver() {
         if (this._user_wants_autogen() && textbox.value) {
             var kvlist = this._get_autogen_potentials(item_id);
             var list = kvlist[0];
+            alert ("list is " + list);
             var question = kvlist[1];
             if (list.length) {
                 if (question && !confirm(S("autogen_barcodes.questionable")))
index 674cd05..28bcab7 100644 (file)
@@ -60,3 +60,8 @@ function num_sort(a, b) {
     [a, b] = [Number(a), Number(b)];
     return a > b ? 1 : (a < b ? -1 : 0);
 }
+
+function no_sort(a,b) {
+    return 0;
+}
+