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

//	field labels
$fieldLabelsgasto = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsgasto["Spanish"] = array();
	$fieldToolTipsgasto["Spanish"] = array();
	$fieldLabelsgasto["Spanish"]["idgasto"] = "Nº Gasto";
	$fieldToolTipsgasto["Spanish"]["idgasto"] = "";
	$fieldLabelsgasto["Spanish"]["fecha"] = "Fecha";
	$fieldToolTipsgasto["Spanish"]["fecha"] = "";
	$fieldLabelsgasto["Spanish"]["descripcion"] = "Descripción";
	$fieldToolTipsgasto["Spanish"]["descripcion"] = "";
	$fieldLabelsgasto["Spanish"]["anulado"] = "Anulado";
	$fieldToolTipsgasto["Spanish"]["anulado"] = "";
	$fieldLabelsgasto["Spanish"]["tipo"] = "Tipo";
	$fieldToolTipsgasto["Spanish"]["tipo"] = "";
	$fieldLabelsgasto["Spanish"]["total"] = "Total";
	$fieldToolTipsgasto["Spanish"]["total"] = "";
	$fieldLabelsgasto["Spanish"]["idmovimiento"] = "Nº Mov. de Caja";
	$fieldToolTipsgasto["Spanish"]["idmovimiento"] = "";
	$fieldLabelsgasto["Spanish"]["idconcepto"] = "Concepto gasto";
	$fieldToolTipsgasto["Spanish"]["idconcepto"] = "";
	if (count($fieldToolTipsgasto["Spanish"]))
		$tdatagasto[".isUseToolTips"] = true;
}
	
	
	$tdatagasto[".NCSearch"] = true;



$tdatagasto[".shortTableName"] = "gasto";
$tdatagasto[".nSecOptions"] = 0;
$tdatagasto[".recsPerRowList"] = 1;
$tdatagasto[".mainTableOwnerID"] = "";
$tdatagasto[".moveNext"] = 1;
$tdatagasto[".nType"] = 0;

$tdatagasto[".strOriginalTableName"] = "gasto";




$tdatagasto[".showAddInPopup"] = false;

$tdatagasto[".showEditInPopup"] = false;

$tdatagasto[".showViewInPopup"] = false;

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

	$tdatagasto[".audit"] = false;

	$tdatagasto[".locking"] = false;

$tdatagasto[".edit"] = true;

$tdatagasto[".exportTo"] = true;



$tdatagasto[".showSimpleSearchOptions"] = false;

$tdatagasto[".showSearchPanel"] = true;

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

$tdatagasto[".rowHighlite"] = true;

// button handlers file names

$tdatagasto[".addPageEvents"] = true;

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




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

$tdatagasto[".allSearchFields"][] = "idgasto";
$tdatagasto[".allSearchFields"][] = "idmovimiento";
$tdatagasto[".allSearchFields"][] = "tipo";
$tdatagasto[".allSearchFields"][] = "idconcepto";
$tdatagasto[".allSearchFields"][] = "fecha";
$tdatagasto[".allSearchFields"][] = "descripcion";
$tdatagasto[".allSearchFields"][] = "total";
$tdatagasto[".allSearchFields"][] = "anulado";

$tdatagasto[".googleLikeFields"][] = "idgasto";
$tdatagasto[".googleLikeFields"][] = "tipo";
$tdatagasto[".googleLikeFields"][] = "fecha";
$tdatagasto[".googleLikeFields"][] = "descripcion";
$tdatagasto[".googleLikeFields"][] = "total";
$tdatagasto[".googleLikeFields"][] = "anulado";
$tdatagasto[".googleLikeFields"][] = "idmovimiento";
$tdatagasto[".googleLikeFields"][] = "idconcepto";

$tdatagasto[".panelSearchFields"][] = "idgasto";
$tdatagasto[".panelSearchFields"][] = "idmovimiento";
$tdatagasto[".panelSearchFields"][] = "tipo";
$tdatagasto[".panelSearchFields"][] = "idconcepto";
$tdatagasto[".panelSearchFields"][] = "fecha";
$tdatagasto[".panelSearchFields"][] = "descripcion";

$tdatagasto[".advSearchFields"][] = "idgasto";
$tdatagasto[".advSearchFields"][] = "idmovimiento";
$tdatagasto[".advSearchFields"][] = "tipo";
$tdatagasto[".advSearchFields"][] = "idconcepto";
$tdatagasto[".advSearchFields"][] = "fecha";
$tdatagasto[".advSearchFields"][] = "descripcion";
$tdatagasto[".advSearchFields"][] = "total";
$tdatagasto[".advSearchFields"][] = "anulado";

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

	



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

$tdatagasto[".totalsFields"][] = array(
	"fName" => "total", 
	"numRows" => 0,
	"totalsType" => "TOTAL",
	"viewFormat" => 'Number');

