$js = "";
if ($use_popup_windows)
$js .= get_js_open_window(800, 500);
+if ($use_date_picker)
+ $js .= get_js_date_picker();
page(_("Item Adjustments Note"), false, false, "", $js);
//-----------------------------------------------------------------------------------------------
function check_item_data()
{
- if (!is_numeric($_POST['qty']))
+ if (!check_num('qty',0))
{
- display_error(_("The quantity entered is not a valid number."));
+ display_error(_("The quantity entered is negative or invalid."));
return false;
}
- if ($_POST['qty'] <= 0)
- {
- display_error(_("The quantity entered must be greater than zero."));
- return false;
- }
-
- if (!is_numeric($_POST['std_cost']) || $_POST['std_cost'] < 0)
+ if (!check_num('std_cost', 0))
{
display_error(_("The entered standard cost is negative or invalid."));
return false;
{
if($_POST['UpdateItem'] != "" && check_item_data())
{
- $_SESSION['adj_items']->update_cart_item($_POST['stock_id'], $_POST['qty'], $_POST['std_cost']);
+ $_SESSION['adj_items']->update_cart_item($_POST['stock_id'],
+ input_num('qty'), input_num('std_cost'));
}
}
if (!check_item_data())
return;
- add_to_order($_SESSION['adj_items'], $_POST['stock_id'], $_POST['qty'], $_POST['std_cost']);
+ add_to_order($_SESSION['adj_items'], $_POST['stock_id'],
+ input_num('qty'), input_num('std_cost'));
}
//-----------------------------------------------------------------------------------------------