21d2e80ba4489ead70205c528cf0f8ba34b44b64
[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 = 10;
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/manufacturing.inc");
19 include_once($path_to_root . "/includes/data_checks.inc");
20
21 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
22 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
23 $js = "";
24 if ($use_popup_windows)
25         $js .= get_js_open_window(800, 500);
26 page(_("View Work Order"), true, false, "", $js);
27
28 //-------------------------------------------------------------------------------------------------
29 $woid = 0;
30 if ($_GET['trans_no'] != "")
31 {
32         $woid = $_GET['trans_no'];
33 }
34
35 display_heading(systypes::name(systypes::work_order()) . " # " . $woid);
36
37 br(1);
38 $myrow = get_work_order($woid);
39
40 if ($myrow["type"]  == wo_types::advanced())
41         display_wo_details($woid, true);
42 else
43         display_wo_details_quick($woid, true);
44
45 echo "<center>";
46
47 // display the WO requirements
48 br(1);
49 if ($myrow["released"] == false)
50 {
51     display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
52     display_bom($myrow["stock_id"]);
53 }
54 else
55 {
56         display_heading2(_("Work Order Requirements"));
57         display_wo_requirements($woid, $myrow["units_reqd"]);
58         if ($myrow["type"] == wo_types::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(_("Payments"));
68         display_wo_payments($woid);
69         echo "</td></tr></table>";
70         }
71 }
72
73 echo "<br></center>";
74
75 is_voided_display(systypes::work_order(), $woid, _("This work order has been voided."));
76
77 end_page(true);
78
79 ?>