<?php

$page_security = 'SA_COMPANY_CASH_FLOW_VIEW';
$path_to_root = "../..";
include($path_to_root . "/includes/session.inc");
include_once ($path_to_root . "/trace.php");

$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 = "Company Cash Flow View"), @$_REQUEST['popup'], false, "", $js);

include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/gl/includes/ui/company_cash_flow_ui.inc");
include_once($path_to_root . "/gl/includes/db/company_cash_flow_db.inc");
include_once($path_to_root . "/admin/db/list_values_db.inc");

start_form(true);

    global $Ajax;
    $Ajax->activate('com_cash_flw');

        display_company_cash_folw_filetrs();

        div_start('com_cas_flw');
            start_outer_table(TABLESTYLE_NOBORDER, "width=100%");
            
//                if ($_POST['year_id'] > 0 && $_POST['month_id'] > 0 && isset($_POST['Refresh'])) {
                if ($_POST['year_id'] > 0 && $_POST['month_id'] > 0 ) {
//                    display_company_cash_folw($_POST['year_id'], $_POST['month_id']);
//                    
//                    display_company_cash_folw_bank_accounts_summary($_POST['year_id'], $_POST['month_id'], 0);
//                    
//                    br(2);
//                    display_company_cash_folw_bank_accounts_summary($_POST['year_id'], $_POST['month_id'], 1);
                    
                    display_company_cash_folw_tabs();
                    
                } else {
                    display_note('Please select an year and a maonth then click Refresh button!', 1, 1, 'style=color:red');
                }
                
            end_outer_table(3);
        div_end();

    hidden('popup', @$_REQUEST['popup']);

end_form();

end_page(@$_REQUEST['popup']);

?>