195f91bcc2522ca0d4c0a5561076b7052b6b8fb4
[fa-stable.git] / inventory / view / view_transfer.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_ITEMSTRANSVIEW';
13 $path_to_root = "../..";
14
15 include($path_to_root . "/includes/session.inc");
16
17 page(_($help_context = "View Inventory Transfer"), true);
18
19 include_once($path_to_root . "/includes/date_functions.inc");
20 include_once($path_to_root . "/includes/ui.inc");
21 include_once($path_to_root . "/gl/includes/gl_db.inc");
22
23 if (isset($_GET["trans_no"]))
24 {
25         $trans_no = $_GET["trans_no"];
26 }
27
28 $transfer_items = get_stock_transfer($trans_no);
29
30 $from_trans = $transfer_items[0];
31 $to_trans = $transfer_items[1];
32
33 display_heading($systypes_array[ST_LOCTRANSFER] . " #$trans_no");
34
35 echo "<br>";
36 start_table("$table_style2 width=90%");
37
38 start_row();
39 label_cells(_("Item"), $from_trans['stock_id'] . " - " . $from_trans['description'], "class='tableheader2'");
40 label_cells(_("From Location"), $from_trans['location_name'], "class='tableheader2'");
41 label_cells(_("To Location"), $to_trans['location_name'], "class='tableheader2'");
42 end_row();
43 start_row();
44 label_cells(_("Reference"), $from_trans['reference'], "class='tableheader2'");
45 $adjustment_type = get_movement_type($from_trans['person_id']) ;
46 label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
47 label_cells(_("Date"), sql2date($from_trans['tran_date']), "class='tableheader2'");
48 end_row();
49
50 comments_display_row(ST_LOCTRANSFER, $trans_no);
51
52 end_table(1);
53
54 echo "<br>";
55 start_table("$table_style width=90%");
56
57 $th = array(_("Item"), _("Description"), _("Quantity"), _("Units"));
58 table_header($th);
59 $transfer_items = get_stock_moves(ST_LOCTRANSFER, $trans_no);
60 $k = 0;
61 while ($item = db_fetch($transfer_items))
62 {
63         if ($item['loc_code'] == $to_trans['loc_code'])
64         {
65         alt_table_row_color($k);
66
67         label_cell($item['stock_id']);
68         label_cell($item['description']);
69         qty_cell($item['qty'], false, get_qty_dec($item['stock_id']));
70         label_cell($item['units']);
71         end_row();;
72         }
73 }
74
75 end_table(1);
76
77 is_voided_display(ST_LOCTRANSFER, $trans_no, _("This transfer has been voided."));
78
79 end_page(true);
80 ?>