<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_BANKTRANSVIEW';
$path_to_root="../..";

include($path_to_root . "/includes/session.inc");

$js = "";
if ($SysPrefs->use_popup_windows)
	$js .= get_js_open_window(800, 500);

//global $systypes_array;

if (isset($_GET["trans_no"])){
	$trans_no = $_GET["trans_no"];
}
if (isset($_GET["type_id"])){
	$type = $_GET["type_id"];
}

page(_($help_context = "View ".$systypes_array[$type]), true, false, "", $js);

include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/gl/includes/db/month_reporting_adjustments_db.inc");
include_once($path_to_root . "/admin/db/fiscalyears_db.inc");

if (isset($_GET["trans_no"])){
	$trans_no = $_GET["trans_no"];
}

$row = view_month_reporting_adjustment($trans_no);

if (!(is_array($row))){
    display_note("No ".$systypes_array[$type]." found.");
    display_footer_exit();
}

display_heading($systypes_array[$type] . " #$trans_no");

echo "<br>";
start_table(TABLESTYLE, "width=40%");

label_row(_("Type"), $row['adjustment_type_name'], "class='tableheader2'");

//$fiscal_year_name = get_fiscal_year_formatted_name($row['year_id']);
//label_row(_("Fiscal Year"), $fiscal_year_name, "class='tableheader2'");

$month_nam = date('F Y', strtotime($row['date']));
label_row(_("Month"), $month_nam, "class='tableheader2'");
label_row(_("Date"), sql2date($row['date']), "class='tableheader2'");

label_row(_("Amount"), number_format2($row['amount'], user_price_dec()), "class='tableheader2'", "align=right");
label_row(_("Comment"), nl2br($row['comment']), "class='tableheader2'");	

end_table();

br(3);

end_page(true, false, false, ST_BANKTRANSFER, $trans_no);
?>