<?php
require_once(getabspath("classes/cipherer.php"));
$tdatamovimiento_caja = array();
	$tdatamovimiento_caja[".NumberOfChars"] = 80; 
	$tdatamovimiento_caja[".ShortName"] = "movimiento_caja";
	$tdatamovimiento_caja[".OwnerID"] = "";
	$tdatamovimiento_caja[".OriginalTable"] = "movimiento_caja";

//	field labels
$fieldLabelsmovimiento_caja = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsmovimiento_caja["Spanish"] = array();
	$fieldToolTipsmovimiento_caja["Spanish"] = array();
	$fieldLabelsmovimiento_caja["Spanish"]["idmovimiento"] = "Nº Movimiento";
	$fieldToolTipsmovimiento_caja["Spanish"]["idmovimiento"] = "";
	$fieldLabelsmovimiento_caja["Spanish"]["idusuario"] = "Usuario";
	$fieldToolTipsmovimiento_caja["Spanish"]["idusuario"] = "";
	$fieldLabelsmovimiento_caja["Spanish"]["estado"] = "Estado";
	$fieldToolTipsmovimiento_caja["Spanish"]["estado"] = "";
	$fieldLabelsmovimiento_caja["Spanish"]["observacion"] = "Observaciones";
	$fieldToolTipsmovimiento_caja["Spanish"]["observacion"] = "";
	if (count($fieldToolTipsmovimiento_caja["Spanish"]))
		$tdatamovimiento_caja[".isUseToolTips"] = true;
}
	
	
	$tdatamovimiento_caja[".NCSearch"] = true;



$tdatamovimiento_caja[".shortTableName"] = "movimiento_caja";
$tdatamovimiento_caja[".nSecOptions"] = 0;
$tdatamovimiento_caja[".recsPerRowList"] = 1;
$tdatamovimiento_caja[".mainTableOwnerID"] = "";
$tdatamovimiento_caja[".moveNext"] = 1;
$tdatamovimiento_caja[".nType"] = 0;

$tdatamovimiento_caja[".strOriginalTableName"] = "movimiento_caja";




$tdatamovimiento_caja[".showAddInPopup"] = false;

$tdatamovimiento_caja[".showEditInPopup"] = false;

$tdatamovimiento_caja[".showViewInPopup"] = false;

$tdatamovimiento_caja[".fieldsForRegister"] = array();
	
if (!isMobile())
	$tdatamovimiento_caja[".listAjax"] = true;
else 
	$tdatamovimiento_caja[".listAjax"] = false;

	$tdatamovimiento_caja[".audit"] = false;

	$tdatamovimiento_caja[".locking"] = false;

$tdatamovimiento_caja[".edit"] = true;
$tdatamovimiento_caja[".inlineEdit"] = true;




$tdatamovimiento_caja[".showSimpleSearchOptions"] = false;

$tdatamovimiento_caja[".showSearchPanel"] = true;

if (isMobile())
	$tdatamovimiento_caja[".isUseAjaxSuggest"] = false;
else 
	$tdatamovimiento_caja[".isUseAjaxSuggest"] = true;

$tdatamovimiento_caja[".rowHighlite"] = true;

// button handlers file names

$tdatamovimiento_caja[".addPageEvents"] = true;

// use timepicker for search panel
$tdatamovimiento_caja[".isUseTimeForSearch"] = false;




$tdatamovimiento_caja[".allSearchFields"] = array();

$tdatamovimiento_caja[".allSearchFields"][] = "idmovimiento";
$tdatamovimiento_caja[".allSearchFields"][] = "idusuario";
$tdatamovimiento_caja[".allSearchFields"][] = "observacion";

$tdatamovimiento_caja[".googleLikeFields"][] = "idmovimiento";
$tdatamovimiento_caja[".googleLikeFields"][] = "idusuario";
$tdatamovimiento_caja[".googleLikeFields"][] = "estado";
$tdatamovimiento_caja[".googleLikeFields"][] = "observacion";


$tdatamovimiento_caja[".advSearchFields"][] = "idmovimiento";
$tdatamovimiento_caja[".advSearchFields"][] = "idusuario";
$tdatamovimiento_caja[".advSearchFields"][] = "observacion";

$tdatamovimiento_caja[".isTableType"] = "list";

	



// Access doesn't support subqueries from the same table as main
	


$tdatamovimiento_caja[".pageSize"] = 20;

$tstrOrderBy = "";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdatamovimiento_caja[".strOrderBy"] = $tstrOrderBy;

$tdatamovimiento_caja[".orderindexes"] = array();

