<?php
/**********************************************************************
    Copyright (C) FrontAccounting, LLC.
	Released under the terms of the GNU General Public License, GPL, 
	as published by the Free Software Foundation, either version 3 
	of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_BANKTRANSVIEW';
$path_to_root = "../..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/admin/db/fiscalyears_db.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/ui/gl_account_inquiry_ui.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/gl/includes/db/gl_db_pre_journal.inc");


$js = '';
if ($SysPrefs->use_popup_windows) {
    $js .= get_js_open_window(900, 500);
}
if (user_use_date_picker()) {
    $js .= get_js_date_picker();
}

page(_($help_context = "View GL Account Transactions"), true, false, "", $js);

if (get_post('Show')) {
    $Ajax->activate('trans_tbl');
}

    if (isset($_GET["account"])) {
	$_POST["account"] = $_GET["account"];
    }
    if (isset($_GET["TransFromDate"])) {
	$_POST["TransFromDate"] = $_GET["TransFromDate"];
    }
    if (isset($_GET["TransToDate"])) {
	$_POST["TransToDate"] = $_GET["TransToDate"];
    }
    if (isset($_GET["Dimension"])) {
	$_POST["Dimension"] = $_GET["Dimension"];
    }
    if (isset($_GET["Dimension2"])) {
	$_POST["Dimension2"] = $_GET["Dimension2"];
    }
    if (isset($_GET["amount_min"])) {
	$_POST["amount_min"] = $_GET["amount_min"];
    }
    if (isset($_GET["amount_max"])) {
	$_POST["amount_max"] = $_GET["amount_max"];
    }

    if (! isset($_POST["amount_min"])) {
	$_POST["amount_min"] = price_format(0);
    }
    if (! isset($_POST["amount_max"])) {
	$_POST["amount_max"] = price_format(0);
    }

    start_form();

        div_start('trans_tbl');
        
            br(2);

            if (get_post('Show') || get_post('account'))
                show_results();

        div_end();

    end_form(3);

end_page(true, false, false, DV_GL_ACCOUNT_TRANSACTIONS, $_POST["account"]);

?>