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
15include_once($path_to_root . "/includes/session.inc");
16
17include_once($path_to_root . "/includes/date_functions.inc");
18include_once($path_to_root . "/includes/manufacturing.inc");
19include_once($path_to_root . "/includes/data_checks.inc");
20
21include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
22include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
23$js = "";
24if ($use_popup_windows)
25	$js .= get_js_open_window(800, 500);
26page(_($help_context = "View Work Order"), true, false, "", $js);
27
28//-------------------------------------------------------------------------------------------------
29$woid = 0;
30if ($_GET['trans_no'] != "")
31{
32	$woid = $_GET['trans_no'];
33}
34
35display_heading($systypes_array[ST_WORKORDER] . " # " . $woid);
36
37br(1);
38$myrow = get_work_order($woid);
39
40if ($myrow["type"]  == WO_ADVANCED)
41	display_wo_details($woid, true);
42else
43	display_wo_details_quick($woid, true);
44
45echo "<center>";
46
47// display the WO requirements
48br(1);
49if ($myrow["released"] == false)
50{
51    display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
52    display_bom($myrow["stock_id"]);
53}
54else
55{
56	display_heading2(_("Work Order Requirements"));
57	display_wo_requirements($woid, $myrow["units_reqd"]);
58	if ($myrow["type"] == WO_ADVANCED)
59	{
60    	echo "<br><table cellspacing=7><tr valign=top><td>";
61    	display_heading2(_("Issues"));
62    	display_wo_issues($woid);
63    	echo "</td><td>";
64    	display_heading2(_("Productions"));
65    	display_wo_productions($woid);
66    	echo "</td><td>";
67    	display_heading2(_("Additional Costs"));
68    	display_wo_payments($woid);
69    	echo "</td></tr></table>";
70	}
71	else
72	{
73    	echo "<br><table cellspacing=7><tr valign=top><td>";
74    	display_heading2(_("Additional Costs"));
75    	display_wo_payments($woid);
76    	echo "</td></tr></table>";
77	}
78}
79
80echo "<br></center>";
81
82is_voided_display(ST_WORKORDER, $woid, _("This work order has been voided."));
83
84end_page(true, false, false, ST_WORKORDER, $woid);
85
86?>
87