X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=manufacturing%2Fwork_order_entry.php;h=1a192ef03fa33d50e9477e53dc4351951febdcee;hb=46d3debec422c5ad5ee99c4acfe42bfa60308afb;hp=4da03e6e0095d2ec8475a36d76dd385466401d07;hpb=0ad7b92c6cf2e4e65ca0fa94ba31f30f7b292ba8;p=fa-stable.git diff --git a/manufacturing/work_order_entry.php b/manufacturing/work_order_entry.php index 4da03e6e..1a192ef0 100644 --- a/manufacturing/work_order_entry.php +++ b/manufacturing/work_order_entry.php @@ -105,12 +105,14 @@ function can_process() if (!references::is_valid($_POST['wo_ref'])) { display_error(_("You must enter a reference.")); + set_focus('wo_ref'); return false; } if (!is_new_reference($_POST['wo_ref'], systypes::work_order())) { display_error(_("The entered reference is already in use.")); + set_focus('wo_ref'); return false; } } @@ -118,17 +120,20 @@ function can_process() if (!check_num('quantity', 0)) { display_error( _("The quantity entered is invalid or less than zero.")); + set_focus('quantity'); return false; } if (!is_date($_POST['date_'])) { display_error( _("The date entered is in an invalid format.")); + set_focus('date_'); return false; } elseif (!is_date_in_fiscalyear($_POST['date_'])) { display_error(_("The entered date is not in fiscal year.")); + set_focus('date_'); return false; } // only check bom and quantites if quick assembly @@ -137,6 +142,7 @@ function can_process() if (!has_bom($_POST['stock_id'])) { display_error(_("The selected item to manufacture does not have a bom.")); + set_focus('stock_id'); return false; } @@ -145,6 +151,7 @@ function can_process() if (!check_num('Costs', 0)) { display_error( _("The cost entered is invalid or less than zero.")); + set_focus('Costs'); return false; } @@ -168,6 +175,7 @@ function can_process() { display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") . " " . $bom_item["component"] . " - " . $bom_item["description"] . ". " . _("Location:") . " " . $bom_item["location_name"]); + set_focus('quantity'); return false; } } @@ -189,6 +197,7 @@ function can_process() { if (!is_date($_POST['RequDate'])) { + set_focus('RequDate'); display_error( _("The date entered is in an invalid format.")); return false; } @@ -203,6 +212,7 @@ function can_process() if ($_POST['units_issued'] > input_num('quantity')) { + set_focus('quantity'); display_error(_("The quantity cannot be changed to be less than the quantity already manufactured for this order.")); return false; } @@ -353,7 +363,7 @@ if (!isset($_POST['quantity'])) if ($_POST['type'] == wo_types::advanced()) { - amount_row(_("Quantity Required:"), 'quantity', 12); + qty_row(_("Quantity Required:"), 'quantity', 12); if ($_POST['released']) label_row(_("Quantity Manufactured:"), qty_format($_POST['units_issued'])); date_row(_("Date") . ":", 'date_'); @@ -361,7 +371,7 @@ if ($_POST['type'] == wo_types::advanced()) } else { - amount_row(_("Quantity:"), 'quantity', 12); + qty_row(_("Quantity:"), 'quantity', 12); date_row(_("Date") . ":", 'date_'); hidden('RequDate', '');