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

//	field labels
$fieldLabelsdet_venta = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsdet_venta["Spanish"] = array();
	$fieldToolTipsdet_venta["Spanish"] = array();
	$fieldLabelsdet_venta["Spanish"]["iddet_venta"] = "Iddet Venta";
	$fieldToolTipsdet_venta["Spanish"]["iddet_venta"] = "";
	$fieldLabelsdet_venta["Spanish"]["idventa"] = "Nº Venta";
	$fieldToolTipsdet_venta["Spanish"]["idventa"] = "";
	$fieldLabelsdet_venta["Spanish"]["idarticulo"] = "Artículo";
	$fieldToolTipsdet_venta["Spanish"]["idarticulo"] = "";
	$fieldLabelsdet_venta["Spanish"]["precio"] = "Precio";
	$fieldToolTipsdet_venta["Spanish"]["precio"] = "";
	$fieldLabelsdet_venta["Spanish"]["cantidad"] = "Cantidad";
	$fieldToolTipsdet_venta["Spanish"]["cantidad"] = "";
	$fieldLabelsdet_venta["Spanish"]["subtotal"] = "Sub total";
	$fieldToolTipsdet_venta["Spanish"]["subtotal"] = "";
	$fieldLabelsdet_venta["Spanish"]["importe"] = "Importe x unid.";
	$fieldToolTipsdet_venta["Spanish"]["importe"] = "";
	$fieldLabelsdet_venta["Spanish"]["descuento"] = "Descuento";
	$fieldToolTipsdet_venta["Spanish"]["descuento"] = "";
	$fieldLabelsdet_venta["Spanish"]["costo"] = "Costo";
	$fieldToolTipsdet_venta["Spanish"]["costo"] = "";
	$fieldLabelsdet_venta["Spanish"]["ganancia"] = "Ganancia";
	$fieldToolTipsdet_venta["Spanish"]["ganancia"] = "";
	$fieldLabelsdet_venta["Spanish"]["anulada"] = "Anulada";
	$fieldToolTipsdet_venta["Spanish"]["anulada"] = "";
	if (count($fieldToolTipsdet_venta["Spanish"]))
		$tdatadet_venta[".isUseToolTips"] = true;
}
	
	
	$tdatadet_venta[".NCSearch"] = true;



$tdatadet_venta[".shortTableName"] = "det_venta";
$tdatadet_venta[".nSecOptions"] = 0;
$tdatadet_venta[".recsPerRowList"] = 1;
$tdatadet_venta[".mainTableOwnerID"] = "";
$tdatadet_venta[".moveNext"] = 1;
$tdatadet_venta[".nType"] = 0;

$tdatadet_venta[".strOriginalTableName"] = "det_venta";




$tdatadet_venta[".showAddInPopup"] = false;

$tdatadet_venta[".showEditInPopup"] = false;

$tdatadet_venta[".showViewInPopup"] = false;

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

	$tdatadet_venta[".audit"] = false;

	$tdatadet_venta[".locking"] = false;

$tdatadet_venta[".inlineEdit"] = true;
$tdatadet_venta[".inlineAdd"] = true;

$tdatadet_venta[".exportTo"] = true;

$tdatadet_venta[".printFriendly"] = true;

$tdatadet_venta[".delete"] = true;

$tdatadet_venta[".showSimpleSearchOptions"] = true;

$tdatadet_venta[".showSearchPanel"] = true;

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

$tdatadet_venta[".rowHighlite"] = true;

// button handlers file names

$tdatadet_venta[".addPageEvents"] = true;

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




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

$tdatadet_venta[".allSearchFields"][] = "idarticulo";

$tdatadet_venta[".googleLikeFields"][] = "idarticulo";


$tdatadet_venta[".advSearchFields"][] = "idarticulo";

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

	



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


$tdatadet_venta[".totalsFields"][] = array(
	"fName" => "costo", 
	"numRows" => 0,
	"totalsType" => "TOTAL",
	"viewFormat" => 'Number');
$tdatadet_venta[".totalsFields"][] = array(
	"fName" => "subtotal", 
	"numRows" => 0,
	"totalsType" => "TOTAL",
	"viewFormat" => 'Number');
$tdatadet_venta[".totalsFields"][] = array(
	"fName" => "descuento", 
	"numRows" => 0,
	"totalsType" => "TOTAL",
	"viewFormat" => 'Number');
$tdatadet_venta[".totalsFields"][] = array(
	"fName" => "ganancia", 
	"numRows" => 0,
	"totalsType" => "TOTAL",
	"viewFormat" => 'Number');

