Password reset mail could take several hours. After fix only a couple of seconds...
[fa-stable.git] / manufacturing / view / work_order_view.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_MANUFTRANSVIEW';
13 $path_to_root = "../..";
14
15 include_once($path_to_root . "/includes/session.inc");
16
17 include_once($path_to_root . "/includes/date_functions.inc");
18 include_once($path_to_root . "/includes/data_checks.inc");
19
20 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
21 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
22 $js = "";
23 if ($SysPrefs->use_popup_windows)
24         $js .= get_js_open_window(800, 500);
25 page(_($help_context = "View Work Order"), true, false, "", $js);
26
27 //-------------------------------------------------------------------------------------------------
28 $woid = 0;
29 if ($_GET['trans_no'] != "")
30 {
31         $woid = $_GET['trans_no'];
32 }
33
34 display_heading($systypes_array[ST_WORKORDER] . " # " . $woid);
35
36 br(1);
37 $myrow = get_work_order($woid);
38
39 if ($myrow["type"]  == WO_ADVANCED)
40         display_wo_details($woid, true);
41 else
42         display_wo_details_quick($woid, true);
43
44 echo "<center>";
45
46 // display the WO requirements
47 br(1);
48 if ($myrow["released"] == false)
49 {
50     display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
51     display_bom($myrow["stock_id"]);
52 }
53 else
54 {
55         display_heading2(_("Work Order Requirements"));
56         display_wo_requirements($woid, $myrow["units_reqd"]);
57         if ($myrow["type"] == WO_ADVANCED)
58         {
59         echo "<br><table cellspacing=7><tr valign=top><td>";
60         display_heading2(_("Issues"));
61         display_wo_issues($woid);
62         echo "</td><td>";
63         display_heading2(_("Productions"));
64         display_wo_productions($woid);
65         echo "</td><td>";
66         display_heading2(_("Additional Costs"));
67         display_wo_payments($woid);
68         echo "</td></tr></table>";
69         }
70         else
71         {
72         echo "<br><table cellspacing=7><tr valign=top><td>";
73         display_heading2(_("Additional Costs"));
74         display_wo_payments($woid);
75         echo "</td></tr></table>";
76         }
77 }
78
79 echo "<br></center>";
80
81 is_voided_display(ST_WORKORDER, $woid, _("This work order has been voided."));
82
83 end_page(true, false, false, ST_WORKORDER, $woid);
84