Merged bugfixes upto [0000072] (version 2.0.3).
[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 br(1);
29 $myrow = get_work_order($woid);
30
31 if ($myrow["type"]  == wo_types::advanced())
32         display_wo_details($woid, true);
33 else
34         display_wo_details_quick($woid, true);
35
36 echo "<center>";
37
38 // display the WO requirements
39 br(1);
40 if ($myrow["released"] == false)
41 {
42     display_heading2(_("BOM for item:") . " " . $myrow["StockItemName"]);
43     display_bom($myrow["stock_id"]);
44 }
45 else
46 {
47         display_heading2(_("Work Order Requirements"));
48         display_wo_requirements($woid, $myrow["units_reqd"]);
49         if ($myrow["type"] == wo_types::advanced())
50         {
51         echo "<br><table cellspacing=7><tr valign=top><td>";
52         display_heading2(_("Issues"));
53         display_wo_issues($woid);
54         echo "</td><td>";
55         display_heading2(_("Productions"));
56         display_wo_productions($woid);
57         echo "</td><td>";
58         display_heading2(_("Payments"));
59         display_wo_payments($woid);
60         echo "</td></tr></table>";
61         }
62 }
63
64 echo "<br></center>";
65
66 is_voided_display(systypes::work_order(), $woid, _("This work order has been voided."));
67
68 end_page(true);
69
70 ?>