X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fpurchasing_data.php;h=0fd952dc5ceaafa026440b981e7e1cdbd28950e1;hb=59233fde6a6ea38e17c1ce5b089cb0b798a98e2d;hp=51cd7fce0602ad839a6acc6b65235affc5e86894;hpb=0ad7b92c6cf2e4e65ca0fa94ba31f30f7b292ba8;p=fa-stable.git diff --git a/inventory/purchasing_data.php b/inventory/purchasing_data.php index 51cd7fce..0fd952dc 100644 --- a/inventory/purchasing_data.php +++ b/inventory/purchasing_data.php @@ -18,7 +18,7 @@ check_db_has_suppliers(_("There are no suppliers defined in the system.")); if (isset($_GET['supplier_id'])) { $supplier_id = strtoupper($_GET['supplier_id']); -} +} elseif (isset($_POST['supplier_id'])) { $supplier_id = strtoupper($_POST['supplier_id']); @@ -39,16 +39,19 @@ if ((isset($_POST['AddRecord']) || isset($_POST['UpdateRecord'])) && isset($supp { $input_error = 1; display_error( _("There is no item selected.")); + set_focus('stock_id'); } elseif (!check_num('price', 0)) { $input_error = 1; display_error( _("The price entered was not numeric.")); + set_focus('price'); } elseif (!check_num('conversion_factor')) { $input_error = 1; display_error( _("The conversion factor entered was not numeric. The conversion factor is the number by which the price must be divided by to get the unit price in our unit of measure.")); + set_focus('conversion_factor'); } if ($input_error == 0) @@ -58,7 +61,7 @@ if ((isset($_POST['AddRecord']) || isset($_POST['UpdateRecord'])) && isset($supp $sql = "INSERT INTO ".TB_PREF."purch_data (supplier_id, stock_id, price, suppliers_uom, conversion_factor, supplier_description) VALUES ("; - $sql .= "'$supplier_id', '" . $_POST['stock_id'] . "', " . + $sql .= "'$supplier_id', '" . $_POST['stock_id'] . "', " . input_num('price') . ", '" . $_POST['suppliers_uom'] . "', " . input_num('conversion_factor') . ", '" . $_POST['supplier_description'] . "')"; @@ -114,17 +117,18 @@ if (!isset($_POST['stock_id'])) echo "