X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fpurchasing_data.php;h=8a1b4c0f2cef176859066345ddaa965f5a141791;hb=412b79dc32855f813d03a8a6dd9debd45bb308f5;hp=4d03d6feb1db2fecdce8323f8bfe31796ba5ee14;hpb=de3a75773afa86df1739d14f24399d6f7a46f809;p=fa-stable.git diff --git a/inventory/purchasing_data.php b/inventory/purchasing_data.php index 4d03d6fe..8a1b4c0f 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'] . "')"; @@ -103,7 +106,8 @@ if (isset($_GET['Delete'])) display_note(_("The purchasing data item has been sucessfully deleted.")); unset ($supplier_id); } - +if (isset($_POST['_stock_id_update'])) + $Ajax->activate('price_table'); //-------------------------------------------------------------------------------------------------- start_form(false, true); @@ -114,17 +118,18 @@ if (!isset($_POST['stock_id'])) echo "