Double semicolon line endings fixed by @apmuthu.
[fa-stable.git] / manufacturing / view / wo_issue_view.php
index 484b08ec74161975a34eea80c69726ae4a1be3d3..cbad96a01986c498508fbb80be8a63ad96f4b4a0 100644 (file)
@@ -1,16 +1,24 @@
 <?php
-
-$page_security = 10;
-$path_to_root="../..";
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+$page_security = 'SA_MANUFTRANSVIEW';
+$path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
 $js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
        $js .= get_js_open_window(900, 500);
-page(_("View Work Order Issue"), true, false, "", $js);
+page(_($help_context = "View Work Order Issue"), true, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
@@ -27,11 +35,10 @@ if ($_GET['trans_no'] != "")
 
 function display_wo_issue($issue_no)
 {
-       global $table_style;
-
     $myrow = get_work_order_issue($issue_no);
 
-    start_table($table_style);
+       br(1);
+    start_table(TABLESTYLE);
     $th = array(_("Issue #"), _("Reference"), _("For Work Order #"),
        _("Item"), _("From Location"), _("To Work Centre"), _("Date of Issue"));
     table_header($th);
@@ -39,26 +46,24 @@ function display_wo_issue($issue_no)
        start_row();
        label_cell($myrow["issue_no"]);
        label_cell($myrow["reference"]);
-       label_cell(get_trans_view_str(systypes::work_order(),$myrow["workorder_id"]));
+       label_cell(get_trans_view_str(ST_WORKORDER,$myrow["workorder_id"]));
        label_cell($myrow["stock_id"] . " - " . $myrow["description"]);
        label_cell($myrow["location_name"]);
        label_cell($myrow["WorkCentreName"]);
        label_cell(sql2date($myrow["issue_date"]));
        end_row();
 
-    comments_display_row(28, $issue_no);
+    comments_display_row(ST_MANUISSUE, $issue_no);
 
        end_table(1);
 
-       is_voided_display(28, $issue_no, _("This issue has been voided."));
+       is_voided_display(ST_MANUISSUE, $issue_no, _("This issue has been voided."));
 }
 
 //-------------------------------------------------------------------------------------------------
 
 function display_wo_issue_details($issue_no)
 {
-       global $table_style;
-
     $result = get_work_order_issue_details($issue_no);
 
     if (db_num_rows($result) == 0)
@@ -67,8 +72,8 @@ function display_wo_issue_details($issue_no)
     }
     else
     {
-        start_table($table_style);
-        $th = array(_("Component"), _("Quantity"), _("Units"));
+        start_table(TABLESTYLE);
+        $th = array(_("Component"), _("Quantity"), _("Units"), _("Unit Cost"));
 
         table_header($th);
 
@@ -83,9 +88,10 @@ function display_wo_issue_details($issue_no)
                        alt_table_row_color($k);
 
                label_cell($myrow["stock_id"]  . " - " . $myrow["description"]);
-            qty_cell($myrow["qty_issued"]);
+            qty_cell($myrow["qty_issued"], false, get_qty_dec($myrow["stock_id"]));
                        label_cell($myrow["units"]);
-                       end_row();;
+                       amount_cell($myrow["unit_cost"]);
+                       end_row();
 
                $j++;
                If ($j == 12)
@@ -101,7 +107,7 @@ function display_wo_issue_details($issue_no)
 
 //-------------------------------------------------------------------------------------------------
 
-display_heading(systypes::name(28) . " # " . $wo_issue_no);
+display_heading($systypes_array[ST_MANUISSUE] . " # " . $wo_issue_no);
 
 display_wo_issue($wo_issue_no);
 
@@ -113,7 +119,5 @@ display_wo_issue_details($wo_issue_no);
 
 echo "<br>";
 
-end_page(true);
-
-?>
+end_page(true, false, false, ST_MANUISSUE, $wo_issue_no);