<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
	die ( 'Not A Valid Entry Point' );
	
	// require_once('modules/EcmGroupSales/HeaderMenu.php');

global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;

require_once ('include/time.php');
require_once ('include/json_config.php');

// add jquery
echo '<link rel="stylesheet" type="text/css" href="modules/EcmPrepaymentInvoices/css/style.css"/>';
echo '<script type="text/javascript"
src="include/jQuery/jquery-lastes.js"></script>';
echo '<script type="text/javascript"
src="include/jQuery/jquery.tablesorter.pager.js"></script>';
echo '<script type="text/javascript"
src="modules/EcmPrepaymentInvoices/javascript/ListNewSales.js"></script>';

$json_config = new json_config ();

$focus = new EcmPrepaymentInvoice ();


if($_POST['submit']){
	$position_list=$focus->GetArrayResultFromQuery($focus->CreateQueryFromPost($_POST));
	
}
if($_POST['gets']){
	$position_list=$focus->GetArrayResultFromQuery($focus->CreateQueryFromPost($_POST));
	$link=$focus->CreateMultiPDF($_POST['selectedid']);
	

}
$edit->ss = new Sugar_Smarty ();
$edit->module = 'EcmPrepaymentInvoices';

$edit->ss->assign ( "CREATED_BY_NAME", $focus->created_by_name );
$edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
$edit->ss->assign ( 'FOCUS', $focus);
$edit->ss->assign ( 'POST', $_POST);
$edit->ss->assign ( 'LINK', $link);
$edit->ss->assign('POSITION_LIST',$position_list);
$edit->ss->assign('POSITION_LIST_C',$position_list_c);
$edit->ss->assign ( 'MOD', $mod_strings);
$edit->ss-> display('modules/EcmPrepaymentInvoices/tpls/ListNewSales.tpl'); //4


// loading view
//echo '<link rel="stylesheet" type="text/css" href="modules/EcmInsideOrders/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
?>