Changed API for input/lists functions, added empty hints when needed
[fa-stable.git] / inventory / reorder_level.php
index 980d04cfb60ed09e393a45875b8a19c32e79e470..a39d094e4b7e519974f77ab54629a05dceac3726 100644 (file)
@@ -31,7 +31,7 @@ if (!isset($_POST['stock_id']))
 echo "<center>" . _("Item:"). "&nbsp;";
 stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
 
-echo "<hr>";
+echo "<hr></center>";
 
 stock_item_heading($_POST['stock_id']);
 
@@ -47,23 +47,26 @@ $k=0; //row colour counter
 
 $result = get_loc_details($_POST['stock_id']);
 
-while ($myrow = db_fetch($result)) 
+while ($myrow = db_fetch($result))
 {
 
        alt_table_row_color($k);
 
-       if (isset($_POST['UpdateData']) && is_numeric($_POST[$myrow["loc_code"]]))
+       if (isset($_POST['UpdateData']) && check_num($myrow["loc_code"]))
        {
 
-               $myrow["reorder_level"] = $_POST[$myrow["loc_code"]];
-               set_reorder_level($_POST['stock_id'], $myrow["loc_code"], $_POST[$myrow["loc_code"]]);
+               $myrow["reorder_level"] = input_num($myrow["loc_code"]);
+               set_reorder_level($_POST['stock_id'], $myrow["loc_code"], input_num($myrow["loc_code"]));
        }
 
        $qoh = get_qoh_on_date($_POST['stock_id'], $myrow["loc_code"]);
 
        label_cell($myrow["location_name"]);
+
+       $_POST[$myrow["loc_code"]] = qty_format($myrow["reorder_level"]);
+
        label_cell(number_format2($qoh,user_qty_dec()), "nowrap align='right'");
-       text_cells(null, $myrow["loc_code"], $myrow["reorder_level"], 10, 10);
+       qty_cells(null, $myrow["loc_code"]);
        end_row();
        $j++;
        If ($j == 12)
@@ -75,7 +78,7 @@ while ($myrow = db_fetch($result))
 
 end_table(1);
 
-submit('UpdateData', _("Update"));
+submit_center('UpdateData', _("Update"));
 
 end_form();
 end_page();