From ca5691de9feebcd61a2b8194c4527726b1960c05 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 29 Oct 2014 17:05:40 -0400 Subject: [PATCH] KMIG43 and KMIG250 - KMAIN117 and KMAIN12 - KCLSUPGRAD10 and KCLSUPGRAD15 Cross-port: 85738f7 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm | 4 ++-- Open-ILS/xul/staff_client/server/serial/batch_receive.js | 8 +++++--- Open-ILS/xul/staff_client/server/serial/common.js | 5 +++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm index d41c688564..8329d2f99c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm @@ -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; diff --git a/Open-ILS/xul/staff_client/server/serial/batch_receive.js b/Open-ILS/xul/staff_client/server/serial/batch_receive.js index f29063ba84..7ee793f131 100644 --- a/Open-ILS/xul/staff_client/server/serial/batch_receive.js +++ b/Open-ILS/xul/staff_client/server/serial/batch_receive.js @@ -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"))) diff --git a/Open-ILS/xul/staff_client/server/serial/common.js b/Open-ILS/xul/staff_client/server/serial/common.js index 674cd05483..28bcab77b3 100644 --- a/Open-ILS/xul/staff_client/server/serial/common.js +++ b/Open-ILS/xul/staff_client/server/serial/common.js @@ -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; +} + -- 2.11.0