Further changes in manufacturing, added unit_cost in issues and requirements
[fa-stable.git] / manufacturing / work_order_costs.php
index 4054fcbdc1cf6889cf8251e6e23ec922264a5db2..6bdb60e714a5d2a0f72048100de229d383409690 100644 (file)
 $page_security = 'SA_WORKORDERCOST';
 $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/gl/includes/db/gl_db_bank_trans.inc");
-include_once($path_to_root . "/includes/db/inventory_db.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
 
 $js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
        $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
        $js .= get_js_date_picker();
 page(_($help_context = "Work Order Additional Costs"), false, false, "", $js);
 
@@ -44,6 +43,8 @@ if (isset($_GET['AddedID']))
 
     display_note(get_trans_view_str($stype, $id, _("View this Work Order")));
 
+       display_note(get_gl_view_str($stype, $id, _("View the GL Journal Entries for this Work Order")), 1);
+
        hyperlink_params("work_order_costs.php", _("Enter another additional cost."), "trans_no=$id");
  
        hyperlink_no_params("search_work_orders.php", _("Select another &Work Order to Process"));
@@ -67,7 +68,6 @@ if (strlen($wo_details[0]) == 0)
 
 function can_process($wo_details)
 {
-
        if (!check_num('costs', 0))
        {
                display_error(_("The amount entered is not a valid number or less then zero."));
@@ -118,7 +118,7 @@ display_wo_details($_POST['selected_id']);
 //-------------------------------------------------------------------------------------
 
 if (!isset($_POST['ref']))
-       $_POST['ref'] = $Refs->get_next(ST_JOURNAL);
+       $_POST['ref'] = $Refs->get_next(ST_JOURNAL, null, get_post('date_'));
 
 start_form();
 
@@ -154,4 +154,3 @@ end_form();
 
 end_page();
 
-?>
\ No newline at end of file