$tdatagasto[".pageSize"] = 20;

$tstrOrderBy = "ORDER BY idgasto DESC";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdatagasto[".strOrderBy"] = $tstrOrderBy;

$tdatagasto[".orderindexes"] = array();
$tdatagasto[".orderindexes"][] = array(1, (0 ? "ASC" : "DESC"), "idgasto");

$tdatagasto[".sqlHead"] = "SELECT idgasto,  tipo,  fecha,  descripcion,  total,  anulado,  idmovimiento,  idconcepto";
$tdatagasto[".sqlFrom"] = "FROM gasto";
$tdatagasto[".sqlWhereExpr"] = "(anulado =\"NO\")";
$tdatagasto[".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;
$tdatagasto[".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;
$tdatagasto[".arrGroupsPerPage"] = $arrGPP;

$tableKeysgasto = array();
$tableKeysgasto[] = "idgasto";
$tdatagasto[".Keys"] = $tableKeysgasto;

$tdatagasto[".listFields"] = array();
$tdatagasto[".listFields"][] = "idgasto";
$tdatagasto[".listFields"][] = "idmovimiento";
$tdatagasto[".listFields"][] = "fecha";
$tdatagasto[".listFields"][] = "tipo";
$tdatagasto[".listFields"][] = "idconcepto";
$tdatagasto[".listFields"][] = "descripcion";
$tdatagasto[".listFields"][] = "total";

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

$tdatagasto[".addFields"] = array();
$tdatagasto[".addFields"][] = "idmovimiento";
$tdatagasto[".addFields"][] = "fecha";
$tdatagasto[".addFields"][] = "tipo";
$tdatagasto[".addFields"][] = "idconcepto";
$tdatagasto[".addFields"][] = "descripcion";
$tdatagasto[".addFields"][] = "total";

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

$tdatagasto[".editFields"] = array();
$tdatagasto[".editFields"][] = "idmovimiento";
$tdatagasto[".editFields"][] = "fecha";
$tdatagasto[".editFields"][] = "tipo";
$tdatagasto[".editFields"][] = "idconcepto";
$tdatagasto[".editFields"][] = "descripcion";
$tdatagasto[".editFields"][] = "anulado";

$tdatagasto[".inlineEditFields"] = array();

$tdatagasto[".exportFields"] = array();
$tdatagasto[".exportFields"][] = "idgasto";
$tdatagasto[".exportFields"][] = "idmovimiento";
$tdatagasto[".exportFields"][] = "tipo";
$tdatagasto[".exportFields"][] = "idconcepto";
$tdatagasto[".exportFields"][] = "fecha";
$tdatagasto[".exportFields"][] = "descripcion";
$tdatagasto[".exportFields"][] = "total";

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

//	idgasto
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "idgasto";
	$fdata["GoodName"] = "idgasto";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Nº Gasto"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idgasto"; 
		$fdata["FullName"] = "idgasto";
	
		
		
				$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"] = "";
			
		
//	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;
	
		
		
	$tdatagasto["idgasto"] = $fdata;
//	tipo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "tipo";
	$fdata["GoodName"] = "tipo";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Tipo"; 
	$fdata["FieldType"] = 200;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "tipo"; 
		$fdata["FullName"] = "tipo";
	
		
		
				$fdata["FieldPermissions"] = true;
	
					
//  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"] = 0;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
		
		$edata["LookupValues"] = array();
	$edata["LookupValues"][] = "FIJOS";
	$edata["LookupValues"][] = "VARIABLES";

	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["tipo"] = $fdata;
//	fecha
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "fecha";
	$fdata["GoodName"] = "fecha";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Fecha"; 
	$fdata["FieldType"] = 7;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "fecha"; 
		$fdata["FullName"] = "fecha";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "Short Date");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

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

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		$edata["DateEditType"] = 11; 
	$edata["InitialYearFactor"] = 100; 
	$edata["LastYearFactor"] = 10; 
	
		
		
		$edata["inputStyle"] = " width:100px;";
	$edata["controlWidth"] = 100;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["fecha"] = $fdata;
//	descripcion
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "descripcion";
	$fdata["GoodName"] = "descripcion";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Descripción"; 
	$fdata["FieldType"] = 201;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "descripcion"; 
		$fdata["FullName"] = "descripcion";
	
		
		
				$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;
	
		
		
	$tdatagasto["descripcion"] = $fdata;
//	total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "total";
	$fdata["GoodName"] = "total";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Total"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "total"; 
		$fdata["FullName"] = "total";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "Number");
	
		
		
		
			
		
		$vdata["DecimalDigits"] = 0;
	
		
		
		
		
		$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["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		$edata["inputStyle"] = " width:160px;";
	$edata["controlWidth"] = 160;
	
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["total"] = $fdata;
//	anulado
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "anulado";
	$fdata["GoodName"] = "anulado";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Anulado"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		
		$fdata["strField"] = "anulado"; 
		$fdata["FullName"] = "anulado";
	
		
		
				$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"] = 0;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
		
		$edata["LookupValues"] = array();
	$edata["LookupValues"][] = "NO";
	$edata["LookupValues"][] = "SI";

	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:80px;";
	$edata["controlWidth"] = 80;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["anulado"] = $fdata;
//	idmovimiento
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "idmovimiento";
	$fdata["GoodName"] = "idmovimiento";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Nº Mov. de Caja"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = 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" => "Readonly");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:80px;";
	$edata["controlWidth"] = 80;
	
