X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fprices.php;h=64371bbe82840e02403978b46de087d090b0fd98;hb=f7eca2b3dad62da7e51365084ef9ef972f0717d8;hp=073289c65b3610cb742be9d097111e145835ff0e;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/inventory/prices.php b/inventory/prices.php index 073289c6..64371bbe 100644 --- a/inventory/prices.php +++ b/inventory/prices.php @@ -67,10 +67,11 @@ function clear_data() if (isset($_POST['updatePrice'])) { - if (!is_numeric($_POST['price']) || $_POST['price'] == "") + if (!check_num('price', 0)) { $input_error = 1; display_error( _("The price entered must be numeric.")); + set_focus('price'); } if ($input_error != 1) @@ -79,14 +80,16 @@ if (isset($_POST['updatePrice'])) if (isset($_POST['PriceID'])) { //editing an existing price - update_item_price($_POST['PriceID'], $_POST['sales_type_id'], $_POST['curr_abrev'], $_POST['price']); + update_item_price($_POST['PriceID'], $_POST['sales_type_id'], + $_POST['curr_abrev'], input_num('price')); $msg = _("This price has been updated."); } elseif ($input_error !=1) { - add_item_price($_POST['stock_id'], $_POST['sales_type_id'], $_POST['curr_abrev'], $_POST['price']); + add_item_price($_POST['stock_id'], $_POST['sales_type_id'], + $_POST['curr_abrev'], input_num('price')); display_note(_("The new price has been added.")); } @@ -148,7 +151,7 @@ if (isset($_GET['Edit'])) hidden('PriceID', $_GET['PriceID']); $_POST['curr_abrev'] = $myrow["curr_abrev"]; $_POST['sales_type_id'] = $myrow["sales_type_id"]; - $_POST['price'] = $myrow["price"]; + $_POST['price'] = price_format($myrow["price"]); } start_table($table_style2); @@ -157,7 +160,7 @@ currencies_list_row(_("Currency:"), 'curr_abrev', null); sales_types_list_row(_("Sales Type:"), 'sales_type_id', null); -text_row(_("Price:"), 'price', null, 10, 10); +small_amount_row(_("Price:"), 'price', null); end_table(1);