Fixed many issues in output HTML code according to HTML 4.01 Transitional format.
[fa-stable.git] / manufacturing / includes / manufacturing_ui.inc
index 5753b716bd51f7025960f6ef33afb33b0a2ef31e..dfedbb296e4eacebf0ce0e28fa41ebaf08fd5be7 100644 (file)
@@ -1,13 +1,20 @@
 <?php
-
+/**********************************************************************
+    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>.
+***********************************************************************/
 include_once($path_to_root . "/includes/ui.inc");
 
 //--------------------------------------------------------------------------------------
 
 function display_bom($item_check)
 {
-       global $table_style;
-
     $result = get_bom($item_check);
 
     if (db_num_rows($result) == 0)
@@ -17,7 +24,7 @@ function display_bom($item_check)
     else
     {
 
-        start_table($table_style);
+        start_table(TABLESTYLE);
         $th = array(_("Component"), _("Description"), _("Work Centre"),
                _("From Location"), _("Quantity"), _("Unit Cost"), _("Total Cost"));
 
@@ -61,7 +68,7 @@ function display_bom($item_check)
 
 function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null)
 {
-       global $table_style;
+       global $SysPrefs;
 
     $result = get_wo_requirements($woid);
 
@@ -72,7 +79,7 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null)
     else
     {
 
-        start_table("$table_style width=80%");
+        start_table(TABLESTYLE, "width='80%'");
         $th = array(_("Component"), _("From Location"), _("Work Centre"),
                _("Unit Quantity"), _("Total Quantity"), _("Units Issued"), _("On Hand"));
 
@@ -97,7 +104,7 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null)
                                $qoh = get_qoh_on_date($myrow["stock_id"], $myrow["loc_code"], $date);
 
                        if ($show_qoh && ($myrow["units_req"] * $quantity > $qoh) &&
-                               !sys_prefs::allow_negative_stock())
+                               !$SysPrefs->allow_negative_stock())
                        {
                                // oops, we don't have enough of one of the component items
                                start_row("class='stockmankobg'");
@@ -136,7 +143,7 @@ function display_wo_requirements($woid, $quantity, $show_qoh=false, $date=null)
 
 function display_wo_productions($woid)
 {
-       global $path_to_root, $table_style;
+       global $path_to_root;
 
     $result = get_work_order_productions($woid);
 
@@ -146,7 +153,7 @@ function display_wo_productions($woid)
     }
     else
     {
-        start_table($table_style);
+        start_table(TABLESTYLE);
         $th = array(_("#"), _("Reference"), _("Date"), _("Quantity"));
 
         table_header($th);
@@ -179,7 +186,7 @@ function display_wo_productions($woid)
 
 function display_wo_issues($woid)
 {
-       global $path_to_root, $table_style;
+       global $path_to_root;
 
     $result = get_work_order_issues($woid);
 
@@ -189,7 +196,7 @@ function display_wo_issues($woid)
     }
     else
     {
-        start_table($table_style);
+        start_table(TABLESTYLE);
         $th = array(_("#"), _("Reference"), _("Date"));
 
         table_header($th);
@@ -215,33 +222,33 @@ function display_wo_issues($woid)
 
 function display_wo_payments($woid)
 {
-       global $path_to_root, $table_style;
+       global $path_to_root, $wo_cost_types;
 
-    $result = get_bank_trans(null, null, payment_person_types::WorkOrder(), $woid);
+    $result = get_gl_wo_cost_trans($woid);
 
     if (db_num_rows($result) == 0)
     {
-       display_note(_("There are no Payments for this Order."), 0, 1);
+       display_note(_("There are no additional costs for this Order."), 0, 1);
     }
     else
     {
-        start_table($table_style);
-        $th = array(_("#"), _("Reference"), _("Date"), _("Amount"));
+        start_table(TABLESTYLE);
+        $th = array(_("#"), _("Type"), _("Date"), _("Amount"));
 
         table_header($th);
 
         $k = 0; //row colour counter
-
+               
         while ($myrow = db_fetch($result))
         {
 
                        alt_table_row_color($k);
 
-               label_cell(get_trans_view_str(1, $myrow["trans_no"]));
-                       label_cell($myrow['ref']);
-                       label_cell(sql2date($myrow["trans_date"]));
+               label_cell(get_gl_view_str(ST_WORKORDER, $myrow["type_no"], $myrow["type_no"]));
+               label_cell($wo_cost_types[$myrow['person_id']]);
+               $date = sql2date($myrow["tran_date"]);
+               label_cell($date);
                        amount_cell(-($myrow['amount']));
-                       label_cell($myrow['bank_curr_code']);
                        end_row();
                }
 
@@ -253,7 +260,7 @@ function display_wo_payments($woid)
 
 function display_wo_details($woid, $suppress_view_link=false)
 {
-       global $table_style;
+       global $wo_types_array;
 
        $myrow = get_work_order($woid);
 
@@ -263,7 +270,7 @@ function display_wo_details($woid, $suppress_view_link=false)
        exit;
     }
 
-       start_table("$table_style width=80%");
+       start_table(TABLESTYLE, "width='80%'");
 
        if ($myrow["released"] == true)
                $th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"),
@@ -278,9 +285,9 @@ function display_wo_details($woid, $suppress_view_link=false)
        if ($suppress_view_link)
                label_cell($myrow["id"]);
        else
-               label_cell(get_trans_view_str(systypes::work_order(), $myrow["id"]));
+               label_cell(get_trans_view_str(ST_WORKORDER, $myrow["id"]));
        label_cell($myrow["wo_ref"]);
-       label_cell(wo_types::name($myrow["type"]));
+       label_cell($wo_types_array[$myrow["type"]]);
        view_stock_status_cell($myrow["stock_id"], $myrow["StockItemName"]);
        label_cell($myrow["location_name"]);
        label_cell(sql2date($myrow["date_"]));
@@ -295,7 +302,7 @@ function display_wo_details($woid, $suppress_view_link=false)
        }
        end_row();
 
-       comments_display_row(systypes::work_order(), $woid);
+       comments_display_row(ST_WORKORDER, $woid);
 
        end_table();
 
@@ -309,7 +316,7 @@ function display_wo_details($woid, $suppress_view_link=false)
 
 function display_wo_details_quick($woid, $suppress_view_link=false)
 {
-       global $table_style;
+       global $wo_types_array;
 
        $myrow = get_work_order($woid);
 
@@ -319,7 +326,7 @@ function display_wo_details_quick($woid, $suppress_view_link=false)
        exit;
     }
 
-       start_table("$table_style width=80%");
+       start_table(TABLESTYLE, "width='80%'");
 
        $th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"),
                _("Into Location"), _("Date"), _("Quantity"));
@@ -329,9 +336,9 @@ function display_wo_details_quick($woid, $suppress_view_link=false)
        if ($suppress_view_link)
                label_cell($myrow["id"]);
        else
-               label_cell(get_trans_view_str(systypes::work_order(), $myrow["id"]));
+               label_cell(get_trans_view_str(ST_WORKORDER, $myrow["id"]));
        label_cell($myrow["wo_ref"]);
-       label_cell(wo_types::name($myrow["type"]));
+       label_cell($wo_types_array[$myrow["type"]]);
        view_stock_status_cell($myrow["stock_id"], $myrow["StockItemName"]);
        label_cell($myrow["location_name"]);
        label_cell(sql2date($myrow["date_"]));
@@ -340,7 +347,7 @@ function display_wo_details_quick($woid, $suppress_view_link=false)
 
        end_row();
 
-       comments_display_row(systypes::work_order(), $woid);
+       comments_display_row(ST_WORKORDER, $woid);
 
        end_table();