Acq: Fix sorting bug in rev 15614 when use_count >= 10
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Feb 2010 20:20:23 +0000 (20:20 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Feb 2010 20:20:23 +0000 (20:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15616 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/li_table.js

index 322d970..015d867 100644 (file)
@@ -772,9 +772,10 @@ function AcqLiTable() {
     this._labelFormulasWithCounts = function(store_data) {
         for (var key in store_data.items) {
             var obj = store_data.items[key];
+            obj.use_count = Number(obj.use_count); /* needed for sorting */
 
             if (this.dfaCache[obj.id])
-                obj.use_count = Number(obj.use_count) + this.dfaCache[obj.id];
+                obj.use_count = obj.use_count + Number(this.dfaCache[obj.id]);
 
             obj.dynLabel = "<span class='acq-lit-distrib-form-use-count'>[" +
                 obj.use_count + "]</span>&nbsp; " + obj.name;