[0004212] Work Order Entry: fixed error when voided WO refence is reused.
[fa-stable.git] / inventory / view / view_adjustment.php
index 9aac2fd83c5e5cf8acf816d3ca30969e86c8c17d..ca3a7edc73a03a28eefd4e8e4d6365d99acc69a6 100644 (file)
@@ -1,11 +1,20 @@
 <?php
-
-$page_security = 1;
-$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_ITEMSTRANSVIEW';
+$path_to_root = "../..";
 
 include($path_to_root . "/includes/session.inc");
 
-page(_("View Inventory Adjustment"), true);
+page(_($help_context = "View Inventory Adjustment"), true);
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
@@ -16,7 +25,7 @@ if (isset($_GET["trans_no"]))
        $trans_no = $_GET["trans_no"];
 }
 
-display_heading(systypes::name(systypes::inventory_adjustment()) . " #$trans_no");
+display_heading($systypes_array[ST_INVADJUST] . " #$trans_no");
 
 br(1);
 $adjustment_items = get_stock_adjustment_items($trans_no);
@@ -27,24 +36,22 @@ while ($adjustment = db_fetch($adjustment_items))
 
        if (!$header_shown)
        {
-               $adjustment_type = get_movement_type($adjustment['person_id']) ;
 
-               start_table("$table_style2 width=90%");
+               start_table(TABLESTYLE2, "width='90%'");
                start_row();
                label_cells(_("At Location"), $adjustment['location_name'], "class='tableheader2'");
        label_cells(_("Reference"), $adjustment['reference'], "class='tableheader2'", "colspan=6");
                label_cells(_("Date"), sql2date($adjustment['tran_date']), "class='tableheader2'");
-               label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
                end_row();
-               comments_display_row(systypes::inventory_adjustment(), $trans_no);
+               comments_display_row(ST_INVADJUST, $trans_no);
 
                end_table();
                $header_shown = true;
 
                echo "<br>";
-               start_table("$table_style width=90%");
+               start_table(TABLESTYLE, "width='90%'");
 
-       $th = array(_("Item"), _("Description"), _("Quantity"),
+       $th = array(_("Item Code"), _("Description"), _("Quantity"),
                _("Units"), _("Unit Cost"));
        table_header($th);
        }
@@ -55,13 +62,12 @@ while ($adjustment = db_fetch($adjustment_items))
     label_cell($adjustment['description']);
     qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id']));
     label_cell($adjustment['units']);
-    amount_cell($adjustment['standard_cost']);
+    amount_decimal_cell($adjustment['standard_cost']);
     end_row();
 }
 
 end_table(1);
 
-is_voided_display(systypes::inventory_adjustment(), $trans_no, _("This adjustment has been voided."));
+is_voided_display(ST_INVADJUST, $trans_no, _("This adjustment has been voided."));
 
-end_page(true);
-?>
\ No newline at end of file
+end_page(true, false, false, ST_INVADJUST, $trans_no);