5 include_once($path_to_root . "/includes/session.inc");
7 page(_("Reorder Levels"));
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/ui.inc");
11 include_once($path_to_root . "/includes/data_checks.inc");
13 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
15 check_db_has_costable_items(_("There are no inventory items defined in the system (Purchased or manufactured items)."));
17 //------------------------------------------------------------------------------------
19 if (isset($_GET['stock_id']))
21 $_POST['stock_id'] = $_GET['stock_id'];
24 if (isset($_POST['_stock_id_update']))
25 $Ajax->activate('reorders');
26 //------------------------------------------------------------------------------------
28 start_form(false, true);
30 if (!isset($_POST['stock_id']))
31 $_POST['stock_id'] = get_global_stock_item();
33 echo "<center>" . _("Item:"). " ";
34 stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
38 stock_item_heading($_POST['stock_id']);
40 set_global_stock_item($_POST['stock_id']);
42 div_start('reorders');
43 start_table("$table_style width=30%");
45 $th = array(_("Location"), _("Quantity On Hand"), _("Re-Order Level"));
49 $k=0; //row colour counter
51 $result = get_loc_details($_POST['stock_id']);
53 while ($myrow = db_fetch($result))
56 alt_table_row_color($k);
58 if (isset($_POST['UpdateData']) && check_num($myrow["loc_code"]))
61 $myrow["reorder_level"] = input_num($myrow["loc_code"]);
62 set_reorder_level($_POST['stock_id'], $myrow["loc_code"], input_num($myrow["loc_code"]));
65 $qoh = get_qoh_on_date($_POST['stock_id'], $myrow["loc_code"]);
67 label_cell($myrow["location_name"]);
69 $_POST[$myrow["loc_code"]] = qty_format($myrow["reorder_level"], $_POST['stock_id'], $dec);
71 qty_cell($qoh, false, $dec);
72 qty_cells(null, $myrow["loc_code"], null, null, null, $dec);
84 submit_center('UpdateData', _("Update"));