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

//	field labels
$fieldLabelsinf_gastos = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsinf_gastos["Spanish"] = array();
	$fieldToolTipsinf_gastos["Spanish"] = array();
	$fieldLabelsinf_gastos["Spanish"]["idgasto"] = "Nº Gasto";
	$fieldToolTipsinf_gastos["Spanish"]["idgasto"] = "";
	$fieldLabelsinf_gastos["Spanish"]["fecha"] = "Fecha";
	$fieldToolTipsinf_gastos["Spanish"]["fecha"] = "";
	$fieldLabelsinf_gastos["Spanish"]["descripcion"] = "Descripción";
	$fieldToolTipsinf_gastos["Spanish"]["descripcion"] = "";
	$fieldLabelsinf_gastos["Spanish"]["anulado"] = "Anulado";
	$fieldToolTipsinf_gastos["Spanish"]["anulado"] = "";
	$fieldLabelsinf_gastos["Spanish"]["tipo"] = "Tipo";
	$fieldToolTipsinf_gastos["Spanish"]["tipo"] = "";
	$fieldLabelsinf_gastos["Spanish"]["total"] = "Total";
	$fieldToolTipsinf_gastos["Spanish"]["total"] = "";
	$fieldLabelsinf_gastos["Spanish"]["idmovimiento"] = "Nº Movimiento";
	$fieldToolTipsinf_gastos["Spanish"]["idmovimiento"] = "";
	$fieldLabelsinf_gastos["Spanish"]["idconcepto"] = "Concepto gasto";
	$fieldToolTipsinf_gastos["Spanish"]["idconcepto"] = "";
	$fieldLabelsinf_gastos["Spanish"]["idcuenta"] = "Cuenta";
	$fieldToolTipsinf_gastos["Spanish"]["idcuenta"] = "";
	if (count($fieldToolTipsinf_gastos["Spanish"]))
		$tdatainf_gastos[".isUseToolTips"] = true;
}
	
	
	$tdatainf_gastos[".NCSearch"] = true;



$tdatainf_gastos[".shortTableName"] = "inf_gastos";
$tdatainf_gastos[".nSecOptions"] = 0;
$tdatainf_gastos[".recsPerRowList"] = 1;
$tdatainf_gastos[".mainTableOwnerID"] = "";
$tdatainf_gastos[".moveNext"] = 1;
$tdatainf_gastos[".nType"] = 1;

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




$tdatainf_gastos[".showAddInPopup"] = false;

$tdatainf_gastos[".showEditInPopup"] = false;

$tdatainf_gastos[".showViewInPopup"] = false;

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

	$tdatainf_gastos[".audit"] = false;

	$tdatainf_gastos[".locking"] = false;


$tdatainf_gastos[".exportTo"] = true;

$tdatainf_gastos[".printFriendly"] = true;


$tdatainf_gastos[".showSimpleSearchOptions"] = false;

$tdatainf_gastos[".showSearchPanel"] = true;

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

$tdatainf_gastos[".rowHighlite"] = true;

// button handlers file names
$tdatainf_gastos[".isUsebuttonHandlers"] = true;

$tdatainf_gastos[".addPageEvents"] = true;

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




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

$tdatainf_gastos[".allSearchFields"][] = "fecha";
$tdatainf_gastos[".allSearchFields"][] = "idgasto";
$tdatainf_gastos[".allSearchFields"][] = "idmovimiento";
$tdatainf_gastos[".allSearchFields"][] = "idcuenta";
$tdatainf_gastos[".allSearchFields"][] = "tipo";
$tdatainf_gastos[".allSearchFields"][] = "idconcepto";
$tdatainf_gastos[".allSearchFields"][] = "descripcion";
$tdatainf_gastos[".allSearchFields"][] = "total";

$tdatainf_gastos[".googleLikeFields"][] = "idgasto";
$tdatainf_gastos[".googleLikeFields"][] = "tipo";
$tdatainf_gastos[".googleLikeFields"][] = "fecha";
$tdatainf_gastos[".googleLikeFields"][] = "descripcion";
$tdatainf_gastos[".googleLikeFields"][] = "total";
$tdatainf_gastos[".googleLikeFields"][] = "idmovimiento";
$tdatainf_gastos[".googleLikeFields"][] = "idconcepto";
$tdatainf_gastos[".googleLikeFields"][] = "idcuenta";

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

$tdatainf_gastos[".advSearchFields"][] = "fecha";
$tdatainf_gastos[".advSearchFields"][] = "idgasto";
$tdatainf_gastos[".advSearchFields"][] = "idmovimiento";
$tdatainf_gastos[".advSearchFields"][] = "idcuenta";
$tdatainf_gastos[".advSearchFields"][] = "tipo";
$tdatainf_gastos[".advSearchFields"][] = "idconcepto";
$tdatainf_gastos[".advSearchFields"][] = "descripcion";
$tdatainf_gastos[".advSearchFields"][] = "total";

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

	



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


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

