X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fadjustments.php;h=a70d2d543ea2889780403bbb0c884ce7eb7055b9;hb=04e10a2fef964ee04596dc8d7672a6e55aa3987a;hp=e2a793843208bc676b69404e26d11852cb8cc952;hpb=431531eebf3ba494002cfbf7ea36f9e82d4975c0;p=fa-stable.git diff --git a/inventory/adjustments.php b/inventory/adjustments.php index e2a79384..a70d2d54 100644 --- a/inventory/adjustments.php +++ b/inventory/adjustments.php @@ -136,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; @@ -163,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')); } } @@ -181,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')); } //-----------------------------------------------------------------------------------------------