X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fadjustments.php;h=a70d2d543ea2889780403bbb0c884ce7eb7055b9;hb=debb4ba801f7bac134d8a1925ad5bf5b9dc4a785;hp=9a114e41c6ab5ef217ab6c481a3a6c8c550015eb;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/inventory/adjustments.php b/inventory/adjustments.php index 9a114e41..a70d2d54 100644 --- a/inventory/adjustments.php +++ b/inventory/adjustments.php @@ -14,6 +14,8 @@ include_once($path_to_root . "/inventory/includes/inventory_db.inc"); $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); //----------------------------------------------------------------------------------------------- @@ -134,19 +136,13 @@ if (isset($_POST['Process']) && can_process()){ 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; @@ -161,7 +157,8 @@ function handle_update_item() { 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')); } } @@ -179,7 +176,8 @@ function handle_new_item() 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')); } //-----------------------------------------------------------------------------------------------