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

//	field labels
$fieldLabelsgastos = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsgastos["Spanish"] = array();
	$fieldToolTipsgastos["Spanish"] = array();
	$fieldLabelsgastos["Spanish"]["idtransaccion"] = "ID";
	$fieldToolTipsgastos["Spanish"]["idtransaccion"] = "";
	$fieldLabelsgastos["Spanish"]["fecha"] = "Fecha";
	$fieldToolTipsgastos["Spanish"]["fecha"] = "";
	$fieldLabelsgastos["Spanish"]["cliente"] = "Proveedor ó Beneficiario";
	$fieldToolTipsgastos["Spanish"]["cliente"] = "";
	$fieldLabelsgastos["Spanish"]["idarticulo"] = "Artículo";
	$fieldToolTipsgastos["Spanish"]["idarticulo"] = "";
	$fieldLabelsgastos["Spanish"]["costo"] = "Costo";
	$fieldToolTipsgastos["Spanish"]["costo"] = "";
	$fieldLabelsgastos["Spanish"]["precio"] = "Precio";
	$fieldToolTipsgastos["Spanish"]["precio"] = "";
	$fieldLabelsgastos["Spanish"]["cant"] = "Cant";
	$fieldToolTipsgastos["Spanish"]["cant"] = "";
	$fieldLabelsgastos["Spanish"]["total"] = "Total";
	$fieldToolTipsgastos["Spanish"]["total"] = "";
	$fieldLabelsgastos["Spanish"]["descuento"] = "Descuento";
	$fieldToolTipsgastos["Spanish"]["descuento"] = "";
	$fieldLabelsgastos["Spanish"]["cobrado"] = "Cobrado";
	$fieldToolTipsgastos["Spanish"]["cobrado"] = "";
	$fieldLabelsgastos["Spanish"]["anulado"] = "Anulado";
	$fieldToolTipsgastos["Spanish"]["anulado"] = "";
	$fieldLabelsgastos["Spanish"]["tipo"] = "Tipo";
	$fieldToolTipsgastos["Spanish"]["tipo"] = "";
	$fieldLabelsgastos["Spanish"]["observacion"] = "Observacion";
	$fieldToolTipsgastos["Spanish"]["observacion"] = "";
	$fieldLabelsgastos["Spanish"]["importe"] = "Importe";
	$fieldToolTipsgastos["Spanish"]["importe"] = "";
	if (count($fieldToolTipsgastos["Spanish"]))
		$tdatagastos[".isUseToolTips"] = true;
}
	
	
	$tdatagastos[".NCSearch"] = true;



$tdatagastos[".shortTableName"] = "gastos";
$tdatagastos[".nSecOptions"] = 0;
$tdatagastos[".recsPerRowList"] = 1;
$tdatagastos[".mainTableOwnerID"] = "";
$tdatagastos[".moveNext"] = 1;
$tdatagastos[".nType"] = 1;

$tdatagastos[".strOriginalTableName"] = "transaccion";




$tdatagastos[".showAddInPopup"] = true;

$tdatagastos[".showEditInPopup"] = true;

$tdatagastos[".showViewInPopup"] = false;

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

	$tdatagastos[".audit"] = false;

	$tdatagastos[".locking"] = false;

$tdatagastos[".edit"] = true;

$tdatagastos[".exportTo"] = true;



$tdatagastos[".showSimpleSearchOptions"] = false;

$tdatagastos[".showSearchPanel"] = true;

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

$tdatagastos[".rowHighlite"] = true;

// button handlers file names

$tdatagastos[".addPageEvents"] = false;

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




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

