Javascript bugfix in selecting orders as template
[fa-stable.git] / purchasing / includes / ui / po_ui.inc
index b2322f99c2d0535c9f806fa67e0ef48b4e3f8053..a4f5115b798fb2533c37a69bcebc0b2bc8aba56b 100644 (file)
@@ -177,7 +177,7 @@ function display_po_items(&$order, $editable=true)
 
                if ($po_line->Deleted == false)
                {
-               $line_total =   $po_line->quantity * $po_line->price;
+               $line_total =   round($po_line->quantity * $po_line->price,  user_price_dec());
                if (!$editable || !isset($_GET['Edit']) || $_GET['Edit'] != $po_line->line_no)
                        {
                        alt_table_row_color($k);
@@ -297,14 +297,14 @@ function po_item_controls(&$order, $stock_id=null)
                $no_item_list = get_company_pref('no_item_list');
                if ($no_item_list)
                {
-                       echo "<td colspan=2>\n";
+                       echo "<td colspan=2 nowrap>\n";
                        stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true);
                        echo "</td>\n";
                }
                else
                {
-                       text_cells(null, "StockID2", "", 12, 10, "", "", "onkeyup='recalcAccounts();' onKeyDown='if(event.keyCode==13) event.keyCode=9;' onblur='return setAccount(0, true);'");
-                       stock_purchasable_items_list_cells(null, 'stock_id', $_POST['stock_id'], false, false, "onchange='return setAccount(1, true)'");
+                       text_cells(null, "StockID2", "", 12, 10, "", "", "class='combo' rel='stock_id' onblur='submit()'");
+                       stock_purchasable_items_list_cells(null, 'stock_id', $_POST['stock_id'], false, false, "class='combo' rel='StockID2'");
                }
        $item_info = get_item_edit_info($_POST['stock_id']);
                $_POST['units'] = $item_info["units"];
@@ -314,14 +314,14 @@ function po_item_controls(&$order, $stock_id=null)
                $_POST['req_del_date'] = add_days(Today(), 10);
        }
 
-       amount_cells(null, 'qty', null);
+       qty_cells(null, 'qty', null);
 
        label_cell($_POST['units']);
        date_cells(null, 'req_del_date', null, 0, 0, 0);
        amount_cells(null, 'price', null);
 
        //$line_total = $_POST['qty'] * $_POST['price'] * (1 - $_POST['Disc'] / 100);
-       $line_total = input_num('qty') * input_num('price');
+       $line_total = round(input_num('qty') * input_num('price'),  user_price_dec());
        amount_cell($line_total);
 
        if (isset($_GET['Edit']))