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_DIMTRANSVIEW';
13 $path_to_root = "../..";
15 include_once($path_to_root . "/includes/session.inc");
18 if (user_use_date_picker())
19 $js .= get_js_date_picker();
20 page(_($help_context = "View Dimension"), true, false, "", $js);
22 include_once($path_to_root . "/includes/date_functions.inc");
23 include_once($path_to_root . "/includes/data_checks.inc");
25 include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
26 include_once($path_to_root . "/dimensions/includes/dimensions_ui.inc");
28 //-------------------------------------------------------------------------------------------------
30 if (isset($_GET['trans_no']) && $_GET['trans_no'] != "")
32 $id = $_GET['trans_no'];
35 if (isset($_POST['Show']))
37 $id = $_POST['trans_no'];
38 $Ajax->activate('_page_body');
42 display_heading($systypes_array[ST_DIMENSION] . " # " . $id);
45 $myrow = get_dimension($id, true);
49 echo _("The dimension number sent is not valid.");
53 start_table(TABLESTYLE);
55 $th = array(_("#"), _("Reference"), _("Name"), _("Type"), _("Date"), _("Due Date"));
59 label_cell($myrow["id"]);
60 label_cell($myrow["reference"]);
61 label_cell($myrow["name"]);
62 label_cell($myrow["type_"]);
63 label_cell(sql2date($myrow["date_"]));
64 label_cell(sql2date($myrow["due_date"]));
67 comments_display_row(ST_DIMENSION, $id);
71 if ($myrow["closed"] == true)
73 display_note(_("This dimension is closed."));
78 start_table(TABLESTYLE_NOBORDER);
81 if (!isset($_POST['TransFromDate']))
82 $_POST['TransFromDate'] = begin_fiscalyear();
83 if (!isset($_POST['TransToDate']))
84 $_POST['TransToDate'] = Today();
85 date_cells(_("from:"), 'TransFromDate');
86 date_cells(_("to:"), 'TransToDate');
87 submit_cells('Show',_("Show"), '', false, 'default');
92 hidden('trans_no', $id);
95 display_dimension_balance($id, $_POST['TransFromDate'], $_POST['TransToDate']);
99 end_page(true, false, false, ST_DIMENSION, $id);