$tdatagastos[".allSearchFields"][] = "importe";
$tdatagastos[".allSearchFields"][] = "tipo";
$tdatagastos[".allSearchFields"][] = "idtransaccion";
$tdatagastos[".allSearchFields"][] = "fecha";
$tdatagastos[".allSearchFields"][] = "cliente";
$tdatagastos[".allSearchFields"][] = "idarticulo";
$tdatagastos[".allSearchFields"][] = "costo";
$tdatagastos[".allSearchFields"][] = "precio";
$tdatagastos[".allSearchFields"][] = "cant";
$tdatagastos[".allSearchFields"][] = "total";
$tdatagastos[".allSearchFields"][] = "descuento";
$tdatagastos[".allSearchFields"][] = "observacion";
$tdatagastos[".allSearchFields"][] = "cobrado";
$tdatagastos[".allSearchFields"][] = "anulado";

$tdatagastos[".googleLikeFields"][] = "idtransaccion";
$tdatagastos[".googleLikeFields"][] = "tipo";
$tdatagastos[".googleLikeFields"][] = "fecha";
$tdatagastos[".googleLikeFields"][] = "cliente";
$tdatagastos[".googleLikeFields"][] = "idarticulo";
$tdatagastos[".googleLikeFields"][] = "costo";
$tdatagastos[".googleLikeFields"][] = "precio";
$tdatagastos[".googleLikeFields"][] = "cant";
$tdatagastos[".googleLikeFields"][] = "total";
$tdatagastos[".googleLikeFields"][] = "importe";
$tdatagastos[".googleLikeFields"][] = "descuento";
$tdatagastos[".googleLikeFields"][] = "observacion";
$tdatagastos[".googleLikeFields"][] = "cobrado";
$tdatagastos[".googleLikeFields"][] = "anulado";


$tdatagastos[".advSearchFields"][] = "importe";
$tdatagastos[".advSearchFields"][] = "tipo";
$tdatagastos[".advSearchFields"][] = "idtransaccion";
$tdatagastos[".advSearchFields"][] = "fecha";
$tdatagastos[".advSearchFields"][] = "cliente";
$tdatagastos[".advSearchFields"][] = "idarticulo";
$tdatagastos[".advSearchFields"][] = "costo";
$tdatagastos[".advSearchFields"][] = "precio";
$tdatagastos[".advSearchFields"][] = "cant";
$tdatagastos[".advSearchFields"][] = "total";
$tdatagastos[".advSearchFields"][] = "descuento";
$tdatagastos[".advSearchFields"][] = "observacion";
$tdatagastos[".advSearchFields"][] = "cobrado";
$tdatagastos[".advSearchFields"][] = "anulado";

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

	



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



$tdatagastos[".pageSize"] = 20;

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

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

