Moving 2.0 development version to main trunk.
[fa-stable.git] / manufacturing / view / work_order_view.php
1 <?php
2
3 $page_security = 10;
4 $path_to_root="../..";
5
6 include_once($path_to_root . "/includes/session.inc");
7
8 include_once($path_to_root . "/includes/date_functions.inc");
9 include_once($path_to_root . "/includes/manufacturing.inc");
10 include_once($path_to_root . "/includes/data_checks.inc");
11
12 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
13 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
14 $js = "";
15 if ($use_popup_windows)
16         $js .= get_js_open_window(800, 500);
17 page(_("View Work Order"), true, false, "", $js);
18
19 //-------------------------------------------------------------------------------------------------
20 $woid = 0;
21 if ($_GET['trans_no'] != "")
22 {
23         $woid = $_GET['trans_no'];
24 }
25
26 display_heading(systypes::name(systypes::work_order()) . " # " . $woid);
27
28 $myrow = get_work_order($woid);
29
30 if ($myrow["type"]  == wo_types::advanced())
31         display_wo_details($woid, true);
32 else
33         display_wo_details_quick($woid, true);
34
35 echo "<center>";
36
37 // display the WO requirements
38 echo "<br>";
39 if ($myrow["released"] == false)
40 {
41     display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
42     display_bom($myrow["stock_id"]);
43 }
44 else
45 {
46         display_heading2(_("Work Order Requirements"));
47         display_wo_requirements($woid, $myrow["units_reqd"]);
48         if ($myrow["type"] == wo_types::advanced())
49         {
50         echo "<br><table cellspacing=7><tr valign=top><td>";
51         display_heading2(_("Issues"));
52         display_wo_issues($woid);
53         echo "</td><td>";
54         display_heading2(_("Productions"));
55         display_wo_productions($woid);
56         echo "</td><td>";
57         display_heading2(_("Payments"));
58         display_wo_payments($woid);
59         echo "</td></tr></table>";
60         }
61 }
62
63 echo "<br></center>";
64
65 is_voided_display(systypes::work_order(), $woid, _("This work order has been voided."));
66
67 end_page(true);
68
69 ?>