<?php

$page_security = 'SA_COMPANY_CASH_FLOW_VIEW';
$path_to_root = "../..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui/ui_input.inc");
include_once($path_to_root . "/gl/includes/ui/view_company_cash_flow_transactions_ui.inc");
include_once($path_to_root . "/gl/includes/db/company_cash_flow_db.inc");
include_once($path_to_root . "/sales/includes/db/customers_db.inc"); 
include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc"); 
include_once($path_to_root . "/payroll/includes/db/employees_db.inc"); 
include_once($path_to_root . "/includes/db/group_companies_db.inc"); 
include_once($path_to_root . "/includes/db/comments_db.inc"); 

$js = '';

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

if (user_use_date_picker()) {
    $js .= get_js_date_picker();
}

simple_page_mode(true);

page(_($help_context = "Company Cash Flow Transactions"), true, false, false, $js);

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

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

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

    if (isset($_GET["to_date"])) {
        $to_date = date2sql($_GET["to_date"]);
    }
   
    start_form();

        display_company_cash_flow_transactions($trans_type, $from_date, $to_date, $param_1);

    end_form();

end_page();