f5d9cbd692c4fcb467ab2d64907fcd3448b7340c
[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 $adjustment_items = get_stock_adjustment_items($trans_no);
22 $k = 0;
23 $header_shown = false;
24 while ($adjustment = db_fetch($adjustment_items)) 
25 {
26
27         if (!$header_shown) 
28         {
29                 $adjustment_type = get_movement_type($adjustment['person_id']) ;
30                 
31                 start_table("$table_style2 width=90%");
32                 start_row();
33                 label_cells(_("At Location"), $adjustment['location_name'], "class='tableheader2'");
34         label_cells(_("Reference"), $adjustment['reference'], "class='tableheader2'", "colspan=6");
35                 label_cells(_("Date"), sql2date($adjustment['tran_date']), "class='tableheader2'");
36                 label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
37                 end_row();
38                 comments_display_row(systypes::inventory_adjustment(), $trans_no);
39
40                 end_table();
41                 $header_shown = true;
42
43                 echo "<br>";
44                 start_table("$table_style width=90%");
45
46         $th = array(_("Item"), _("Description"), _("Quantity"),
47                 _("Units"), _("Unit Cost"));
48         table_header($th);      
49         }
50
51     alt_table_row_color($k);
52
53     label_cell($adjustment['stock_id']);
54     label_cell($adjustment['description']);
55     qty_cell($adjustment['qty']);
56     label_cell($adjustment['units']);
57     amount_cell($adjustment['standard_cost']);
58     end_row();
59 }
60
61 end_table(1);
62
63 is_voided_display(systypes::inventory_adjustment(), $trans_no, _("This adjustment has been voided."));
64
65 end_page(true);
66 ?>