//	Begin validation
	$edata["validateAs"] = array();
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["idmovimiento"] = $fdata;
//	idconcepto
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "idconcepto";
	$fdata["GoodName"] = "idconcepto";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Concepto gasto"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idconcepto"; 
		$fdata["FullName"] = "idconcepto";
	
		
		
				$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["LinkField"] = "idconcepto";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "nombre";
	
		
	$edata["LookupTable"] = "concepto_gasto";
	$edata["LookupOrderBy"] = "";
	
		
		
		$edata["UseCategory"] = true; 
	$edata["CategoryControl"] = "tipo"; 
	$edata["CategoryFilter"] = "tipo"; 
	
		
		$edata["AllowToAdd"] = true; 
	
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagasto["idconcepto"] = $fdata;

	
$tables_data["gasto"]=&$tdatagasto;
$field_labels["gasto"] = &$fieldLabelsgasto;
$fieldToolTips["gasto"] = &$fieldToolTipsgasto;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["gasto"] = array();
$dIndex = 1-1;
			$strOriginalDetailsTable="det_gasto";
	$detailsParam["dDataSourceTable"]="det_gasto";
	$detailsParam["dOriginalTable"]=$strOriginalDetailsTable;
	$detailsParam["dShortTable"]="det_gasto";
	$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["gasto"][$dIndex] = $detailsParam;
	
		
		$detailsTablesData["gasto"][$dIndex]["masterKeys"][]="idgasto";
		$detailsTablesData["gasto"][$dIndex]["detailKeys"][]="idgasto";

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

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

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










function createSqlQuery_gasto()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "idgasto,  tipo,  fecha,  descripcion,  total,  anulado,  idmovimiento,  idconcepto";
$proto0["m_strFrom"] = "FROM gasto";
$proto0["m_strWhere"] = "(anulado =\"NO\")";
$proto0["m_strOrderBy"] = "ORDER BY idgasto DESC";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "anulado =\"NO\"";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "anulado",
	"m_strTable" => "gasto"
));

$proto1["m_column"]=$obj;
$proto1["m_contained"] = array();
$proto1["m_strCase"] = "=\"NO\"";
$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" => "idgasto",
	"m_strTable" => "gasto"
));

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

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

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

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

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

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto13=array();
			$obj = new SQLField(array(
	"m_strName" => "total",
	"m_strTable" => "gasto"
));

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

$proto0["m_fieldlist"][]=$obj;
						$proto15=array();
			$obj = new SQLField(array(
	"m_strName" => "anulado",
	"m_strTable" => "gasto"
));

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

$proto0["m_fieldlist"][]=$obj;
						$proto17=array();
			$obj = new SQLField(array(
	"m_strName" => "idmovimiento",
	"m_strTable" => "gasto"
));

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

$proto0["m_fieldlist"][]=$obj;
						$proto19=array();
			$obj = new SQLField(array(
	"m_strName" => "idconcepto",
	"m_strTable" => "gasto"
));

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

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto21=array();
$proto21["m_link"] = "SQLL_MAIN";
			$proto22=array();
$proto22["m_strName"] = "gasto";
$proto22["m_columns"] = array();
$proto22["m_columns"][] = "idgasto";
$proto22["m_columns"][] = "idmovimiento";
$proto22["m_columns"][] = "tipo";
$proto22["m_columns"][] = "idconcepto";
$proto22["m_columns"][] = "fecha";
$proto22["m_columns"][] = "descripcion";
$proto22["m_columns"][] = "total";
$proto22["m_columns"][] = "anulado";
$obj = new SQLTable($proto22);

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

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
												$proto25=array();
						$obj = new SQLField(array(
	"m_strName" => "idgasto",
	"m_strTable" => "gasto"
));

$proto25["m_column"]=$obj;
$proto25["m_bAsc"] = 0;
$proto25["m_nColumn"] = 0;
$obj = new SQLOrderByItem($proto25);

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

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

include_once(getabspath("include/gasto_events.php"));
$tableEvents["gasto"] = new eventclass_gasto;
$tdatagasto[".hasEvents"] = true;

$cipherer = new RunnerCipherer("gasto");

?>