$tdatainf_gastos[".pageSize"] = 20;

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

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

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

$tableKeysinf_gastos = array();
$tableKeysinf_gastos[] = "idgasto";
$tdatainf_gastos[".Keys"] = $tableKeysinf_gastos;

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

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

$tdatainf_gastos[".addFields"] = array();

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

$tdatainf_gastos[".editFields"] = array();

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

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

$tdatainf_gastos[".printFields"] = array();
$tdatainf_gastos[".printFields"][] = "fecha";
$tdatainf_gastos[".printFields"][] = "idgasto";
$tdatainf_gastos[".printFields"][] = "idmovimiento";
$tdatainf_gastos[".printFields"][] = "idcuenta";
$tdatainf_gastos[".printFields"][] = "tipo";
$tdatainf_gastos[".printFields"][] = "idconcepto";
$tdatainf_gastos[".printFields"][] = "descripcion";
$tdatainf_gastos[".printFields"][] = "total";

//	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["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idgasto"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "tipo"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "fecha"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "descripcion"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "total"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["strField"] = "anulado"; 
		$fdata["FullName"] = "gasto.anulado";
	
		
		
				
				$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;
	
		
		
	$tdatainf_gastos["anulado"] = $fdata;
//	idmovimiento
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "idmovimiento";
	$fdata["GoodName"] = "idmovimiento";
	$fdata["ownerTable"] = "gasto";
	$fdata["Label"] = "Nº Movimiento"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idmovimiento"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["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["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idconcepto"; 
		$fdata["FullName"] = "gasto.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;
	
		
		
	$tdatainf_gastos["idconcepto"] = $fdata;
//	idcuenta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "idcuenta";
	$fdata["GoodName"] = "idcuenta";
	$fdata["ownerTable"] = "det_gasto";
	$fdata["Label"] = "Cuenta"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idcuenta"; 
		$fdata["FullName"] = "det_gasto.idcuenta";
	
		
		
				$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"] = "idcuenta";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "denominacion";
	
		
	$edata["LookupTable"] = "cuenta";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		
				
	
	
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatainf_gastos["idcuenta"] = $fdata;

	
$tables_data["inf_gastos"]=&$tdatainf_gastos;
$field_labels["inf_gastos"] = &$fieldLabelsinf_gastos;
$fieldToolTips["inf_gastos"] = &$fieldToolTipsinf_gastos;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["inf_gastos"] = array();
	
// tables which are master tables for current table (detail)
$masterTablesData["inf_gastos"] = array();

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

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










function createSqlQuery_inf_gastos()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "gasto.idgasto,  gasto.tipo,  gasto.fecha,  gasto.descripcion,  gasto.total,  gasto.anulado,  gasto.idmovimiento,  gasto.idconcepto,  det_gasto.idcuenta";
$proto0["m_strFrom"] = "FROM gasto  INNER JOIN det_gasto ON gasto.idgasto = det_gasto.idgasto";
$proto0["m_strWhere"] = "(gasto.anulado =\"NO\")";
$proto0["m_strOrderBy"] = "ORDER BY gasto.idgasto DESC";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "gasto.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;
						$proto21=array();
			$obj = new SQLField(array(
	"m_strName" => "idcuenta",
	"m_strTable" => "det_gasto"
));

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

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

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

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

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

$proto0["m_fromlist"][]=$obj;
												$proto27=array();
$proto27["m_link"] = "SQLL_INNERJOIN";
			$proto28=array();
$proto28["m_strName"] = "det_gasto";
$proto28["m_columns"] = array();
$proto28["m_columns"][] = "iddet_gasto";
$proto28["m_columns"][] = "idgasto";
$proto28["m_columns"][] = "idcuenta";
$proto28["m_columns"][] = "idtipo_cuenta";
$proto28["m_columns"][] = "importe";
$proto28["m_columns"][] = "anulado";
$obj = new SQLTable($proto28);

$proto27["m_table"] = $obj;
$proto27["m_alias"] = "";
$proto29=array();
$proto29["m_sql"] = "gasto.idgasto = det_gasto.idgasto";
$proto29["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "idgasto",
	"m_strTable" => "gasto"
));

$proto29["m_column"]=$obj;
$proto29["m_contained"] = array();
$proto29["m_strCase"] = "= det_gasto.idgasto";
$proto29["m_havingmode"] = "0";
$proto29["m_inBrackets"] = "0";
$proto29["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto29);

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

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

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

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

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

include_once(getabspath("include/inf_gastos_events.php"));
$tableEvents["inf_gastos"] = new eventclass_inf_gastos;
$tdatainf_gastos[".hasEvents"] = true;

$cipherer = new RunnerCipherer("inf_gastos");

?>