$tdatamovimiento_caja[".sqlHead"] = "SELECT idmovimiento,  idusuario,  estado,  observacion";
$tdatamovimiento_caja[".sqlFrom"] = "FROM movimiento_caja";
$tdatamovimiento_caja[".sqlWhereExpr"] = "(estado =\"ABIERTO\")";
$tdatamovimiento_caja[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatamovimiento_caja[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatamovimiento_caja[".arrGroupsPerPage"] = $arrGPP;

$tableKeysmovimiento_caja = array();
$tableKeysmovimiento_caja[] = "idmovimiento";
$tdatamovimiento_caja[".Keys"] = $tableKeysmovimiento_caja;

$tdatamovimiento_caja[".listFields"] = array();
$tdatamovimiento_caja[".listFields"][] = "idmovimiento";
$tdatamovimiento_caja[".listFields"][] = "idusuario";
$tdatamovimiento_caja[".listFields"][] = "observacion";

$tdatamovimiento_caja[".viewFields"] = array();

$tdatamovimiento_caja[".addFields"] = array();
$tdatamovimiento_caja[".addFields"][] = "idusuario";

$tdatamovimiento_caja[".inlineAddFields"] = array();

$tdatamovimiento_caja[".editFields"] = array();
$tdatamovimiento_caja[".editFields"][] = "idusuario";
$tdatamovimiento_caja[".editFields"][] = "estado";

$tdatamovimiento_caja[".inlineEditFields"] = array();
$tdatamovimiento_caja[".inlineEditFields"][] = "observacion";

$tdatamovimiento_caja[".exportFields"] = array();

$tdatamovimiento_caja[".printFields"] = array();

//	idmovimiento
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "idmovimiento";
	$fdata["GoodName"] = "idmovimiento";
	$fdata["ownerTable"] = "movimiento_caja";
	$fdata["Label"] = "Nº Movimiento"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		
		$fdata["strField"] = "idmovimiento"; 
		$fdata["FullName"] = "idmovimiento";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		$edata["inputStyle"] = " width:100px;";
	$edata["controlWidth"] = 100;
	
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatamovimiento_caja["idmovimiento"] = $fdata;
//	idusuario
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "idusuario";
	$fdata["GoodName"] = "idusuario";
	$fdata["ownerTable"] = "movimiento_caja";
	$fdata["Label"] = "Usuario"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		
		$fdata["strField"] = "idusuario"; 
		$fdata["FullName"] = "idusuario";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Lookup wizard");
	
		
		
	
//	Begin Lookup settings
								$edata["LookupType"] = 2;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
			$edata["LookupUnique"] = true;
	
	$edata["LinkField"] = "idusuario";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "nombres";
	
		
	$edata["LookupTable"] = "usuario";
	$edata["LookupOrderBy"] = "idusuario";
	
		
		$edata["LookupWhere"] = "nick =  '".$_SESSION["UserName"]."'";
	
		
		
		
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:200px;";
	$edata["controlWidth"] = 200;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatamovimiento_caja["idusuario"] = $fdata;
//	estado
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "estado";
	$fdata["GoodName"] = "estado";
	$fdata["ownerTable"] = "movimiento_caja";
	$fdata["Label"] = "Estado"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		$fdata["bEditPage"] = true; 
	
		
		
		
		
		
		$fdata["strField"] = "estado"; 
		$fdata["FullName"] = "estado";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Readonly");
	
		
		$edata["AutoUpdate"] = true; 
	
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:100px;";
	$edata["controlWidth"] = 100;
	
//	Begin validation
	$edata["validateAs"] = array();
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatamovimiento_caja["estado"] = $fdata;
//	observacion
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "observacion";
	$fdata["GoodName"] = "observacion";
	$fdata["ownerTable"] = "movimiento_caja";
	$fdata["Label"] = "Observaciones"; 
	$fdata["FieldType"] = 201;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		$fdata["bInlineEdit"] = true; 
	
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		
		$fdata["strField"] = "observacion"; 
		$fdata["FullName"] = "observacion";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text area");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
				$edata["nRows"] = 100;
			$edata["nCols"] = 200;
	
		
		
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatamovimiento_caja["observacion"] = $fdata;

	
$tables_data["movimiento_caja"]=&$tdatamovimiento_caja;
$field_labels["movimiento_caja"] = &$fieldLabelsmovimiento_caja;
$fieldToolTips["movimiento_caja"] = &$fieldToolTipsmovimiento_caja;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["movimiento_caja"] = array();
$dIndex = 1-1;
			$strOriginalDetailsTable="det_movimiento";
	$detailsParam["dDataSourceTable"]="det_movimiento";
	$detailsParam["dOriginalTable"]=$strOriginalDetailsTable;
	$detailsParam["dShortTable"]="det_movimiento";
	$detailsParam["masterKeys"]=array();
	$detailsParam["detailKeys"]=array();
	$detailsParam["dispChildCount"]= "1";
	$detailsParam["hideChild"]="0";
	$detailsParam["previewOnList"]= 2;
	$detailsParam["previewOnAdd"]= 1;
	$detailsParam["previewOnEdit"]= 0;
	$detailsParam["previewOnView"]= 0;
		
	$detailsTablesData["movimiento_caja"][$dIndex] = $detailsParam;
	
		
		$detailsTablesData["movimiento_caja"][$dIndex]["masterKeys"][]="idmovimiento";
		$detailsTablesData["movimiento_caja"][$dIndex]["detailKeys"][]="idmovimiento";

	
// tables which are master tables for current table (detail)
$masterTablesData["movimiento_caja"] = array();

$mIndex = 1-1;
			$strOriginalDetailsTable="usuario";
	$masterParams["mDataSourceTable"]="usuario";
	$masterParams["mOriginalTable"]= $strOriginalDetailsTable;
	$masterParams["mShortTable"]= "usuario";
	$masterParams["masterKeys"]= array();
	$masterParams["detailKeys"]= array();
	$masterParams["dispChildCount"]= "1";
	$masterParams["hideChild"]= "0";
	$masterParams["dispInfo"]= "1";
	$masterParams["previewOnList"]= 1;
	$masterParams["previewOnAdd"]= 1;
	$masterParams["previewOnEdit"]= 0;
	$masterParams["previewOnView"]= 0;
	$masterTablesData["movimiento_caja"][$mIndex] = $masterParams;	
		$masterTablesData["movimiento_caja"][$mIndex]["masterKeys"][]="idusuario";
		$masterTablesData["movimiento_caja"][$mIndex]["detailKeys"][]="idusuario";

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










function createSqlQuery_movimiento_caja()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "idmovimiento,  idusuario,  estado,  observacion";
$proto0["m_strFrom"] = "FROM movimiento_caja";
$proto0["m_strWhere"] = "(estado =\"ABIERTO\")";
$proto0["m_strOrderBy"] = "";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "estado =\"ABIERTO\"";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "estado",
	"m_strTable" => "movimiento_caja"
));

