Replaced the ajax paging in stock movements with the old file.
[fa-stable.git] / includes / ui / ui_lists.inc
index 7b8f503e4f8cd912875c3b703b37a5b3e7910db5..77b34a0be0b4824a585ac6bf650cc11046acf51f 100644 (file)
@@ -133,7 +133,9 @@ $opts = array(              // default options
                }
        }
        if ($opts['order'] != false) {
-               $sql .= ' ORDER BY '.$opts['order'];
+               if (!is_array($opts['order']))
+                       $opts['order'] = array($opts['order']);
+               $sql .= ' ORDER BY '.implode(',',$opts['order']);
        }
 
        $sql .= $limit;
@@ -640,7 +642,8 @@ function stock_items_list($name, $selected_id=null, $all_option=false, $submit_o
                'search_submit' => get_company_pref('no_item_list')!=0,
                'size'=>10,
                'select_submit'=> $submit_on_change,
-               'category' => 2
+               'category' => 2,
+               'order' => array('c.description','stock_id')
          ), $opts) );
 }
 
@@ -683,10 +686,9 @@ function sales_items_list($name, $selected_id=null, $all_option=false,
                        ON i.category_id=c.category_id";
 
        if ($type == 'local')   { // exclude foreign codes
-               $sql .= " WHERE NOT i.is_foreign"; 
+               $sql .= " WHERE !i.is_foreign"; 
        } elseif ($type == 'kits') { // sales kits
-               $sql .= " WHERE NOT i.is_foreign 
-                       AND NOT i.item_code=i.stock_id";
+               $sql .= " WHERE !i.is_foreign AND i.item_code!=i.stock_id";
        }
                                
        $sql .= " GROUP BY i.item_code";
@@ -702,8 +704,8 @@ function sales_items_list($name, $selected_id=null, $all_option=false,
                'search_submit' => get_company_pref('no_item_list')!=0,
                'size'=>15,
                'select_submit'=> $submit_on_change,
-               'order' => 'i.item_code',
-               'category' => 2
+               'category' => 2,
+               'order' => array('c.description','i.item_code')
          ), $opts) );
 }
 
@@ -1537,7 +1539,7 @@ function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=fals
                'format' => '_format_account',
                'spec_option' => $all_option===true ?  _("Use Item Sales Accounts") : $all_option,
                'spec_id' => '',
-               'order' => 'account_code',
+               'order' => array('name','account_code'),
                'search_box' => $cells,
                        'search_submit' => false,
                        'size' => 12,