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

//	field labels
$fieldLabelsventa = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsventa["Spanish"] = array();
	$fieldToolTipsventa["Spanish"] = array();
	$fieldLabelsventa["Spanish"]["idventa"] = "Nº venta";
	$fieldToolTipsventa["Spanish"]["idventa"] = "";
	$fieldLabelsventa["Spanish"]["fecha"] = "Fecha";
	$fieldToolTipsventa["Spanish"]["fecha"] = "";
	$fieldLabelsventa["Spanish"]["cliente"] = "Cliente";
	$fieldToolTipsventa["Spanish"]["cliente"] = "";
	$fieldLabelsventa["Spanish"]["observacion"] = "Observación";
	$fieldToolTipsventa["Spanish"]["observacion"] = "";
	$fieldLabelsventa["Spanish"]["cobrada"] = "Cobrada";
	$fieldToolTipsventa["Spanish"]["cobrada"] = "";
	$fieldLabelsventa["Spanish"]["anulada"] = "Anulada";
	$fieldToolTipsventa["Spanish"]["anulada"] = "";
	$fieldLabelsventa["Spanish"]["total_venta"] = "Total Venta";
	$fieldToolTipsventa["Spanish"]["total_venta"] = "";
	$fieldLabelsventa["Spanish"]["total_cobro"] = "Total Cobro";
	$fieldToolTipsventa["Spanish"]["total_cobro"] = "";
	if (count($fieldToolTipsventa["Spanish"]))
		$tdataventa[".isUseToolTips"] = true;
}
	
	
	$tdataventa[".NCSearch"] = true;



$tdataventa[".shortTableName"] = "venta";
$tdataventa[".nSecOptions"] = 0;
$tdataventa[".recsPerRowList"] = 1;
$tdataventa[".mainTableOwnerID"] = "";
$tdataventa[".moveNext"] = 1;
$tdataventa[".nType"] = 0;

$tdataventa[".strOriginalTableName"] = "venta";




$tdataventa[".showAddInPopup"] = false;

$tdataventa[".showEditInPopup"] = false;

$tdataventa[".showViewInPopup"] = false;

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

	$tdataventa[".audit"] = false;

	$tdataventa[".locking"] = false;

$tdataventa[".edit"] = true;
$tdataventa[".view"] = true;

$tdataventa[".exportTo"] = true;



$tdataventa[".showSimpleSearchOptions"] = false;

$tdataventa[".showSearchPanel"] = true;

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

$tdataventa[".rowHighlite"] = true;

// button handlers file names

$tdataventa[".addPageEvents"] = true;

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




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

$tdataventa[".allSearchFields"][] = "idventa";
$tdataventa[".allSearchFields"][] = "fecha";
$tdataventa[".allSearchFields"][] = "cliente";
$tdataventa[".allSearchFields"][] = "total_venta";
$tdataventa[".allSearchFields"][] = "total_cobro";
$tdataventa[".allSearchFields"][] = "observacion";
$tdataventa[".allSearchFields"][] = "cobrada";

$tdataventa[".googleLikeFields"][] = "total_venta";
$tdataventa[".googleLikeFields"][] = "total_cobro";
$tdataventa[".googleLikeFields"][] = "cobrada";

$tdataventa[".panelSearchFields"][] = "idventa";
$tdataventa[".panelSearchFields"][] = "fecha";
$tdataventa[".panelSearchFields"][] = "cliente";
$tdataventa[".panelSearchFields"][] = "observacion";
$tdataventa[".panelSearchFields"][] = "cobrada";

$tdataventa[".advSearchFields"][] = "idventa";
$tdataventa[".advSearchFields"][] = "fecha";
$tdataventa[".advSearchFields"][] = "cliente";
$tdataventa[".advSearchFields"][] = "total_venta";
$tdataventa[".advSearchFields"][] = "total_cobro";
$tdataventa[".advSearchFields"][] = "observacion";
$tdataventa[".advSearchFields"][] = "cobrada";

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

	



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

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