$tdatagastos[".sqlHead"] = "SELECT idtransaccion,  tipo,  fecha,  cliente,  idarticulo,  costo,  precio,  cant,  total,  importe,  descuento,  observacion,  cobrado,  anulado";
$tdatagastos[".sqlFrom"] = "FROM transaccion";
$tdatagastos[".sqlWhereExpr"] = "(tipo =\"GASTO\")";
$tdatagastos[".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;
$tdatagastos[".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;
$tdatagastos[".arrGroupsPerPage"] = $arrGPP;

$tableKeysgastos = array();
$tableKeysgastos[] = "idtransaccion";
$tdatagastos[".Keys"] = $tableKeysgastos;

$tdatagastos[".listFields"] = array();
$tdatagastos[".listFields"][] = "idtransaccion";
$tdatagastos[".listFields"][] = "fecha";
$tdatagastos[".listFields"][] = "cliente";
$tdatagastos[".listFields"][] = "cant";
$tdatagastos[".listFields"][] = "importe";
$tdatagastos[".listFields"][] = "observacion";

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

$tdatagastos[".addFields"] = array();
$tdatagastos[".addFields"][] = "tipo";
$tdatagastos[".addFields"][] = "fecha";
$tdatagastos[".addFields"][] = "cliente";
$tdatagastos[".addFields"][] = "importe";
$tdatagastos[".addFields"][] = "total";
$tdatagastos[".addFields"][] = "observacion";

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

$tdatagastos[".editFields"] = array();
$tdatagastos[".editFields"][] = "importe";
$tdatagastos[".editFields"][] = "tipo";
$tdatagastos[".editFields"][] = "fecha";
$tdatagastos[".editFields"][] = "cliente";
$tdatagastos[".editFields"][] = "total";
$tdatagastos[".editFields"][] = "observacion";

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

$tdatagastos[".exportFields"] = array();
$tdatagastos[".exportFields"][] = "importe";
$tdatagastos[".exportFields"][] = "idtransaccion";
$tdatagastos[".exportFields"][] = "tipo";
$tdatagastos[".exportFields"][] = "fecha";
$tdatagastos[".exportFields"][] = "cliente";
$tdatagastos[".exportFields"][] = "idarticulo";
$tdatagastos[".exportFields"][] = "costo";
$tdatagastos[".exportFields"][] = "precio";
$tdatagastos[".exportFields"][] = "cant";
$tdatagastos[".exportFields"][] = "total";
$tdatagastos[".exportFields"][] = "descuento";
$tdatagastos[".exportFields"][] = "observacion";
$tdatagastos[".exportFields"][] = "cobrado";
$tdatagastos[".exportFields"][] = "anulado";

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

//	idtransaccion
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "idtransaccion";
	$fdata["GoodName"] = "idtransaccion";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "ID"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idtransaccion"; 
		$fdata["FullName"] = "idtransaccion";
	
		
		
				$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;
	
		
		
	$tdatagastos["idtransaccion"] = $fdata;
//	tipo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "tipo";
	$fdata["GoodName"] = "tipo";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Tipo"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "tipo"; 
		$fdata["FullName"] = "tipo";
	
		
		
				$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;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagastos["tipo"] = $fdata;
//	fecha
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "fecha";
	$fdata["GoodName"] = "fecha";
	$fdata["ownerTable"] = "transaccion";
	$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;
	
		
		
	$tdatagastos["fecha"] = $fdata;
//	cliente
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "cliente";
	$fdata["GoodName"] = "cliente";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Proveedor ó Beneficiario"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cliente"; 
		$fdata["FullName"] = "cliente";
	
		
		
				$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();
				if(strpos(GetUserPermissions("gastos"), 'S') !== false)
		$edata["LCType"] = 2;
	else 
		$edata["LCType"] = 0;
			
		
			
	$edata["LinkField"] = "idbeneficiario";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "denominacion";
	
		
	$edata["LookupTable"] = "cliente";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		
				
	
	
	//	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;
	
		
		
	$tdatagastos["cliente"] = $fdata;
//	idarticulo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "idarticulo";
	$fdata["GoodName"] = "idarticulo";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Artículo"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idarticulo"; 
		$fdata["FullName"] = "idarticulo";
	
		
		
				$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();
				if(strpos(GetUserPermissions("gastos"), 'S') !== false)
		$edata["LCType"] = 2;
	else 
		$edata["LCType"] = 0;
			
		
			
	$edata["LinkField"] = "idarticulo";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "nombre";
	
		
	$edata["LookupTable"] = "articulo";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		
				
	
	
	//	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;
	
		
		
	$tdatagastos["idarticulo"] = $fdata;
//	costo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "costo";
	$fdata["GoodName"] = "costo";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Costo"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "costo"; 
		$fdata["FullName"] = "costo";
	
		
		
				$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;
	
		
		
	$tdatagastos["costo"] = $fdata;
//	precio
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "precio";
	$fdata["GoodName"] = "precio";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Precio"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "precio"; 
		$fdata["FullName"] = "precio";
	
		
		
				$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;
	
		
		
	$tdatagastos["precio"] = $fdata;
//	cant
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "cant";
	$fdata["GoodName"] = "cant";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Cant"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cant"; 
		$fdata["FullName"] = "cant";
	
		
		
				$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;
	
		
		
	$tdatagastos["cant"] = $fdata;
//	total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "total";
	$fdata["GoodName"] = "total";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Total"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = 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" => "");
	
		
		
		
			
		
		
		
		
		
		
		$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:80px;";
	$edata["controlWidth"] = 80;
	
//	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;
	
		
		
	$tdatagastos["total"] = $fdata;
//	importe
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "importe";
	$fdata["GoodName"] = "importe";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Importe"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "importe"; 
		$fdata["FullName"] = "importe";
	
		
		
				$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["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		$edata["inputStyle"] = " width:80px;";
	$edata["controlWidth"] = 80;
	
//	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;
	
		
		
	$tdatagastos["importe"] = $fdata;
//	descuento
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "descuento";
	$fdata["GoodName"] = "descuento";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Descuento"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "descuento"; 
		$fdata["FullName"] = "descuento";
	
		
		
				$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;
	
		
		
	$tdatagastos["descuento"] = $fdata;
//	observacion
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 12;
	$fdata["strName"] = "observacion";
	$fdata["GoodName"] = "observacion";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Observacion"; 
	$fdata["FieldType"] = 201;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = 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;
	
		
		
	$tdatagastos["observacion"] = $fdata;
//	cobrado
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 13;
	$fdata["strName"] = "cobrado";
	$fdata["GoodName"] = "cobrado";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Cobrado"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cobrado"; 
		$fdata["FullName"] = "cobrado";
	
		
		
				$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"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagastos["cobrado"] = $fdata;
//	anulado
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 14;
	$fdata["strName"] = "anulado";
	$fdata["GoodName"] = "anulado";
	$fdata["ownerTable"] = "transaccion";
	$fdata["Label"] = "Anulado"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = 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" => "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"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatagastos["anulado"] = $fdata;

	
$tables_data["gastos"]=&$tdatagastos;
$field_labels["gastos"] = &$fieldLabelsgastos;
$fieldToolTips["gastos"] = &$fieldToolTipsgastos;

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

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

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










function createSqlQuery_gastos()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "idtransaccion,  tipo,  fecha,  cliente,  idarticulo,  costo,  precio,  cant,  total,  importe,  descuento,  observacion,  cobrado,  anulado";
$proto0["m_strFrom"] = "FROM transaccion";
$proto0["m_strWhere"] = "(tipo =\"GASTO\")";
$proto0["m_strOrderBy"] = "ORDER BY idtransaccion DESC";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "tipo =\"GASTO\"";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "tipo",
	"m_strTable" => "transaccion"
));

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

