X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fgl_deposit.php;h=a4b5f1734f38cf97f0234b11f83a6d7123459376;hb=04e10a2fef964ee04596dc8d7672a6e55aa3987a;hp=fd4f98e567a28e5228a03d7e2276bae285c341b6;hpb=431531eebf3ba494002cfbf7ea36f9e82d4975c0;p=fa-stable.git diff --git a/gl/gl_deposit.php b/gl/gl_deposit.php index fd4f98e5..a4b5f173 100644 --- a/gl/gl_deposit.php +++ b/gl/gl_deposit.php @@ -149,15 +149,9 @@ if (isset($_POST['Process'])) function check_item_data() { - if (!is_numeric($_POST['amount'])) + if (!check_num('amount', 0)) { - display_error( _("The amount entered is not a valid number.")); - return false; - } - - if ($_POST['amount'] <= 0) - { - display_error( _("The amount entered must be a postitive number.")); + display_error( _("The amount entered is not a valid number or is less than zero.")); return false; } @@ -182,7 +176,8 @@ function handle_update_item() { if($_POST['UpdateItem'] != "" && check_item_data()) { - $_SESSION['deposit_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'], $_POST['dimension2_id'], -$_POST['amount'], $_POST['LineMemo']); + $_SESSION['deposit_items']->update_gl_item($_POST['Index'], $_POST['dimension_id'], + $_POST['dimension2_id'], -input_num('amount'), $_POST['LineMemo']); } } @@ -200,7 +195,8 @@ function handle_new_item() if (!check_item_data()) return; - $_SESSION['deposit_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'], $_POST['dimension2_id'], -$_POST['amount'], $_POST['LineMemo']); + $_SESSION['deposit_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'], + $_POST['dimension2_id'], -input_num('amount'), $_POST['LineMemo']); } //-----------------------------------------------------------------------------------------------