$tdatadet_venta[".pageSize"] = 20;

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

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

$tdatadet_venta[".sqlHead"] = "SELECT iddet_venta,   idventa,   idarticulo,   costo,   precio,   cantidad,   importe,   subtotal,   descuento,   ganancia,   anulada";
$tdatadet_venta[".sqlFrom"] = "FROM det_venta";
$tdatadet_venta[".sqlWhereExpr"] = "";
$tdatadet_venta[".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;
$tdatadet_venta[".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;
$tdatadet_venta[".arrGroupsPerPage"] = $arrGPP;

$tableKeysdet_venta = array();
$tableKeysdet_venta[] = "iddet_venta";
$tdatadet_venta[".Keys"] = $tableKeysdet_venta;

$tdatadet_venta[".listFields"] = array();
$tdatadet_venta[".listFields"][] = "idarticulo";
$tdatadet_venta[".listFields"][] = "costo";
$tdatadet_venta[".listFields"][] = "precio";
$tdatadet_venta[".listFields"][] = "cantidad";
$tdatadet_venta[".listFields"][] = "importe";
$tdatadet_venta[".listFields"][] = "subtotal";
$tdatadet_venta[".listFields"][] = "descuento";
$tdatadet_venta[".listFields"][] = "ganancia";

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

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

$tdatadet_venta[".inlineAddFields"] = array();
$tdatadet_venta[".inlineAddFields"][] = "idarticulo";
$tdatadet_venta[".inlineAddFields"][] = "precio";
$tdatadet_venta[".inlineAddFields"][] = "cantidad";
$tdatadet_venta[".inlineAddFields"][] = "importe";
$tdatadet_venta[".inlineAddFields"][] = "subtotal";

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

$tdatadet_venta[".inlineEditFields"] = array();
$tdatadet_venta[".inlineEditFields"][] = "idarticulo";
$tdatadet_venta[".inlineEditFields"][] = "precio";
$tdatadet_venta[".inlineEditFields"][] = "cantidad";
$tdatadet_venta[".inlineEditFields"][] = "importe";
$tdatadet_venta[".inlineEditFields"][] = "subtotal";

$tdatadet_venta[".exportFields"] = array();
$tdatadet_venta[".exportFields"][] = "iddet_venta";
$tdatadet_venta[".exportFields"][] = "idventa";
$tdatadet_venta[".exportFields"][] = "idarticulo";
$tdatadet_venta[".exportFields"][] = "costo";
$tdatadet_venta[".exportFields"][] = "precio";
$tdatadet_venta[".exportFields"][] = "cantidad";
$tdatadet_venta[".exportFields"][] = "importe";
$tdatadet_venta[".exportFields"][] = "subtotal";
$tdatadet_venta[".exportFields"][] = "descuento";
$tdatadet_venta[".exportFields"][] = "ganancia";

$tdatadet_venta[".printFields"] = array();
$tdatadet_venta[".printFields"][] = "idarticulo";
$tdatadet_venta[".printFields"][] = "precio";
$tdatadet_venta[".printFields"][] = "cantidad";
$tdatadet_venta[".printFields"][] = "importe";
$tdatadet_venta[".printFields"][] = "subtotal";
$tdatadet_venta[".printFields"][] = "descuento";

//	iddet_venta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "iddet_venta";
	$fdata["GoodName"] = "iddet_venta";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Iddet Venta"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		
		
		
		
		
		
		
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "iddet_venta"; 
		$fdata["FullName"] = "iddet_venta";
	
		
		
				$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;
	
		
		
	$tdatadet_venta["iddet_venta"] = $fdata;
//	idventa
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "idventa";
	$fdata["GoodName"] = "idventa";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Nº Venta"; 
	$fdata["FieldType"] = 3;
	
		
		
		
		
		
		
		
		
		
		
		$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" => "Lookup wizard");
	
		
		
	
//	Begin Lookup settings
								$edata["LookupType"] = 2;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
			
	$edata["LinkField"] = "idventa";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "idventa";
	
		
	$edata["LookupTable"] = "venta";
	$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;
	
		
		
	$tdatadet_venta["idventa"] = $fdata;
//	idarticulo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "idarticulo";
	$fdata["GoodName"] = "idarticulo";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Artículo"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = 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();
				$edata["LCType"] = 1;
			
		
			
	$edata["LinkField"] = "idarticulo";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "cod_nombre";
	
		
	$edata["LookupTable"] = "v_articulo";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		$edata["FastType"] = true; 
	
		$edata["AllowToAdd"] = true; 
	
				
			//	dependent dropdowns	
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "precio";
	
	
		$edata["Multiselect"] = true; 
	$edata["SelectSize"] = 8;
//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:450px;";
	$edata["controlWidth"] = 450;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["idarticulo"] = $fdata;
//	costo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "costo";
	$fdata["GoodName"] = "costo";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Costo"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = 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" => "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"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["costo"] = $fdata;
//	precio
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "precio";
	$fdata["GoodName"] = "precio";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Precio"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		
		
		$fdata["bPrinterPage"] = 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" => "Number");
	
		
		
		
			
		
		$vdata["DecimalDigits"] = 0;
	
		
		
		
		
		$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"] = "precio";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "precio";
	
		
	$edata["LookupTable"] = "articulo";
	$edata["LookupOrderBy"] = "";
	
		
		
		$edata["UseCategory"] = true; 
	$edata["CategoryControl"] = "idarticulo"; 
	$edata["CategoryFilter"] = "idarticulo"; 
	
		
		
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$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;
	
		
		
	$tdatadet_venta["precio"] = $fdata;
//	cantidad
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "cantidad";
	$fdata["GoodName"] = "cantidad";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Cantidad"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		
		
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cantidad"; 
		$fdata["FullName"] = "cantidad";
	
		
		
				$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:40px;";
	$edata["controlWidth"] = 40;
	
//	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;
	
		
		
	$tdatadet_venta["cantidad"] = $fdata;
//	importe
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "importe";
	$fdata["GoodName"] = "importe";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Importe x unid."; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		
		
		$fdata["bPrinterPage"] = 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["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		$edata["inputStyle"] = " width:120px;";
	$edata["controlWidth"] = 120;
	
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["importe"] = $fdata;
//	subtotal
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "subtotal";
	$fdata["GoodName"] = "subtotal";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Sub total"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		
		
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "subtotal"; 
		$fdata["FullName"] = "subtotal";
	
		
		
				$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:120px;";
	$edata["controlWidth"] = 120;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["subtotal"] = $fdata;
//	descuento
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "descuento";
	$fdata["GoodName"] = "descuento";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Descuento"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		
		$fdata["bPrinterPage"] = 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" => "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"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["descuento"] = $fdata;
//	ganancia
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "ganancia";
	$fdata["GoodName"] = "ganancia";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Ganancia"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		
		
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "ganancia"; 
		$fdata["FullName"] = "ganancia";
	
		
		
				$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"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["ganancia"] = $fdata;
//	anulada
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "anulada";
	$fdata["GoodName"] = "anulada";
	$fdata["ownerTable"] = "det_venta";
	$fdata["Label"] = "Anulada"; 
	$fdata["FieldType"] = 200;
	
		
		
		
		
		
		
		
		
		
		
		
		$fdata["strField"] = "anulada"; 
		$fdata["FullName"] = "anulada";
	
		
		
				
				$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["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
		
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdatadet_venta["anulada"] = $fdata;

	
$tables_data["det_venta"]=&$tdatadet_venta;
$field_labels["det_venta"] = &$fieldLabelsdet_venta;
$fieldToolTips["det_venta"] = &$fieldToolTipsdet_venta;

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

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

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

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










function createSqlQuery_det_venta()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "iddet_venta,   idventa,   idarticulo,   costo,   precio,   cantidad,   importe,   subtotal,   descuento,   ganancia,   anulada";
$proto0["m_strFrom"] = "FROM det_venta";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto27=array();
$proto27["m_link"] = "SQLL_MAIN";
			$proto28=array();
$proto28["m_strName"] = "det_venta";
$proto28["m_columns"] = array();
$proto28["m_columns"][] = "iddet_venta";
$proto28["m_columns"][] = "idventa";
$proto28["m_columns"][] = "idarticulo";
$proto28["m_columns"][] = "costo";
$proto28["m_columns"][] = "precio";
$proto28["m_columns"][] = "cantidad";
$proto28["m_columns"][] = "importe";
$proto28["m_columns"][] = "subtotal";
$proto28["m_columns"][] = "descuento";
$proto28["m_columns"][] = "ganancia";
$proto28["m_columns"][] = "anulada";
$obj = new SQLTable($proto28);

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

$proto29["m_column"]=$obj;
$proto29["m_contained"] = array();
$proto29["m_strCase"] = "";
$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();
$obj = new SQLQuery($proto0);

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

include_once(getabspath("include/det_venta_events.php"));
$tableEvents["det_venta"] = new eventclass_det_venta;
$tdatadet_venta[".hasEvents"] = true;

$cipherer = new RunnerCipherer("det_venta");

?>