$proto1["m_column"]=$obj;
$proto1["m_contained"] = array();
$proto1["m_strCase"] = "=\"ABIERTO\"";
$proto1["m_havingmode"] = "0";
$proto1["m_inBrackets"] = "0";
$proto1["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto1);

$proto0["m_where"] = $obj;
$proto3=array();
$proto3["m_sql"] = "";
$proto3["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto3["m_column"]=$obj;
$proto3["m_contained"] = array();
$proto3["m_strCase"] = "";
$proto3["m_havingmode"] = "0";
$proto3["m_inBrackets"] = "0";
$proto3["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto3);

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto5=array();
			$obj = new SQLField(array(
	"m_strName" => "idmovimiento",
	"m_strTable" => "movimiento_caja"
));

$proto5["m_expr"]=$obj;
$proto5["m_alias"] = "";
$obj = new SQLFieldListItem($proto5);

$proto0["m_fieldlist"][]=$obj;
						$proto7=array();
			$obj = new SQLField(array(
	"m_strName" => "idusuario",
	"m_strTable" => "movimiento_caja"
));

$proto7["m_expr"]=$obj;
$proto7["m_alias"] = "";
$obj = new SQLFieldListItem($proto7);

$proto0["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLField(array(
	"m_strName" => "estado",
	"m_strTable" => "movimiento_caja"
));

$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "";
$obj = new SQLFieldListItem($proto9);

$proto0["m_fieldlist"][]=$obj;
						$proto11=array();
			$obj = new SQLField(array(
	"m_strName" => "observacion",
	"m_strTable" => "movimiento_caja"
));

$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "";
$obj = new SQLFieldListItem($proto11);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto13=array();
$proto13["m_link"] = "SQLL_MAIN";
			$proto14=array();
$proto14["m_strName"] = "movimiento_caja";
$proto14["m_columns"] = array();
$proto14["m_columns"][] = "idmovimiento";
$proto14["m_columns"][] = "idusuario";
$proto14["m_columns"][] = "observacion";
$proto14["m_columns"][] = "estado";
$obj = new SQLTable($proto14);

$proto13["m_table"] = $obj;
$proto13["m_alias"] = "";
$proto15=array();
$proto15["m_sql"] = "";
$proto15["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto15["m_column"]=$obj;
$proto15["m_contained"] = array();
$proto15["m_strCase"] = "";
$proto15["m_havingmode"] = "0";
$proto15["m_inBrackets"] = "0";
$proto15["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto15);

$proto13["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto13);

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_movimiento_caja = createSqlQuery_movimiento_caja();
				$tdatamovimiento_caja[".sqlquery"] = $queryData_movimiento_caja;
	
if(isset($tdatamovimiento_caja["field2"])){
	$tdatamovimiento_caja["field2"]["LookupTable"] = "carscars_view";
	$tdatamovimiento_caja["field2"]["LookupOrderBy"] = "name";
	$tdatamovimiento_caja["field2"]["LookupType"] = 4;
	$tdatamovimiento_caja["field2"]["LinkField"] = "email";
	$tdatamovimiento_caja["field2"]["DisplayField"] = "name";
	$tdatamovimiento_caja[".hasCustomViewField"] = true;
}

include_once(getabspath("include/movimiento_caja_events.php"));
$tableEvents["movimiento_caja"] = new eventclass_movimiento_caja;
$tdatamovimiento_caja[".hasEvents"] = true;

$cipherer = new RunnerCipherer("movimiento_caja");

?>