$tdataventa[".pageSize"] = 20;

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

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

$tdataventa[".sqlHead"] = "SELECT idventa,  fecha,  cliente,  total_venta,  total_cobro,  observacion,  cobrada,  anulada";
$tdataventa[".sqlFrom"] = "FROM venta";
$tdataventa[".sqlWhereExpr"] = "(anulada =\"NO\")";
$tdataventa[".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;
$tdataventa[".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;
$tdataventa[".arrGroupsPerPage"] = $arrGPP;

$tableKeysventa = array();
$tableKeysventa[] = "idventa";
$tdataventa[".Keys"] = $tableKeysventa;

$tdataventa[".listFields"] = array();
$tdataventa[".listFields"][] = "idventa";
$tdataventa[".listFields"][] = "fecha";
$tdataventa[".listFields"][] = "cliente";
$tdataventa[".listFields"][] = "total_venta";
$tdataventa[".listFields"][] = "total_cobro";
$tdataventa[".listFields"][] = "observacion";
$tdataventa[".listFields"][] = "cobrada";

$tdataventa[".viewFields"] = array();
$tdataventa[".viewFields"][] = "idventa";
$tdataventa[".viewFields"][] = "fecha";
$tdataventa[".viewFields"][] = "cliente";
$tdataventa[".viewFields"][] = "total_venta";
$tdataventa[".viewFields"][] = "total_cobro";
$tdataventa[".viewFields"][] = "observacion";
$tdataventa[".viewFields"][] = "cobrada";
$tdataventa[".viewFields"][] = "anulada";

$tdataventa[".addFields"] = array();
$tdataventa[".addFields"][] = "fecha";
$tdataventa[".addFields"][] = "cliente";
$tdataventa[".addFields"][] = "total_venta";
$tdataventa[".addFields"][] = "total_cobro";
$tdataventa[".addFields"][] = "observacion";

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

$tdataventa[".editFields"] = array();
$tdataventa[".editFields"][] = "fecha";
$tdataventa[".editFields"][] = "cliente";
$tdataventa[".editFields"][] = "observacion";
$tdataventa[".editFields"][] = "anulada";

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

$tdataventa[".exportFields"] = array();
$tdataventa[".exportFields"][] = "idventa";
$tdataventa[".exportFields"][] = "fecha";
$tdataventa[".exportFields"][] = "cliente";
$tdataventa[".exportFields"][] = "total_venta";
$tdataventa[".exportFields"][] = "total_cobro";
$tdataventa[".exportFields"][] = "observacion";
$tdataventa[".exportFields"][] = "cobrada";

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

//	idventa
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "idventa";
	$fdata["GoodName"] = "idventa";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Nº venta"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idventa"; 
		$fdata["FullName"] = "idventa";
	
		
		
				$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;
	
		
		
	$tdataventa["idventa"] = $fdata;
//	fecha
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "fecha";
	$fdata["GoodName"] = "fecha";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Fecha"; 
	$fdata["FieldType"] = 7;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		$fdata["bViewPage"] = 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;
	
		
		
	$tdataventa["fecha"] = $fdata;
//	cliente
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "cliente";
	$fdata["GoodName"] = "cliente";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Cliente"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		$fdata["bViewPage"] = 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("venta"), 'S') !== false)
		$edata["LCType"] = 2;
	else 
		$edata["LCType"] = 0;
			
		
			
	$edata["LinkField"] = "idcliente";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "denominacion";
	
		
	$edata["LookupTable"] = "v_cliente";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		$edata["AllowToAdd"] = true; 
	
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:250px;";
	$edata["controlWidth"] = 250;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataventa["cliente"] = $fdata;
//	total_venta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "total_venta";
	$fdata["GoodName"] = "total_venta";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Total Venta"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "total_venta"; 
		$fdata["FullName"] = "total_venta";
	
		
		
				$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:160px;";
	$edata["controlWidth"] = 160;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataventa["total_venta"] = $fdata;
//	total_cobro
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "total_cobro";
	$fdata["GoodName"] = "total_cobro";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Total Cobro"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "total_cobro"; 
		$fdata["FullName"] = "total_cobro";
	
		
		
				$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:160px;";
	$edata["controlWidth"] = 160;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataventa["total_cobro"] = $fdata;
//	observacion
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "observacion";
	$fdata["GoodName"] = "observacion";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Observación"; 
	$fdata["FieldType"] = 201;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		$fdata["bEditPage"] = true; 
	
		
		$fdata["bViewPage"] = 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"] = 60;
			$edata["nCols"] = 400;
	
		
		
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataventa["observacion"] = $fdata;
//	cobrada
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "cobrada";
	$fdata["GoodName"] = "cobrada";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Cobrada"; 
	$fdata["FieldType"] = 200;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cobrada"; 
		$fdata["FullName"] = "cobrada";
	
		
		
				$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["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataventa["cobrada"] = $fdata;
//	anulada
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "anulada";
	$fdata["GoodName"] = "anulada";
	$fdata["ownerTable"] = "venta";
	$fdata["Label"] = "Anulada"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		$fdata["bEditPage"] = true; 
	
		
		$fdata["bViewPage"] = true; 
	
		
		
		
		$fdata["strField"] = "anulada"; 
		$fdata["FullName"] = "anulada";
	
		
		
				$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;
	
		
		
	$tdataventa["anulada"] = $fdata;

	
$tables_data["venta"]=&$tdataventa;
$field_labels["venta"] = &$fieldLabelsventa;
$fieldToolTips["venta"] = &$fieldToolTipsventa;

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

$dIndex = 2-1;
			$strOriginalDetailsTable="cobro";
	$detailsParam["dDataSourceTable"]="cobro";
	$detailsParam["dOriginalTable"]=$strOriginalDetailsTable;
	$detailsParam["dShortTable"]="cobro";
	$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["venta"][$dIndex] = $detailsParam;
	
		
		$detailsTablesData["venta"][$dIndex]["masterKeys"][]="idventa";
		$detailsTablesData["venta"][$dIndex]["detailKeys"][]="idventa";

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

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

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










function createSqlQuery_venta()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "idventa,  fecha,  cliente,  total_venta,  total_cobro,  observacion,  cobrada,  anulada";
$proto0["m_strFrom"] = "FROM venta";
$proto0["m_strWhere"] = "(anulada =\"NO\")";
$proto0["m_strOrderBy"] = "ORDER BY idventa DESC";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "anulada =\"NO\"";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "anulada",
	"m_strTable" => "venta"
));

$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" => "idventa",
	"m_strTable" => "venta"
));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$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"] = "venta";
$proto22["m_columns"] = array();
$proto22["m_columns"][] = "idventa";
$proto22["m_columns"][] = "fecha";
$proto22["m_columns"][] = "cliente";
$proto22["m_columns"][] = "total_venta";
$proto22["m_columns"][] = "total_cobro";
$proto22["m_columns"][] = "observacion";
$proto22["m_columns"][] = "cobrada";
$proto22["m_columns"][] = "anulada";
$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" => "idventa",
	"m_strTable" => "venta"
));

$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_venta = createSqlQuery_venta();
								$tdataventa[".sqlquery"] = $queryData_venta;
	
if(isset($tdataventa["field2"])){
	$tdataventa["field2"]["LookupTable"] = "carscars_view";
	$tdataventa["field2"]["LookupOrderBy"] = "name";
	$tdataventa["field2"]["LookupType"] = 4;
	$tdataventa["field2"]["LinkField"] = "email";
	$tdataventa["field2"]["DisplayField"] = "name";
	$tdataventa[".hasCustomViewField"] = true;
}

include_once(getabspath("include/venta_events.php"));
$tableEvents["venta"] = new eventclass_venta;
$tdataventa[".hasEvents"] = true;

$cipherer = new RunnerCipherer("venta");

?>