Function line misplaced.
[fa-stable.git] / sales / includes / ui / sales_order_ui.inc
index f2dd4af50800e2cccff408bdb87e0e17a1dec78c..72ad103b1ebe6237b13ef88ba37062e38c85ec21 100644 (file)
@@ -502,13 +502,14 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1)
                if ($order->fixed_asset)
                        stock_disposable_fa_list_cells(null,'stock_id', null, _('[Select item]'), true, $order->line_items);
                else
-                       sales_items_list_cells(null,'stock_id', null, false, true, true);
+            sales_items_list_cells(null,'stock_id', null, false, true, true);
                if (list_updated('stock_id')) {
                            $Ajax->activate('price');
                            $Ajax->activate('units');
                            $Ajax->activate('qty');
                            $Ajax->activate('line_total');
-               }
+               } else
+                        sales_items_list_cells(null,'stock_id', last_sales_order_detail($order, 'stk_code'), false, true, true);
 
                $item_info = get_item_edit_info($_POST['stock_id']);
                $units = $item_info["units"];
@@ -607,7 +608,7 @@ function display_delivery_details(&$order)
                table_section(1);
 
                locations_list_row(_("Deliver from Location:"), 'Location', null, false, true, $order->fixed_asset);
-               if ($order->payment_terms['days_before_due'] < 0)
+               if ($order->payment_terms['days_before_due'] == -1)
                {
                        $Ajax->addUpdate('items_table', 'prep_amount', price_format($order->get_trans_total())); // bind to items_table update
                        if (!$order->is_started())