Fixed transaction date check message.
[fa-stable.git] / manufacturing / work_order_add_finished.php
index 953e863f7d0fecb5e3631bfdf1e6f703b2cd4808..c9c7e6271133e40a0ab0cc16a986ed8133d7667a 100644 (file)
@@ -50,6 +50,7 @@ if (isset($_GET['AddedID']))
        display_note(print_link(_("Print the GL Journal Entries for this Work Order"), 702, $ar), 1);
 
        hyperlink_no_params("search_work_orders.php", _("Select another &Work Order to Process"));
+       br();
 
        end_page();
        exit;
@@ -100,7 +101,7 @@ function can_process()
        }
        elseif (!is_date_in_fiscalyear($_POST['date_']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                return false;
        }
@@ -110,7 +111,13 @@ function can_process()
                set_focus('date_');
                return false;
        }
-
+       // don't produce more that required. Otherwise change the Work Order.
+       if (input_num('quantity') > ($wo_details["units_reqd"] - $wo_details["units_issued"]))
+       {
+               display_error(_("The production exceeds the quantity needed. Please change the Work Order."));
+               set_focus('quantity');
+               return false;
+       }
        // if unassembling we need to check the qoh
        if (($_POST['ProductionType'] == 0) && !$SysPrefs->allow_negative_stock())
        {