Merged bugfixes upto [0000072] (version 2.0.3).
[fa-stable.git] / inventory / view / view_adjustment.php
1 <?php
2
3 $page_security = 1;
4 $path_to_root="../..";
5
6 include($path_to_root . "/includes/session.inc");
7
8 page(_("View Inventory Adjustment"), true);
9
10 include_once($path_to_root . "/includes/date_functions.inc");
11 include_once($path_to_root . "/includes/ui.inc");
12 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
13
14 if (isset($_GET["trans_no"]))
15 {
16         $trans_no = $_GET["trans_no"];
17 }
18
19 display_heading(systypes::name(systypes::inventory_adjustment()) . " #$trans_no");
20
21 br(1);
22 $adjustment_items = get_stock_adjustment_items($trans_no);
23 $k = 0;
24 $header_shown = false;
25 while ($adjustment = db_fetch($adjustment_items))
26 {
27
28         if (!$header_shown)
29         {
30                 $adjustment_type = get_movement_type($adjustment['person_id']) ;
31
32                 start_table("$table_style2 width=90%");
33                 start_row();
34                 label_cells(_("At Location"), $adjustment['location_name'], "class='tableheader2'");
35         label_cells(_("Reference"), $adjustment['reference'], "class='tableheader2'", "colspan=6");
36                 label_cells(_("Date"), sql2date($adjustment['tran_date']), "class='tableheader2'");
37                 label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
38                 end_row();
39                 comments_display_row(systypes::inventory_adjustment(), $trans_no);
40
41                 end_table();
42                 $header_shown = true;
43
44                 echo "<br>";
45                 start_table("$table_style width=90%");
46
47         $th = array(_("Item"), _("Description"), _("Quantity"),
48                 _("Units"), _("Unit Cost"));
49         table_header($th);
50         }
51
52     alt_table_row_color($k);
53
54     label_cell($adjustment['stock_id']);
55     label_cell($adjustment['description']);
56     qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id']));
57     label_cell($adjustment['units']);
58     amount_cell($adjustment['standard_cost']);
59     end_row();
60 }
61
62 end_table(1);
63
64 is_voided_display(systypes::inventory_adjustment(), $trans_no, _("This adjustment has been voided."));
65
66 end_page(true);
67 ?>