$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" => "transaccion"
));

$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" => "transaccion"
));

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

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

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

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

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

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

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

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

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

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

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

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto23=array();
			$obj = new SQLField(array(
	"m_strName" => "importe",
	"m_strTable" => "transaccion"
));

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

$proto0["m_fieldlist"][]=$obj;
						$proto25=array();
			$obj = new SQLField(array(
	"m_strName" => "descuento",
	"m_strTable" => "transaccion"
));

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

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto29=array();
			$obj = new SQLField(array(
	"m_strName" => "cobrado",
	"m_strTable" => "transaccion"
));

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

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

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

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto33=array();
$proto33["m_link"] = "SQLL_MAIN";
			$proto34=array();
$proto34["m_strName"] = "transaccion";
$proto34["m_columns"] = array();
$proto34["m_columns"][] = "idtransaccion";
$proto34["m_columns"][] = "tipo";
$proto34["m_columns"][] = "fecha";
$proto34["m_columns"][] = "cliente";
$proto34["m_columns"][] = "idarticulo";
$proto34["m_columns"][] = "costo";
$proto34["m_columns"][] = "precio";
$proto34["m_columns"][] = "cant";
$proto34["m_columns"][] = "total";
$proto34["m_columns"][] = "importe";
$proto34["m_columns"][] = "descuento";
$proto34["m_columns"][] = "ganancia";
$proto34["m_columns"][] = "observacion";
$proto34["m_columns"][] = "cobrado";
$proto34["m_columns"][] = "anulado";
$obj = new SQLTable($proto34);

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

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
												$proto37=array();
						$obj = new SQLField(array(
	"m_strName" => "idtransaccion",
	"m_strTable" => "transaccion"
));

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

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

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

$tableEvents["gastos"] = new eventsBase;
$tdatagastos[".hasEvents"] = false;

$cipherer = new RunnerCipherer("gastos");

?>