<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_I_OWE_YOU_INQ';

	$path_to_root = "../..";


include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");

include_once($path_to_root . "/petty_cash/includes/ui/employee_petty_cash_outstanding_ui.inc");
include_once($path_to_root . "/includes/ui/ui_lists_group_companies.inc");
include_once($path_to_root . "/includes/db/group_companies_db.inc");
include_once($path_to_root . "/petty_cash/includes/db/employee_petty_cash_outstanding_db.inc");
include_once($path_to_root . "/projects/includes/db/projects_db.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/admin/db/list_values_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();
}

if (!@$_GET['popup'])
	page(_($help_context = "Employee Petty Cash Outstanding"), @$_GET['popup'], false, "", $js);

simple_page_mode(true);

//-----------------------------------------------------------------------------------


global $Ajax;


start_form();

display_employee_petty_cash_outstanding_filtering_criteria();

$Ajax->activate('doc_tbl');

div_start('doc_tbl');

br(1);

//display_customer_opening_balance($_POST['customer_id'], $_POST['from_date']);

br(1);

if(isset($_POST['RefreshInquiry'])){
    display_employee_petty_cash_outstanding($_POST['company_code'], $_POST['employee_code'], $_POST['batch_complete_filter'], $_POST['from_date'], 
                                            $_POST['to_date'], $_POST['outstanding_calculation'], $_POST['float_id'], $_POST['project_id']);
}else{
    br(1);
    display_note('Please select as employee and click on "Display" button.');
    br(2);
}
div_end();
//-----------------------------------------------------------------------------------




end_form();

//------------------------------------------------------------------------------------

end_page();

?>
